private void SetImageByMode(ImageButton button, TabMode targetMode, bool hidden, params TabMode[] modes) { foreach (TabMode mode in modes) { if (targetMode == mode) { if (button.Type == "update" && Version.NowVersion == updater.NewVersion) { break; } if (button.Type == "vercheck" && Version.NowVersion != updater.NewVersion) { break; } if (button.Type == "arrange" && !Status.Root) { break; } button.ViewMode = ImageButton.Mode.Visible; return; } } if (hidden) { button.ViewMode = ImageButton.Mode.Hidden; } else { button.ViewMode = ImageButton.Mode.Disable; } }
public DockingTabPage() { m_tabForm = new Form(); m_tabForm.FormClosing += new FormClosingEventHandler(tabForm_FormClosing); m_tabForm.ShowInTaskbar = false; m_tabMode = TabMode.Dock; }
/// <summary> /// 刷新组件可视状态 /// </summary> public void UpdateWidgetsVisbleStatus() { if (null != m_dic_ts) { Transform ts = null; bool visible = false; bool empty = IsMuhonListEmpty(); for (TabMode i = TabMode.None + 1; i < TabMode.Max; i++) { visible = (i == this.status) && !empty; if (m_dic_ts.TryGetValue(i, out ts) && ts.gameObject.activeSelf != visible) { ts.gameObject.SetActive(visible); } } UpdateCommonCostVisible(); if (null != m_trans_NullMuhonTipsContent && m_trans_NullMuhonTipsContent.gameObject.activeSelf != empty) { m_trans_NullMuhonTipsContent.gameObject.SetActive(empty); } } }
public PullApartTabPage() { /// normally vs2005 dose all this stuff for us, but since a tabpage doesn't have a nice /// viewable interface we have to do most of the construction by hand /// we will be using the same form over and over for simplicity myform = new Form(); /// prevent accidental closure myform.FormClosing += new FormClosingEventHandler(myform_FormClosing); /// we don't want all the separate windows appearing in the task bar myform.ShowInTaskbar = false; /// make the button we use to tell the app to dock/undock btnchangemode = new Button(); btnchangemode.Image = Resources.arrow; btnchangemode.Size = btnchangemode.Image.Size; btnchangemode.Click += new EventHandler(btnchangemode_Click); btnchangemode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; /// a studious observer will note that there is no btnchangemode.Location. /// see the code project article for an explanation Controls.Add(btnchangemode); mode = TabMode.Dock; this.SizeChanged += new EventHandler(PullApartTabPage_SizeChanged); this.ResizeRedraw = true; }
// ReSharper disable once InconsistentNaming // ReSharper disable once UnusedMember.Global public void OnGUI() { EditorContent.Space(); EditorContent.BeginObjectChanged(); _tabMode = (TabMode) EditorContent.Tab((int) _tabMode, "Create Preset", "Apply Preset"); if (EditorContent.IsObjectChanged()) { _gameObject = null; _enabledComponents.Clear(); _configurations.Clear(); _preset = null; } EditorContent.Space(); switch (_tabMode) { case TabMode.Save: CreatePresetLayout(); break; case TabMode.Restore: ApplyPresetLayout(); break; } }
protected override void OnJump(UIPanelBase.PanelJumpData jumpData) { base.OnJump(jumpData); if (jumpData != null) { if (jumpData.Param != null) { if (jumpData.Param is TabMode) { curMode = (TabMode)jumpData.Param; } } } else { CHATTYPE chatType = DataManager.Manager <ChatDataManager>().CurChatType; if (chatType == CHATTYPE.CHAT_WORLD) { curMode = TabMode.ShiJie; } else { curMode = TabMode.ShiZu; } } UIFrameManager.Instance.OnCilckTogglePanel(this.PanelId, 1, (int)curMode); ReqRefreshAllInfo(); }
/*private void MB_Studio_MdiChildActivate(object sender, EventArgs e) * { * if (ActiveMdiChild == null) * tabControl.Visible = false; * // If no any child form, hide tabControl * else * { * ActiveMdiChild.WindowState = FormWindowState.Maximized; * // Child form always maximized * * // If child form is new and no has tabPage, * // create new tabPage * if (ActiveMdiChild.Tag == null) * { * // Add a tabPage to tabControl with child * // form caption * TabPage tp = new TabPage(ActiveMdiChild.Text) * { * Tag = ActiveMdiChild, * Parent = tabControl * }; * tabControl.SelectedTab = tp; * * ActiveMdiChild.Tag = tp; * ActiveMdiChild.FormClosed += new FormClosedEventHandler(ActiveMdiChild_FormClosed); * } * * if (!tabControl.Visible) * tabControl.Visible = true; * } * }*/ private void AddNewTab(SpecialForm form, TabMode tabMode = TabMode.Default) { if (IsShownAsTab(form)) { tabControl.SelectedIndex = tabControl.TabPages.IndexOfKey(form.Name);//TabControlGetIndexOf(form.Text); return; } bool specialForm = false; TabPage tab = new TabPage(form.Text) { Name = form.Name,//is the same name good idea? //Parent = tabControl, }; Control[] ccc = form.Controls.Find("title_lbl", false); if (ccc.Length != 0) { specialForm = !specialForm; // true } tabControl.TabPages.Add(tab); form.TopLevel = false; form.Parent = tab; tabControl.SelectedTab = tab; tab.BackColor = form.BackColor;//check for problems with baseColor here tab.AutoScroll = true; if (!specialForm) { form.FormBorderStyle = FormBorderStyle.None; } else { form.Top = form.Top - ccc[0].Height; } if (tabMode != TabMode.Default) { if ((tabMode & TabMode.FillWidth) == TabMode.FillWidth) { form.Width = tab.Width; } if ((tabMode & TabMode.FillHeight) == TabMode.FillHeight) { form.Height = tab.Height; } } //else //{ // form.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; // form.Dock = DockStyle.Left; //} form.Visible = true; }
private void myform_FormClosing(object sender, FormClosingEventArgs e) { /// you don't want the user to close the undocked form then not be /// able to get to all the controls that were on the form. so cancel /// the close and dock the tabpage. this hides the form too. e.Cancel = true; TabMode = TabMode.Dock; }
public DockingTabPage(String title) { base.Text = title; m_tabForm = new Form(); m_tabForm.FormClosing += new FormClosingEventHandler(tabForm_FormClosing); m_tabForm.ShowInTaskbar = false; m_tabMode = TabMode.Dock; }
/// <summary> /// Initializes a new instance of the <see cref="TabBarStyle"/> class. /// </summary> public TabBarStyle() { this.font = Font.Default; this.alignment = Alignment.None; this.mode = TabMode.AutoSize; this.hoverColour = Colours.Blue; this.selectColour = Colours.Red; this.foregroundColour = Colours.Black; }
private void OnEnable() { m_TabMode = (TabMode)EditorPrefs.GetInt("TabMode", (int)TabMode.BuildProject); foreach (var item in m_SubWindows) { item.OnEnable(); } }
public static void WriteText(string text, int width, int tab, TabMode mode) { text = text.Replace("\r", ""); string[] lines = text.Split(new char[] { '\n' }); foreach (string line in lines) { WriteLine(line, width, tab, mode); } }
void OnDiscardPet() {//宠物为0 if (CurPet == null) { TabMode subFlag = TabMode.TuJian; UIFrameManager.Instance.OnCilckTogglePanel(PanelID.PetPanel, 1, (int)subFlag); return; } }
private void SetActiveFirstTab(TabMode type, bool force = false) { if (memActiveFirstTab == type && !force) { return; } this.memActiveFirstTab = type; this.mActiveSecondTab = 0; CreateTab(); }
bool ShowRightBtnContent(TabMode flag) { //if (CurPet == null) //{ // flag = PetPanelSubFlag.Tujian; //} int index = (int)flag; if (!IsPetOpen()) { if (flag != TabMode.TuJian) { return(false); } } m_nLastToggleIndex = m_nRightToggleIndex; m_nRightToggleIndex = index; var iter = m_dicContent.GetEnumerator(); while (iter.MoveNext()) { if (iter.Current.Key == (int)index) { iter.Current.Value.gameObject.SetActive(true); } else { iter.Current.Value.gameObject.SetActive(false); } } if (flag == TabMode.TuJian) { InitTujian(); m_widget_leftcontent.gameObject.SetActive(false); } else { m_widget_leftcontent.gameObject.SetActive(true); } if (flag == TabMode.ShuXing) { onClick_BaseProp_Btn(m_trans_BaseProp.gameObject); } else if (flag == TabMode.ChuanCheng) { InitInHerit(); } InitSliderData(); m_nRightToggleIndex = (int)flag; return(true); }
/// <summary> /// 设置初始化状态 /// </summary> /// <param name="status"></param> /// <param name="init"></param> public void SetInitStatus(TabMode status, bool init) { if (init) { m_int_modeInitMask |= (1 << (int)status); } else { m_int_modeInitMask &= (~(1 << (int)status)); } }
public override bool OnTogglePanel(int tabType, int pageid) { base.OnTogglePanel(tabType, pageid); TabMode subFlag = (TabMode)pageid; if (subFlag == TabMode.ShuXing) { InitRenderTextureObj(); } return(ShowRightBtnContent(subFlag)); }
/// <summary> /// Creates an entity-UI setup object. /// </summary> /// <param name="navActions">The navigational action components</param> /// <param name="navFormControls">The navigational form controls</param> /// <param name="actions">The action components</param> /// <param name="entitySummaryContent">Pass a value to include an entity summary in the UI.</param> /// <param name="tabMode">The tab mode</param> public EntityUiSetup( IReadOnlyCollection <ActionComponentSetup> navActions = null, IReadOnlyCollection <NavFormControl> navFormControls = null, IReadOnlyCollection <ActionComponentSetup> actions = null, IReadOnlyCollection <FlowComponent> entitySummaryContent = null, TabMode tabMode = TabMode.Automatic) { NavActions = navActions ?? Enumerable.Empty <ActionComponentSetup>().Materialize(); NavFormControls = navFormControls ?? Enumerable.Empty <NavFormControl>().Materialize(); Actions = actions ?? Enumerable.Empty <ActionComponentSetup>().Materialize(); EntitySummaryContent = entitySummaryContent; this.tabMode = tabMode; }
private void btnchangemode_Click(object sender, EventArgs e) { if (TabMode == TabMode.Dock) { TabMode = TabMode.Float; } else { TabMode = TabMode.Dock; } }
private void SetTabMode(TabButton button, TabMode targetMode, params TabMode[] modes) { foreach (TabMode mode in modes) { if (targetMode == mode) { button.ViewMode = TabButton.Mode.Clickable; return; } } button.ViewMode = TabButton.Mode.Hidden; }
private void OnGUI() { using (new EditorGUILayout.VerticalScope()) { using (new EditorGUILayout.HorizontalScope()) { m_TabMode = (TabMode)GUILayout.Toolbar((int)m_TabMode, Enum.GetNames(typeof(TabMode))); } GUILayout.Space(10); m_SubWindows[(int)m_TabMode].OnGUI(); } }
public override bool OnTogglePanel(int tabType, int pageid) { curMode = (TabMode)pageid; if (curMode == TabMode.ShiZu) { if (!DataManager.Manager <ClanManger>().IsJoinFormal) { TipsManager.Instance.ShowTips(LocalTextType.Red_Tips_nihaimeiyoujiarushizu); // return false; } } RefreshScrollView(); return(base.OnTogglePanel(tabType, pageid)); }
/// <summary> /// 更新功能toggle可视状态 /// </summary> private void UpdateMuhonToggleVisible() { UITabGrid tabGrid = null; bool visible = false; for (TabMode i = TabMode.ShengJi; i < TabMode.Max; i++) { visible = IsStatus(i); if (null != m_dic_tabs && m_dic_tabs.TryGetValue(i, out tabGrid)) { tabGrid.SetHightLight(visible); } } }
public void SetTab(TabMode mode) { foreach (Panel panel in allPanels) { panel.SetActive(false); if (panel.Mode == current) { panel.OnExit(); } if (panel.Mode == mode) { panel.OnEnter(); panel.SetActive(true); } } this.current = mode; }
/// Changes all of the tabs in the provided text into the specified format public static string NormalizeTabs(string textToFix, TabMode tabMode) { //Perform the final transformation switch (tabMode) { case TabMode.tabs: textToFix = textToFix.Replace(" ", "\t"); break; case TabMode.spaces: textToFix = textToFix.Replace("\t", " "); break; } //Return the result return(textToFix); }
protected override void OnJump(UIPanelBase.PanelJumpData jumpData) { base.OnJump(jumpData); if (null != mFirstJumpData) { mFirstJumpData = GetPanelData().JumpData; mFirstJumpData.IsBackspacing = true; } if (null == jumpData) { jumpData = new PanelJumpData(); } int firstTabData = -1; int secondTabData = -1; if (null != jumpData.Tabs && jumpData.Tabs.Length > 0) { firstTabData = jumpData.Tabs[0]; } else { firstTabData = (int)TabMode.JinBi; } memActiveFirstTab = TabMode.None; UIFrameManager.Instance.OnCilckTogglePanel(this.PanelId, 1, firstTabData); if (null != jumpData.Tabs && jumpData.Tabs.Length > 1) { SetActiveTab(jumpData.Tabs[1], true, true); } if (jumpData.IsBackspacing && null != jumpData.ExtParam && jumpData.ExtParam is int) { purchaseNum = (int)jumpData.ExtParam; } if (null != jumpData.Param && jumpData.Param is uint) { SetSelectItemId((uint)jumpData.Param, true, true, jumpData.IsBackspacing); } mBSecondJump = (null != mFirstJumpData); if (null == mFirstJumpData) { mFirstJumpData = GetPanelData().JumpData; mFirstJumpData.IsBackspacing = true; } }
void UpdateWidgetState(TabMode tab, byte pageindex) { if (tab == TabMode.TAB_BUY) { redeemBtn.Hide(true); buyBtn.Hide(false); sellBtn.Hide(false); } else if (tab == TabMode.TAB_REDEEM) { redeemBtn.Hide(false); buyBtn.Hide(true); sellBtn.Hide(true); } prePageBtn.controlIsEnabled = false; nextPageBtn.controlIsEnabled = false; pageNumText.Text = pageIndex.ToString(); }
public override bool OnTogglePanel(int nTabType, int pageid) { if (nTabType == UIPanelBase.FisrstTabsIndex) { TabMode type = (TabMode)pageid; if (type == TabMode.MaJiu) { if (m_rideMgr.GetRideList().Count <= 0) { TipsManager.Instance.ShowTips(LocalTextType.Ride_Commond_nihaimeiyouzuoqibunengdakaizuoqijiemian); return(false); } } m_curMode = type; ToggleRideContent(type, false); } return(base.OnTogglePanel(nTabType, pageid)); }
public void AddTab(string text, string name, int ImageIndex) { Tabs.Add(new TabContent(text, name, ImageIndex)); tabControl.TabPages.Add(name); editor1.ReadOnly = false; editor2.ReadOnly = false; if (tabControl.TabPages.Count == 1) { EndEditorHandle(); TabMode = Tabs[0].TabMode; editor1.Text = text; editor1.ClearUndo(); currentTab = name; currentTabSaved = true; tabControl.Visible = true; BeginEditorHandle(); line2.Hide(); } }
void ButtonManagement(TabMode tm) { foreach (Control c in this.Controls) { if (c.GetType() == typeof(Button)) { c.Enabled = true; } } switch (tm) { case TabMode.Nothin: btn_create.Enabled = btn_delete.Enabled = btn_update.Enabled = false; break; case TabMode.Create: btn_create.Enabled = btn_delete.Enabled = false; break; case TabMode.Update: btn_update.Enabled = btn_delete.Enabled = false; break; case TabMode.Delete: btn_create.Enabled = btn_update.Enabled = false; break; } }
private void SetTabMode(string tag) { switch (tag) { case "season": Tab = TabMode.Season; break; case "archive": Tab = TabMode.Archive; break; case "noti": Tab = TabMode.Notification; UpdateNotifyTime(); break; default: Tab = TabMode.Setting; break; } }
void InitWidgets() { imgr = DataManager.Manager <ItemManager>(); emgr = DataManager.Manager <EquipManager>(); tmgr = DataManager.Manager <TextManager>(); Transform ts = null; m_dic_tabs = new Dictionary <TabMode, UITabGrid>(); m_dic_ts = new Dictionary <TabMode, Transform>(); if (null != m_trans_FunctionConent) { for (TabMode i = TabMode.None + 1; i < TabMode.Max; i++) { ts = m_trans_FunctionConent.Find(i.ToString()); if (null != ts) { m_dic_ts.Add(i, ts); } } } InitDataListWiget(); SetStatus(TabMode.ShengJi); }
public void SwitchMode() { if (TabMode == TabMode.Dock) TabMode = TabMode.Float; else TabMode = TabMode.Dock; }
private void tabForm_FormClosing(object sender, FormClosingEventArgs e) { /// you don't want the user to close the undocked form then not be /// able to get to all the controls that were on the form. so cancel /// the close and dock the tabpage. this hides the form too. e.Cancel = true; TabMode = TabMode.Dock; }
public void SelectTabText(string name) { EndEditorHandle(); foreach (TabContent t in Tabs) { if (t.Name == currentTab) { t.TabMode = TabMode; t.Text = editor1.Text; t.Saved = currentTabSaved; t.XScroll1 = editor1.HorizontalScroll.Value; t.YScroll1 = editor1.VerticalScroll.Value; t.XScroll2 = editor2.HorizontalScroll.Value; t.YScroll2 = editor2.VerticalScroll.Value; } } foreach (TabContent t in Tabs) { if (t.Name == name) { TabMode = t.TabMode; //suppressHighlight = true; editor1.Text = t.Text; //suppressHighlight = false; currentTabSaved = t.Saved; //Scroll position if (t.XScroll1 < editor1.HorizontalScroll.Maximum + 1) editor1.HorizontalScroll.Value = t.XScroll1; else editor1.HorizontalScroll.Value = editor1.HorizontalScroll.Maximum; if (t.YScroll1 < editor1.VerticalScroll.Maximum + 1) editor1.VerticalScroll.Value = t.YScroll1; else editor1.VerticalScroll.Value = editor1.VerticalScroll.Maximum; if (t.XScroll2 < editor2.HorizontalScroll.Maximum + 1) editor2.HorizontalScroll.Value = t.XScroll2; else editor2.HorizontalScroll.Value = editor2.HorizontalScroll.Maximum; if (t.YScroll2 < editor2.VerticalScroll.Maximum + 1) editor2.VerticalScroll.Value = t.YScroll2; else editor2.VerticalScroll.Value = editor2.VerticalScroll.Maximum; editor1.UpdateScrollbars(); editor2.UpdateScrollbars(); } } currentTab = name; BeginEditorHandle(); }
private bool entityUsesTabMode( TabMode tabMode ) { var entitySetupInfo = EwfPage.Instance.InfoAsBaseType.EsInfoAsBaseType; return entitySetupInfo != null && EwfPage.Instance.InfoAsBaseType.ParentResource == null && entitySetupInfo.GetTabMode() == tabMode; }