Exemple #1
0
            protected override void AdditionalMenuItems()
            {
                Add(new MenuSeparator());

                //add before
                Add(new MenuItemButton(BGEditorUtility.LoadTexture2D(BGEditorUtility.Image.BGPointInsertBefore123), "Insert a point before this point",
                                       () =>
                {
                    var curve    = point.Curve;
                    var settings = BGPrivateField.GetSettings(curve);
                    var index    = curve.IndexOf(point);
                    curve.AddPoint(BGNewPointPositionManager.InsertBefore(curve, index, settings.ControlType, settings.Sections), index);
                }));

                //add after
                Add(new MenuItemButton(BGEditorUtility.LoadTexture2D(BGEditorUtility.Image.BGPointInsertAfter123), "Insert a point after this point",
                                       () =>
                {
                    var curve    = point.Curve;
                    var settings = BGPrivateField.GetSettings(curve);
                    var index    = curve.IndexOf(point);
                    curve.AddPoint(BGNewPointPositionManager.InsertAfter(curve, index, settings.ControlType, settings.Sections), index + 1);
                }));


                //add remove to selection
                addToSelectionItem = new MenuItemButton(BGEditorUtility.LoadTexture2D(BGEditorUtility.Image.BGSelectionAdd123), "Add this point to selection",
                                                        () => EditorSelection.Add(point));

                removeFromSelectionItem = new MenuItemButton(BGEditorUtility.LoadTexture2D(BGEditorUtility.Image.BGSelectionRemove123), "Remove this point from selection",
                                                             () => EditorSelection.Remove(point));

                Add(addToSelectionItem);
                Add(removeFromSelectionItem);
            }
Exemple #2
0
        private void InitMenuItems()
        {
            // MAIN BODY
            _root = new MenuItemGrid("friendsManagement", 4, 7);
            _currentRoomButton = new MenuItemButton("currentRoomButton");
            _currentRoomButton.SetText("Current Room");
            _currentRoomButton.Clicked += SetCurrentRoomActive;
            _root.AddChild(0, 0, 1, 1, _currentRoomButton);
            _friendsListButton = new MenuItemButton("friendsListButton");
            _friendsListButton.SetText("My Friends");
            _friendsListButton.Clicked += SetFriendsListActive;
            _root.AddChild(1, 0, 1, 1, _friendsListButton);
            _friendSearchButton = new MenuItemButton("friendSearchButton");
            _friendSearchButton.SetText("Find Friends");
            _friendSearchButton.Clicked += SetFriendSearchActive;
            _root.AddChild(2, 0, 1, 1, _friendSearchButton);
            _friendRequestsButton = new MenuItemButton("friendRequestsButton");
            _friendRequestsButton.SetText("Friend Requests");
            _friendRequestsButton.Clicked += SetFriendRequestsActive;
            _root.AddChild(3, 0, 1, 1, _friendRequestsButton);

            _currentRoom    = new CurrentRoom(_api);
            _friendRequests = new FriendRequests(_api);
            _friendsList    = new FriendsList(_api);
            _friendSearch   = new FriendsSearch(_api);
            SetCurrentRoomActive();
        }
    // Update is called once per frame
    void Update()
    {
        if (currentMenuItemButton == null)
        {
            return;
        }

        animator.SetFloat("moveMagnitude", input.magnitude);

        if (timer > 0)
        {
            timer -= Time.deltaTime;
        }
        else if (timer < 0)
        {
            timer = 0;
        }

        if (timer == 0 && !ignoreInput)
        {
            MenuItemButton newButton = currentMenuItemButton.GetButtonFromInput(input);

            if (newButton)
            {
                SetCurrentMenuItemButton(newButton);
                timer = timerTime;
            }
        }
    }
