public void checkEndtSepForGroup(MgFormBase form, int toolGroup, GuiMenuEntry.MenuType menuType) { if (menuType != GuiMenuEntry.MenuType.SEPARATOR) { form.createSepOnGroup(this, toolGroup); } }
/// <summary> /// This method adds a tool to the passed group and returns the new tool’s index. /// </summary> /// <param name = "toolGroup">group to which we add the tool</param> /// <returns>new tool index</returns> public int addToolToGroup(MgFormBase form, int toolGroup, GuiMenuEntry.MenuType menuType) { int i; int newToolIndex = 0; int count = 0; for (i = 0; i <= toolGroup; i++) { count = form.getToolbarGroupCount(i); newToolIndex += count; } //if we added a new tool and we already have a tool items we need to add the new tool before the seperator if (menuType != GuiMenuEntry.MenuType.SEPARATOR && form.getToolbarGroupMenuEntrySep(toolGroup) != null) { newToolIndex--; } // each group ends with a separator, so we will increase the counter only after // we got the index form.setToolbarGroupCount(toolGroup, count + 1); return(newToolIndex); }
/// <summary> /// This method adds a tool to the passed group and returns the new tool’s index. /// </summary> /// <param name = "toolGroup">group to which we add the tool</param> /// <returns> - new tool index</returns> public bool checkStartSepForGroup(MgFormBase form, int toolGroup, GuiMenuEntry.MenuType menuType) { bool createSepAtTheEnd = false; if (menuType != GuiMenuEntry.MenuType.SEPARATOR) { createSepAtTheEnd = form.createToolGroup(this, toolGroup); } return(createSepAtTheEnd); }