public SkinGalleryHelper(DevExpress.XtraBars.RibbonGalleryBarItem ribbonGallerySkins)
 {
     this.ribbonGallerySkins = ribbonGallerySkins;
     ribbonGallerySkins.Id = frmRibbonMain.IIII++;
     InitBarItem();
     FillImages();
 }
Beispiel #2
0
        public void LoadTopMenus(RibbonControl iMaster)
        {
            RibbonPage pgActions = new RibbonPage("Home");

            pgActions.Name = "Home";
            RibbonPageGroup grpActions = new RibbonPageGroup("Purchase");
            RibbonPageGroup grpUsers   = new RibbonPageGroup("Adminstration");
            RibbonPageGroup grpSales   = new RibbonPageGroup("Sales");
            RibbonPageGroup grpSetups  = new RibbonPageGroup("Setups");
            RibbonPageGroup grpReports = new RibbonPageGroup("Reports");

            BarButtonItem DirectInvoice = new BarButtonItem();

            iMaster.Items.Add(DirectInvoice);
            DirectInvoice.Caption         = "Direct Purchase";
            DirectInvoice.LargeImageIndex = 13;
            DirectInvoice.Id = iMaster.Manager.GetNewItemId(); //Ensures correct runtime layout (de)serialization.
                                                               // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            DirectInvoice.ItemClick += new ItemClickEventHandler(DirectInvoice_ItemClick);

            BarButtonItem rUsers = new BarButtonItem();

            iMaster.Items.Add(rUsers);
            rUsers.Caption         = "Users";
            rUsers.LargeImageIndex = 9;
            //  rUsers.ImageIndex = 9;
            rUsers.Id = iMaster.Manager.GetNewItemId(); //Ensures correct runtime layout (de)serialization.
            // rUsers.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rUsers.ItemClick += new ItemClickEventHandler(rUsers_ItemClick);

            BarButtonItem rUsersRoles = new BarButtonItem();

            iMaster.Items.Add(rUsersRoles);
            rUsersRoles.Caption         = "Users Roles";
            rUsersRoles.LargeImageIndex = 10;
            rUsersRoles.Id         = iMaster.Manager.GetNewItemId(); // rUsersRoles.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rUsersRoles.ItemClick += new ItemClickEventHandler(rUsersRoles_ItemClick);

            BarButtonItem rRoles = new BarButtonItem();

            iMaster.Items.Add(rRoles);
            rRoles.Caption         = "Roles";
            rRoles.LargeImageIndex = 21;
            rRoles.Id         = iMaster.Manager.GetNewItemId(); // rUsersRoles.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rRoles.ItemClick += new ItemClickEventHandler(rRoles_ItemClick);

            BarButtonItem rPOReceipt = new BarButtonItem();

            iMaster.Items.Add(rPOReceipt);
            rPOReceipt.Caption         = "PO Receipt";
            rPOReceipt.LargeImageIndex = 15;
            rPOReceipt.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rPOReceipt.ItemClick += new ItemClickEventHandler(rPOReceipt_ItemClick);

            BarButtonItem rSupplierPayment = new BarButtonItem();

            iMaster.Items.Add(rSupplierPayment);
            rSupplierPayment.Caption         = "Supplier Payment";
            rSupplierPayment.LargeImageIndex = 12;
            rSupplierPayment.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rSupplierPayment.ItemClick += new ItemClickEventHandler(rSupplierPayment_ItemClick);

            BarButtonItem rReturnOutwards = new BarButtonItem();

            iMaster.Items.Add(rReturnOutwards);
            rReturnOutwards.Caption         = "Return Outwards";
            rReturnOutwards.LargeImageIndex = 14;
            rReturnOutwards.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rReturnOutwards.ItemClick += new ItemClickEventHandler(rReturnOutwards_ItemClick);

            BarButtonItem rSalesOrder = new BarButtonItem();

            iMaster.Items.Add(rSalesOrder);
            rSalesOrder.Caption         = "Sales Order";
            rSalesOrder.LargeImageIndex = 16;
            rSalesOrder.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rSalesOrder.ItemClick += new ItemClickEventHandler(rSalesOrder_ItemClick);

            BarButtonItem rCustomerReceipt = new BarButtonItem();

            iMaster.Items.Add(rCustomerReceipt);
            rCustomerReceipt.Caption         = "Customer Receipt";
            rCustomerReceipt.LargeImageIndex = 19;
            rCustomerReceipt.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCustomerReceipt.ItemClick += new ItemClickEventHandler(rCustomerReceipt_ItemClick);

            BarButtonItem rReturnInwards = new BarButtonItem();

            iMaster.Items.Add(rReturnInwards);
            rReturnInwards.Caption         = "Return Inwards";
            rReturnInwards.LargeImageIndex = 18;
            rReturnInwards.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rReturnInwards.ItemClick += new ItemClickEventHandler(rReturnInwards_ItemClick);

            BarButtonItem rCustomerRefunds = new BarButtonItem();

            iMaster.Items.Add(rCustomerRefunds);
            rCustomerRefunds.Caption         = "Customer Refunds";
            rCustomerRefunds.LargeImageIndex = 17;
            rCustomerRefunds.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCustomerRefunds.ItemClick += new ItemClickEventHandler(rCustomerRefunds_ItemClick);

            BarButtonItem rCostRevision = new BarButtonItem();

            iMaster.Items.Add(rCostRevision);
            rCostRevision.Caption         = "Cost/Price Revisions";
            rCostRevision.LargeImageIndex = 22;
            rCostRevision.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCostRevision.ItemClick += new ItemClickEventHandler(rCostRevision_ItemClick);

            BarButtonItem rSaleSummary = new BarButtonItem();

            iMaster.Items.Add(rSaleSummary);
            rSaleSummary.Caption         = "Sales Summary";
            rSaleSummary.LargeImageIndex = 22;
            rSaleSummary.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rSaleSummary.ItemClick += new ItemClickEventHandler(rSaleSummary_ItemClick);

            BarButtonItem rCustomerInvoices = new BarButtonItem();

            iMaster.Items.Add(rCustomerInvoices);
            rCustomerInvoices.Caption         = "Customer Invoices";
            rCustomerInvoices.LargeImageIndex = 22;
            rCustomerInvoices.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCustomerInvoices.ItemClick += new ItemClickEventHandler(rCustomerInvoices_ItemClick);

            BarButtonItem rCustomerBalances = new BarButtonItem();

            iMaster.Items.Add(rCustomerBalances);
            rCustomerBalances.Caption         = "Customer Balances";
            rCustomerBalances.LargeImageIndex = 22;
            rCustomerBalances.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCustomerBalances.ItemClick += new ItemClickEventHandler(rCustomerBalances_ItemClick);

            BarButtonItem rCreditNotes = new BarButtonItem();

            iMaster.Items.Add(rCreditNotes);
            rCreditNotes.Caption         = "Credit Notes";
            rCreditNotes.LargeImageIndex = 22;
            rCreditNotes.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCreditNotes.ItemClick += new ItemClickEventHandler(rCreditNotes_ItemClick);

            BarSubItem Setups = new BarSubItem();

            iMaster.Items.Add(Setups);
            Setups.Caption         = "Setups";
            Setups.LargeImageIndex = 25;
            Setups.Id = iMaster.Manager.GetNewItemId(); //Ensures correct runtime layout (de)serialization.

            BarButtonItem rItemMaster = new BarButtonItem();

            iMaster.Items.Add(rItemMaster);
            rItemMaster.Caption         = "Item Master";
            rItemMaster.LargeImageIndex = 23;
            rItemMaster.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rItemMaster.ItemClick += new ItemClickEventHandler(rItemMaster_ItemClick);

            BarButtonItem rCustomers = new BarButtonItem();

            iMaster.Items.Add(rCustomers);
            rCustomers.Caption    = "Customers";
            rCustomers.ImageIndex = 15;
            Setups.AddItem(rCustomers);
            rCustomers.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCustomers.ItemClick += new ItemClickEventHandler(rCustomers_ItemClick);

            BarButtonItem rSuppliers = new BarButtonItem();

            iMaster.Items.Add(rSuppliers);
            rSuppliers.Caption    = "Suppliers";
            rSuppliers.ImageIndex = 16;
            Setups.AddItem(rSuppliers);
            rSuppliers.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rSuppliers.ItemClick += new ItemClickEventHandler(rSuppliers_ItemClick);

            BarButtonItem rCategory = new BarButtonItem();

            iMaster.Items.Add(rCategory);
            rCategory.Caption    = "Categories";
            rCategory.ImageIndex = 19;
            Setups.AddItem(rCategory);
            rCategory.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rCategory.ItemClick += new ItemClickEventHandler(rCategory_ItemClick);

            BarButtonItem rUOM = new BarButtonItem();

            iMaster.Items.Add(rUOM);
            rUOM.Caption    = "UOM";
            rUOM.ImageIndex = 17;
            Setups.AddItem(rUOM);
            rUOM.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rUOM.ItemClick += new ItemClickEventHandler(rUOM_ItemClick);

            BarButtonItem rUOMConversions = new BarButtonItem();

            iMaster.Items.Add(rUOMConversions);
            rUOMConversions.Caption    = "UOM Conversions";
            rUOMConversions.ImageIndex = 18;
            Setups.AddItem(rUOMConversions);
            rUOMConversions.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rUOMConversions.ItemClick += new ItemClickEventHandler(rUOMConversions_ItemClick);

            BarButtonItem rPriceBands = new BarButtonItem();

            iMaster.Items.Add(rPriceBands);
            rPriceBands.Caption    = "Price Bands";
            rPriceBands.ImageIndex = 20;
            Setups.AddItem(rPriceBands);
            rPriceBands.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rPriceBands.ItemClick += new ItemClickEventHandler(rPriceBands_ItemClick);

            BarButtonItem rWareHouses = new BarButtonItem();

            iMaster.Items.Add(rWareHouses);
            rWareHouses.Caption    = "Warehouses";
            rWareHouses.ImageIndex = 21;
            Setups.AddItem(rWareHouses);
            rWareHouses.Id         = iMaster.Manager.GetNewItemId(); // EmployeeInfo.RibbonStyle = ((DevExpress.XtraBars.Ribbon.RibbonItemStyles)((DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText | DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithoutText)));
            rWareHouses.ItemClick += new ItemClickEventHandler(rWareHouses_ItemClick);


            RibbonPageGroup      Skins     = new RibbonPageGroup();
            RibbonGalleryBarItem rgbiSkins = new DevExpress.XtraBars.RibbonGalleryBarItem();

            rgbiSkins.Caption = "Skins";

            rgbiSkins.Gallery.AllowHoverImages = true;
            rgbiSkins.Gallery.Appearance.ItemCaptionAppearance.Normal.Options.UseFont        = true;
            rgbiSkins.Gallery.Appearance.ItemCaptionAppearance.Normal.Options.UseTextOptions = true;
            rgbiSkins.Gallery.Appearance.ItemCaptionAppearance.Normal.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            rgbiSkins.Gallery.ColumnCount         = 4;
            rgbiSkins.Gallery.FixedHoverImageSize = false;
            rgbiSkins.Gallery.ImageSize           = new System.Drawing.Size(32, 17);
            rgbiSkins.Gallery.ItemImageLocation   = DevExpress.Utils.Locations.Top;
            rgbiSkins.Gallery.RowCount            = 4;
            rgbiSkins.Id   = 60;
            rgbiSkins.Name = "rgbiSkins";
            iMaster.Items.AddRange(new DevExpress.XtraBars.BarItem[] { rgbiSkins });
            Skins.ItemLinks.Add(rgbiSkins);
            Skins.Name = "skinsRibbonPageGroup";
            Skins.ShowCaptionButton = false;
            Skins.Text = "Skins";
            SkinHelper.InitSkinGallery(rgbiSkins, true);


            grpSetups.ItemLinks.AddRange(new BarItem[] { rItemMaster, rCostRevision, rCustomers, rSuppliers });
            grpSetups.ItemLinks.AddRange(Setups);
            grpSales.ItemLinks.AddRange(new BarItem[] { rSalesOrder, rCustomerReceipt, rReturnInwards, rCustomerRefunds });
            grpUsers.ItemLinks.AddRange(new BarItem[] { rUsers, rRoles, rUsersRoles });
            grpActions.ItemLinks.AddRange(new BarItem[] { DirectInvoice, rSupplierPayment, rReturnOutwards });
            grpReports.ItemLinks.AddRange(new BarItem[] { rSaleSummary, rCustomerInvoices, rCustomerBalances, rCreditNotes });

            pgActions.Groups.Add(grpUsers);
            pgActions.Groups.Add(grpSales);
            pgActions.Groups.Add(Skins);
            pgActions.Groups.Add(grpActions);
            pgActions.Groups.Add(grpSetups);
            pgActions.Groups.Add(grpReports);
            iMaster.Pages.Add(pgActions);
        }