Exemple #4
0
        private void RenderRoomList(List <Room> list)
        {
            _roomListGrid.RemoveChild(_loading);
            _loading.Dispose();
            int i = 0;

            foreach (Room r in list)
            {
                if (i >= 10)
                {
                    break;
                }
                MenuItemText roomName = new MenuItemText($"roomName{i}");
                roomName.SetText(r.Name);
                roomName.SetFontSize(5, 15);
                _roomListGrid.AddChild(0, i, 3, 1, roomName);
                MenuItemText roomCapacity = new MenuItemText($"roomCapacity{i}");
                roomCapacity.SetText($"{r.Players.Count}/{r.Capacity}");
                roomCapacity.SetFontSize(5, 15);
                _roomListGrid.AddChild(3, i, 1, 1, roomCapacity);
                MenuItemButton connect = new MenuItemButton($"roomConnect{i}");
                connect.SetText("Connect");
                connect.Clicked += () => ConnectRoom(r);
                _roomListGrid.AddChild(4, i, 2, 1, connect);
                i++;
            }
        }
        private IMenuItem CreateUserBlock(string username, ChatObj chat)
        {
            MenuItemGrid item          = new MenuItemGrid(username, 5, 3);
            MenuItemText usernameBlock = new MenuItemText("username");

            item.AddChild(0, 0, 4, 1, usernameBlock);
            usernameBlock.SetText(username);
            usernameBlock.SetFontSize(8, 15);
            usernameBlock.SetTextStyle(UnityEngine.FontStyle.Bold);
            MenuItemText lastMsgBlock = new MenuItemText("lastMsg");

            item.AddChild(0, 1, 4, 2, lastMsgBlock);
            string text = chat.Messages.Last().Message;

            if (text.Length > MAX_MSG_LEN)
            {
                text  = text.Substring(0, MAX_MSG_LEN - 3);
                text += "...";
            }
            lastMsgBlock.SetText(text);
            lastMsgBlock.SetFontSize(5, 10);
            lastMsgBlock.SetAlignment(UnityEngine.TextAnchor.MiddleLeft);
            MenuItemButton openChat = new MenuItemButton("openChat");

            item.AddChild(4, 0, 1, 3, openChat);
            openChat.SetText(">");
            openChat.Clicked += () => ChatSelected?.Invoke(chat);
            return(item);
        }
Exemple #6
0
 private void RenderPage(int pageNum)
 {
     if (_friends == null)
     {
         Refresh();
     }
     _root.GetChildren().ForEach(x => x.Dispose());
     _root.Clear();
     for (int i = 0; i <= ROWS; ++i)
     {
         if (pageNum * ROWS + i >= _friends.Count)
         {
             break;
         }
         FriendsAppUser friend   = _friends[pageNum * ROWS + i];
         MenuItemText   username = new MenuItemText($"username{friend.UserId}");
         username.SetText(friend.Username);
         _root.AddChild(0, i, 3, 1, username);
         if (friend.CurrentRoomId.HasValue)
         {
             MenuItemButton connectBtn = new MenuItemButton($"connect{friend.UserId}");
             connectBtn.SetText("Connect");
             connectBtn.Clicked += () =>
             {
                 _api.DefaultApps.RoomList.ChangeRoom(friend.CurrentRoomId.Value);
             };
             _root.AddChild(3, i, 1, 1, connectBtn);
         }
         MenuItemButton removeFriend = new MenuItemButton($"remove{friend.UserId}");
         removeFriend.SetText("Remove");
         removeFriend.Clicked += () =>
         {
             _api.DefaultApps.Friends.RemoveFriend(friend.UserId).Wait();
             Refresh();
         };
         _root.AddChild(4, i, 1, 1, removeFriend);
     }
     if (pageNum > 0)
     {
         MenuItemButton prevPage = new MenuItemButton("prevPage");
         prevPage.SetText("<");
         prevPage.Clicked += () =>
         {
             RenderPage(pageNum - 1);
         };
         _root.AddChild(0, ROWS, 1, 1, prevPage);
     }
     if ((pageNum + 1) * ROWS < _friends.Count)
     {
         MenuItemButton nextPage = new MenuItemButton("nextPage");
         nextPage.SetText(">");
         nextPage.Clicked += () =>
         {
             RenderPage(pageNum + 1);
         };
         _root.AddChild(4, ROWS, 1, 1, nextPage);
     }
 }
    public void SetCurrentMenuItemButton(MenuItemButton button)
    {
        currentMenuItemButton = button;
        transform.position    = currentMenuItemButton.transform.position + selectionOffset;

        if (onCursorMoved != null)
        {
            onCursorMoved(currentMenuItemButton.Highlight());
        }
    }
