コード例 #1
0
ファイル: ToolBarContain.cs プロジェクト: icprog/MiKe
 /// <summary>
 /// 删除按钮
 /// </summary>
 /// <param name="barTool"></param>
 /// <param name="items"></param>
 public static void ToolbarC(DevExpress.XtraBars.Bar barTool, DevExpress.XtraBars.BarItem item)
 {
     if (barTool.LinksPersistInfo.Count > item.Id && barTool.LinksPersistInfo [item.Id].Item.Name == item.Name)
     {
         barTool.LinksPersistInfo.RemoveAt(item.Id);
     }
 }
コード例 #2
0
 public void SetEnableOfToolbarButton(String strButtonTag, bool isEnable)
 {
     DevExpress.XtraBars.BarItem barbtn = GetToolbarButton(strButtonTag);
     if (barbtn != null)
     {
         barbtn.Enabled = isEnable;
     }
 }
コード例 #3
0
        private void ClearMenuChecked()
        {
            for (int i = 0; i < main_menu.Items.Count; i++)
            {
                DevExpress.XtraBars.BarItem si = main_menu.Items[0];

                /*for (int j = 0; j < (si as ToolStripMenuItem).DropDownItems.Count; j++)
                 * {
                 *  ToolStripItem sd = (si as ToolStripMenuItem).DropDownItems[j];
                 *  (sd as ToolStripMenuItem).Checked = false;
                 * }*/
            }
        }
コード例 #4
0
        protected override void DegiskenleriDoldur()
        {
            Tablo        = tablo;
            BaseKartTuru = KartTuru.Il;
            FormShow     = new ShowEditForms <IlEditForm>();
            Navigator    = longNavigator.Navigator;

            if (IsMdiChild)
            {
                ShowItems = new DevExpress.XtraBars.BarItem[] { btnBagliKartlar }
            }
            ;
        }
コード例 #5
0
        public LocalizedItem(DevExpress.XtraBars.BarItem item, string resourceId)
        {
            const int TextsCount = 1;

            this.resourceIds = new string[TextsCount] {
                resourceId
            };
            this.obj           = (object)item;
            this.type          = ItemType.BarItem;
            this.defaultValues = new string[TextsCount] {
                item.Caption
            };
        }
コード例 #6
0
        public FiltreEditForm(params object[] prm)
        {
            InitializeComponent();

            _filtreKartTuru = (KartTuru)prm[0];
            _filtreGrid     = (GridControl)prm[1];

            HideItems = new DevExpress.XtraBars.BarItem[] { btnYeni, btnGeriAl, };
            ShowItems = new DevExpress.XtraBars.BarItem[] { btnFarkliKaydet, btnUygula };

            DataLayoutControl = myDataLayoutControl;
            Bll          = new FiltreBll(myDataLayoutControl);
            BaseKartTuru = COMMON.Enums.KartTuru.Filtre;
            EventsLoad();
        }
コード例 #7
0
ファイル: LocalizedItem.cs プロジェクト: horba/prizm
        public LocalizedItem(DevExpress.XtraBars.BarItem item, List <string> list, string [] resourceIds)
        {
            this.resourceIds = new string[resourceIds.Length];
            for (int index = 0; index < resourceIds.Length; index++)
            {
                this.resourceIds[index] = resourceIds[index];
            }
            this.obj           = (object)new Tuple <DevExpress.XtraBars.BarItem, List <string> >(item, list);
            this.type          = ItemType.BarItemCustomCaption;
            this.defaultValues = new string[resourceIds.Length];

            for (int index = 0; index < resourceIds.Length; index++)
            {
                this.defaultValues[index] = (index == 0) ? item.Caption : "";
            }
        }
コード例 #8
0
        private void ctm_S_ButtonClicked(string barItemName, DevExpress.XtraBars.BarItem barItem, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            switch (barItemName)
            {
            case "Refresh":
                SRefresh();
                break;

            case "Save":
                SSave();
                break;

            case "New":
                SNew();
                break;
            }
        }
コード例 #9
0
        private void addItemToBar(DevExpress.XtraBars.Bar sourceItem, DevExpress.XtraBars.BarItem newItem)
        {
            DevExpress.XtraBars.BarItemLink linkForDelete = null;
            foreach (DevExpress.XtraBars.BarItemLink link in sourceItem.ItemLinks)
            {
                if (link.Caption == newItem.Caption)
                {
                    linkForDelete = link; break;
                }
            }
            if (linkForDelete != null)
            {
                sourceItem.RemoveLink(linkForDelete);
            }

            int newID = sourceItem.ItemLinks.Count;

            newItem.Id = newID;
            sourceItem.AddItem(newItem);
        }
コード例 #10
0
 protected BarSubItemLink(DevExpress.XtraBars.BarItemLinkReadOnlyCollection ALinks, DevExpress.XtraBars.BarItem AItem, object ALinkedObject) : base(ALinks, AItem, ALinkedObject)
 {
 }
