private void logInButton_Click(object sender, EventArgs e) { Menubar mainwindows = new Menubar(); mainwindows.Show(); this.Hide(); }
public override void Begin() { Engine.MapLoaded = true; Logger.Log("Beginning map editor."); // Initialize room list window RoomListWindow = new WindowRoomList(); ToolListWindow = new WindowToolList(BGAutotiler, FGAutotiler); List <string> roomNames = new List <string>(); foreach (Room room in State.LoadedLevel.Rooms) { roomNames.Add(room.Name); } RoomListWindow.RoomNames = roomNames.ToArray(); Engine.CreateWindow(RoomListWindow); Engine.CreateWindow(ToolListWindow); Engine.Instance.GraphicsDevice.SetRenderTarget(null); Engine.OnViewportUpdate += UpdateViewport; RoomListWindow.UpdateListHeight(); ToolListWindow.UpdateListHeight(); // Initialize shortcuts Shortcuts = new ShortcutManager(); Shortcuts.RegisterShortcut(new Shortcut(Menubar.Open, Keys.LeftControl, Keys.O)); Shortcuts.RegisterShortcut(new Shortcut(new Action(() => { Menubar.Save(); }), Keys.LeftControl, Keys.S)); Shortcuts.RegisterShortcut(new Shortcut(Menubar.SaveAs, Keys.LeftControl, Keys.LeftShift, Keys.S)); Shortcuts.RegisterShortcut(new Shortcut(State.Redo, Keys.LeftControl, Keys.LeftShift, Keys.Z)); Shortcuts.RegisterShortcut(new Shortcut(State.Undo, Keys.LeftControl, Keys.Z)); }
public Menubar CreateMenubar(string type, string name) { IntPtr cPtr = CeguiBindingsPINVOKE.WindowManager_CreateMenubar(swigCPtr, new CeguiDotNet.String(type).HandleRef, new CeguiDotNet.String(name).HandleRef); Menubar ret = (cPtr == IntPtr.Zero) ? null : new Menubar(cPtr, false); if (CeguiBindingsPINVOKE.SWIGPendingException.Pending) { throw CeguiBindingsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public MainDlg() { this.Title = "CSV Viewer"; this.lstTable = new Listbox(2, 2, Console.WindowWidth - 5, Console.WindowHeight - 5); lstTable.CanHaveFocus = false; base.Add(lstTable); var mb = new Menubar(2, Console.WindowHeight - 2); mb.Menuitems = new[] { "First", "Last", "Exit" }; mb.OnSelected += Menuitem_selected; base.Add(mb); }
private void Menuitem_selected(Menubar menu, int selectedItemIndex) { switch (selectedItemIndex) { case 0: OnFirstPageRequested(); break; case 1: OnLastPageRequested(); break; case 2: OnExitRequested(); break; } }
public void SaveItem(dtoMenubar dto) { long IdMenubar = View.IdMenubar; if (UserContext.isAnonymous) { View.DisplaySessionTimeout(rootObject.EditMenuBar(IdMenubar, Service.GetMenubarType(IdMenubar))); } else { Menubar menubar = Service.SaveMenubar(dto, IdMenubar); if (menubar != null) { View.ChangeTreeItemName(dto, dto.Name, 0); } else { View.SaveError(); } } }
protected override void Draw(GameTime gt) { base.Draw(gt); GUIRenderer.BeforeLayout(gt); Scene.Render(gt); // Set render target back to the window so we don't accidentally render UI content on top of a room. GraphicsDevice.SetRenderTarget(null); for (int i = 0; i < Windows.Count; i++) { if (Windows[i].Visible) { Windows[i].Render(); } else { DeleteWindow(Windows[i]); } } Menubar.Render(); GUIRenderer.AfterLayout(); }
public void AddMenuBar() { if (UserContext.isAnonymous) { View.CreationError(); View.DisplaySessionTimeout(rootObject.CreateMenuBar(View.PreloadType)); } else { dtoMenubar dto = View.MenuBar; dto.Deleted = BaseStatusDeleted.None; dto.Status = ItemStatus.Draft; Menubar menubar = Service.CreateMenubar(dto, View.TopItemsnumber, View.SubItemsnumber); if (menubar == null) { View.CreationError(); } else { View.EditMenubar(menubar.Id, menubar.MenuBarType); } } }
public void EditActiveMenubar(long idMenubar, String menuBarName) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(rootObject.MenuBarList(View.CurrentView)); } else { dtoMenubar dto = Service.GetDtoMenubar(idMenubar); if (dto != null) { ModuleMenu module = ModuleMenu.CreatePortalmodule(UserContext.UserTypeID); Boolean allowManage = (dto.MenuBarType == MenuBarType.PortalAdministration) ? module.ManagePortalMenubar : (dto.MenuBarType == MenuBarType.GenericCommunity) ? module.ManageCommunitiesMenubar : (dto.MenuBarType == MenuBarType.Portal) ? module.ManageAdministrationMenubar : false; if (allowManage) { Menubar clone = Service.CloneMenubar(idMenubar, (menuBarName.Contains("{0}")) ? String.Format(menuBarName, dto.Name) : "[COPY] " + dto.Name); if (clone != null) { View.EditMenubar(clone.Id, clone.MenuBarType); } } } } }
public FlowExplorer() : base() { contextTools = new Menubar( new ToolMenuItem(ToolMainRefreshClick) { Name = "Refresh", Glyph = GlyphType.Refresh }, new ToolMenuItem(ToolGenerateDBClick) { Name = "Generate database", Glyph = GlyphType.Database }, new ToolMenuItem(ToolStatClick) { Name = "Stats", Glyph = GlyphType.Link }) { Name = "FlowExplorer" }; contextAdd = new Menubar( new ToolMenuItem { Name = "Template", Sensitive = Template.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.Book }, new ToolMenuItem { Name = "Template Data", Sensitive = TemplateData.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.File }, new ToolMenuItem { Name = "Work", Sensitive = Work.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.GearsAlias }, new ToolMenuItem { Name = "Work Stage", Sensitive = Stage.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.EditAlias }, new ToolMenuItem { Name = "Stage Parameter", Sensitive = StageParam.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.Columns, DropDown = new Menubar( new ToolMenuItem { Name = "Stage Procedure", Sensitive = StageParam.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.EditAlias }, new ToolMenuItem { Name = "Stage Reference", Sensitive = StageParam.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.EditAlias } ) }, new ToolMenuItem { Name = "Group", Sensitive = UserGroup.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.Users }, new ToolMenuItem { Name = "Department", Sensitive = Department.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.Home }, new ToolMenuItem { Name = "Position", Sensitive = Position.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.UserMd }, new ToolMenuItem { Name = "User", Sensitive = User.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.User }, new ToolMenuItem { Name = "Scheduler", Sensitive = Scheduler.DBTable?.Access.GetFlag(AccessType.Create, GuiEnvironment.User) ?? false, Glyph = GlyphType.ClockO }) { Name = "FlowExplorer" }; contextAdd.Bar.ItemClick += ContextAddItemClicked; barMain = new Toolsbar( new ToolDropDown { Name = "Add", GlyphColor = Colors.DarkGreen, DropDown = contextAdd, Glyph = GlyphType.PlusCircle }, new ToolItem(ToolMainRemoveClick) { Name = "Remove", GlyphColor = Colors.DarkRed, Glyph = GlyphType.MinusCircle }, new ToolItem(ToolMainCopyClick) { Name = "Copy", Glyph = GlyphType.CopyAlias }, new ToolDropDown { Name = "Tools", DropDown = contextTools, Glyph = GlyphType.Wrench }, new ToolSearchEntry() { Name = "FilterText", FillWidth = true }) { Name = "FlowExplorer" }; se = new ListEditor(); ose = new ToolWindow { Target = se }; ose.ButtonAcceptClick += AcceptOnActivated; var userKeys = UserTreeKeys.None; if (Department.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { userKeys |= UserTreeKeys.Department; } if (Position.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { userKeys |= UserTreeKeys.Position; } if (GroupPermission.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { userKeys |= UserTreeKeys.Permission; } if (User.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { userKeys |= UserTreeKeys.User; } if (UserGroup.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { userKeys |= UserTreeKeys.Group; } if (Scheduler.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { userKeys |= UserTreeKeys.Scheduler; } var keys = FlowTreeKeys.None; //if (TemplateParam.DBTable?.Access.View ?? false) keys |= FlowTreeKeys.TemplateParam; if (Template.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { keys |= FlowTreeKeys.Template; } if (StageParam.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { keys |= FlowTreeKeys.StageParam; } if (Stage.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { keys |= FlowTreeKeys.Stage; } if (Work.DBTable?.Access.GetFlag(AccessType.Read, GuiEnvironment.User) ?? false) { keys |= FlowTreeKeys.Work; } tree = new FlowTree { FlowKeys = keys, UserKeys = userKeys, FilterEntry = ((ToolSearchEntry)barMain["FilterText"]).Entry }; tree.ListInfo.HeaderVisible = true; tree.ListInfo.HeaderWidth = 35; tree.SelectionChanged += TreeAfterSelect; tree.CellMouseClick += TreeNodeMouseClick; tree.CellDoubleClick += TreeNodeMouseDoubleClick; Name = "FlowExplorer"; PackStart(barMain, false, false); PackStart(tree, true, true); }
public Maindialog(ShellForms sf) { var tb = new Textbox(2, 4, 15); tb.Text = "Hello, world!"; base.Add(tb); var btn = new Button(2, 6, "Display"); base.Add(btn); var lbl = new Label(15, 6, 15); lbl.Text = "Overwrite"; base.Add(lbl); btn.OnPressed += _ => lbl.Text = tb.Text; var lst = new Listbox(2, 8, 20, 3); lst.Items = new[] { "multi", "selection", "listbox", "with", "scrolling" }; lst.MultipleSelect = true; base.Add(lst); base.Add(new Label(2, 12) { Text = "No mammal?" }); var rbg = new Radiobuttongroup(15, 12); rbg.Choices = new[] { "dog", "cat", "mouse", "ant" }; base.Add(rbg); var btn2 = new Button(2, 17, "Open new Dlg..."); base.Add(btn2); btn2.OnPressed += _ => { sf.Push(new Nesteddialog(sf) { Title = "Nested" }); sf.Refresh(); }; base.Add(new Label(2, 19) { Text = "Type command, hit Enter: " }); var cmd = new Command(26, 19, 10); base.Add(cmd); cmd.OnOrdered += sender => new Messagebox("Command entered", sender.Text).Show(sf); var mb = new Menubar(2, 21); mb.Menuitems = new[] { "Show message box", "Reset command", "Exit" }; base.Add(mb); mb.OnSelected += (sender, i) => { switch (i) { case 0: if (new Messagebox("Test", "A msg\nbox with a\nmulti-line message.", Messagebox.ConfirmationButtons.OkCancel).Show(sf) == Messagebox.Confirmations.Cancel) { new Messagebox("Test", "Oh, cancellation?").Show(sf); } break; case 1: cmd.Text = ""; break; case 2: Environment.Exit(0); break; } }; var cb = new Checkbox(2, 23, "The red pill?"); cb.Checked = true; base.Add(cb); base.Add(new Label(2, 25) { Text = "Password: "******"geheim"; txtPwd.IsPassword = true; base.Add(txtPwd); btn = new Button(21, 25, "Show Password..."); base.Add(btn); btn.OnPressed += sender => new Messagebox("Password", txtPwd.Text).Show(sf); base.Add(new Label(2, 27) { Text = "Progress percent (0..100): " }); var cmdPercent = new Command(29, 27, 5) { Text = "30" }; cmdPercent.Name = "tbPercent"; base.Add(cmdPercent); var pb = new Progressbar(35, 27, 12); base.Add(pb); cmdPercent.OnOrdered += _ => pb.Percent = Single.Parse(cmdPercent.Text); }
public DataExplorer() { contextTools = new Menubar( new ToolMenuItem(ToolMainRefreshOnClick) { Name = "Refresh Tree", GlyphColor = Colors.DarkBlue, Glyph = GlyphType.Refresh }, new ToolMenuItem(ToolDBCheckClick) { Name = "Check Connection" }, new ToolMenuItem(ToolDBRefreshClick) { Name = "Refresh Schema Info" }, new ToolMenuItem(ToolDBGenerateClick) { Name = "Generate Database" }, new ToolSeparator(), new ToolMenuItem(ToolDBExportClick) { Name = "Export" }, new ToolMenuItem(ToolPatchCreateClick) { Name = "Patch Create" }, new ToolMenuItem(ToolPatchLoadClick) { Name = "Patch Load" }, new ToolSeparator(), new ToolMenuItem(ToolTableRefreshOnClick) { Name = "Refresh Table Info" }, new ToolMenuItem(ToolTableReportOnClick) { Name = "Table Report" }, new ToolMenuItem(ToolTableExplorerOnClick) { Name = "Table Explorer" }, new ToolMenuItem(ToolSequenceRefreshOnClick) { Name = "Refresh Sequence" }, new ToolSeparator(), new ToolMenuItem(ToolExtractDDLClick) { Name = "Extract DDL" }, new ToolMenuItem(ToolSerializeClick) { Name = "Serialize" }, new ToolMenuItem(ToolDeserializeClick) { Name = "Deserialize" }, new ToolMenuItem(ToolLoadFileClick) { Name = "Load Files" }) { Name = "DataExplorer" }; contextAdd = new Menubar( new ToolMenuItem(ToolAddConnectionClick) { Name = "Connection", Glyph = GlyphType.Connectdevelop }, new ToolMenuItem(ToolAddSchemaClick) { Name = "Schema", Glyph = GlyphType.Database }, new ToolMenuItem(ToolAddTableGroupClick) { Name = "TableGroup", Glyph = GlyphType.FolderOTable }, new ToolMenuItem(ToolAddTableClick) { Name = "Table", Glyph = GlyphType.Table }, new ToolMenuItem(ToolAddColumnGroupClick) { Name = "ColumnGroup", Glyph = GlyphType.FolderOColumn }, new ToolMenuItem(ToolAddColumnClick) { Name = "Column", Glyph = GlyphType.Columns }, new ToolMenuItem(ToolAddIndexClick) { Name = "Index", Glyph = GlyphType.Anchor }, new ToolMenuItem(ToolAddConstraintClick) { Name = "Constraint", Glyph = GlyphType.Check }, new ToolMenuItem(ToolAddForeignClick) { Name = "Foreign", Glyph = GlyphType.Link }, new ToolMenuItem(ToolAddSequenceClick) { Name = "Sequence", Glyph = GlyphType.Plus }, new ToolMenuItem(ToolAddProcedureClick) { Name = "Procedure", Glyph = GlyphType.GearAlias }, new ToolMenuItem(ToolAddProcedureParamClick) { Name = "Procedure Parameter", Glyph = GlyphType.Columns }) { Name = "DBSchema" }; contextMain = new Menubar( new ToolMenuItem { Name = "Add", GlyphColor = Colors.DarkGreen, DropDown = contextAdd, Glyph = GlyphType.PlusCircle }, new ToolMenuItem(ToolCopyClick) { Name = "Copy", Glyph = GlyphType.CopyAlias }, new ToolMenuItem(ToolRemoveClick) { Name = "Remove", GlyphColor = Colors.DarkRed, Glyph = GlyphType.MinusCircle }, new ToolSeparator(), new ToolMenuItem { Name = "Tools", DropDown = contextTools, Glyph = GlyphType.Wrench }, new ToolMenuItem(ToolPropertyClick) { Name = "Properties" }) { Name = "Bar" }; barMain = new Toolsbar( new ToolDropDown() { Name = "Add", GlyphColor = Colors.DarkGreen, DropDown = contextAdd, Glyph = GlyphType.PlusCircle }, new ToolItem(ToolRemoveClick) { Name = "Remove", GlyphColor = Colors.DarkRed, Glyph = GlyphType.MinusCircle }, new ToolItem(ToolCopyClick) { Name = "Copy", Glyph = GlyphType.CopyAlias }, new ToolDropDown { Name = "Tools", DropDown = contextTools, Glyph = GlyphType.Wrench }, new ToolSearchEntry() { Name = "FilterText" }) { Name = "Bar" }; barChanges = new Toolsbar( new ToolItem(ToolChangesCommitClick) { Name = "Commit", DisplayStyle = ToolItemDisplayStyle.Text }, new ToolItem(ToolChangesSkipClick) { Name = "Skip", DisplayStyle = ToolItemDisplayStyle.Text }) { Name = "Changes" }; changesView = new LayoutList { Name = "changesView", GenerateColumns = false, AutoToStringFill = true, CheckView = true, ListSource = DBService.Changes }; changesView.ListInfo.ColumnsVisible = false; dataTree = new DataTree() { Name = "dataTree", DataKeys = DataTreeKeys.Schema | DataTreeKeys.TableGroup | DataTreeKeys.Table | DataTreeKeys.LogTable | DataTreeKeys.ColumnGroup | DataTreeKeys.Column | DataTreeKeys.Index | DataTreeKeys.Constraint | DataTreeKeys.Foreign | DataTreeKeys.Procedure | DataTreeKeys.ProcedureParam | DataTreeKeys.Sequence, Menu = contextMain, FilterEntry = ((ToolSearchEntry)barMain["FilterText"]).Entry }; dataTree.CellMouseClick += DataTreeOnNodeMouseClick; dataTree.CellDoubleClick += DataTreeOnDoubleClick; dataTree.SelectionChanged += DataTreeOnAfterSelect; panel1 = new VBox { Name = "Panel1" }; panel1.PackStart(barMain, false, false); panel1.PackStart(dataTree, true, true); panel2 = new VBox { Name = "Panel2" }; panel2.PackStart(barChanges, false, false); panel2.PackStart(changesView, true, true); container = new VPaned(); container.Panel1.Content = panel1; PackStart(container, true, true); Name = "DataExplorer"; itemWindow.Target = listExplorer; itemWindow.ButtonAcceptClick += AcceptOnActivated; DBService.DBSchemaChanged += OnDBSchemaChanged; }
protected override void CreateScene() { base.mSceneManager.AmbientLight = Color.FromArgb(125, 125, 125, 125); base.mSceneManager.SetSkyDome(true, "Examples/CloudySky", 5, 8); mGuiRenderer = new OgreCEGUIRenderer(base.mRenderWindow, (byte)RenderQueueGroupID.RENDER_QUEUE_OVERLAY, false, 3000, mSceneManager); mGuiRenderer.Initialise(); mGuiSystem = new GuiSystem(mGuiRenderer); Logger.Instance.setLoggingLevel(LoggingLevel.Informative); SchemeManager.Instance.LoadScheme("TaharezLookSkin.scheme"); mGuiSystem.SetDefaultMouseCursor("TaharezLook", "MouseArrow"); mGuiSystem.DefaultFontName = "BlueHighway-12"; mBackgroundWindow = WindowManager.Instance.CreateWindow("DefaultWindow", "BackgroundWindow"); mGuiSystem.GUISheet = mBackgroundWindow; mTestWindow = WindowManager.Instance.CreateWindow("TaharezLook/FrameWindow", "TestWindow"); mBackgroundWindow.AddChildWindow(mTestWindow); mTestWindow.SetSize(0.3f, 0.6f); mTestWindow.SetPosition(0.7f, 0.2f); mTestWindow.Text = "Test Window"; mTestWindow.SubscribeEvents(); mQuitButton = WindowManager.Instance.CreatePushButton("TaharezLook/Button", "QuitButton"); mQuitButton.Text = "Quit"; mQuitButton.SetPosition(0.1f, 0.1f); mQuitButton.SetSize(0.8f, 0.2f); mQuitButton.SubscribeEvents(); mQuitButton.Clicked += new WindowEventDelegate(QuitClicked); mTestWindow.AddChildWindow(mQuitButton); mEditbox = WindowManager.Instance.CreateEditbox("TaharezLook/Editbox", "Editbox"); mEditbox.Text = "Editbox"; mEditbox.SetPosition(0.1f, 0.4f); mEditbox.SetSize(0.8f, 0.2f); mTestWindow.AddChildWindow(mEditbox); Menubar menuBar = WindowManager.Instance.CreateMenubar("TaharezLook/Menubar", "Main menubar"); menuBar.SetPosition(0.0f, 0.0f); menuBar.SetSize(1.0f, 0.04f); mBackgroundWindow.AddChildWindow(menuBar); MenuItem mnuFile = WindowManager.Instance.CreateMenuItem("TaharezLook/MenubarItem", "mnuFile"); mnuFile.setText("File"); menuBar.addItem(mnuFile); PopupMenu mnuFilePopup = WindowManager.Instance.CreatePopupMenu("TaharezLook/PopupMenu", "mnuFilePopup"); mnuFile.AddChildWindow(mnuFilePopup); MenuItem mnuFileNew = WindowManager.Instance.CreateMenuItem("TaharezLook/MenuItem", "mnuFileNew"); mnuFileNew.setText("New"); mnuFilePopup.AddChildWindow(mnuFileNew); MenuItem mnuFileOpen = WindowManager.Instance.CreateMenuItem("TaharezLook/MenuItem", "mnuFileOpen"); mnuFileOpen.setText("Open"); mnuFilePopup.AddChildWindow(mnuFileOpen); MenuItem mnuFileClose = WindowManager.Instance.CreateMenuItem("TaharezLook/MenuItem", "mnuFileClose"); mnuFileClose.setText("Close"); mnuFileClose.setEnabled(false); mnuFilePopup.AddChildWindow(mnuFileClose); MenuItem mnuFileSave = WindowManager.Instance.CreateMenuItem("TaharezLook/MenuItem", "mnuFileSave"); mnuFileSave.setText("Save"); mnuFileSave.setEnabled(false); mnuFilePopup.AddChildWindow(mnuFileSave); MenuItem mnuFileSaveAs = WindowManager.Instance.CreateMenuItem("TaharezLook/MenuItem", "mnuFileSaveAs"); mnuFileSaveAs.setText("Save As"); mnuFileSaveAs.setEnabled(false); mnuFilePopup.AddChildWindow(mnuFileSaveAs); MenuItem mnuFileExit = WindowManager.Instance.CreateMenuItem("TaharezLook/MenuItem", "mnuFileExit"); mnuFileExit.setText("Exit"); mnuFileExit.SubscribeEvents(); mnuFileExit.Clicked += new WindowEventDelegate(QuitClicked); mnuFilePopup.AddChildWindow(mnuFileExit); mTestWindow.Show(); }