Exemple #8
0
 private void RenderPage(int pageNum)
 {
     if (_requests == null)
     {
         Refresh();
     }
     _root.GetChildren().ForEach(x => x.Dispose());
     _root.Clear();
     for (int i = 0; i <= ROWS; ++i)
     {
         if (pageNum * ROWS + i >= _requests.Count)
         {
             break;
         }
         FriendsAppUser user     = _requests[pageNum * ROWS + i];
         MenuItemText   username = new MenuItemText($"username{user.UserId}");
         username.SetText(user.Username);
         _root.AddChild(0, i, 3, 1, username);
         MenuItemButton acceptBtn = new MenuItemButton($"accept{user.UserId}");
         acceptBtn.SetText("Accept");
         acceptBtn.Clicked += () =>
         {
             _api.DefaultApps.Friends.AcceptFriendRequest(user.UserId).Wait();
             Refresh();
         };
         _root.AddChild(3, i, 1, 1, acceptBtn);
         MenuItemButton rejectBtn = new MenuItemButton($"reject{user.UserId}");
         rejectBtn.SetText("Reject");
         rejectBtn.Clicked += () => {
             _api.DefaultApps.Friends.DeleteFriendRequest(user.UserId).Wait();
             Refresh();
         };
         _root.AddChild(4, i, 1, 1, rejectBtn);
     }
     if (pageNum > 0)
     {
         MenuItemButton prevPage = new MenuItemButton("prevPage");
         prevPage.SetText("<");
         prevPage.Clicked += () =>
         {
             RenderPage(pageNum - 1);
         };
         _root.AddChild(0, ROWS, 1, 1, prevPage);
     }
     if ((pageNum + 1) * ROWS < _requests.Count)
     {
         MenuItemButton nextPage = new MenuItemButton("nextPage");
         nextPage.SetText(">");
         nextPage.Clicked += () =>
         {
             RenderPage(pageNum + 1);
         };
         _root.AddChild(4, ROWS, 1, 1, nextPage);
     }
 }
