public override void Run(Window window) { Background bg = new Background(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.Black }; bg.Show(); window.AddResizeObject(bg); Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window); box.Geometry = window.GetInnerSquare(); box.Show(); var capital1 = new Entry(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = " Word", AutoCapital = AutoCapital.Word }; var capital2 = new Entry(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = "Sentence", AutoCapital = AutoCapital.Sentence }; var capital3 = new Entry(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = "All", AutoCapital = AutoCapital.All }; var getText = new Entry(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = "get cursor content test", }; var label = new Label(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; getText.CursorChanged += (s, e) => { label.Text = getText.GetCursorContent(); }; box.PackEnd(capital1); box.PackEnd(capital2); box.PackEnd(capital3); box.PackEnd(getText); box.PackEnd(label); capital1.Show(); capital2.Show(); capital3.Show(); getText.Show(); label.Show(); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentY = -1, AlignmentX = -1, WeightX = 1, WeightY = 1, }; box.Show(); conformant.SetContent(box); Background bg = new Background(window) { AlignmentY = -1, AlignmentX = -1, WeightX = 1, WeightY = 1, }; bg.Show(); box.PackEnd(bg); Slider red = new Slider(window) { Minimum = 0, Maximum = 255, Text = "Red", AlignmentX = -1, WeightX = 1 }; Slider green = new Slider(window) { Minimum = 0, Maximum = 255, Text = "Green", AlignmentX = -1, WeightX = 1 }; Slider blue = new Slider(window) { Minimum = 0, Maximum = 255, Text = "Blue", AlignmentX = -1, WeightX = 1 }; Slider alpha = new Slider(window) { Minimum = 0, Maximum = 255, Text = "Alpha", AlignmentX = -1, WeightX = 1 }; red.Show(); green.Show(); blue.Show(); alpha.Show(); box.PackEnd(red); box.PackEnd(green); box.PackEnd(blue); box.PackEnd(alpha); red.Value = 255; green.Value = 255; blue.Value = 255; alpha.Value = 255; bg.Color = new Color(255, 255, 255, 255); EventHandler handler = (s, e) => { bg.Color = new Color((int)red.Value, (int)green.Value, (int)blue.Value, (int)alpha.Value); }; red.ValueChanged += handler; green.ValueChanged += handler; blue.ValueChanged += handler; alpha.ValueChanged += handler; }
public override void Run(Window window) { Background bg = new Background(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.Black }; bg.Show(); window.AddResizeObject(bg); Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window); box.Geometry = window.GetInnerSquare(); box.Show(); Entry entry = new Entry(window) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1, IsSingleLine = true, Text = "Hello, Tizen" }; var btn = new Button(window) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1, Text = "Set Filter" }; btn.Show(); //var filter = new Entry.TextFilter(SetFilter); btn.Clicked += (s, e) => { entry.AppendMarkUpFilter(SetFilter); }; var btn1 = new Button(window) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1, Text = "Remove Filter" }; btn1.Show(); btn1.Clicked += (s, e) => { entry.RemoveMarkUpFilter(SetFilter); }; //entry.AppendMarkUpFilter(new Entry.Filter(SetFilter)); entry.Show(); box.PackEnd(entry); box.PackEnd(btn); box.PackEnd(btn1); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box outterBox = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = false, }; outterBox.Show(); Scroller scroller = new Scroller(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, ScrollBlock = ScrollBlock.Vertical, HorizontalPageScrollLimit = 1, }; scroller.SetPageSize(1.0, 1.0); scroller.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; box.Show(); scroller.SetContent(box); var rnd = new Random(); for (int i = 0; i < 102; i++) { int r = rnd.Next(255); int g = rnd.Next(255); int b = rnd.Next(255); Color color = Color.FromRgb(r, g, b); Rectangle colorBox = new Rectangle(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = color, MinimumWidth = window.ScreenSize.Width, }; colorBox.Show(); Console.WriteLine("Height = {0}", colorBox.Geometry.Height); box.PackEnd(colorBox); } conformant.SetContent(outterBox); outterBox.PackEnd(scroller); Button prev = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "Prev" }; Button next = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "next" }; prev.Clicked += (s, e) => { scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1: 0, scroller.VerticalPageIndex, true); }; next.Clicked += (s, e) => { scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true); }; prev.Show(); next.Show(); outterBox.PackEnd(prev); outterBox.PackEnd(next); scroller.DragStart += Scroller_DragStart; scroller.DragStop += Scroller_DragStop; }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box outerBox = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; outerBox.Show(); outerBox.IsHorizontal = true; conformant.SetContent(outerBox); Scroller scroller = new Scroller(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, ScrollBlock = ScrollBlock.None, }; scroller.Show(); outerBox.PackEnd(scroller); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; box.Show(); scroller.SetContent(box); scroller.VerticalBounce = true; var rnd = new Random(); for (int i = 0; i < 102; i++) { int r = rnd.Next(255); int g = rnd.Next(255); int b = rnd.Next(255); Color color = Color.FromRgb(r, g, b); Rectangle colorBox = new Rectangle(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = color, MinimumHeight = 400, }; colorBox.Show(); Console.WriteLine("Height = {0}", colorBox.Geometry.Height); box.PackEnd(colorBox); } Scroller scroller2 = new Scroller(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, ScrollBlock = ScrollBlock.None, }; scroller2.Show(); outerBox.PackEnd(scroller2); Box box2 = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; box2.Show(); scroller2.SetContent(box2); for (int i = 0; i < 102; i++) { int r = rnd.Next(255); int g = rnd.Next(255); int b = rnd.Next(255); Color color = Color.FromRgb(r, g, b); Background colorBox = new Background(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = color, MinimumHeight = 400, }; colorBox.Show(); Console.WriteLine("Height = {0}", colorBox.Geometry.Height); box2.PackEnd(colorBox); } GenItemClass fullyCustomizeClass = new GenItemClass("full") { GetContentHandler = (obj, part) => { int r = rnd.Next(255); int g = rnd.Next(255); int b = rnd.Next(255); Color color = Color.FromRgb(r, g, b); Background colorBox = new Background(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = color, MinimumHeight = 400, }; colorBox.Show(); return(colorBox); }, }; GenList list = new GenList(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; list.Show(); for (int i = 0; i < 102; i++) { list.Append(fullyCustomizeClass, string.Format("Data #", i)); } InteropAPI.elm_genlist_realization_mode_set(list, true); outerBox.PackEnd(list); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window); conformant.SetContent(box); box.Show(); Box buttonBox1 = new Box(window) { IsHorizontal = true, AlignmentX = -1, AlignmentY = 0, }; buttonBox1.Show(); Box buttonBox2 = new Box(window) { IsHorizontal = true, AlignmentX = -1, AlignmentY = 0, }; buttonBox2.Show(); Button btnFile1 = new Button(window) { Text = "Blue (BG)", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFile1.Show(); Button btnFile2 = new Button(window) { Text = "Default (BG)", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFile2.Show(); Button btnFile3 = new Button(window) { Text = "Blue (FG)", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFile3.Show(); Button btnFile4 = new Button(window) { Text = "Default (FG)", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFile4.Show(); buttonBox1.PackEnd(btnFile1); buttonBox1.PackEnd(btnFile2); buttonBox2.PackEnd(btnFile3); buttonBox2.PackEnd(btnFile4); lbInfo = new Label(window) { Color = Color.White, AlignmentX = -1, AlignmentY = 0, WeightX = 1 }; lbInfo.Show(); image = new Image(window) { IsFixedAspect = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; image.Show(); image.Load(Path.Combine(TestRunner.ResourceDir, "btn_delete.png")); image.Clicked += (s, e) => { Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); image.IsFixedAspect = image.IsFixedAspect == true ? false : true; }; btnFile1.Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); }; btnFile2.Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); }; btnFile3.Clicked += (s, e) => { image.Color = Color.Blue; UpdateLabelText(image.Color.ToString(), false); }; btnFile4.Clicked += (s, e) => { image.Color = Color.Default; UpdateLabelText(image.Color.ToString(), false); }; box.PackEnd(buttonBox1); box.PackEnd(buttonBox2); box.PackEnd(lbInfo); box.PackEnd(image); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new ColoredBox(window); box.Show(); conformant.SetContent(box); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.1, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion Box inner = new Box(window) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; box.PackEnd(inner); inner.Show(); var slider = new MSlider(window) { Minimum = 0, Maximum = 100 }; slider.Value = 50; slider.Show(); inner.PackEnd(slider); var disabledSlider = new MSlider(window) { Minimum = 0, Maximum = 100, IsEnabled = false }; disabledSlider.Value = 50; disabledSlider.Show(); inner.PackEnd(disabledSlider); inner.SetLayoutCallback(() => { var rect = inner.Geometry; slider.Geometry = new Rect((rect.Width / 2) - 250, (rect.Height / 2 - 100), 500, 50); disabledSlider.Geometry = new Rect((rect.Width / 2) - 250, (rect.Height / 2), 500, 50); }); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; conformant.SetContent(box); box.Show(); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.1, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion MNavigationView nv = new MNavigationView(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; var btn1 = new Button(window) { Text = "Chage Header", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, MinimumHeight = 300, }; btn1.Show(); var btn2 = new Button(window) { Text = "Chage Header", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.Blue }; btn2.Show(); var btn3 = new Button(window) { Text = "Button", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; btn3.Show(); var header = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.White }; header.PackEnd(btn2); header.PackEnd(btn3); header.Show(); nv.Header = btn1; btn1.Clicked += (s, e) => { nv.Header = header; }; btn2.Clicked += (s, e) => { nv.Header = btn1; }; var items = new List <MItem>(); items.Add(new MItem("My Files", "icon.png")); items.Add(new MItem("Shared with me", "icon.png")); items.Add(new MItem("Starred", "icon.png")); items.Add(new MItem("Recent", "icon.png")); items.Add(new MItem("Offline", "icon.png")); items.Add(new MItem("Uploads", "icon.png")); items.Add(new MItem("Backup", "icon.png")); items.Add(new MItem("Movie", "icon.png")); items.Add(new MItem("Music", "icon.png")); items.Add(new MItem("Play", "icon.png")); var items1 = new List <MItem>(); for (int i = 0; i < 20; i++) { items1.Add(new MItem("Change Item", "icon.png")); } nv.Menu = items; var dividers = new List <int>(); dividers.Add(1); dividers.Add(3); dividers.Add(5); nv.MenuItemSelected += (s, e) => { if (nv.Menu == items) { nv.Menu = items1; } else { nv.Menu = items; } }; nv.Show(); box.PackEnd(nv); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.Show(); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.2, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion MBottomNavigation bn = new MBottomNavigation(window); bn.Show(); box.PackEnd(bn); var IconPath = Path.Combine(ThemeLoader.AppResourcePath, "icon.png"); for (int i = 0; i < 4; i++) { var item2 = bn.Append(string.Format("{0} Item", i), IconPath); } }
void Initialize() { Window window = new Window("ElottieSharp") { AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 }; window.BackButtonPressed += (s, e) => { Exit(); }; window.Show(); var box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var bg = new Background(window) { Color = Color.Transparent }; bg.SetContent(box); var conformant = new Conformant(window); conformant.Show(); conformant.SetContent(bg); Button button = new Button(window) { Text = "Button", AlignmentX = -1, WeightX = 1, }; button.Show(); LottieAnimationView lottie = new LottieAnimationView(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, AutoPlay = true, AutoRepeat = true, MinimumProgress = 0.2f, MaximumProgress = 0.8f, }; var path = Path.Combine(DirectoryInfo.Resource, "a_mountain.json"); lottie.SetAnimation(path); lottie.Play(); lottie.Show(); lottie.FrameUpdated += (s, e) => { button.Text = e.CurrentFrame + ""; }; button.Clicked += (s, e) => { button.Text = lottie.GetFrameFromProgress(0.7f) + ""; lottie.Stop(); }; Button button2 = new Button(window) { Text = "Play Segment", AlignmentX = -1, WeightX = 1 }; button2.Show(); button2.Clicked += (s, e) => { lottie.Play(30, 50); // lottie.Play(0.5f, 0.7f); }; Button button3 = new Button(window) { Text = "Pause", AlignmentX = -1, WeightX = 1 }; button3.Show(); button3.Clicked += (s, e) => { lottie.Pause(); }; box.PackEnd(button); box.PackEnd(lottie); box.PackEnd(button2); box.PackEnd(button3); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); gParent = new Box(window) { BackgroundColor = Color.Yellow, PassEvents = false, PropagateEvents = false, }; conformant.SetContent(gParent); Box parent = new Box(gParent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.Green, PassEvents = false, PropagateEvents = false, }; Box child = new Box(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.Blue, PassEvents = false, PropagateEvents = false, }; Check ch = new Check(child) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.Silver, PassEvents = false, PropagateEvents = false, }; gParent.PackEnd(parent); parent.PackEnd(child); child.PackEnd(ch); gParent.Show(); parent.Show(); child.Show(); ch.Show(); _gParentLayer = new GestureLayer(gParent); _gParentLayer.Attach(gParent); _gParentLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => { Debug.WriteLine($"@@@ Grand Parent Tap : {gParent.PassEvents}, {gParent.PropagateEvents}, {gParent.RepeatEvents}"); }); _parentLayer = new GestureLayer(parent); _parentLayer.Attach(parent); _parentLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => { Debug.WriteLine($"@@@ Parent Tap : {parent.PassEvents}, {parent.PropagateEvents}, {parent.RepeatEvents}"); }); childLayer = new GestureLayer(child); childLayer.Attach(child); childLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => { Debug.WriteLine($"@@@ Child Tap : {child.PassEvents}, {child.PropagateEvents}, {child.RepeatEvents}"); }); chLayer = new GestureLayer(ch); chLayer.Attach(ch); chLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => { Debug.WriteLine($"@@@ Check1 Tap : {ch.PassEvents}, {ch.PropagateEvents}, {ch.RepeatEvents}"); }); EvasObjectEvent eventGrand = new EvasObjectEvent(gParent, EvasObjectCallbackType.MouseDown); eventGrand.On += (s, e) => { Debug.WriteLine($"@@@ Grand Parent down : {gParent.PassEvents}, {gParent.PropagateEvents}, {gParent.RepeatEvents}"); }; EvasObjectEvent evnetParent = new EvasObjectEvent(parent, EvasObjectCallbackType.MouseDown); evnetParent.On += (s, e) => { Debug.WriteLine($"@@@ Parent down : {parent.PassEvents}, {parent.PropagateEvents}, {parent.RepeatEvents}"); }; EvasObjectEvent eventChild = new EvasObjectEvent(child, EvasObjectCallbackType.MouseDown); eventChild.On += (s, e) => { Debug.WriteLine($"@@@ Child down : {child.PassEvents}, {child.PropagateEvents}, {child.RepeatEvents}"); }; EvasObjectEvent eventCh = new EvasObjectEvent(ch, ch.RealHandle, EvasObjectCallbackType.MouseDown); eventCh.On += (s, e) => { Debug.WriteLine($"@@@ Check down : {ch.PassEvents}, {ch.PropagateEvents}, {ch.RepeatEvents}"); }; }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window); conformant.SetContent(box); box.Show(); Image realObject2 = new Image(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; realObject2.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); realObject2.Show(); EvasImage img1 = new EvasImage(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; img1.IsFilled = true; img1.File = Path.Combine(TestRunner.ResourceDir, "picture.png"); img1.Show(); EvasImage img2 = new EvasImage(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; img2.IsFilled = true; img2.SetStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "picture.png"), FileMode.Open, FileAccess.Read)); img2.Show(); EvasImage img3 = new EvasImage(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; img3.IsFilled = true; img3.SetSource(realObject2); img3.Show(); img3.IsSourceVisible = true; box.PackEnd(realObject2); box.PackEnd(img1); box.PackEnd(img2); box.PackEnd(img3); }
public override void Run(Window window) { Background bg = new Background(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.White }; bg.Show(); window.AddResizeObject(bg); Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; conformant.SetContent(box); box.Show(); Label label1 = new Label(window) { Text = "Test Slide Animaiton", Color = Color.Black, Style = "slide_long", SlideSpeed = 100, SlideMode = LabelSlideMode.Always, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; label1.Show(); label1.PlaySlide(); Button btnCurrentSpeed = new Button(window) { Text = "Current Speed : 100", AlignmentX = -1, AlignmentY = -1, WeightX = 1, }; Button btnSpeedUp = new Button(window) { Text = "Speed + 10", AlignmentX = -1, AlignmentY = -1, WeightX = 1, }; btnSpeedUp.Clicked += (s, e) => { label1.SlideSpeed += 10; btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed); label1.PlaySlide(); }; Button btnSpeedDown = new Button(window) { Text = "Speed - 10", AlignmentX = -1, AlignmentY = -1, WeightX = 1, }; btnSpeedDown.Clicked += (s, e) => { label1.SlideSpeed -= 10; btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed); label1.PlaySlide(); }; box.PackEnd(label1); box.PackEnd(btnCurrentSpeed); box.PackEnd(btnSpeedUp); box.PackEnd(btnSpeedDown); btnCurrentSpeed.Show(); btnSpeedUp.Show(); btnSpeedDown.Show(); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); conformant.SetContent(box); GenList list = new GenList(window) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; GenItemClass defaultClass = new GenItemClass("default") { GetTextHandler = (obj, part) => { return(string.Format("{0} - {1}", (string)obj, part)); }, DeleteHandler = new GenItemClass.DeleteDelegate((obj) => { Console.WriteLine("DeleteHandler was called with... {0}", (string)obj); }), }; GenListItem[] items = new GenListItem[100]; for (int i = 0; i < 100; i++) { items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); } list.Show(); list.ItemSelected += List_ItemSelected; list.ItemActivated += List_ItemActivated; list.ItemUnselected += List_ItemUnselected; list.ItemPressed += List_ItemPressed; list.ItemRealized += List_ItemRealized; list.ItemReleased += List_ItemReleased; list.ItemUnrealized += List_ItemUnrealized; list.ItemLongPressed += List_ItemLongPressed; list.ItemDoubleClicked += List_ItemDoubleClicked; box.PackEnd(list); Button first = new Button(window) { Text = "Delete", AlignmentX = -1, WeightX = 1, }; first.Clicked += (s, e) => { selected?.Delete(); }; first.Show(); box.PackEnd(first); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; box.Show(); GenList list = new GenList(window) { Homogeneous = false, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; list.Show(); Index index = new Index(window) { IsHorizontal = false, AlignmentY = -1, WeightY = 1, MinimumWidth = 100, AutoHide = false, Style = "fastscroll" }; index.Show(); GenItemClass groupClass = new GenItemClass("group_index") { GetTextHandler = (obj, part) => { return(string.Format("{0} - {1}", (string)obj, part)); } }; GenListItem[] groups = new GenListItem[10]; for (int i = 0; i < 10; i++) { groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group); var indexitem = index.Append(string.Format("{0}", i)); indexitem.Selected += (s, e) => { Console.WriteLine("Index selected : {0}", ((IndexItem)s).Text); list.ScrollTo(_indexTable[(IndexItem)s], ScrollToPosition.In, true); }; _indexTable[indexitem] = groups[i]; } GenItemClass defaultClass = new GenItemClass("default") { GetTextHandler = (obj, part) => { return(string.Format("{0} - {1}", (string)obj, part)); } }; for (int j = 0; j < 10; j++) { for (int i = 0; i < 20; i++) { list.Append(defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]); } } list.ItemSelected += List_ItemSelected; index.Update(0); box.PackEnd(list); box.PackEnd(index); box.SetLayoutCallback(() => { list.Geometry = box.Geometry; index.Geometry = box.Geometry; }); conformant.SetContent(box); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Table table = new Table(window); conformant.SetContent(table); table.Show(); ProgressBar pb1 = new ProgressBar(window) { Text = "ProgressBar Test", UnitFormat = "%.0f %%", Value = 0.1, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; Label lb1 = new Label(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; Label lb2 = new Label(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; Button bt1 = new Button(window) { Text = "Increase Value", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; Button bt2 = new Button(window) { Text = "Decrease Value", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; Button bt3 = new Button(window) { Text = "Increase PartValue", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; Button bt4 = new Button(window) { Text = "Decrease PartValue", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; string part = "elm.cur.progressbar"; double unit = 0.1; double max = 1.0; double min = 0; pb1.ValueChanged += (s, e) => { lb1.Text = string.Format("Value Changed: {0}", pb1.Value); lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; lb2.Text = string.Format("PartValue Changed: {0}", pb1.GetPartValue(part)); lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; }; bt1.Clicked += (s, e) => { var val = pb1.Value + unit; if (val <= max) { pb1.Value = val; } }; bt2.Clicked += (s, e) => { var val = pb1.Value - unit; if (val >= min) { pb1.Value = val; } }; bt3.Clicked += (s, e) => { var val = pb1.GetPartValue(part) + unit; if (val <= max) { pb1.SetPartValue(part, val); } }; bt4.Clicked += (s, e) => { var val = pb1.GetPartValue(part) - unit; if (val >= min) { pb1.SetPartValue(part, val); } }; table.Pack(bt1, 1, 1, 1, 1); table.Pack(bt2, 2, 1, 1, 1); table.Pack(pb1, 1, 2, 2, 1); table.Pack(lb1, 1, 3, 2, 1); table.Pack(lb2, 1, 4, 2, 1); table.Pack(bt3, 1, 5, 1, 1); table.Pack(bt4, 2, 5, 1, 1); pb1.Show(); lb1.Show(); lb2.Show(); bt1.Show(); bt2.Show(); bt3.Show(); bt4.Show(); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Naviframe navi = new Naviframe(conformant) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; navi.Show(); conformant.SetContent(navi); Layout layout = new Layout(conformant) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; layout.SetTheme("layout", "application", "default"); layout.Show(); Background bg = new Background(layout) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, Color = Color.Gray, }; bg.Show(); layout.SetPartContent("elm.swallow.bg", bg); Box box = new Box(conformant) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; box.Show(); box.SetPadding(5, 5); layout.SetPartContent("elm.swallow.content", box); Label label = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 0.5, AlignmentY = 0, }; label.Show(); box.PackEnd(label); AnimationView aniview = new AnimationView(box) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; aniview.SetAnimation(Path.Combine(TestRunner.ResourceDir, "a_mountain.json")); aniview.Show(); Box box1 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box1.Show(); box.PackEnd(box1); Label label1 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 0.0, AlignmentY = 0.5, Text = "Default Size = (" + aniview.DefaultSize.Width + "," + aniview.DefaultSize.Height + ")", }; label1.Show(); box1.PackEnd(label1); Label label2 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 1.0, AlignmentY = 0.5, Text = "FrameCount : " + (aniview.FrameCount).ToString(), }; label2.Show(); box1.PackEnd(label2); Label label3 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 1.0, AlignmentY = 0.5, Text = "Duration : " + (Math.Round(Convert.ToDouble(aniview.DurationTime), 2)).ToString(), }; label3.Show(); box.PackEnd(label3); box.PackEnd(aniview); Box box2 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box2.Show(); box.PackEnd(box2); Check check = new Check(box2) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Loop", }; check.Show(); box2.PackEnd(check); check.StateChanged += (s, e) => { aniview.AutoRepeat = !aniview.AutoRepeat; }; Check check2 = new Check(box2) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Speed: 0.25x", }; check2.Show(); box2.PackEnd(check2); check2.StateChanged += (s, e) => { if (check2.IsChecked) { aniview.Speed = 0.25; } else { aniview.Speed = 1.0; } }; Slider slider = new Slider(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, IsIndicatorVisible = true, IndicatorFormat = "%1.1f", Minimum = 0, Maximum = 1, }; slider.Show(); box.PackEnd(slider); slider.ValueChanged += (s, e) => { aniview.Progress = slider.Value; }; Box box3 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box3.Show(); box.PackEnd(box3); Label label4 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 0.0, AlignmentY = 0.5, Text = (aniview.MinFrame).ToString() + " / " + (aniview.MaxFrame).ToString(), }; label4.Show(); box3.PackEnd(label4); Label label5 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 1.0, AlignmentY = 0.5, Text = (aniview.MinProgress).ToString() + " / " + (aniview.MaxProgress).ToString(), }; label5.Show(); box3.PackEnd(label5); Box box4 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box4.Show(); box.PackEnd(box4); Button btn1 = new Button(box4) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Play", }; btn1.Show(); box4.PackEnd(btn1); btn1.Clicked += (s, e) => { aniview.Play(); UpdateAnimationViewStateLabel(aniview, label); }; Button btn2 = new Button(box4) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Reverse", }; btn2.Show(); box4.PackEnd(btn2); btn2.Clicked += (s, e) => { aniview.Play(true); UpdateAnimationViewStateLabel(aniview, label); }; Button btn3 = new Button(box4) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Stop", }; btn3.Show(); box4.PackEnd(btn3); btn3.Clicked += (s, e) => { aniview.Stop(); }; Box box5 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box5.Show(); box.PackEnd(box5); Button btn4 = new Button(box5) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Pause", }; btn4.Show(); box5.PackEnd(btn4); btn4.Clicked += (s, e) => { aniview.Pause(); }; Button btn5 = new Button(box5) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Resume", }; btn5.Show(); box5.PackEnd(btn5); btn5.Clicked += (s, e) => { aniview.Resume(); }; aniview.Started += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); }; aniview.Stopped += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); label4.Text = "0 / " + (aniview.MaxFrame).ToString(); label5.Text = "0 / " + (aniview.MaxProgress).ToString(); slider.Value = 0; }; aniview.Paused += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); }; aniview.Resumed += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); }; aniview.Updated += (s, e) => { slider.Value = aniview.Progress; label4.Text = (aniview.Frame).ToString() + " / " + (aniview.MaxFrame).ToString(); label5.Text = (Math.Round(Convert.ToDouble(aniview.Progress), 2)).ToString() + " / " + (aniview.MaxProgress).ToString(); }; UpdateAnimationViewStateLabel(aniview, label); navi.Push(layout, "AnimationView Test"); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { BackgroundColor = Color.White }; conformant.SetContent(box); box.Show(); MProgressIndicator determinatePI = new MProgressIndicator(window) { Value = 0, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; determinatePI.Show(); MProgressIndicator indeterminatePI = new MProgressIndicator(window) { Text = "Linear progress indicator (Indeterminate)", Type = MProgressIndicatorType.Indeterminate, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; indeterminatePI.Show(); Label label1 = new Label(window) { Text = "Linear progress indicator (Determinate)", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; label1.Show(); Label label2 = new Label(window) { Text = "Linear progress indicator (Indeterminate)", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; label2.Show(); box.PackEnd(label1); box.PackEnd(determinatePI); box.PackEnd(label2); box.PackEnd(indeterminatePI); double max = 1.0; double min = 0; double unit = 0.1; if (_animator == null) { _animator = new EcoreTimelineAnimator(1.0, () => { var val = determinatePI.Value + unit; if (val <= max) { determinatePI.Value = val; } }); _animator.Finished += (s, e) => { determinatePI.Value = min; _animator.Start(); }; } _animator.Start(); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box outterBox = new Box(window) { BackgroundColor = Color.Gray, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = false, }; outterBox.Show(); _scroller = new Scroller(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, HorizontalPageScrollLimit = 1, }; _scroller.SetPageSize(1.0, 1.0); _scroller.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; box.Show(); _scroller.SetContent(box); for (int i = 0; i < 150; i++) { Label addlabel = new Label(window) { Text = i + " Label Test", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; addlabel.Show(); box.PackEnd(addlabel); } conformant.SetContent(outterBox); outterBox.PackEnd(_scroller); Button prev = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "Prev" }; Button next = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "next" }; int index = 0; prev.Clicked += (s, e) => { Rect region = new Rect(0, _scroller.Geometry.Height * --index, _scroller.Geometry.Width * index, _scroller.Geometry.Height); Console.WriteLine("index : {0} [{1}, {2}]\n", index, _scroller.Geometry.Width, _scroller.Geometry.Height); _scroller.ScrollTo(region, false); }; next.Clicked += (s, e) => { Rect region = new Rect(0, _scroller.Geometry.Height * ++index, _scroller.Geometry.Width, _scroller.Geometry.Height); Console.WriteLine("index : {0} [{1}, {2}]\n", index, _scroller.Geometry.Width, _scroller.Geometry.Height); _scroller.ScrollTo(region, false); }; prev.Show(); next.Show(); Button prev2 = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "animation Prev" }; Button next2 = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "animation next" }; prev2.Clicked += (s, e) => { Rect region = new Rect(0, _scroller.Geometry.Height * --index, _scroller.Geometry.Width * index, _scroller.Geometry.Height); Console.WriteLine("animation index : {0} [{1}, {2}]\n", index, _scroller.Geometry.Width, _scroller.Geometry.Height); _scroller.ScrollTo(region, true); }; next2.Clicked += (s, e) => { Rect region = new Rect(0, _scroller.Geometry.Height * ++index, _scroller.Geometry.Width, _scroller.Geometry.Height); Console.WriteLine("animation index : {0} [{1}, {2}]\n", index, _scroller.Geometry.Width, _scroller.Geometry.Height); _scroller.ScrollTo(region, true); }; prev2.Show(); next2.Show(); outterBox.PackEnd(prev); outterBox.PackEnd(next); outterBox.PackEnd(prev2); outterBox.PackEnd(next2); _scroller.DragStart += Scroller_DragStart; _scroller.DragStop += Scroller_DragStop; _scroller.ScrollAnimationStarted += Scroller_ScrollStart; _scroller.ScrollAnimationStopped += Scroller_ScrollStop; _scroller.Scrolled += Scroller_Scrolled; }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = false, }; box.Show(); conformant.SetContent(box); Slider sld1 = new Slider(window) { Text = "Slider Test", IndicatorFormat = "%1.2f meters", Minimum = 0.0, Maximum = 100.0, Value = 0.1, AlignmentX = -1, AlignmentY = 0.5, WeightX = 1, WeightY = 1, IsIndicatorFocusable = true }; Label lb1 = new Label(window) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1 }; Label lb2 = new Label(window) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1, Text = string.Format("IsIndicatorFocusable : {0}", sld1.IsIndicatorFocusable.ToString()), }; Label lb3 = new Label(window) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1, Text = string.Format("IndicatorVisibleMode : {0}", sld1.IndicatorVisibleMode.ToString()), }; Box buttonBox = new Box(window) { IsHorizontal = true, AlignmentX = -1, AlignmentY = 0, }; buttonBox.Show(); Button btn = new Button(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = "IsIndicatorFocusable" }; btn.Clicked += (s, e) => { if (sld1.IsIndicatorFocusable) { sld1.IsIndicatorFocusable = false; } else { sld1.IsIndicatorFocusable = true; } lb2.Text = string.Format("IsIndicatorFocusable : {0}", sld1.IsIndicatorFocusable.ToString()); lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; }; Button btn2 = new Button(window) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = "IndicatorVisibleMode" }; btn2.Clicked += (s, e) => { if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Default) { sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Always; } else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Always) { sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.OnFocus; } else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.OnFocus) { sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.None; } else { sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Default; } lb3.Text = string.Format("IndicatorVisibleMode : {0}", sld1.IndicatorVisibleMode.ToString()); lb3.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; }; sld1.Show(); lb1.Show(); lb2.Show(); lb3.Show(); btn.Show(); btn2.Show(); buttonBox.PackEnd(btn); buttonBox.PackEnd(btn2); box.PackEnd(lb1); box.PackEnd(lb2); box.PackEnd(lb3); box.PackEnd(sld1); box.PackEnd(buttonBox); lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; lb3.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; sld1.ValueChanged += (s, e) => { lb1.Text = string.Format("Value Changed: {0}", sld1.Value); lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; }; }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box outterBox = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = false, }; outterBox.Show(); Toolbar toolbar = new Toolbar(window) { AlignmentX = -1, WeightX = 1, ShrinkMode = ToolbarShrinkMode.Scroll }; toolbar.Show(); outterBox.PackEnd(toolbar); Scroller scroller = new Scroller(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, ScrollBlock = ScrollBlock.Vertical, HorizontalPageScrollLimit = 1, }; scroller.SetPageSize(1.0, 1.0); scroller.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; box.Show(); scroller.SetContent(box); var rnd = new Random(); for (int i = 0; i < 5; i++) { int r = rnd.Next(255); int g = rnd.Next(255); int b = rnd.Next(255); Color color = Color.FromRgb(r, g, b); Rectangle colorBox = new Rectangle(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = color, MinimumWidth = window.ScreenSize.Width, }; colorBox.Show(); box.PackEnd(colorBox); ToolbarItem item = toolbar.Append(string.Format("{0} Item", i), "home"); _itemTable[item] = i; _reverseItemTable[i] = item; item.Selected += (s, e) => { scroller.ScrollTo(_itemTable[(ToolbarItem)s], 0, true); }; } scroller.Scrolled += (s, e) => { if (scroller.HorizontalPageIndex != currentItemIndex) { currentItemIndex = scroller.HorizontalPageIndex; _reverseItemTable[currentItemIndex].IsSelected = true; } }; conformant.SetContent(outterBox); outterBox.PackEnd(scroller); }
/// <summary> /// Create a base UI. /// </summary> void Initialize() { // Create the window window = new Window("MapApp"); window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false); window.KeyUp += (s, e) => { if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName) { // Close the map if the back key is selected CloseApp(); } else if (e.KeyName == EvasKeyEventArgs.PlatformMenuButtonName) { // Create the ContextPopup for the ViewPage selection viewCtxPopup = new ContextPopup(window) { // Set the AutoHide value AutoHide = true, }; // Append items for the ContextPopup and add event handlers (viewCtxPopup.Append("Map")).Selected += ViewPageSelected; (viewCtxPopup.Append("POI")).Selected += ViewPageSelected; (viewCtxPopup.Append("Route")).Selected += ViewPageSelected; // Move the ContextPopup viewCtxPopup.Move(0, window.ScreenSize.Height); // Show the ContextPopup viewCtxPopup.Show(); } }; // Show the window window.Show(); var box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var bg = new Background(window) { Color = Color.White }; bg.SetContent(box); var conformant = new Conformant(window); conformant.Show(); conformant.SetContent(bg); // Create the MapView s_mapview = new MapView(window, s_maps); // Move the MapView s_mapview.Move(0, 0); // Resize the MapView s_mapview.Resize(window.ScreenSize.Width, window.ScreenSize.Height); // Show the MapView s_mapview.Show(); // Set the latitude and longitude for the center position of the MapView //s_mapview.Center = new Geocoordinates(SEOUL_LAT, SEOUL_LON); s_mapview.Center = new Geocoordinates(DEFAULT_LAT, DEFAULT_LON); // Set the zoom level s_mapview.ZoomLevel = 9; // Add the handler for the longpress event on MapView s_mapview.LongPressed += MapViewLongPressed; CreateLabel(); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); GenGrid grid = new GenGrid(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, ItemAlignmentX = -1, ItemAlignmentY = -1, ItemWidth = window.ScreenSize.Width / 3, ItemHeight = window.ScreenSize.Width / 3, }; GenItemClass defaultClass = new GenItemClass("default") { GetTextHandler = (obj, part) => { Color item = (Color)obj; return(String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B)); }, GetContentHandler = (obj, part) => { Color item = (Color)obj; if (part == "elm.swallow.icon") { var colorbox = new Rectangle(window) { Color = item }; return(colorbox); } return(null); } }; GenGridItem firstitem = null; GenGridItem lastitem = null; var rnd = new Random(); for (int i = 0; i < 102; i++) { int r = rnd.Next(255); int g = rnd.Next(255); int b = rnd.Next(255); Color color = Color.FromRgb(r, g, b); var item = grid.Append(defaultClass, color); if (i == 0) { firstitem = item; } if (i == 101) { lastitem = item; } } grid.Show(); var square = window.GetInnerSquare(); grid.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4); Button first = new Button(window) { Text = "First", BackgroundColor = Color.Red }; Button last = new Button(window) { Text = "Last", BackgroundColor = Color.Blue }; first.Clicked += (s, e) => { grid.ScrollTo(firstitem, ScrollToPosition.In, true); Log.Debug(first.Text); }; last.Clicked += (s, e) => { grid.ScrollTo(lastitem, ScrollToPosition.In, true); Log.Debug(last.Text); }; first.Show(); last.Show(); first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height); last.Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height); grid.ItemActivated += Grid_ItemActivated; grid.ItemSelected += Grid_ItemSelected; grid.ItemUnselected += Grid_ItemUnselected; grid.ItemRealized += Grid_ItemRealized; grid.ItemUnrealized += Grid_ItemUnrealized; grid.ItemPressed += Grid_ItemPressed; grid.ItemReleased += Grid_ItemReleased; grid.ItemLongPressed += Grid_ItemLongPressed; grid.ItemDoubleClicked += Grid_ItemDoubleClicked; }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box outterBox = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = false, }; outterBox.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; box.Show(); FlipSelector flip = new FlipSelector(window) { Interval = 1.0, }; flip.Append("two"); flip.Prepend("one"); flip.Show(); box.PackEnd(flip); conformant.SetContent(outterBox); outterBox.PackEnd(box); Button prev = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "Prev" }; prev.Clicked += (s, e) => { flip.Prev(); }; prev.Show(); Button next = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "next" }; next.Clicked += (s, e) => { flip.Next(); }; next.Show(); Button prepend = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "prepend" }; prepend.Clicked += (s, e) => { var random = new Random(); int value = random.Next(99); flip.Prepend(value.ToString()); }; prepend.Show(); Button append = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "append" }; append.Clicked += (s, e) => { var random = new Random(); int value = random.Next(99); flip.Append(value.ToString()); }; append.Show(); Button remove = new Button(window) { AlignmentX = -1, WeightX = 1, Text = "remove" }; remove.Clicked += (s, e) => { flip.Remove(flip.SelectedItem); }; remove.Show(); outterBox.PackEnd(box); outterBox.PackEnd(prev); outterBox.PackEnd(next); outterBox.PackEnd(append); outterBox.PackEnd(prepend); outterBox.PackEnd(remove); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window); conformant.SetContent(box); box.Show(); Rectangle redBox = new Rectangle(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.Red, }; redBox.Show(); Rectangle blueBox = new Rectangle(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.Blue, }; Rectangle greenBox = new Rectangle(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.Green, }; Panes subPanes = new Panes(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Proportion = 0.3, IsHorizontal = false }; subPanes.Show(); subPanes.SetPartContent("left", blueBox); subPanes.SetPartContent("right", greenBox); Panes panes = new Panes(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Proportion = 0.1, IsFixed = true, IsHorizontal = true, }; panes.SetPartContent("left", redBox); panes.SetPartContent("right", subPanes); panes.Show(); box.PackEnd(panes); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window); conformant.SetContent(box); box.Show(); Box buttonBox1 = new Box(window) { IsHorizontal = true, AlignmentX = -1, AlignmentY = 0, }; buttonBox1.Show(); Box buttonBox2 = new Box(window) { IsHorizontal = true, AlignmentX = -1, AlignmentY = 0, }; buttonBox2.Show(); Button btnFile1 = new Button(window) { Text = "File1", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFile1.Show(); Button btnFile2 = new Button(window) { Text = "File2", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFile2.Show(); Button btnUri1 = new Button(window) { Text = "Uri", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnUri1.Show(); Button btnStream1 = new Button(window) { Text = "Strm", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnStream1.Show(); buttonBox1.PackEnd(btnFile1); buttonBox1.PackEnd(btnFile2); buttonBox1.PackEnd(btnUri1); buttonBox1.PackEnd(btnStream1); Button btnFileAsync1 = new Button(window) { Text = "FileA1", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFileAsync1.Show(); Button btnFileAsync2 = new Button(window) { Text = "FileA2", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnFileAsync2.Show(); Button btnUriAsync1 = new Button(window) { Text = "UriA", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnUriAsync1.Show(); Button btnStreamAsync1 = new Button(window) { Text = "StrmA", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; btnStreamAsync1.Show(); buttonBox2.PackEnd(btnFileAsync1); buttonBox2.PackEnd(btnFileAsync2); buttonBox2.PackEnd(btnUriAsync1); buttonBox2.PackEnd(btnStreamAsync1); lbInfo = new Label(window) { Color = Color.White, AlignmentX = -1, AlignmentY = 0, WeightX = 1 }; lbInfo.Show(); image = new Image(window) { IsFixedAspect = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; image.Show(); image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); image.Clicked += (s, e) => { Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); image.IsFixedAspect = image.IsFixedAspect == true ? false : true; }; image.LoadingCompleted += (s, e) => { Console.WriteLine("Image has been loaded successfully."); }; image.LoadingFailed += (s, e) => { Console.WriteLine("Image loading has been failed."); }; btnFile1.Clicked += (s, e) => LoadFile("TED/large/a.jpg"); btnFile2.Clicked += (s, e) => LoadFile("TED/large/b.jpg"); btnUri1.Clicked += (s, e) => LoadUri("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg"); btnStream1.Clicked += (s, e) => LoadStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/c.jpg"), FileMode.Open, FileAccess.Read)); btnFileAsync1.Clicked += (s, e) => LoadFileAsync("TED/large/d.jpg"); btnFileAsync2.Clicked += (s, e) => LoadFileAsync("TED/large/e.jpg"); btnUriAsync1.Clicked += (s, e) => LoadUriAsync("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg"); btnStreamAsync1.Clicked += (s, e) => LoadStreamAsync(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/f.jpg"), FileMode.Open, FileAccess.Read)); box.PackEnd(buttonBox1); box.PackEnd(buttonBox2); box.PackEnd(lbInfo); box.PackEnd(image); }
public override void Run(Window window) { Background bg = new Background(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.White }; bg.Show(); window.AddResizeObject(bg); Conformant conformant = new Conformant(window); conformant.Show(); int number = 0; bool bReturn = true; Label label1 = new Label(window); label1.Move(150, 150); label1.Resize(300, 100); Button btnTimerSwitch = new Button(window); btnTimerSwitch.Text = "Timer : On"; btnTimerSwitch.Move(0, 300); btnTimerSwitch.Resize(300, 100); Func <bool> handler = () => { label1.Text = (++number).ToString(); label1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#000000 font_size=64 align=left valign=bottom wrap=word'"; return(bReturn); }; IntPtr prevId = EcoreMainloop.AddTimer(1.0, handler); btnTimerSwitch.Clicked += (s, e) => { if (bReturn) { bReturn = false; btnTimerSwitch.Text = "Timer : Off"; } else { bReturn = true; btnTimerSwitch.Text = "Timer : On"; EcoreMainloop.RemoveTimer(prevId); prevId = EcoreMainloop.AddTimer(1.0, handler); } }; window.BackButtonPressed += (s, e) => { EcoreMainloop.RemoveTimer(prevId); }; label1.Show(); btnTimerSwitch.Show(); }
public override void Run(Window window) { Background bg = new Background(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = Color.White }; bg.Show(); window.AddResizeObject(bg); Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window); box.Show(); conformant.SetContent(box); box.Resize(window.ScreenSize.Width, window.ScreenSize.Height); var label = new Label(window); var label2 = new Label(window); var button = new Button(window); box.SetLayoutCallback(() => { label.Geometry = new Rect(10, box.Geometry.Y, box.Geometry.Width - 20, 100); label2.Geometry = new Rect(10, label.Geometry.Y + 120, box.Geometry.Width - 20, 100); button.Geometry = new Rect(0, box.Geometry.Y + 300, box.Geometry.Width, 200); }); label.BackgroundColor = Color.Aqua; label.LineWrapType = WrapType.Word; label.IsEllipsis = false; label.TextStyle = "DEFAULT = 'align=left'"; label2.BackgroundColor = Color.Aqua; label2.LineWrapType = WrapType.None; label2.IsEllipsis = false; label2.TextStyle = "DEFAULT = 'align=left'"; label.Show(); label2.Show(); box.PackEnd(label); box.PackEnd(label2); button.SetAlignment(-1, -1); button.SetWeight(1, 1); button.Text = "Append"; button.Show(); box.PackEnd(button); button.Clicked += (s, e) => { string alpahbat = "ABCDEFGHIJKLMOPQRSTUVWXYZ"; label.Text += alpahbat[count % alpahbat.Length]; label.Text += alpahbat[count % alpahbat.Length]; label2.Text += alpahbat[count % alpahbat.Length]; label2.Text += alpahbat[count % alpahbat.Length]; count++; }; }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.Show(); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.1, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion MTabs tabs = new MTabs(window) { Type = MTabsType.Scrollable, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; tabs.Show(); Label label1 = new Label(window) { Text = " Scrollable Tabs", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; label1.Show(); MTabs tabs2 = new MTabs(window) { Type = MTabsType.Fixed, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; tabs2.Show(); Label label2 = new Label(window) { Text = " Fixed Tabs", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; label2.Show(); for (int i = 0; i < 4; i++) { var item = tabs.Append(string.Format("{0}ht Item", i)); } for (int i = 0; i < 4; i++) { var item2 = tabs2.Append(string.Format("{0}ht Item", i), "home"); item2.SetPartColor("bg", backgroudColor); } box.PackEnd(tabs); box.PackEnd(label1); box.PackEnd(tabs2); box.PackEnd(label2); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); conformant.SetContent(box); GenList list = new GenList(window) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; GenItemClass defaultClass = new GenItemClass("default") { GetTextHandler = (obj, part) => { return(string.Format("{0} - {1}", (string)obj, part)); } }; List <GenListItem> items = new List <GenListItem>(); int idx = 20; for (int t = 1; t < 10; t++) { items.Add(list.InsertSorted(defaultClass, idx.ToString(), myCompare, GenListItemType.Normal, null)); idx--; } list.Show(); list.ItemSelected += List_ItemSelected; box.PackEnd(list); Button first = new Button(window) { Text = "Check first and last item", AlignmentX = -1, WeightX = 1, }; Button Add = new Button(window) { Text = "Add", AlignmentX = -1, WeightX = 1, }; Add.Clicked += (s, e) => { items.Add(list.InsertSorted(defaultClass, idx.ToString(), myCompare, GenListItemType.Normal, null)); idx--; }; first.Clicked += (s, e) => { Console.WriteLine("Last Item's Data : " + list.LastItem.Data); Console.WriteLine("First date of Items " + items[0].Data); Console.WriteLine("Result for comparinson " + (bool)(list.LastItem == list.LastItem)); }; first.Show(); Add.Show(); box.PackEnd(first); box.PackEnd(Add); }