protected virtual void InitBtnGroup() { XVerticalToolBar xToolBar = new XVerticalToolBar(this);//父容器 //xToolBar.ButtonsNumInGroup = 3; xToolBar.PaddingTop = 20; xToolBar.BackColor = Color.White; this.BackColor = Color.White; int tabIndex = 0; List <Dictionary <string, AssiBtnDTO> > btnGrpList = this.GetDispalyBtnGroup(); int[] btnGrp = new int[btnGrpList.Count]; for (int i = 0; i < btnGrpList.Count; i++) { Dictionary <string, AssiBtnDTO> btnDic = btnGrpList[i]; btnGrp[i] = btnDic.Count; foreach (string key in btnDic.Keys) { AssiBtnDTO btnDTO = btnDic[key]; XIconToolButton button = new XIconToolButton(); button.TabIndex = tabIndex++; button.Text = btnDTO.Text; button.ButtonId = btnDTO.ButtonId; button.TipText = string.IsNullOrEmpty(btnDTO.TipText) ? btnDTO.Text : btnDTO.TipText; if (btnDTO.ButtonId.Equals("btnDiagDef")) { button.TipText = "诊断"; button.MouseClick += btnDi_MouseClick; } else { button.MouseClick += Button_MouseClick; } button.ValueObj = btnDTO; SetToolbarButtonImage(button, button.Text); xToolBar.AddRender(button); xIconToolButtonsList.Add(button); } } xToolBar.BtnsInGroupAry = btnGrp; xToolBar.Layout(); this.AddRender(xToolBar); // 切换按钮样式事件 SkinFactory.Instance().SkinChanged += AssistantBtnBaseView_SkinChanged; }
void buttonView_Load(object sender, EventArgs e) { // // string[] titles = { "门诊组套", "", "医嘱模板", "医技常规", "患者常用", "服务分类", "临床指南" }; szCiCommand = new ICiCommand[] { (ICiCommand)this.Context.Config.GetInstance("MedclingrpAppCommand"), // 门诊组套 (ICiCommand)this.Context.Config.GetInstance(TPL_COMMAND), // 病历模板 (ICiCommand)this.Context.Config.GetInstance("OrderTemplateCommand"), //医嘱模板 (ICiCommand)this.Context.Config.GetInstance("OpMedicalTechmologyCommand"), //医技常规, //(ICiCommand)this.Context.Config.GetInstance("OpPatCommonUseCommand"), // 患者常用 (ICiCommand)this.Context.Config.GetInstance("OpMedSrvCatgCommand") // 服务分类 //(ICiCommand)this.Context.Config.GetInstance("OpClinicalGuideCommand") // 临床指南 暂时屏蔽 }; XVerticalToolBar xToolBar = new XVerticalToolBar(this);//父容器 xToolBar.ButtonsNumInGroup = 4; xToolBar.PaddingTop = 20; xToolBar.BackColor = Color.White; this.BackColor = Color.White; int tabIndex = 0; foreach (ICiCommand cmd in szCiCommand) { XIconToolButton button = new XIconToolButton(); button.TabIndex = tabIndex++; button.Text = cmd.GetTitle(); button.ImageShow = false; button.ButtonId = ""; button.TipText = cmd.GetTitle(); button.MouseClick += new MouseEventHandler(button_MouseClick); button.ValueObj = cmd; //this.SetBindingAction(xbuttoneventtype[cmd.GetTitle()], button); setToolbarButtonImage(tmpIamgePath, button, cmd.GetTitle(), null); // SkinFactory.Instance().CurrentSkin.SkinPath xToolBar.AddRender(button); _xIconToolButtonsList.Add(button); } xToolBar.Layout(); this.AddRender(xToolBar); //图标换肤 ganwh add 2016-9-13 SkinFactory.Instance().SkinChanged += OnSkinChanged; }