Exemple #9
0
 private void RenderPage(int pageNum)
 {
     if (_friends == null || _users == null)
     {
         Refresh();
     }
     _root.GetChildren().ForEach(x => x.Dispose());
     _root.Clear();
     for (int i = 0; i <= ROWS; ++i)
     {
         if (pageNum * ROWS + i >= _users.Count)
         {
             break;
         }
         UserDetailMsg user     = _users[pageNum * ROWS + i];
         MenuItemText  username = new MenuItemText($"username{user.Username}");
         username.SetText(user.Username);
         _root.AddChild(0, i, 3, 1, username);
         if (!_friends.Contains(user.UserId))
         {
             MenuItemButton addFriend = new MenuItemButton($"addFriend{user.Username}");
             addFriend.SetText("Add Friend");
             addFriend.Clicked += () =>
             {
                 _api.DefaultApps.Friends.SendFriendRequest(user.UserId).Wait();
                 MenuItemText requestSent = new MenuItemText("requestSent");
                 _root.RemoveChild(addFriend);
                 addFriend.Dispose();
                 _root.AddChild(3, i, 1, 1, requestSent);
             };
             _root.AddChild(3, i, 1, 1, addFriend);
         }
     }
     if (pageNum > 0)
     {
         MenuItemButton prevPage = new MenuItemButton("prevPage");
         prevPage.SetText("<");
         prevPage.Clicked += () =>
         {
             RenderPage(pageNum - 1);
         };
         _root.AddChild(0, ROWS, 1, 1, prevPage);
     }
     if ((pageNum + 1) * ROWS < _users.Count)
     {
         MenuItemButton nextPage = new MenuItemButton("nextPage");
         nextPage.SetText(">");
         nextPage.Clicked += () =>
         {
             RenderPage(pageNum + 1);
         };
         _root.AddChild(3, ROWS, 1, 1, nextPage);
     }
 }
        private IMenuItem CreateBlock(FriendsAppUser friend)
        {
            MenuItemGrid item     = new MenuItemGrid(friend.Username, 5, 1);
            MenuItemText username = new MenuItemText("username");

            item.AddChild(0, 0, 4, 1, username);
            username.SetText(friend.Username);
            username.SetFontSize(8, 15);
            username.SetTextStyle(UnityEngine.FontStyle.Bold);
            MenuItemButton selectButton = new MenuItemButton("selectButton");

            item.AddChild(4, 0, 1, 1, selectButton);
            selectButton.SetText(">");
            selectButton.Clicked += () => FriendSelected?.Invoke(friend.UserId);
            return(item);
        }
Exemple #11
0
        private void CreateMenuItems()
        {
            _root = new MenuItemGrid("roomListGrid", 7, 7);
            MenuItemText roomText = new MenuItemText("roomText");

            roomText.SetText("Room List");
            roomText.SetTextColor(Color.black);
            roomText.SetAlignment(TextAnchor.MiddleCenter);
            _root.AddChild(0, 0, 2, 1, roomText);
            MenuItemText searchText = new MenuItemText("searchText");

            searchText.SetText("Search:");
            searchText.SetAlignment(TextAnchor.LowerLeft);
            searchText.SetFontSize(5, 7);
            _root.AddChild(0, 2, 2, 1, searchText);
            MenuItemInput searchInput = new MenuItemInput("searchInput");

            searchInput.SetPlaceholder("Name...");
            _root.AddChild(0, 3, 2, 1, searchInput);
            searchInput.SetPadding(10f, 0f, 10f, 10f);
            MenuItemCheckbox notEmpty = new MenuItemCheckbox("notEmpty");

            notEmpty.SetValue(false);
            notEmpty.SetText("Filter empty");
            _root.AddChild(0, 4, 2, 1, notEmpty);
            notEmpty.SetPadding(10f, 6f);
            MenuItemCheckbox notFull = new MenuItemCheckbox("notFull");

            notFull.SetValue(false);
            notFull.SetText("Filter full");
            _root.AddChild(0, 5, 2, 1, notFull);
            notFull.SetPadding(10f, 6f);
            MenuItemButton filter = new MenuItemButton("filter");

            filter.SetText("Filter");
            filter.Clicked += () =>
            {
                List <Room> roomList = GetRoomList(searchInput.GetText(), notEmpty.IsChecked(), notFull.IsChecked());
                RenderRoomList(roomList);
            };
            _root.AddChild(0, 6, 2, 1, filter);
            filter.SetPadding(20f, 4f);
            _roomListGrid = new MenuItemGrid("roomItems", 6, 10);
            _root.AddChild(2, 0, 5, 7, _roomListGrid);
        }
