public override EvasObject CreateContent(EvasObject parent) { Box box = new ColoredBox(parent); box.Show(); box.PackEnd(GetTitleLabel(parent)); var button = new MButton(parent) { Text = "Button", WeightX = 1, WeightY = 1, AlignmentX = 0.5, AlignmentY = 0.5, }; button.Show(); var button2 = new MButton(parent) { Text = "Click", WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = 0.5 }; button2.Show(); var button3 = new MButton(parent) { IsEnabled = true, Text = "Chage Tooltip Button2", WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = 0.5, BackgroundColor = Color.FromHex("#03A9F4"), }; button3.Show(); button.UseMTooltip(); button2.UseMTooltip(); button3.UseMTooltip(); button.SetTooltipText("Button"); button2.SetTooltipText("Tooltip Test"); button3.SetTooltipText("#03A9F4"); button3.Clicked += (s, e) => { button2.SetTooltipText("Chage Tooltip"); }; box.PackEnd(button2); return(box); }
protected virtual void Move(int x, int y, int xglobal, int yglobal, MButton mb) { if (PointOnControl(x, y)) { MouseMove?.Invoke(x, y, mb); } }
private void InitOKButton() { Button btnOK = new MButton(); btnOK.Text = "OK"; btnOK.Click += ButtonClick; this._buttonCollection.Add(btnOK); }
public SettingsScreen() : base("SettingsScreen") { _UserNameText = GetMenuItem <MText>("UserNameText"); _PortText = GetMenuItem <MText>("PortText"); _DefaultHostText = GetMenuItem <MText>("DefaultHostText"); _DoneButton = GetMenuItem <MButton>("DoneButton"); _DoneButton.OnClicked += _DoneButton_OnClicked; }
public DeckBuilderScreen() : base("DeckBuilder/DeckBuilderScreen") { _MercDeckBuilderButton = GetMenuItem <MListItem>("MercDeckBuilder"); _KfDeckBuilderButton = GetMenuItem <MListItem>("KfDeckBuilder"); _DoneButton = GetMenuItem <MButton>("DoneButton"); _MercDeckBuilderButton.OnClicked += _MercDeckBuilderButton_OnClicked; _KfDeckBuilderButton.OnClicked += _KfDeckBuilderButton_OnClicked; _DoneButton.OnClicked += _DoneButton_OnClicked; }
EvasObject CreateNewWindow(EvasObject parent, BaseGalleryPage page) { var box = new ColoredBox(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var titleLabel = new Label(parent) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1, LineWrapType = WrapType.Word, LineWrapWidth = 300, Text = $"<span align=center color=#000000>{page.Name}</span > " }; titleLabel.Show(); var button = new MButton(parent) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = "run" }; button.Show(); button.Clicked += (s, e) => { Window window = new Window(page.Name); window.Show(); window.BackButtonPressed += (sender, args) => { page.TearDown(); window.Hide(); window.Unrealize(); }; page.Run(window); }; box.PackEnd(titleLabel); box.PackEnd(button); return(box); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.Show(); var button = new MButton(window) { Text = "Button", }; button.Resize(400, 80); button.Move(180, 300); button.Show(); var button2 = new MButton(window) { Text = "Button2", }; button2.Resize(400, 80); button2.Move(180, 600); button2.Show(); var button3 = new MButton(window) { IsEnabled = true, Text = "Chage Tooltip Button2", BackgroundColor = Color.FromHex("#03A9F4"), }; button3.Resize(600, 80); button3.Move(80, 900); button3.Show(); button.UseMTooltip(); button2.UseMTooltip(); button3.UseMTooltip(); button.SetTooltipText("Button"); button2.SetTooltipText("Tooltip Test"); button3.SetTooltipText("#03A9F4"); button3.Clicked += (s, e) => { button2.SetTooltipText("Chage Tooltip"); }; }
private bool DeleteButton(MButton btn) { if (DataBase.DeleteButton(btn.TabId, btn.Col, btn.Row) < 1) { return(false); } btn.IconImage = null; btn.Text = string.Empty; btn.Path = string.Empty; return(true); }
public ClientConnectScreen() : base("ClientConnectScreen") { _IpTextBox = GetMenuItem <MText>("IpTextBox"); _ConnectButton = GetMenuItem <MButton>("ConnectButton"); _IpTextBox.Filters = Systems.AllowKeyString.All | ~Systems.AllowKeyString.Space; _IpTextBox.Text = GSettings.DefaultHost; _IpTextBox.OnEnterPressed += _IpTextBox_OnEnterPressed; _ConnectButton.OnClicked += _ConnectButton_OnClicked; GNet.OnGotMessage += GNet_OnGotMessage; }
private HitTestResultBehavior MyHitTestResult(HitTestResult result) { Console.WriteLine("result : " + result.VisualHit.GetType()); // wpf 에서 의도적으로 구현했는지 모르겠지만, userControl은 hitTest에서 result로 떨어지지 않는다. // 그래서 눈에 보이는 놈 하나만 발견하면 다 중지시켜버리고 // 돔 구조니까 부모를 따라가도록 한다. var std = result.VisualHit as DependencyObject; MButton button = std.GetVisualParent <MButton>(); DeleteButton(button); return(HitTestResultBehavior.Stop); }
public EvasObject CreateThemeButtons(EvasObject parent) { Box box = new Box(parent) { IsHorizontal = true, WeightX = 1, WeightY = 0.1, AlignmentX = -1, AlignmentY = 0.5, }; box.Show(); var defaultColor = new MButton(parent) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(parent) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(parent) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); box.PackEnd(defaultColor); box.PackEnd(light); box.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; return(box); }
private void InitYesNoButtons() { Button btnYes = new MButton(); btnYes.Text = "YES"; btnYes.Click += ButtonClick; Button btnNo = new MButton(); btnNo.Text = "NO"; btnNo.Click += ButtonClick; this._buttonCollection.Add(btnYes); this._buttonCollection.Add(btnNo); }
private void InitRetryCancelButtons() { Button btnRetry = new MButton(); btnRetry.Text = "OK"; btnRetry.Click += ButtonClick; Button btnCancel = new MButton(); btnCancel.Text = "CANCEL"; btnCancel.Click += ButtonClick; this._buttonCollection.Add(btnRetry); this._buttonCollection.Add(btnCancel); }
private void InitOKCancelButtons() { Button btnOK = new MButton(); btnOK.Text = "OK"; btnOK.Click += ButtonClick; Button btnCancel = new MButton(); btnCancel.Text = "CANCEL"; btnCancel.Click += ButtonClick; this._buttonCollection.Add(btnOK); this._buttonCollection.Add(btnCancel); }
/// <summary> /// 快捷菜单按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void FastBtnClick(object sender, MMouseEventArgs e) { MButton mb = sender as MButton; if (mb != null) { ContractCategoryDic cv = mb.Tag as ContractCategoryDic; if (cv != null && mb.hasChoose) { UpdataSelect(cv); DataManager.Instance.CurrentCode = cv.categoryCode; UpdateTable(); //this.PublishControl1.SetContractIDChanged(cv); this.publishForm.SetContractIDChanged(cv); } } }
public override EvasObject CreateContent(EvasObject parent) { var box = new ColoredBox(parent); box.Show(); box.PackEnd(GetTitleLabel(parent)); var button = new MButton(parent) { Text = "Button", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button); button.Show(); var button2 = new MButton(parent) { IsEnabled = false, Text = "Disabled", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button2); button2.Show(); var button3 = new MButton(parent) { IsEnabled = true, Text = "Custom Color", BackgroundColor = Color.FromHex("#03A9F4"), MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button3); button3.Show(); return(box); }
private bool InsertButton(MButton btn, string path) { // 파일명 읽어와야 함 string fileName = Path.GetFileName(path); ImageSource imgIcon = IconManager.GetIcon(path); byte[] baIcon = IconManager.ImageSourceToByte(imgIcon); if (DataBase.InsertButton(btn.TabId, btn.Col, btn.Row, fileName, path, baIcon) < 1) { return(false); } btn.IconImage = imgIcon; btn.Text = fileName; btn.Path = path; return(true); }
// Update is called once per frame void Update() { if (isWork) { //for 3d Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit3d; MButton button = null; // if (Physics.Raycast(, -Vector3.up, out hit, 100f) if (Physics.Raycast(ray, out hit3d)) { button = hit3d.collider.GetComponent<MButton>(); } //for 2d RaycastHit2D hit2d = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero); if (hit2d != null && hit2d.collider != null) { button = hit2d.collider.GetComponent<MButton>(); } if ( button != null ) { if ( Input.GetMouseButtonUp(0)) { button.OnClick(); } else if (Input.GetMouseButton(0)) { button.OnPress(); } else { button.OnHover(); } } if (button != tempButton) { if (tempButton != null) tempButton.OnExit(); tempButton = button; } } }
private static void Bt1_MouseUp(int x, int y, MButton mButton) { Thread.Sleep(30); bt1.Free(); new Thread(() => { int h = 0; while (true) { Thread.Sleep(30); h++; if (h >= 360) { h = 0; } consoleForms.SetBackgroundColorsRGB(consoleForms.HsvToRgb(h, 1, 1)); Console.WriteLine(); } }).Start(); }
private void Button_Click(object sender, RoutedEventArgs e) { MButton btn = sender as MButton; if (string.IsNullOrWhiteSpace(btn.Path)) { return; } try { if (File.Exists(btn.Path)) { if (Path.GetExtension(btn.Path).ToLower() == ".bat") { string path = Path.GetDirectoryName(btn.Path); string file = Path.GetFileName(btn.Path); ProcessStartInfo psi = new ProcessStartInfo(); psi.WorkingDirectory = path; psi.FileName = "cmd.exe"; psi.Arguments = string.Format("/C \"{0}\"", file); Process.Start(psi); } else { Process.Start(btn.Path); } } else if (Directory.Exists(btn.Path)) { Process.Start(btn.Path); } else { MessageBox.Show(string.Format("해당 경로의 파일이 없습니다.\r\n{0}", btn.Path)); return; } } catch { } }
private void InitAbortRetryIgnoreButtons() { Button btnAbort = new MButton(); btnAbort.Text = "INTERRUPT"; btnAbort.Click += ButtonClick; Button btnRetry = new MButton(); btnRetry.Text = "RETRY"; btnRetry.Click += ButtonClick; Button btnIgnore = new MButton(); btnIgnore.Text = "IGNORE"; btnIgnore.Click += ButtonClick; this._buttonCollection.Add(btnAbort); this._buttonCollection.Add(btnRetry); this._buttonCollection.Add(btnIgnore); }
EvasObject CreateNewWindow(EvasObject parent, BaseGalleryPage page) { var box = new ColoredBox(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var button = new MButton(parent) { AlignmentX = -1, AlignmentY = 0.5, WeightX = 1, WeightY = 1, Text = "click" }; button.Show(); button.Clicked += (s, e) => { Window window = new Window(page.Name); window.Show(); window.BackButtonPressed += (sender, args) => { page.TearDown(); window.Hide(); window.Unrealize(); }; page.Run(window); }; box.PackEnd(button); return(box); }
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(); var button = new MButton(window) { Text = "Button", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.9 }; box.PackEnd(button); button.Show(); var button2 = new MButton(window) { IsEnabled = false, Text = "Button 2", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.1 }; box.PackEnd(button2); button2.Show(); }
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 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 var button = new MButton(window) { Text = "Button", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button); button.Show(); var button2 = new MButton(window) { IsEnabled = false, Text = "Disabled", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button2); button2.Show(); var button3 = new MButton(window) { IsEnabled = true, Text = "Custom Color", BackgroundColor = Color.FromHex("#03A9F4"), MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button3); button3.Show(); }
public void Msetdata(MButton b, float?x, float?y) { blr = b; xPos = x; yPos = y; }
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 var switch1 = new MSwitch(window) { WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(switch1); switch1.Show(); var switch2 = new MSwitch(window) { WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(switch2); switch2.Show(); var switch3 = new MSwitch(window) { IsEnabled = false, IsChecked = true, Text = "Disabled", WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(switch3); switch3.Show(); var switch4 = new MSwitch(window) { IsEnabled = true, Text = "Custom Color", Color = Color.FromHex("#E30425"), WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(switch4); switch4.Show(); }
protected override void OnElementChanged(ElementChangedEventArgs <Stepper> e) { if (Control == null) { var outter = new EBox(System.Maui.Maui.NativeParent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; outter.SetPadding(horizontalPadding, 0); outter.Show(); outter.SetLayoutCallback(OnLayout); _borderL = new BorderRectangle(System.Maui.Maui.NativeParent); _borderL.Show(); _borderL.SetRadius(radius); _borderL.BorderWidth = borderWidth; _borderL.Color = defaultColor; _buttonL = new MButton(System.Maui.Maui.NativeParent) { BackgroundColor = EColor.Transparent, Text = "<span color='#000000'>-</span>", }; _buttonL.Show(); _buttonL.Clicked += OnDecrementButtonClicked; outter.PackEnd(_borderL); outter.PackEnd(_buttonL); _borderR = new BorderRectangle(System.Maui.Maui.NativeParent); _borderR.Show(); _borderR.SetRadius(radius); _borderR.BorderWidth = borderWidth; _borderR.Color = defaultColor; _buttonR = new MButton(System.Maui.Maui.NativeParent) { BackgroundColor = EColor.Transparent, Text = "<span color='#000000'>+</span>", }; _buttonR.Show(); _buttonR.Clicked += OnIncrementButtonClicked; outter.PackEnd(_borderR); outter.PackEnd(_buttonR); SetNativeView(outter); } UpdateValue(); UpdateIncrement(); UpdateMinimum(); UpdateMaximum(); base.OnElementChanged(e); }
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 //AlertDialog var button = new MButton(window) { Text = "AlertDialog", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button); button.Show(); var dialog = CreateAlertDialog(window); button.Clicked += (s, e) => { dialog.Show(); }; //SimpleDialog var button2 = new MButton(window) { Text = "SimpleDialog", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button2); button2.Show(); var dialog2 = CreateSimpleDialog(window); button2.Clicked += (s, e) => { dialog2.Show(); }; //ConfirmationDialog var button3 = new MButton(window) { Text = "Confirmation(multi)", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button3); button3.Show(); var dialog3 = CreateConfirmationDialog(window); button3.Clicked += (s, e) => { dialog3.Show(); }; //ConfirmationDialog2 var button5 = new MButton(window) { Text = "Confirmation(single)", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button5); button5.Show(); var dialog5 = CreateConfirmationDialog2(window); button5.Clicked += (s, e) => { dialog5.Show(); }; //FullScreenDialog var button4 = new MButton(window) { Text = "FullScreenDialog", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5 }; box.PackEnd(button4); button4.Show(); var dialog4 = CreateFullScreenDialog(window); button4.Clicked += (s, e) => { dialog4.Show(); }; }
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(); MNavigationView nv = new MNavigationView(window); var paddingbox = new Box(window) { AlignmentX = -1, AlignmentY = -1, MinimumWidth = 32, }; paddingbox.Show(); var paddingbox1 = new Box(window) { AlignmentX = -1, AlignmentY = -1, MinimumWidth = 32, }; paddingbox1.Show(); var paddingbox2 = new Box(window) { AlignmentX = -1, AlignmentY = -1, MinimumHeight = 30, }; paddingbox2.Show(); var paddingbox3 = new Box(window) { AlignmentX = -1, AlignmentY = -1, MinimumHeight = 10, }; paddingbox3.Show(); var name = new Label(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Text = "<span font_weight=bold font_size=50>Tizen</span>", MinimumHeight = 80 }; name.Show(); var namebox = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; namebox.Show(); namebox.PackEnd(paddingbox); namebox.PackEnd(name); var email = new Label(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Text = "<span font_size=35>[email protected]<span>", }; email.Show(); var emailbox = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; emailbox.Show(); emailbox.PackEnd(paddingbox1); emailbox.PackEnd(email); var header = new Box(window) { MinimumHeight = 200, BackgroundColor = Color.White }; header.PackEnd(paddingbox2); header.PackEnd(namebox); header.PackEnd(emailbox); header.PackEnd(paddingbox3); header.Show(); nv.Header = header; var items1 = new List <MItem>(); items1.Add(new MItem("My Files", "icon.png")); items1.Add(new MItem("Shared with me", "icon.png")); items1.Add(new MItem("Starred", "icon.png")); items1.Add(new MItem("Recent", "icon.png")); items1.Add(new MItem("Offline", "icon.png")); var items2 = new List <MItem>(); items2.Add(new MItem("Uploads", "icon.png")); items2.Add(new MItem("Backup", "icon.png")); items2.Add(new MItem("Movie", "icon.png")); items2.Add(new MItem("Music", "icon.png")); items2.Add(new MItem("Play", "icon.png")); var group1 = new MGroup(items1, "Account"); var group2 = new MGroup(items2); var groups = new List <MGroup>(); groups.Add(group1); groups.Add(group2); nv.GroupMenu = groups; var main1 = new MButton(window) { Text = "Open NavigationView", AlignmentX = 0, AlignmentY = 0, MinimumWidth = 720, MinimumHeight = 300 }; main1.Show(); var nd = new MNavigationDrawer(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; nd.Main = main1; nd.NavigationView = nv; main1.Clicked += (s, e) => { nd.IsOpen = true; }; nd.Show(); box.PackEnd(nd); }
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.5, 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 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(); MProgressIndicator disabledPI = new MProgressIndicator(window) { Text = "Disabled", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, IsEnabled = false, }; disabledPI.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); box.PackEnd(disabledPI); 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(); }