コード例 #11
0
        public void ToolbarButton_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                DevExpress.XtraBars.BarItem btn = sender as DevExpress.XtraBars.BarItem;
                String strToolbarTag            = e.Item.Tag.ToString();
                String strToolbarGroup          = e.Item.Hint;

                STToolbarFunctionsController objSTToolbarFunctionsController = new STToolbarFunctionsController();
                STToolbarFunctionsInfo       objToolbarFunctionsInfo         = objSTToolbarFunctionsController.GetLastToolbarFunctionByModuleIDAndToolbarTagAndGroup(Module.CurrentModuleID
                                                                                                                                                                     , strToolbarTag
                                                                                                                                                                     , strToolbarGroup);

                if (objToolbarFunctionsInfo != null)
                {
                    MethodInfo method = Module.GetMethodInfoByMethodFullNameAndMethodClass(objToolbarFunctionsInfo.STToolbarFunctionName,
                                                                                           objToolbarFunctionsInfo.STToolbarFunctionFullName,
                                                                                           objToolbarFunctionsInfo.STToolbarFunctionClass);

                    method.Invoke(Module, Module.GetMethodParameterValues(method.GetParameters(), sender, "ItemClick"));
                }
                else
                {
                    if (!(e.Item is DevExpress.XtraBars.BarSubItem))
                    {
                        switch (strToolbarTag)
                        {
                        case BaseToolbar.ToolbarButtonNew:
                        {
                            Module.ActionNew();
                            break;
                        }

                        case BaseToolbar.ToolbarButtonEdit:
                        {
                            Module.ActionEdit();
                            break;
                        }

                        case BaseToolbar.ToolbarButtonCancel:
                        {
                            Module.ActionCancel();
                            break;
                        }

                        case BaseToolbar.ToolbarButtonSave:
                        {
                            Module.ActionSave();
                            break;
                        }

                        case BaseToolbar.ToolbarButtonComplete:
                        {
                            Module.ActionComplete();
                            break;
                        }

                        case BaseToolbar.ToolbarButtonPrint:
                        {
                            Module.ActionPrint();
                            break;
                        }

                        case BaseToolbar.ToolbarButtonApproved:
                        {
                            Module.ActionApproved();
                            break;
                        }

                        default:
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #12
0
        public virtual DevExpress.XtraBars.BarItem[] InitToolbarButtonsForToolbar(List <STToolbarsInfo> toolbarList, string strToolbarGroup)
        {
            Dictionary <int, DevExpress.XtraBars.BarItem> lstParentToolbar = new Dictionary <int, DevExpress.XtraBars.BarItem>();
            List <DevExpress.XtraBars.BarItem>            btnToolbarList   = new List <DevExpress.XtraBars.BarItem>();

            STToolbarsController objSTToolbarsController = new STToolbarsController();

            if (toolbarList.Count() == 0)
            {
                return(btnToolbarList.ToArray());
            }

            DevExpress.XtraBars.BarItem objBarItem = null;

            toolbarList.ForEach(o =>
            {
                objBarItem = null;
                if (toolbarList.Any(o1 => o1.STToolbarParentID == o.STToolbarID))
                {
                    objBarItem = new DevExpress.XtraBars.BarSubItem();
                    lstParentToolbar.Add(o.STToolbarID, objBarItem);
                }
                else
                {
                    objBarItem = new DevExpress.XtraBars.BarButtonItem();
                }
                objBarItem.Id          = ToolbarManager.GetNewItemId();
                objBarItem.Name        = o.STToolbarName;
                objBarItem.Tag         = o.STToolbarTag;
                objBarItem.Caption     = o.STToolbarCaption;
                objBarItem.Description = o.STToolbarDesc;
                objBarItem.Hint        = strToolbarGroup;
                objBarItem.PaintStyle  = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;

                if (o.STToolbarParentID == 0)
                {
                    btnToolbarList.Add(objBarItem);
                }

                if (VinaApp.ToolbarImageList.Images.IndexOfKey(objBarItem.Tag.ToString()) >= 0)
                {
                    objBarItem.LargeImageIndex = VinaApp.ToolbarImageList.Images.IndexOfKey(objBarItem.Tag.ToString());
                    objBarItem.ImageIndex      = VinaApp.ToolbarImageList.Images.IndexOfKey(objBarItem.Tag.ToString());
                    objBarItem.Glyph           = VinaApp.ToolbarImageList.Images[objBarItem.Tag.ToString()];
                }

                if (objBarItem is DevExpress.XtraBars.BarButtonItem)
                {
                    objBarItem.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(ToolbarButton_ItemClick);
                    //InitHotKeyForToolbarButton(barButton);
                }

                if (lstParentToolbar.ContainsKey(o.STToolbarParentID))
                {
                    (lstParentToolbar[o.STToolbarParentID] as DevExpress.XtraBars.BarSubItem).AddItem(objBarItem);
                }

                ToolbarManager.Items.Add(objBarItem);
            });
            return(btnToolbarList.ToArray());
        }