X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-swig%2Fexamples%2Fcontrol-dashboard.cs;h=3ec656e2445dce83e74703fbb0ea6b0a0417803e;hp=0ddd6f1b81371de3f0e82c24ff5c9ebd707db16a;hb=bc7cb028cf42ff75d7644c278201883ea3426199;hpb=a3b69d118ee5f918a827b23ea76813a7aefad845 diff --git a/plugins/dali-swig/examples/control-dashboard.cs b/plugins/dali-swig/examples/control-dashboard.cs index 0ddd6f1..3ec656e 100755 --- a/plugins/dali-swig/examples/control-dashboard.cs +++ b/plugins/dali-swig/examples/control-dashboard.cs @@ -40,14 +40,16 @@ namespace MyCSharpExample private Dali.Application _application; private TableView _contentContainer; + private Timer _timer; private Stage _stage; private Popup _popup; + private ProgressBar _progressBar; // List of items private Item[] mViewList = { new Item("PushButton", true), new Item("DropDown", false), new Item("Toggle", true), new Item("InputField", false), new Item("AnimateGif", false), new Item("Loading", false), - new Item("ProgressBar", false), new Item("CheckBox", false), new Item("RadioButton", true), + new Item("ProgressBar", true), new Item("CheckBox", false), new Item("RadioButton", true), new Item("Tooltip", true), new Item("Popup", true), new Item("Toast", true), new Item("ItemView", false), new Item("CheckBox", true) }; @@ -191,7 +193,33 @@ namespace MyCSharpExample } if (item.name.CompareTo("ProgressBar") == 0) { + _progressBar = new ProgressBar(); + _progressBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH); + _progressBar.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT); + _progressBar.SetSize( 0, 50 ); + _progressBar.ValueChanged += OnProgressBarValueChanged; + + _timer = new Timer( 100 ); + _timer.Tick += ( obj, e ) => + { + float progress = (float)Math.Round( _progressBar.ProgressValue , 2 ); + + if( progress == 1.0f ) + { + _progressBar.ProgressValue = 0.0f; + _progressBar.SecondaryProgressValue = 0.01f; + } + else + { + _progressBar.ProgressValue = progress + 0.01f; + _progressBar.SecondaryProgressValue = progress + 0.21f; + } + return true; + }; + _timer.Start(); + + _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); } if (item.name.CompareTo("ScrollBar") == 0) { @@ -414,6 +442,15 @@ namespace MyCSharpExample return cancelButton; } + void OnProgressBarValueChanged( object source, ProgressBar.ValueChangedEventArgs e ) + { + Property.Map labelVisual = new Property.Map(); + labelVisual.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text) ) + .Add( Dali.Constants.TextVisualProperty.Text, new Property.Value( Math.Round( e.ProgressBar.ProgressValue, 2 ) +" / "+Math.Round( e.ProgressBar.SecondaryProgressValue, 2 )) ); + e.ProgressBar.LabelVisual = labelVisual; + return; + } + public void MainLoop() { _application.MainLoop();