Exemple #12
0
 public void InitMenuItems()
 {
     _root       = new MenuItemGrid("chatBlock", 1, 10);
     _headerItem = new MenuItemText("headerChat");
     _root.AddChild(0, 0, 1, 1, _headerItem);
     _headerItem.SetText("None");
     _headerItem.SetFontSize(2, 20);
     _headerItem.SetAlignment(UnityEngine.TextAnchor.MiddleLeft);
     _chatItem = new MenuItemScrollable("chatScrollable", UnityEngine.TextAnchor.LowerCenter);
     _root.AddChild(0, 1, 1, 7, _chatItem);
     _bottomBlock = new MenuItemGrid("bottomPartChatBlock", 5, 1);
     _root.AddChild(0, 8, 1, 2, _bottomBlock);
     _msgInput = new MenuItemInput("chatMsgInput");
     _bottomBlock.AddChild(0, 0, 4, 1, _msgInput);
     _msgInput.SetPlaceholder("Message...");
     _msgInput.SetLineType(UnityEngine.UI.InputField.LineType.MultiLineSubmit);
     _msgInput.onSubmit += OnSendClicked;
     _sendButton         = new MenuItemButton("chatSendButton");
     _bottomBlock.AddChild(4, 0, 1, 1, _sendButton);
     _sendButton.SetText("Send");
     _sendButton.Clicked += OnSendClicked;
 }
 public void ResetCursor(MenuItemButton button)
 {
     SetCurrentMenuItemButton(button);
     input = Vector2.zero;
     animator.SetTrigger("ReturnToEntry");
 }
Exemple #14
0
 private void SetActive(MenuItemButton btn)
 {
     btn.SetBgColor(_activeButtonBg);
     btn.SetTextColor(_activeButtonFg);
 }
Exemple #15
0
 public abstract void PaintMenuItemButton(MenuItemButton component);
Exemple #16
0
 public abstract Size GetMenuItemButtonPreferedSize(MenuItemButton component);
