internal static VerticalStack GetStandardLayout(int topMargin) { VerticalStack layout = new VerticalStack(); layout.SetMargin(0, topMargin, 0, 0); layout.SetBackground(60, 60, 60); return(layout); }
public static VerticalStack GetSideBarLayout() { VerticalStack layout = new VerticalStack(); layout.SetWidthPolicy(SizePolicy.Fixed); layout.SetWidth(40); layout.SetBackground(35, 35, 35); layout.SetMargin(0, 55, 0, 55); layout.SetContentAlignment(ItemAlignment.VCenter); return(layout); }
public override void InitElements() { base.InitElements(); //window's attr Window.SetBackground(45, 45, 45); //title TitleBar title = new TitleBar("Adding a new member"); title.SetFont(DefaultsService.GetDefaultFont(14)); title.GetMinimizeButton().SetVisible(false); title.GetMaximizeButton().SetVisible(false); VerticalStack layout = new VerticalStack(); layout.SetMargin(0, title.GetHeight(), 0, 0); layout.SetPadding(6, 15, 6, 6); layout.SetSpacing(vertical: 30); layout.SetBackground(255, 255, 255, 20); //message _input.EventKeyRelease += OnKeyRelease; //ok _add.SetBackground(255, 181, 111); _add.SetStyle(Styles.GetButtonStyle()); _add.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0)); _add.EventMouseClick += (sender, args) => { InputResult = _input.GetText(); Close(); }; //adding items Window.AddItems( title, layout ); layout.AddItems( _input, _add ); title.GetCloseButton().EventMouseClick = null; title.GetCloseButton().EventMouseClick += (sender, args) => { Close(); }; }
public override void InitWindow() { SetParameters(nameof(MainWindow), "EnigmaGame", 798, 640, false); SetAntiAliasingQuality(MSAA.MSAA8x); SetBackground(Common.Background); SetPadding(1, 1, 1, 1); SetMinSize(GetWidth(), GetHeight()); //icons var big = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.icon.png")); var small = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.icon.png")); SetIcon(big, small); TitleBar title = new TitleBar("EnigmaGame"); title.SetIcon(small, 20, 20); title.SetShadow(5, 0, 2, Color.Black); VerticalStack layout = new VerticalStack(); layout.SetBackground(GetBackground()); layout.SetPadding(30, 30, 30, 30); layout.SetMargin(10, title.GetHeight() + 10, 10, 10); layout.SetSpacing(0, 10); layout.SetBorder(new Border(Common.Selected, new CornerRadius(10), 4)); layout.SetShadow(10, 0, 0, Color.Black); //adding AddItems( layout, title, menu ); layout.AddItems( header, time_limit, cards_board, hand ); //events EventKeyPress += OnKeyPress; wrong = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.wrong.wav")); key = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.switch.wav")); next = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("EnigmaGame.next.wav")); }
public override void InitWindow() { // Window's attr SetParameters(Controller.GetLanguage()["MainTitle"], Controller.GetLanguage()["MainTitle"], 300, 360, false); SetMinSize(300, 360); SetBackground(Palette.CommonDark); IsCentered = true; SetIcon(Resources.Icon, Resources.Icon); // Content Title = Items.GetTitleBar(Controller.GetLanguage()["MainTitle"]); VerticalStack layout = Items.GetLayout(); layout.SetMargin(0, Title.GetHeight(), 0, 0); BtnStatus = Items.GetButton(Controller.GetLanguage()["BatteryButton"]); BtnSettings = Items.GetButton(Controller.GetLanguage()["SettingsButton"]); BtnStart = Items.GetButton(Controller.GetLanguage()["StartButton"]); ImgStatus = Items.GetBatteryItem(); ProfileList = Items.GetProfileList(); foreach (var profile in Controller.GetAllProfiles()) { ProfileList.AddItem(Items.GetListItem(profile.Name)); } // Adding content AddItems(Title, layout); layout.AddItems( ProfileList, ImgStatus, BtnStatus, BtnSettings, new Frame(), BtnStart ); // Post settings ProfileList.SetCurrentIndex( Controller.GetAllProfiles().Select(p => p.Name).ToList().IndexOf(Controller.GetProfile().Name)); ProfileList.SelectionChanged += () => { Controller.InvokeEventProfileChanged(ProfileList.GetText()); }; }
public override void InitWindow() { // Window's attr SetParameters(Controller.GetLanguage()["SetsTitle"], Controller.GetLanguage()["SetsTitle"], 900, 600, false); SetMinSize(900, 600); SetBackground(Factory.Palette.CommonDark); IsCentered = true; SetIcon(Factory.Resources.Icon, Factory.Resources.Icon); // Content _titleBar = Factory.Items.GetTitleBar(Controller.GetLanguage()["SetsTitle"]); CloseBtn = _titleBar.GetCloseButton(); VerticalStack layout = Factory.Items.GetLayout(); layout.SetMargin(0, _titleBar.GetHeight(), 0, 0); layout.SetPadding(0, 0, 0, 15); _tabArea = new TabView(); _tabArea.SetTabPolicy(SizePolicy.Expand); _common = new SettingsTab(Controller.GetLanguage()["SetsTabCommon"]); _commonContent = new CommonSettingsContainer(); _binds = new SettingsTab(Controller.GetLanguage()["SetsTabBinds"]); _bindsContent = new BindsSettingsContainer(); _sticks = new SettingsTab(Controller.GetLanguage()["SetsTabSticks"]); _sticksContent = new SticksSettingsContainer(); SaveBtn = Items.GetControlButton(Controller.GetLanguage()["SaveButton"]); // Adding content AddItems(_titleBar, layout); layout.AddItems( _tabArea, SaveBtn ); _tabArea.AddTab(_common); _tabArea.AddTab(_sticks); _tabArea.AddTab(_binds); _tabArea.AddItemToTab(_common, _commonContent as IBaseItem); _tabArea.AddItemToTab(_sticks, _sticksContent as IBaseItem); _tabArea.AddItemToTab(_binds, _bindsContent as IBaseItem); }
public override void InitElements() { Grid left_arrows = new Grid(2, 1); left_arrows.SetWidth(20); left_arrows.SetWidthPolicy(SizePolicy.Fixed); Grid right_arrows = new Grid(2, 1); right_arrows.SetStyle(left_arrows.GetCoreStyle()); //board VerticalStack board = new VerticalStack(); board.SetMargin(5, 0, 5, 0); board.SetSpacing(0, 0); top_grid.SetBorder(new Border(Common.Significant, new CornerRadius(10, 10, 0, 0), 1)); top_grid.SetPadding(5, 1, 1, 0); //numbers bottom_grid.SetBorder(new Border(Common.Significant, new CornerRadius(0, 0, 10, 10), 1)); bottom_grid.SetPadding(5, 0, 1, 1); //adding AddItems( left_arrows, board, right_arrows ); left_arrows.AddItems( Common.GetArrow(135), Common.GetArrow(135) ); right_arrows.AddItems( Common.GetArrow(-45), Common.GetArrow(-45) ); board.AddItems( top_grid, bottom_grid ); for (int i = 0; i < 9; i++) { Card top_card = new Card(); top_grid.AddItem(top_card); Card bottom_card = new Card(); bottom_grid.AddItem(bottom_card); top_list.Add(top_card); bottom_list.Add(bottom_card); if (i == 0 || i == 8) { top_card.SetBorderFill(Color.Transparent); bottom_card.SetBorderFill(Color.Transparent); } } InitHand(); }
public override void InitElements() { //important! base.InitElements(); //window init Window.SetMinSize(330, 150); Window.SetBackground(47, 49, 54); Window.SetPadding(0, 0, 0, 0); //title TitleBar title = new TitleBar("Adding a new friend"); title.SetStyle(Styles.GetTitleBarStyle()); title.GetMaximizeButton().SetVisible(false); title.GetMinimizeButton().SetVisible(false); VerticalStack layout = new VerticalStack(); layout.SetAlignment(ItemAlignment.Top | ItemAlignment.HCenter); layout.SetMargin(0, 22, 0, 0); layout.SetPadding(6, 15, 6, 6); layout.SetSpacing(vertical: 30); layout.SetBackground(255, 255, 255, 20); //new friend's name input.SetBorderRadius(4); input.EventKeyRelease += OnKeyRelease; //add button add = InfinityItemsBox.GetOrdinaryButton(); add.SetSize(150, 30); add.SetBackground(67, 181, 129); add.SetForeground(Color.White); add.SetText("Add"); add.SetAlignment(ItemAlignment.HCenter | ItemAlignment.Bottom); add.SetPadding(0, 2, 0, 0); add.SetShadow(4, 0, 2, Color.FromArgb(150, 0, 0, 0)); //adding items Window.AddItems( title, layout ); layout.AddItems( input, add ); add.EventMouseClick += (sender, args) => { InputResult = input.GetText(); Close(); }; title.GetCloseButton().EventMouseClick = null; title.GetCloseButton().EventMouseClick += (sender, args) => { Close(); }; //focus on textedit input.SetFocus(); }
public override void InitWindow() { //Window attr SetParameters(nameof(MainWindow), nameof(CustomChance), 360, 500, false); SetMinSize(350, 500); SetBackground(45, 45, 45); EventKeyRelease += (sender, args) => OnKeyRelease(sender, args); EventClose = () => { CommonLogic.GetInstance().TrySerialize(); Close(); }; //icons var big = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("CustomChance.icon_big.png")); var small = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("CustomChance.icon_small.png")); SetIcon(big, small); //title TitleBar title = new TitleBar("Custom Chance"); title.SetIcon(small, 16, 16); title.SetFont(DefaultsService.GetDefaultFont(14)); title.GetMaximizeButton().SetVisible(false); //layout VerticalStack layout = new VerticalStack(); layout.SetMargin(0, title.GetHeight(), 0, 0); layout.SetPadding(3, 3, 3, 3); layout.SetSpacing(vertical: 5); layout.SetBackground(255, 255, 255, 20); //listBox _listBox = new ListBox(); _listBox.SetBackground(52, 52, 52); _listBox.SetHScrollBarPolicy(VisibilityPolicy.Never); _listBox.SetVScrollBarPolicy(VisibilityPolicy.Never); _listBox.SetSelectionVisible(false); //AddButton AddButton = new ButtonStand("Add a Member!"); AddButton.SetStyle(Styles.GetButtonStyle()); AddButton.SetMargin(0, 5, 0, 5); AddButton.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0)); AddButton.EventMouseClick += (sender, args) => { InputDialog dialog = new InputDialog(); dialog.OnCloseDialog += () => { String result = dialog.InputResult; //add member if (CommonLogic.GetInstance().AddMember(CommonLogic.GetInstance().Storage.Members, result)) { //add member to ui MemberItem member = new MemberItem(); member.MemberName.SetText(result); member.Index = CommonLogic.GetInstance().Storage.Members.Count - 1; _listBox.AddItem(member); } }; dialog.Show(this); }; //StartButton StartButton = new ButtonStand("Make a Chance!"); StartButton.SetStyle(Styles.GetButtonStyle()); StartButton.SetMargin(0, 5, 0, 5); StartButton.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0)); StartButton.EventMouseClick += (sender, args) => { if (CommonLogic.GetInstance().Storage.Members == null || CommonLogic.GetInstance().Storage.Members.Count == 0) { return; } CommonLogic.GetInstance().StartRandom(CommonLogic.GetInstance().Storage.Members); UpdateUI(); }; //adding AddItems( title, layout ); layout.AddItems( AddButton, _listBox, StartButton ); //load save file if (CommonLogic.GetInstance().Storage.Members.Count > 0) { RestoreItems(); } }