Esempio n. 1
0
        public override void PaintMenuItemButton(MenuItemButton component)
        {
            Position origin = UI.Instance.GetOrigin();

            switch (component.GetStatus())
            {
                case EStatus.Normal:
                    {
                        GL.Color3((byte)255, (byte)255, (byte)255);
                        break;
                    }


                    ;
                case EStatus.Pressed:
                    {
                        GL.Color3((byte)180, (byte)180, (byte)180);
                        break;
                    }


                    ;
                case EStatus.Hover:
                    {
                        GL.Disable(EnableCap.Texture2D);
                        GL.Color3((byte)176, (byte)200, (byte)28);
                        GL.Begin(BeginMode.Quads);
                        GL.Vertex2(component.Position.X + origin.X, origin.Y + component.Position.Y);
                        GL.Vertex2(component.Position.X + origin.X + component.Size.width, origin.Y + component.Position.Y);
                        GL.Vertex2(component.Position.X + origin.X + component.Size.width, origin.Y + component.Position.Y + component.Size.height);
                        GL.Vertex2(component.Position.X + origin.X, origin.Y + component.Position.Y + component.Size.height);
                        GL.End();
                        GL.Color3((byte)88, (byte)101, (byte)9);
                        break;
                    }


                    ;
            }
            component.textFont.PosX = (int)(component.Position.X + component.Left + origin.X);
            component.textFont.PosY = (int)(component.Top + origin.Y + component.Position.Y - 2);
            component.textFont.Render(true);
        }
Esempio n. 2
0
 public override Size GetMenuItemButtonPreferedSize(MenuItemButton component)
 {
     UI.Instance.CurrentTheme.defaultTextFont.MeasureString(component.Text, out w, out h);
     return new Size(24 + (uint)w, 20);
 }
Esempio n. 3
0
 public abstract void PaintMenuItemButton(MenuItemButton component);
Esempio n. 4
0
 public abstract Size GetMenuItemButtonPreferedSize(MenuItemButton component);
Esempio n. 5
0
        public MainV3(uint width, uint height)
            : base((int)width, (int)height)
        {
            MainV3.instance = this;

            UI.Instance.Init(width, height);
            Keyboard.KeyDown += Keyboard_KeyDown;
            Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown);
            Mouse.ButtonUp += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonUp);

            Menu menuConnect = new Menu("Connect");
            Menu menuFlightData = new Menu("FlightData");
            Menu menuFlightPlanner = new Menu("FlightPlanner");
            Menu menuConfig = new Menu("Config");
            Menu menuFirmware = new Menu("Firmware");
            Menu menuTerminal = new Menu("Terminal");
            Menu menuHelp = new Menu("Help");
            Menu menuExit = new Menu("Exit");

            MenuItemButton menuItemPort = new MenuItemButton("Port");
            MenuItemButton menuItemBaud = new MenuItemButton("Baud");

            menuConnect.AddItem(menuItemPort);
            menuConnect.AddItem(menuItemBaud);

            MenuBar.Instance.AddMenu(menuConnect);
            MenuBar.Instance.AddMenu(menuFlightData);
            MenuBar.Instance.AddMenu(menuFlightPlanner);
            MenuBar.Instance.AddMenu(menuConfig);
            MenuBar.Instance.AddMenu(menuFirmware);
            MenuBar.Instance.AddMenu(menuTerminal);
            MenuBar.Instance.AddMenu(menuHelp);
            MenuBar.Instance.AddMenu(menuExit);

            menuConnect.MousePressedEvent += new MousePressedHandler(MenuConnect_Click);
            menuExit.MousePressedEvent += new AssortedWidgets.Widgets.MousePressedHandler(menuItemFileExit_MousePressedEvent);

            Dialog dl = new Dialog("test", 23, 32, 150, 150);
            PictureBox picb = new PictureBox();
            picb.Image = ArdupilotMega.Properties.Resources.x8;

            dl.Add(picb);

            DialogManager.Instance.SetModelessDialog(dl);

            CustomMessageBox.Show("test", "test2",MessageBox.MessageBoxButtons.YesNo);
        }
Esempio n. 6
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("File");
            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);
        }