private void ChangeBtn(BtnType btnType) { Image btnIcon = WPFHelper.GetVisualChild <Image>(Btn); switch (btnType) { case BtnType.BTN_CANCEL: Btn.Click -= BtnSearch_OnClick; Btn.Click += BtnCancel_OnClick; BitmapImage closeIcon = new BitmapImage(new Uri("close.png", UriKind.Relative)); btnIcon.Source = closeIcon; TbxInput.IsEnabled = false; break; case BtnType.BTN_SEARCH: Btn.Click -= BtnCancel_OnClick; Btn.Click += BtnSearch_OnClick; BitmapImage searchIcon = new BitmapImage(new Uri("search.png", UriKind.Relative)); btnIcon.Source = searchIcon; TbxInput.IsEnabled = true; break; default: break; } }
private void mix_btn_Click(object sender, EventArgs e) { switch (btnType) { case BtnType.Pause: downloadFollow.Pause = true; btnType = BtnType.Start; SetMixBtnImage(btnType); break; case BtnType.Start: downloadFollow.Pause = false; btnType = BtnType.Pause; SetMixBtnImage(btnType); break; case BtnType.Install: installFollow.StartInstall(); installFollow.doInstallOver += () => Utility.ExitApp(); btnType = BtnType.Null; mix_btn.Visible = false; start_btn.Visible = false; break; case BtnType.Update: SetInfoControlVisible(true); downloadFollow.StartDownload(); btnType = BtnType.Pause; SetMixBtnImage(btnType); break; } }
void OnBtnsClick(BtnType type) { if (type == BtnType.liuliang) { IsLiuliangAuto = m_btn_liuliang.GetComponent <UIToggle>().value; } }
public void setButtonUpOrDown(BtnType bt, string Cls) { if (id == 0) { return; } List <ButtonDate> btndate = PubulicData.sourceData[PubulicData.ClassName.ButtonDate.ToString()] as List <ButtonDate>; ButtonDate btnd = btndate.FirstOrDefault(c => c.ID == id); if (btnd == null) { return; } int NewIndex = btnd.Index; int NexIndex = 0; if (Cls == "上移" && NewIndex > btndate.Where(c => c.Type == bt.ToString() && c.State == "show").Min(c => c.Index)) { NexIndex = btndate.Where(c => c.Type == bt.ToString() && c.Index < NewIndex && c.State == "show").Max(c => c.Index); } else if (Cls == "下移" && NewIndex < btndate.Where(c => c.Type == bt.ToString() && c.State == "show").Max(c => c.Index)) { NexIndex = btndate.Where(c => c.Type == bt.ToString() && c.Index > NewIndex && c.State == "show").Min(c => c.Index); } if (NexIndex != 0) { var model = btndate.FirstOrDefault(c => c.Index == NexIndex && c.Type == bt.ToString()); btnd.Index = NexIndex; model.Index = NewIndex; } PubulicData.sourceData[PubulicData.ClassName.ButtonDate.ToString()] = btndate; SX(); }
UI.MainUI.ItemFielInfo GetBeLinkedItem(BtnType btnType) { foreach (UI.MainUI.ItemFielInfo itemFielInfo in UI.MainUI.ContainerInfomanager.Instance.itemFielArrayInfo) { if (itemFielInfo.LocalItemData._GoodsClass == 2 && itemFielInfo.medicamentEntity.MEDICAMENT_FIELD_BELINKED == 1) { switch (itemFielInfo.LocalItemData._GoodsSubClass) { case 3: //恢复生命类 if (btnType == BtnType.Health) { return(itemFielInfo); } break; case 4: //恢复真气类 if (btnType == BtnType.Magic) { return(itemFielInfo); } break; default: break; } } } return(null); }
private void SetMixBtnImage(BtnType bt) { switch (bt) { case BtnType.Update: mix_btn.Image = Properties.Resources.UI_Update_BG; mix_btn.OnMouseEnterBG = Properties.Resources.UI_Update_Over; mix_btn.OnMouseLeaveBG = Properties.Resources.UI_Update_BG; mix_btn.OnMouseDownBG = Properties.Resources.UI_Update_Press; break; case BtnType.Pause: mix_btn.Image = Properties.Resources.UI_Pause_BG; mix_btn.OnMouseEnterBG = Properties.Resources.UI_Pause_Over; mix_btn.OnMouseLeaveBG = Properties.Resources.UI_Pause_BG; mix_btn.OnMouseDownBG = Properties.Resources.UI_Pause_Press; time_lab.Visible = true; break; case BtnType.Start: mix_btn.Image = Properties.Resources.UI_Update_BG; mix_btn.OnMouseEnterBG = Properties.Resources.UI_Update_Over; mix_btn.OnMouseLeaveBG = Properties.Resources.UI_Update_BG; mix_btn.OnMouseDownBG = Properties.Resources.UI_Update_Press; time_lab.Visible = false; break; case BtnType.Install: mix_btn.Image = Properties.Resources.UI_Install_BG; mix_btn.OnMouseEnterBG = Properties.Resources.UI_Install_Over; mix_btn.OnMouseLeaveBG = Properties.Resources.UI_Install_BG; mix_btn.OnMouseDownBG = Properties.Resources.UI_Install_Press; break; } }
public Button(BtnType t, Point Pos, Texture2D img, Vector2 scale) { Type = t; Position = Pos.ToVector2(); Image = img; Box = new Rectangle(Pos, (new Vector2(470, 188) * scale).ToPoint()); }
protected override void OnLoading() { base.OnLoading(); m_dataManager = DataManager.Manager <WelfareManager>(); m_dataManager.UpdateWelfareState(2); UIToggle[] toggles = m_trans_ToggleContent.GetComponentsInChildren <UIToggle>(); foreach (var item in toggles) { BtnType btntype = (BtnType)System.Enum.Parse(typeof(BtnType), item.name); EventDelegate.Add(item.onChange, () => { if (item.value) { this.OnContentToggleValueChange(btntype); } }); if (btntype == BtnType.Content_1) { m_toggleContent1 = item; } m_dicLable.Add(btntype, item.transform.Find("Label").GetComponent <UILabel>()); } UIEventListener.Get(m__Icon.gameObject).onClick = OnClickDiscountGift; UIEventListener.Get(m__Model.gameObject).onDrag = DragModel; awardList = m_dataManager.m_dicSevenDay[6]; }
void OnBtnsClick(BtnType type) { switch (type) { case BtnType.None: break; case BtnType.btn_search: { if (!string.IsNullOrEmpty(m_input_Input.value)) { uint uid = 0; if (uint.TryParse(m_input_Input.value, out uid)) { DataManager.Instance.Sender.RequestSearchUserRelation(uid, ""); } else { DataManager.Instance.Sender.RequestSearchUserRelation(0, m_input_Input.value); } } else { if (!m_relationMgr.CheckRecommendList()) { DataManager.Instance.Sender.ReqRecomFriendList(); } } } break; default: break; } }
void onClick_Btn_sure_Btn(GameObject caster) { foreach (var item in m_toggles) { BtnType btntype = (BtnType)System.Enum.Parse(typeof(BtnType), item.name); if (m_dicChannelType.ContainsKey(btntype)) { if (item.value != m_chatManager.SimpleChannelContain(m_dicChannelType[btntype])) { m_chatManager.SetSimpleChannel(m_dicChannelType[btntype], item.value); } } } foreach (var item in m_autotoggles) { BtnType btntype = (BtnType)System.Enum.Parse(typeof(BtnType), item.name); if (m_dicChannelType.ContainsKey(btntype)) { if (item.value != m_chatManager.IsAutoPlayVoice(m_dicChannelType[btntype])) { m_chatManager.SetAutoPlayVoice(m_dicChannelType[btntype], item.value); } } } m_chatManager.SetAutoInLiuLiangPlay(IsLiuliangAuto); HideSelf(); }
public ActionButtonControl(string _Id, string _Title, BtnType _btnType, string _onClickEvent) { this.Id = _Id; this.Title = _Title; this.btnType = _btnType; this.onClickEvent = _onClickEvent; }
private static Image GetLeaveImage(BtnType type) { switch (type) { case BtnType.Encrypt: return(Properties.Resources.encrypt); case BtnType.Decrypt: return(Properties.Resources.decrypt); case BtnType.Clear: return(Properties.Resources.clear); case BtnType.About: return(Properties.Resources.about); case BtnType.Show: return(Properties.Resources.show); case BtnType.Hide: return(Properties.Resources.hide); } return(null); }
/// Нажатие кнопки сброса public void CE() { SetOperand(0); OperToRes(); fLastCommand = Command.None; fLastButton = BtnType.NoneB; fShowing = ShowNum.OperS; }
public Btn(BtnType type, rect rect, string text) { Type = type; Rect = rect; Image = null; Text = text; Pressed = false; Down = false; Enabled = true; }
public Btn(BtnType type, rect rect, Bitmap image) { Type = type; Rect = rect; Image = image; Text = null; Pressed = false; Down = false; Enabled = true; }
public void HideBtn(BtnType btnType) { if (m_btnOK != null) { m_btnOK.SetActive(btnType == BtnType.OKBTN); } if (m_btnYesNo != null) { m_btnYesNo.SetActive(btnType == BtnType.YESNOBTN); } }
void OnWelfareBtnUIEvent(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: if (data is UIWelfareTypeGrid) { UIWelfareTypeGrid grid = data as UIWelfareTypeGrid; //日期限制 if (grid.SevenDayIndex > m_dataManager.ServerOpenCurrDay) { return; } if (grid != null) { curType = BtnType.Content_1; OnToggleValueChange(grid.SevenDayIndex); if (activedType == null) { activedType = grid; } else { if (activedType != grid) { activedType.OnSevenDaySelect(false); } } grid.OnSevenDaySelect(true); activedType = grid; } } else if (data is UISevenDayRewardGrid) { UISevenDayRewardGrid grid = data as UISevenDayRewardGrid; List <uint> gotIDs = m_dataManager.m_lstServerOpenGotReward; uint curNum = m_dataManager.CurActiveNum; uint id = grid._UIItemRewardDatas.DataID; if (!gotIDs.Contains(id)) { for (int i = 0; i < awardList.Count; i++) { if (awardList[i].id == id && curNum >= awardList[i].param1) { DataManager.Instance.Sender.RequestGetServerOpenReward(id); } } } } break; } }
private void SetToggleContentLabel(uint nid, int nIndex) { m_nIndex = nIndex + 1; LocalTextType textType = (LocalTextType)System.Enum.Parse(typeof(LocalTextType), string.Format("Local_TXT_Welfare7Day_{0}", nid)); BtnType btnType = (BtnType)System.Enum.Parse(typeof(BtnType), string.Format("Content_{0}", m_nIndex)); if (m_dicLable.ContainsKey(btnType) && m_dicLable[btnType] != null) { m_dicLable[btnType].text = DataManager.Manager <TextManager>().GetLocalText(textType); } }
public static void Show(string message, Action okAction, Action cancelAction, BtnType btnType = BtnType.YESNOBTN, bool clickBackHide = false) { Hashtable hash = new Hashtable(); hash.Add("Message", message); hash.Add("OkAction", (Action)okAction); hash.Add("CancelAction", (Action)cancelAction); hash.Add("BtnType", btnType); hash.Add("ClickBackHide", clickBackHide); //GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_UI_SHOW_MESSAGEBOX, null, hash); GameCore.Instance.UIManager.ShowUI(UIConfig.UIMessageBox, UILayer.MessageUI, hash); }
void OnToggleValueChange(string channelName) { Log.LogGroup(GameDefine.LogGroup.User_ZCX, channelName); BtnType btntype = (BtnType)System.Enum.Parse(typeof(BtnType), channelName); if (btntype == BtnType.TabRed) { return; } CHATTYPE chatType = GetChatType(btntype); ResetChannel(chatType); }
private void SetBtnText() { if (mix_btn.InvokeRequired) { mix_btn.Invoke(new GlobalEvent.CallV_V(SetBtnText)); } else { btnType = BtnType.Install; SetMixBtnImage(btnType); ShowDownloadSpeed(""); } }
void OnContentToggleValueChange(BtnType type) { switch (type) { case BtnType.Content_1: case BtnType.Content_2: case BtnType.Content_3: case BtnType.Content_4: { if (type == BtnType.Content_1) { m_toggleContent1.value = true; } curType = type; m_lstCurrWelfare = null; if (m_dicSeventWelfare.ContainsKey(type)) { m_lstCurrWelfare = m_dicSeventWelfare[type]; m_lstCurrWelfare.Sort(); } if (m_lstCurrWelfare != null && m_lstCurrWelfare.Count > 0) { m_widget_RightContainer.enabled = false; if (m_lstCurrWelfare[0].nType == 10) //打折 { m_widget_GiftBagPanel.alpha = 1f; m_widget_LevelAndTimePanel.alpha = 0f; ResreshDiscountUI(); } else { m_widget_RightContainer.enabled = true; m_widget_GiftBagPanel.alpha = 0f; m_widget_LevelAndTimePanel.alpha = 1f; m_ctor_LevelAndTimeScrollView.CreateGrids(m_lstCurrWelfare.Count); } } } break; case BtnType.Max: break; default: break; } }
/// <summary> 設定Menu-Button </summary> /// <param name="i"></param> /// <param name="type"></param> public static void SetMenuButtonSetting(MVCxMenuItem i, BtnType type) { i.Text = GetButtonText(type); var image = GetButtonIcon(type); if (type == BtnType.Search) { i.Image.Url = image; } else { i.Image.IconID = image; } }
private void ShowMessageBox() { if (this.InvokeRequired) { this.Invoke(new GlobalEvent.CallV_V(ShowMessageBox)); } else { // MessageBox.Show(this, "检测到部分文件损坏,请重新下载", "警告", MessageBoxButtons.OK); btnType = BtnType.Update; mix_btn.Visible = true; mix_btn_Click(null, null); } }
/// <summary> 設定Button </summary> /// <param name="settings"></param> /// <param name="type"></param> public static void SetButtonSetting(ButtonSettings settings, BtnType type) { settings.Text = GetButtonText(type); var image = GetButtonIcon(type); if (type == BtnType.Search) { settings.Images.Image.Url = image; } else { settings.Images.Image.IconID = image; } }
public static void UpdateButtonImage(Button button, BtnType type, BtnState state) { switch (state) { default: case BtnState.Leave: SetButtonImage(button, GetLeaveImage(type)); break; case BtnState.Hovered: SetButtonImage(button, GetHoveredImage(type)); break; } }
private static string GetButtonText(BtnType type) { var value = string.Empty; switch (type) { case BtnType.Search: value = "查詢"; break; case BtnType.AddNew: value = "新增"; break; case BtnType.Reload: //value = Resources.Resource.BtnReload; break; case BtnType.Save: value = "儲存"; break; case BtnType.Cancel: value = "取消"; break; case BtnType.Delete: value = "刪除"; break; case BtnType.Filter: value = "篩選"; break; case BtnType.Confirm: value = "確認"; break; case BtnType.Edit: value = "編輯"; break; case BtnType.Import: value = "匯入"; break; } return(value); }
private static string GetButtonIcon(BtnType type) { var value = string.Empty; switch (type) { case BtnType.Search: value = "~/Content/Icon/Search.png"; break; case BtnType.AddNew: value = "actions_additem_16x16"; break; case BtnType.Reload: value = "actions_refresh2_16x16"; break; case BtnType.Save: value = "save_save_16x16office2013"; break; case BtnType.Cancel: value = "actions_cancel_16x16"; break; case BtnType.Delete: value = "actions_deletelist_16x16"; break; case BtnType.Filter: value = "filter_filter_16x16office2013"; break; case BtnType.Confirm: value = "actions_apply_16x16office2013"; break; case BtnType.Edit: value = "edit_edit_16x16office2013"; break; case BtnType.Import: value = "actions_download_16x16office2013"; break; } return(value); }
private void OnShow() { btnType = BtnType.Update; version_lab.Visible = start_btn.Visible = !GlobalData.isFirstUse; version_lab.Text = GlobalData.version; if (GlobalData.checkedUpdate) { updateinfo_lab.Text = ""; foreach (var item in GlobalData.updateText) { updateinfo_lab.Text += item; } } SetInfoControlVisible(false); Alpha(); }
CHATTYPE GetChatType(BtnType type) { switch (type) { case BtnType.None: break; case BtnType.TabWorld: return(CHATTYPE.CHAT_WORLD); case BtnType.TabTeam: { if (DataManager.Manager <TeamDataManager>().IsJoinTeam == true) { return(CHATTYPE.CHAT_TEAM); } else { return(CHATTYPE.CHAT_RECRUIT); } } case BtnType.TabClan: return(CHATTYPE.CHAT_CLAN); case BtnType.TabNear: return(CHATTYPE.CHAT_MAP); case BtnType.TabGhost: return(CHATTYPE.CHAT_DEMON); case BtnType.TabSystem: return(CHATTYPE.CHAT_SYS); case BtnType.Max: break; default: break; } return(CHATTYPE.CHAT_NONE); }