public void ShowWindow() { if (childWindow == null) { childWindow = SystemHandler.GeneralChildWindow.GetNewInstance(); } //childWindow.BorderStyle = VBRUN.FormBorderStyleConstants.vbFixedSingle; childWindow.Caption = "Custom Item"; childWindow.IDFieldCaption = "Artigo:"; childWindow.SearchButtonVisible = false; childWindow.NavigationButtonsVisible = false; childWindow.IDFieldVisible = true; // // Construir menus da janela // 1. Botões var xternderMenuItems = new ExtenderMenuItems(); var m = xternderMenuItems.Add("xAction1", "Acção 1"); m.ActionType = ExtenderActionType.ExtenderActionPrimary; m = xternderMenuItems.Add("xAction2", "Acção 2"); m.ActionType = ExtenderActionType.ExtenderActionSecondary; // //2. Opções m = xternderMenuItems.Add("xOpcoes", "Opções"); m.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; m.BeginGroup = true; m.ChildItems.Add("xOpcoes1", "Opção 1"); m.ChildItems.Add("xOpcoes2", "Opção 2"); childWindow.MenuItems = xternderMenuItems; childWindow.Init(this); //childWindow.Init("Artigo:", false, false, xternderMenuItems, this); //Translate to twips childWindow.SetClientArea(this.Width * 15, this.Height * 15); childWindow.CenterOnScreen(); this.Visible = true; childWindow.Show(); //Enable panel if (childWindow.EditState == EditStateType.esNull) { childWindow.EditState = EditStateType.esNew; } }
/// <summary> /// Inicializa a extensão nos Artigos (Item) /// Não mostra mensagens /// </summary> /// <param name="Sender"></param> /// <param name="e"> /// IN: /// PropertyList: /// "Window": Form, /// "IManagementConsole": IManagementConsole /// /// OUT: /// e.result: true: para extender os menus, e sinalizar sucesso /// e.set_Data(): Passar um ExtenderMenuItems para extender os menus /// /// Não mostra mensagens ///</param> void myEvents_OnInitialize(object Sender, ExtenderEventArgs e) { var propertyList = (ExtendedPropertyList)e.get_data(); // Acrescentar Items ao menu var newMenu = new ExtenderMenuItems(); var menuGroup = newMenu.Add("mniXFormacao", "Formação X"); menuGroup.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //Opções de menu menuGroup.BeginGroup = true; //Novo grupo // var menuItem = menuGroup.ChildItems.Add("mniXItem1", "Meu menu 1"); menuItem.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //Opções de menu menuItem = menuGroup.ChildItems.Add("mniXItem2", "Meu menu 2"); menuItem.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //Opções de menu object oMenu = newMenu; e.result.set_data(ref oMenu); e.result.Success = true; e.result.ResultMessage = string.Empty; }
/// <summary> /// Inicializa a extensão nos Artigos ( OtherContact) /// Não mostra mensagens /// </summary> /// <param name="Sender"></param> /// <param name="e"> /// IN: /// PropertyList: /// "Window": Form, /// "IManagementConsole": IManagementConsole /// /// OUT: /// e.result: true: para extender os menus, e sinalizar sucesso /// e.set_Data(): Passar um ExtenderMenuItems para extender os menus /// /// Não mostra mensagens ///</param> void myEvents_OnInitialize(object Sender, ExtenderEventArgs e) { var propertyList = (ExtendedPropertyList)e.get_data(); if (propertyList.PropertyExists("IManagementConsole")) { _managementConsole = (IManagementConsole)propertyList.get_Value("IManagementConsole"); // Form a colocar no TAB dos Outros Devedores/Credores _formTab = new FormOtherContactTab(); _managementConsole.AddChildPanel(_formTab); } // Acrescentar Items ao menu var newMenu = new ExtenderMenuItems(); var menuGroup = newMenu.Add("mniXFormacao", "Formação X"); menuGroup.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //Opções de menu menuGroup.BeginGroup = true; //Novo grupo // var menuItem = menuGroup.ChildItems.Add("mniXOtherContact1", "Meu menu 1"); menuItem.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //Opções de menu menuItem = menuGroup.ChildItems.Add("mniXOtherContact2", "Meu menu 2"); menuItem.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //Opções de menu object oMenu = newMenu; e.result.set_data(ref oMenu); e.result.Success = true; e.result.ResultMessage = string.Empty; }
/// <summary> /// Inicialização /// Podemos adicionar novas opções de menu aqui /// IN: /// e.get_data(): ExtendedPropertyList /// "PropertyChangeNotifier" = Evento que podemos subscrever para controlar quando uma propriedade é alterada /// "TransactionManager" = BSOItemTransaction; Controlador da transação em curso /// /// OUT: /// result.Sucess: true para sinalizar sucesso e carregar novos menus; false para cancelar /// result.ResultMessage: Ignorado /// result.set_data( ExtenderMenuItems ): Items de menu a carregar /// </summary> /// <param name="Sender"></param> /// <param name="e"></param> void HeaderEvents_OnInitialize(object Sender, ExtenderEventArgs e) { var propList = (ExtendedPropertyList)e.get_data(); propChangeNotifier = (PropertyChangeNotifier)propList.get_Value("PropertyChangeNotifier"); propChangeNotifier.PropertyChanged += OnPropertyChanged; bsoItemTrans = (BSOItemTransaction)propList.get_Value("TransactionManager"); bsoItemTrans.WarningItemStock += BsoItemTrans_WarningItemStock; var newMenus = new ExtenderMenuItems(); // //Criar o grupo: Tab var mnuGroup = newMenus.Add("mniXCustomTools", "Custom Tools"); //criar item1 var mnuItem1 = mnuGroup.ChildItems.Add("mniXTrans1", "Custom Item 1"); mnuItem1.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //mnuItem1.Picture = ImageConverter.GetIPictureDispFromImage( ) //criar item2 mnuItem1 = mnuGroup.ChildItems.Add("mniXTrans2", "Custom Item 2"); mnuItem1.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; object returnMenu = newMenus; e.result.set_data(returnMenu); }
/// <summary> /// Inicialização /// Podemos adicionar novas opções de menu aqui /// IN: /// e.get_data(): ExtendedPropertyList /// "PropertyChangeNotifier" = Evento que podemos subscrever para controlar quando uma propriedade é alterada /// "TransactionManager" = BSOItemTransaction; Controlador da transação em curso /// /// OUT: /// result.Sucess: true para sinalizar sucesso e carregar novos menus; false para cancelar /// result.ResultMessage: Ignorado /// result.set_data( ExtenderMenuItems ): Items de menu a carregar /// </summary> /// <param name="Sender"></param> /// <param name="e"></param> void HeaderEvents_OnInitialize(object Sender, ExtenderEventArgs e) { var propList = (ExtendedPropertyList)e.get_data(); propChangeNotifier = (PropertyChangeNotifier)propList.get_Value("PropertyChangeNotifier"); propChangeNotifier.PropertyChanged += OnPropertyChanged; bsoItemTrans = (BSOItemTransaction)propList.get_Value("TransactionManager"); bsoItemTrans.WarningItemStock += BsoItemTrans_WarningItemStock; // Colocar o caminho para o icone. // Não usar os nomes de ficheiro da Sage em: // TARGETDIR\Icons50c // TARGETDIR\Images var myTargetDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName); myTargetDir = System.IO.Path.Combine(myTargetDir, "Icons"); var newMenus = new ExtenderMenuItems(); // //Criar o grupo: Tab var mnuGroup = newMenus.Add("mniXCustomTools", "Custom Tools"); //criar item1 var mnuItem1 = mnuGroup.ChildItems.Add("mniXTrans1", "Custom Item 1"); mnuItem1.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; mnuItem1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-save.ico"); //mnuItem1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-01.png"); //criar item2 mnuItem1 = mnuGroup.ChildItems.Add("mniXTrans2", "Custom Item 2"); mnuItem1.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; mnuItem1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-02.png"); object returnMenu = newMenus; e.result.set_data(returnMenu); }
private void HeaderStockEvents_OnInitialize(object Sender, ExtenderEventArgs e) { var propList = (ExtendedPropertyList)e.get_data(); propaChangeNotifier = (PropertyChangeNotifier)propList.get_Value("PropertyChangeNotifier"); propaChangeNotifier.PropertyChanged += OnaPropertyChanged; bsoStockTrans = (BSOStockTransaction)propList.get_Value("TransactionManager"); e.result.ResultMessage = "HeaderEvents_OnInitialize"; var newMenus1 = new ExtenderMenuItems(); // //Criar o grupo: Tab var mnuGroup1 = newMenus1.Add("mniXCustomTools1", "Custom Tools"); //criar item1 var mnuItem1 = mnuGroup1.ChildItems.Add("mniXTrans11", "Custom Item 1"); mnuItem1.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; //mnuItem1.Picture = ImageConverter.GetIPictureDispFromImage( ) //criar item2 mnuItem1 = mnuGroup1.ChildItems.Add("mniXTrans21", "Custom Item 2"); mnuItem1.GroupType = ExtenderGroupType.ExtenderGroupTypeExtraOptions; object returnMenu = newMenus1; e.result.set_data(returnMenu); }
private void MyEvents_OnStartup(object Sender, ExtenderEventArgs e) { ExtendedPropertyList properties = null;; ExtenderMenuItems menuItem; //MyApp.SystemSettings.WorkstationInfo.Touch.CompanyLogoPosition = 1; properties = (ExtendedPropertyList)e.get_data(); //this property will only be available in the backoffice if (properties.PropertyExists("ChildWindow")) { generalChildWindow = (IChildWindow)properties.get_Value("ChildWindow"); } //this property will only be available in the backoffice if (properties.PropertyExists("WorkspaceWindow")) { generalWorkspaceWindow = (IWorkspaceWindow)properties.get_Value("WorkspaceWindow"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("DialogWindow")) { generalDialogWindow = (IDialogWindow)properties.get_Value("DialogWindow"); } // CUSTOM MENUS // Definir os menus menuItem = new ExtenderMenuItems(); var childItems = menuItem.Add("miExtensibilidade", "&Extensibilidade").ChildItems; childItems.Add("miXItem1", "Item &1"); childItems.Add("miXItem2", "Item &2"); // // COM mandatories object oMenuItem = menuItem; properties.set_Value("ExtenderMenuItems", ref oMenuItem); //Use this property if you want Sage Retail to rebuild the permissions tree... //object rebuildPermissionsTree = true; //properties.set_Value("RebuildPermissionsTree", rebuildPermissionsTree); object oProps = properties; e.result.set_data(ref oProps); menuItem = null; }
private void MyEvents_OnStartup(object Sender, ExtenderEventArgs e) { ExtendedPropertyList properties = null;; ExtenderMenuItems menuItem; //APIEngine.SystemSettings.WorkstationInfo.Touch.CompanyLogoPosition = 1; properties = (ExtendedPropertyList)e.get_data(); //this property will only be available in the backoffice if (properties.PropertyExists("ChildWindow")) { generalChildWindow = (IChildWindow2)properties.get_Value("ChildWindow"); } //this property will only be available in the backoffice if (properties.PropertyExists("WorkspaceWindow")) { generalWorkspaceWindow = (IWorkspaceWindow)properties.get_Value("WorkspaceWindow"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("DialogWindow")) { generalDialogWindow = (IDialogWindow)properties.get_Value("DialogWindow"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("UITransactionManager")) { generalUITransactionManager = (IUITransaction)properties.get_Value("UITransactionManager"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("UIMasterTableManager")) { generalUIMasterTableManager = (IUIMasterTable)properties.get_Value("UIMasterTableManager"); } if (properties.PropertyExists("UIMenuManager")) { generalUIMenuManager = (IUIMenu)properties.get_Value("UIMenuManager"); } // CUSTOM MENUS // Definir os menus // Botão simples menuItem = new ExtenderMenuItems(); var simpleButton = menuItem.Add("miSimpleButton", "Exemplo de janela"); // Colocar o caminho para o icone. // Não usar os nomes de ficheiro da Sage em: // TARGETDIR\Icons50c // TARGETDIR\Images var myTargetDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName); myTargetDir = System.IO.Path.Combine(myTargetDir, "Icons"); simpleButton.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-01.png"); var simpleButton2 = menuItem.Add("miSimpleButton1", "Exemplo 2 de janela"); simpleButton2.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-02.png"); // Botão com submenu var parentButton = menuItem.Add("miComplexButton", "Grupo"); var parentBtn1 = parentButton.ChildItems.Add("miComplexButtonItem1", "Clique aqui para ver uma mensagem do Grupo!"); parentBtn1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-03.png"); //menuItem.Add("miItemView", "Alterar Artigos"); var parentButton2 = menuItem.Add("miComplexButton2", "Grupo"); var child1 = parentButton2.ChildItems.Add("miComplexButtonItem2", "SubGrupo"); var childItem1 = child1.ChildItems.Add("miComplexButtonItem3", "Clique aqui para ver uma mensagem do SubGrupo!", "miComplexButtonItem3"); childItem1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-03.png"); var childItem2 = child1.ChildItems.Add("miComplexButtonItem4", "Clique aqui para ver outra mensagem do SubGrupo!", "miComplexButtonItem3"); childItem2.PictureName = System.IO.Path.Combine(myTargetDir, "icon-save.ico"); // Custom Functions // Remember, all functions declared here will not recorded on physical base AddMyFunction("XFunctionA", "PTG"); AddMyFunction("XPosDisplay", "PTG"); // // COM mandatories object oMenuItem = menuItem; properties.set_Value("ExtenderMenuItems", ref oMenuItem); //Change RibbonTab Title object oRibbonCaption = "My caption"; properties.set_Value("RibbonCaption", ref oRibbonCaption); //Use this property if you want Sage Retail to rebuild the permissions tree... //object rebuildPermissionsTree = true; //properties.set_Value("RebuildPermissionsTree", rebuildPermissionsTree); object oProps = properties; e.result.set_data(ref oProps); menuItem = null; }