private void btnDi_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) { XIconToolButton btn = sender as XIconToolButton; AssiBtnDTO btnDTO = btn.ValueObj as AssiBtnDTO; if (!IsAllowOpenAssiFrameValidate(btnDTO)) { if (assiViewFrame != null) { assiViewFrame.Close(); } return; } if (assiViewFrame != null) { assiViewFrame.Close(); } XBaseControl xBaseCtrl = this.getParentCtrl(btnDTO.FrameLocation); if (!isDiOpen) { diAssiForm = new EntDiAssiForm(this.Context); diAssiForm.Size = GetFrameSize(xBaseCtrl); diAssiForm.Location = GetFrameLocation(xBaseCtrl); diAssiForm.delegateHelper += getDOsFromHelp; diAssiForm.FormClosed += new FormClosedEventHandler(diAssiForm_FormClosed); isDiOpen = true; diAssiForm.Show(xBaseCtrl); } }
/// <summary> /// 点击助手按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) { XIconToolButton btn = sender as XIconToolButton; AssiBtnDTO btnDTO = btn.ValueObj as AssiBtnDTO; this.LoadAssiFrame(btnDTO); }
private void SetIconToolButton(XIconToolButton button, String iconName) { String SkinPath = LargeImageMode? SkinFactory.Instance().CurrentSkin.SkinPath:SkinFactory.Instance().CurrentSkin.SmalSkinPath; button.NormalImage = Image.FromFile(SkinPath + string.Format("\\{0}-1.png", iconName)); button.HoverImage = Image.FromFile(SkinPath + string.Format("\\{0}-2.png", iconName)); button.DownImage = Image.FromFile(SkinPath + string.Format("\\{0}-3.png", iconName)); button.DisableImage = Image.FromFile(SkinPath + string.Format("\\{0}-4.png", iconName)); button.Invalidate(); }
private void setToolbarButtonImage(String path, XIconToolButton button, String imageName, EventHandler evt) { if (this.tmpIamgePath == null) { return; } int index = 1; button.NormalImage = Image.FromFile(path + imageName + "-" + (index++).ToString() + ".png"); button.HoverImage = Image.FromFile(path + imageName + "-" + (index++).ToString() + ".png"); button.DownImage = Image.FromFile(path + imageName + "-" + (index++).ToString() + ".png"); button.DisableImage = Image.FromFile(path + imageName + "-" + (index++).ToString() + ".png"); }
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; }
public override void HandleState(object sender, DictionaryEventArgs e) { // 获取助手弹出窗口的坐标 this.GetICiCommandParamDic(); base.HandleState(sender, e); if (sender is ShortcutOpOrdTemplatAction) { if (sender == null || BizAssMessageBoxUtil.ShowPatIsNullMsg(ent4BannerDTO, null) || IsEntCompleted()) { return; } this.szCiCommand[2].exec(this.paramDic); } else if (sender is ShortcutOpMedclingrpAppAction) { if (sender == null || BizAssMessageBoxUtil.ShowPatIsNullMsg(ent4BannerDTO, null) || IsEntCompleted()) { return; } this.szCiCommand[0].exec(this.paramDic); } else if (sender is ShortcutOpTplcommandAction) { if (sender == null || BizAssMessageBoxUtil.ShowPatIsNullMsg(ent4BannerDTO, null) || IsEntCompleted()) { return; } this.szCiCommand[1].exec(this.paramDic); } else if (sender is ShortcutOpMedicalTechmologyAction) { XIconToolButton btn = new XIconToolButton(); btn.Text = "医技常规"; this.button_MouseClick(btn, null); } else if (sender is ShortcutOpMedSrvCatgAction) { XIconToolButton btn = new XIconToolButton(); btn.Text = "服务分类"; this.button_MouseClick(btn, null); } }
/// <summary> /// 设置按钮图片 /// </summary> /// <param name="path"></param> /// <param name="button"></param> /// <param name="imageName"></param> protected virtual void SetToolbarButtonImage(XIconToolButton button, String imageName) { if (this.imgBasePath == null) { return; } string imgPath = this.imgBasePath + "\\" + imageName; try { button.NormalImage = Image.FromFile(imgPath + "-1.png"); button.HoverImage = Image.FromFile(imgPath + "-2.png"); button.DownImage = Image.FromFile(imgPath + "-3.png"); button.DisableImage = Image.FromFile(imgPath + "-4.png"); } catch (Exception) { ErrorMsg msg = new ErrorMsg(); msg.Message = "未获取到[" + imageName + "]对应的图片"; throw new XapServiceException(msg); } }
void button_MouseClick(object sender, MouseEventArgs e) { XIconToolButton btn = sender as XIconToolButton; // 如不是中间按钮区直接返回,或者banner为空,弹出提示信息并返回 if (btn == null || BizAssMessageBoxUtil.ShowPatIsNullMsg(ent4BannerDTO, btn.Text) || IsEntCompleted()) { return; } if (btn.TabIndex < szCiCommand.Length && szCiCommand[btn.TabIndex] != null) { // 获取助手弹出窗口的坐标 this.GetICiCommandParamDic(); if (btn.Text == "医嘱模板") { // 判断是否已经诊毕,以及是否已经下诊断 if (!IsWriteCiDi("医嘱模板")) { return; } using (OpOrderTemplateForm OrderSevrice_Frm = new OpOrderTemplateForm(this, 1)) { // helperForm OrderSevrice_Frm = new helperForm(this); OrderSevrice_Frm.StartPosition = FormStartPosition.Manual; OrderSevrice_Frm.Location = this.GetLeftLocation(); // OrderSevrice_Frm.LocationChanged += new EventHandler(OrderSevrice_Frm_LocationChanged); OrderSevrice_Frm.SaveClick += new MouseEventHandler(OrderSevrice_Frm_SaveClick); OrderSevrice_Frm.FormClosed += new FormClosedEventHandler(OrderSevrice_Frm_FormClosed); OrderSevrice_Frm.ShowDialog(); } } else if (btn.Text == "医技常规") { // 判断是否已经诊毕,以及是否已经下诊断 if (!IsWriteCiDi("医技常规")) { return; } using (OpOrderTemplateForm OrderSevrice_Frm = new OpOrderTemplateForm(this, 2)) { // helperForm OrderSevrice_Frm = new helperForm(this); OrderSevrice_Frm.StartPosition = FormStartPosition.Manual; OrderSevrice_Frm.Location = this.GetLeftLocation(); // OrderSevrice_Frm.LocationChanged += new EventHandler(OrderSevrice_Frm_LocationChanged); OrderSevrice_Frm.SaveClick += new MouseEventHandler(OrderSevrice_Frm_SaveClick); OrderSevrice_Frm.FormClosed += new FormClosedEventHandler(OrderSevrice_Frm_FormClosed); OrderSevrice_Frm.ShowDialog(); } } else if (btn.Text == "服务分类") { // 判断是否已经诊毕,以及是否已经下诊断 if (!IsWriteCiDi("服务分类")) { return; } using (OpOrderTemplateForm OrderSevrice_Frm = new OpOrderTemplateForm(this, 0)) { // helperForm OrderSevrice_Frm = new helperForm(this); OrderSevrice_Frm.StartPosition = FormStartPosition.Manual; OrderSevrice_Frm.Location = this.GetLeftLocation(); // OrderSevrice_Frm.LocationChanged += new EventHandler(OrderSevrice_Frm_LocationChanged); OrderSevrice_Frm.SaveClick += new MouseEventHandler(OrderSevrice_Frm_SaveClick); OrderSevrice_Frm.FormClosed += new FormClosedEventHandler(OrderSevrice_Frm_FormClosed); OrderSevrice_Frm.ShowDialog(); } } else if (btn.Text == "病历模板") { Object result = szCiCommand[btn.TabIndex].exec(paramDic); } else if (btn.Text == "门诊组套") { Object result = szCiCommand[btn.TabIndex].exec(paramDic); } else { Object result = szCiCommand[btn.TabIndex].exec(this); } } }