Exemple #17
0
        public override void Initialize()
        {
            _menu = new Menu();
            var menuButton1 = new MenuItemButton <object>()
            {
                Text = "Menu 1",
            };

            menuButton1.AddChild(new MenuItemButton <object>()
            {
                Text = "Submenu 1.1"
            });
            _menu.AddChild(menuButton1);
            var menuButton2 = new MenuItemButton <object>()
            {
                Text = "Menu 2",
            };

            menuButton2.AddChild(new MenuItemButton <object>()
            {
                Text = "Submenu 2.1"
            });
            menuButton2.AddChild(new MenuItemButton <object>()
            {
                Text = "Submenu 2.2"
            });
            _menu.AddChild(menuButton2);
            Menu = _menu;

            _checkbox1 = new Checkbox {
                Location = new Point {
                    Left = 3, Top = 5
                }, Text = "Checkbox tentative"
            };
            _checkbox1.CheckedChanged += checkbox1_CheckedChanged;
            RootPanel.AddChild(_checkbox1);

            _checkbox2 = new Checkbox {
                Location = new Point {
                    Left = 3, Top = 7
                }, IsChecked = true, Text = "Checkbox checked"
            };
            RootPanel.AddChild(_checkbox2);

            _checkbox3 = new Checkbox {
                Location = new Point {
                    Left = 3, Top = 9
                }, IsChecked = false, Text = "Checkbox unchecked"
            };
            RootPanel.AddChild(_checkbox3);

            _checkbox4 = new Checkbox {
                Location = new Point {
                    Left = 3, Top = 11
                }, IsChecked = false, Text = "Checkbox disabled", IsEnabled = false
            };
            RootPanel.AddChild(_checkbox4);

            _label1 = new Label {
                Location = new Point {
                    Left = 3, Top = 19
                }, Text = "Label"
            };
            RootPanel.AddChild(_label1);

            _radioButton1 = new RadioButton {
                Location = new Point {
                    Left = 3, Top = 13
                }, Text = "Radio unchecked"
            };
            RootPanel.AddChild(_radioButton1);

            _radioButton2 = new RadioButton {
                Location = new Point {
                    Left = 3, Top = 15
                }, Text = "Radio checked", IsChecked = true
            };
            RootPanel.AddChild(_radioButton2);

            _radioButton3 = new RadioButton {
                Location = new Point {
                    Left = 3, Top = 17
                }, Text = "Radio checked", IsChecked = true, IsEnabled = false
            };
            RootPanel.AddChild(_radioButton3);

            _textBox1 = new TextBox {
                Location = new Point {
                    Left = 29, Top = 16
                }
            };
            _textBox1.TextChanged += textBox1_TextChanged;
            RootPanel.AddChild(_textBox1);

            _dateTimeBox1 = new DateTimeBox()
            {
                Location = new Point {
                    Left = 29, Top = 18
                }
            };
            RootPanel.AddChild(_dateTimeBox1);

            _numericBox1 = new NumericBox()
            {
                Location = new Point {
                    Left = 29, Top = 20
                }
            };
            RootPanel.AddChild(_numericBox1);

            _button1 = new Button {
                Location = new Point {
                    Left = 3, Top = 22
                }, Width = 10
            };
            _button1.Pressed += button1_Pressed;
            RootPanel.AddChild(_button1);

            _button2 = new Button {
                Location = new Point {
                    Left = 16, Top = 22
                }, Width = 10, IsEnabled = false, Text = "Disabled button"
            };
            _button2.Pressed += button2_Pressed;
            RootPanel.AddChild(_button2);

            _progressBar1 = new ProgressBar {
                Location = new Point {
                    Left = 3, Top = 3
                }, Width = 74, TextAligment = TitleAligment.Left
            };
            RootPanel.AddChild(_progressBar1);

            _bnext1 = new Button {
                Location = new Point {
                    Left = 40, Top = 22
                }, Width = 10, Text = "Next 1", Tag = 1
            };
            _bnext1.Pressed += bNextPressed;
            RootPanel.AddChild(_bnext1);

            _bnext2 = new Button {
                Location = new Point {
                    Left = 51, Top = 22
                }, Width = 10, Text = "Next 2", Tag = 2
            };
            _bnext2.Pressed += bNextPressed;
            RootPanel.AddChild(_bnext2);

            _bnext3 = new Button {
                Location = new Point {
                    Left = 62, Top = 22
                }, Width = 10, Text = "Next 3", Tag = 3
            };
            _bnext3.Pressed += bNextPressed;
            RootPanel.AddChild(_bnext3);

            _panel1 = new BorderPanel
            {
                Location = new Point {
                    Left = 28, Top = 4
                },
                Size = new Size {
                    Height = 7, Width = 25
                }
            };
            RootPanel.AddChild(_panel1);

            var subRadiobuton1 = new RadioButton
            {
                Location = new Point
                {
                    Left = 1,
                    Top  = 1
                }
            };

            _panel1.AddChild(subRadiobuton1);

            var subRadiobuton2 = new RadioButton
            {
                Location = new Point
                {
                    Left = 1,
                    Top  = 3
                }
            };

            _panel1.AddChild(subRadiobuton2);

            var subRadiobuton3 = new RadioButton
            {
                Location = new Point
                {
                    Left = 1,
                    Top  = 5
                }
            };

            _panel1.AddChild(subRadiobuton3);


            _comboBox1 = new ComboBox
            {
                Location = new Point {
                    Left = 29, Top = 12
                },
                VisibleItemsCount = 7
            };
            _comboBox1.Items.AddRange(new[]
            {
                new ComboBoxItem()
                {
                    Key = 1, Text = "EntityFX"
                },
                new ComboBoxItem()
                {
                    Key = 2, Text = "Green.Dragon"
                },
                new ComboBoxItem()
                {
                    Key = 3, Text = "Guzalianna"
                },
                new ComboBoxItem()
                {
                    Key = 4, Text = "Prozz"
                },
                new ComboBoxItem()
                {
                    Key = 5, Text = "Aik2029"
                },
                new ComboBoxItem()
                {
                    Key = 6, Text = "Zombie"
                },
                new ComboBoxItem()
                {
                    Key = 7, Text = "Wesker"
                },
                new ComboBoxItem()
                {
                    Key = 8, Text = "Perez"
                },
                new ComboBoxItem()
                {
                    Key = 9, Text = "Chuvak"
                },
                new ComboBoxItem()
                {
                    Key = 10, Text = "Magistr"
                },
                new ComboBoxItem()
                {
                    Key = 11, Text = "Mad"
                },
                new ComboBoxItem()
                {
                    Key = 12, Text = "XOBAH"
                }
            });
            RootPanel.AddChild(_comboBox1);

            RootPanel.AddChild(new Checkbox {
                Location = new Point {
                    Left = 29, Top = 14
                }, Text = "Checkbox for overlapp"
            });

            _image = Image.FromString(
                @"───▄▄▄
─▄▀░▄░▀▄
─█░█▄▀░█
─█░▀▄▄▀█▄█▄▀
▄▄█▄▄▄▄███▀
");
            _image.Location = new Point()
            {
                Left = 55, Top = 4
            };
            RootPanel.AddChild(_image);


            _plotChart = new PlotChart()
            {
                Size = new Size()
                {
                    Height = 10, Width = 30
                },
                Location = new Point()
                {
                    Left = 48, Top = 11
                },
                PlotSymbol = ':'
            };
            _plotChart.Points = GenerateSinChartPoints(_plotChart.Size, 7);
            RootPanel.AddChild(_plotChart);

            StatusStrip = new StatusStrip();
            StatusStrip.AddChild(new StatusStripLabel
            {
                Text = "Item 1"
            });

            StatusStrip.AddChild(new StatusStripLabel
            {
                Text = "Item 2"
            });

            _timeStripItem = new StatusStripLabel
            {
                Text         = "Item 3",
                ItemLocation = ItemLocationEnum.Right
            };
            StatusStrip.AddChild(_timeStripItem);

            StatusStrip.AddChild(new StatusStripLabel
            {
                Text         = "Item 4",
                ItemLocation = ItemLocationEnum.Right
            });

            StatusStrip.AddChild(new StatusStripButton
            {
                Text         = "But 1",
                ItemLocation = ItemLocationEnum.Left
            });

            StatusStrip.AddChild(new StatusStripButton
            {
                Text         = "But 2",
                ItemLocation = ItemLocationEnum.Left
            });

            _statusStripProgressBar = new StatusStripProgressBar
            {
                Text    = "P: {0}",
                Width   = 14,
                Minimum = 0,
                Value   = 16,
                Maximum = 25
            };
            StatusStrip.AddChild(_statusStripProgressBar);


            Initializetable();

            _timer.Elapsed += timer_Elapsed;
            _timer.Start();

            _timer2.Elapsed += _timer2_Elapsed;
            _timer2.Start();
        }
Exemple #18
0
        public void Init(uint width, uint height)
        {
            ReSize(width, height);

            DefaultTheme theme = new DefaultTheme(width, height);

            theme.Setup("aw.png", "./Resources/");
            //selectionManager.setup(width,height);
            UI.Instance.CurrentTheme = theme;
            MenuBar.Instance.Init(width);



            menuFile                  = new Menu("FlightData");
            menuItemFileOpen          = new MenuItemButton("Open");
            menuItemFileSave          = new MenuItemButton("Save");
            menuItemFileSaveAs        = new MenuItemButton("Save As");
            menuItemFileSeparator     = new MenuItemSeparator();
            menuItemFileExit          = new MenuItemButton("Exit");
            menuItemFileExport        = new MenuItemSubMenu("Export");
            menuItemFilePNG           = new MenuItemSubMenu("PNG Image");
            menuItemFilePNGNone       = new MenuItemButton("None");
            menuItemFilePNGInterlaced = new MenuItemButton("Interlaced");
            menuItemFilePNG.AddItem(menuItemFilePNGNone);
            menuItemFilePNG.AddItem(menuItemFilePNGInterlaced);
            menuItemFileJPEG = new MenuItemButton("JPEG Image");
            menuItemFileExport.AddItem(menuItemFilePNG);
            menuItemFileExport.AddItem(menuItemFileJPEG);
            menuItemFileImport = new MenuItemSubMenu("Import");
            menuItemFile3DS    = new MenuItemButton("3DS Model");
            menuItemFileOBJ    = new MenuItemButton("OBJ Model");
            menuItemFileSIA    = new MenuItemButton("SIA Model");
            menuItemFileImport.AddItem(menuItemFile3DS);
            menuItemFileImport.AddItem(menuItemFileOBJ);
            menuItemFileImport.AddItem(menuItemFileSIA);
            menuFile.AddItem(menuItemFileOpen);
            menuFile.AddItem(menuItemFileSave);
            menuFile.AddItem(menuItemFileSaveAs);
            menuFile.AddItem(menuItemFileExport);
            menuFile.AddItem(menuItemFileImport);
            menuFile.AddItem(menuItemFileSeparator);
            menuFile.AddItem(menuItemFileExit);

            menuHelp          = new Menu("Help");
            menuItemHelpAbout = new MenuItemButton("About");
            menuItemHelpHelp  = new MenuItemButton("Help");
            menuHelp.AddItem(menuItemHelpAbout);
            menuHelp.AddItem(menuItemHelpHelp);

            menuAssortedWidgetsTest = new Menu("Assorted Widgets Test");

            dialogTestDialog   = new DialogTestDialog();
            menuItemDialogTest = new MenuItemButton("Modal Dialog Test");
            menuAssortedWidgetsTest.AddItem(menuItemDialogTest);

            checkNRadioTestDialog   = new CheckNRadioTestDialog();
            menuItemCheckNRadioTest = new MenuItemButton("Check & Radio Test");
            menuAssortedWidgetsTest.AddItem(menuItemCheckNRadioTest);

            progressNSliderTestDialog   = new ProgressNSliderTestDialog();
            menuItemProgressNSliderTest = new MenuItemButton("Progress & Slider Test");
            menuAssortedWidgetsTest.AddItem(menuItemProgressNSliderTest);

            multipleLayoutTestDialog = new MultipleLayoutTestDialog();
            menuItemMultipleTest     = new MenuItemButton("MultipleLayout Test");
            menuAssortedWidgetsTest.AddItem(menuItemMultipleTest);

            scrollPanelTestDialog   = new ScrollPanelTestDialog();
            menuItemScrollPanelTest = new MenuItemButton("Scroll Panel Test");
            menuAssortedWidgetsTest.AddItem(menuItemScrollPanelTest);

            textNDropTestDialog   = new TextNDropTestDialog();
            menuItemTextNDropTest = new MenuItemButton("DropList Test");
            menuAssortedWidgetsTest.AddItem(menuItemTextNDropTest);

            MenuBar.Instance.AddMenu(menuFile);
            MenuBar.Instance.AddMenu(menuHelp);
            MenuBar.Instance.AddMenu(menuAssortedWidgetsTest);

            //menuItemDialogTest.MousePressedEvent += new MousePressedHandler(menuItemDialogTest_MousePressedEvent);
            //menuItemCheckNRadioTest.MousePressedEvent += new MousePressedHandler(menuItemCheckNRadioTest_MousePressedEvent);
            //menuItemProgressNSliderTest.MousePressedEvent += new MousePressedHandler(menuItemProgressNSliderTest_MousePressedEvent);
            //menuItemMultipleTest.MousePressedEvent += new MousePressedHandler(menuItemMultipleTest_MousePressedEvent);
            //menuItemScrollPanelTest.MousePressedEvent += new MousePressedHandler(menuItemScrollPanelTest_MousePressedEvent);
            //menuItemTextNDropTest.MousePressedEvent += new MousePressedHandler(menuItemTextNDropTest_MousePressedEvent);
        }