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); }
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); }