private void UpdateCell(KryptonWorkspaceCell cell) { NavigatorMode newMode = NavigatorMode.BarTabGroup; if (checkSetDocMode.CheckedButton == buttonTabs) newMode = NavigatorMode.BarTabGroup; else if (checkSetDocMode.CheckedButton == buttonRibbonTabs) newMode = NavigatorMode.BarRibbonTabGroup; else if (checkSetDocMode.CheckedButton == buttonCheckButtons) newMode = NavigatorMode.BarCheckButtonGroupOutside; else if (checkSetDocMode.CheckedButton == buttonHeaderGroup) newMode = NavigatorMode.HeaderGroup; else if (checkSetDocMode.CheckedButton == buttonHeaderBar) newMode = NavigatorMode.HeaderBarCheckButtonHeaderGroup; else if (checkSetDocMode.CheckedButton == buttonStack) newMode = NavigatorMode.StackCheckButtonGroup; cell.NavigatorMode = newMode; // Set mode specific properties switch (newMode) { case NavigatorMode.BarRibbonTabGroup: case NavigatorMode.BarRibbonTabOnly: cell.PageBackStyle = PaletteBackStyle.ControlRibbon; cell.Group.GroupBackStyle = PaletteBackStyle.ControlRibbon; cell.Group.GroupBorderStyle = PaletteBorderStyle.ControlRibbon; break; default: cell.PageBackStyle = PaletteBackStyle.ControlClient; cell.Group.GroupBackStyle = PaletteBackStyle.ControlClient; cell.Group.GroupBorderStyle = PaletteBorderStyle.ControlClient; break; } }
private void UpdateRadioButtonsFromMode() { // Grab the current mode of the navigator control NavigatorMode mode = kryptonNavigator1.NavigatorMode; // Update buttons to reflect the mode radioBarTabGroup.Checked = (mode == NavigatorMode.BarTabGroup); radioBarTabOnly.Checked = (mode == NavigatorMode.BarTabOnly); radioBarRibbonTabGroup.Checked = (mode == NavigatorMode.BarRibbonTabGroup); radioBarRibbonTabOnly.Checked = (mode == NavigatorMode.BarRibbonTabOnly); radioBarCheckButtonGroupInside.Checked = (mode == NavigatorMode.BarCheckButtonGroupInside); radioBarCheckButtonGroupOutside.Checked = (mode == NavigatorMode.BarCheckButtonGroupOutside); radioBarCheckButtonGroupOnly.Checked = (mode == NavigatorMode.BarCheckButtonGroupOnly); radioBarCheckButtonOnly.Checked = (mode == NavigatorMode.BarCheckButtonOnly); radioHeaderBarCheckButtonGroup.Checked = (mode == NavigatorMode.HeaderBarCheckButtonGroup); radioHeaderBarCheckButtonHeaderGroup.Checked = (mode == NavigatorMode.HeaderBarCheckButtonHeaderGroup); radioHeaderBarCheckButtonOnly.Checked = (mode == NavigatorMode.HeaderBarCheckButtonOnly); radioStackCheckButtonGroup.Checked = (mode == NavigatorMode.StackCheckButtonGroup); radioStackCheckButtonHeaderGroup.Checked = (mode == NavigatorMode.StackCheckButtonHeaderGroup); radioOutlookFull.Checked = (mode == NavigatorMode.OutlookFull); radioOutlookMini.Checked = (mode == NavigatorMode.OutlookMini); radioHeaderGroup.Checked = (mode == NavigatorMode.HeaderGroup); radioGroup.Checked = (mode == NavigatorMode.Group); radioPanel.Checked = (mode == NavigatorMode.Panel); // Update the description with text for the mode textBoxDescription.Text = _lookup[mode]; }
private void radioMode_CheckedChanged(object sender, EventArgs e) { NavigatorMode mode = _mode; // Work out the new mode we want if (radioBarTabGroup.Checked) { mode = NavigatorMode.BarTabGroup; } else if (radioBarRibbonTabGroup.Checked) { mode = NavigatorMode.BarRibbonTabGroup; } else if (radioBarCheckButtonGroupInside.Checked) { mode = NavigatorMode.BarCheckButtonGroupInside; } else if (radioBarCheckButtonGroupOutside.Checked) { mode = NavigatorMode.BarCheckButtonGroupOutside; } else if (radioHeaderBarCheckButtonGroup.Checked) { mode = NavigatorMode.HeaderBarCheckButtonGroup; } else if (radioHeaderBarCheckButtonHeaderGroup.Checked) { mode = NavigatorMode.HeaderBarCheckButtonHeaderGroup; } else if (radioStackCheckButtonGroup.Checked) { mode = NavigatorMode.StackCheckButtonGroup; } else if (radioStackCheckButtonHeaderGroup.Checked) { mode = NavigatorMode.StackCheckButtonHeaderGroup; } else if (radioOutlookFull.Checked) { mode = NavigatorMode.OutlookFull; } else if (radioOutlookMini.Checked) { mode = NavigatorMode.OutlookMini; } else if (radioHeaderGroup.Checked) { mode = NavigatorMode.HeaderGroup; } else if (radioGroup.Checked) { mode = NavigatorMode.Group; } else if (radioPanel.Checked) { mode = NavigatorMode.Panel; } UpdateCellMode(mode); }
private void buttonGrouping_Click(object sender, EventArgs e) { // Cache the new mode setting KryptonRibbonGroupButton button = (KryptonRibbonGroupButton)sender; _cellMode = (NavigatorMode)Enum.Parse(typeof(NavigatorMode), (string)button.Tag); UpdateCellsFromGrouping(); UpdateButtonsFromGrouping(); }
private void kryptonRibbonModeButton_Click(object sender, EventArgs e) { // Extract the navigator mode from the tag field of the ribbon button KryptonRibbonGroupButton button = (KryptonRibbonGroupButton)sender; _mode = (NavigatorMode)Enum.Parse(typeof(NavigatorMode), (string)button.Tag); UpdateModeButtons(); UpdateAllCells(); }
public MemoEditorForm() { InitializeComponent(); _paletteButtons = new KryptonRibbonGroupButton[] { button2010Blue, button2010Silver, button2010Black, button2007Blue, button2007Silver, button2007Black, buttonSparkleBlue, buttonSparkleOrange, buttonSparklePurple, buttonSystem, button2003 }; _groupingButtons = new KryptonRibbonGroupButton[] { buttonTabs, buttonRibbonTabs, buttonButtons, buttonHeader, buttonHeaderButtons, buttonStack }; _cellMode = NavigatorMode.BarTabGroup; }
private void UpdateCellMode(NavigatorMode mode) { // Cache new mode _mode = mode; // Update all existing cells with new mode KryptonWorkspaceCell cell = kryptonWorkspace.FirstCell(); while (cell != null) { cell.NavigatorMode = _mode; cell = kryptonWorkspace.NextCell(cell); } }
public MemoEditorForm() { InitializeComponent(); _paletteButtons = new KryptonRibbonGroupButton[]{button2010Blue, button2010Silver, button2010Black, button2007Blue, button2007Silver, button2007Black, buttonSparkleBlue, buttonSparkleOrange, buttonSparklePurple, buttonSystem, button2003}; _groupingButtons = new KryptonRibbonGroupButton[]{buttonTabs, buttonRibbonTabs, buttonButtons, buttonHeader, buttonHeaderButtons, buttonStack}; _cellMode = NavigatorMode.BarTabGroup; }
/// <summary> /// Create a new view builder appropriate for the provided mode. /// </summary> /// <param name="mode">Navigator mode of operation.</param> /// <returns>ViewBuild appropriate for mode.</returns> public static ViewBuilderBase CreateViewBuilder(NavigatorMode mode) { switch (mode) { case NavigatorMode.BarTabGroup: return(new ViewBuilderBarTabGroup()); case NavigatorMode.BarTabOnly: return(new ViewBuilderBarTabOnly()); case NavigatorMode.BarRibbonTabGroup: return(new ViewBuilderBarRibbonTabGroup()); case NavigatorMode.BarRibbonTabOnly: return(new ViewBuilderBarRibbonTabOnly()); case NavigatorMode.BarCheckButtonOnly: return(new ViewBuilderBarCheckButtonOnly()); case NavigatorMode.BarCheckButtonGroupOnly: return(new ViewBuilderBarCheckButtonGroupOnly()); case NavigatorMode.BarCheckButtonGroupInside: return(new ViewBuilderBarCheckButtonGroupInside()); case NavigatorMode.BarCheckButtonGroupOutside: return(new ViewBuilderBarCheckButtonGroupOutside()); case NavigatorMode.StackCheckButtonGroup: return(new ViewBuilderStackCheckButtonGroup()); case NavigatorMode.StackCheckButtonHeaderGroup: return(new ViewBuilderStackCheckButtonHeaderGroup()); case NavigatorMode.HeaderGroupTab: return(new ViewBuilderHeaderBarTabGroup()); case NavigatorMode.HeaderBarCheckButtonOnly: return(new ViewBuilderHeaderBarCheckButtonOnly()); case NavigatorMode.HeaderBarCheckButtonGroup: return(new ViewBuilderHeaderBarCheckButtonGroup()); case NavigatorMode.HeaderBarCheckButtonHeaderGroup: return(new ViewBuilderHeaderBarCheckButtonHeaderGroup()); case NavigatorMode.OutlookFull: return(new ViewBuilderOutlookFull()); case NavigatorMode.OutlookMini: return(new ViewBuilderOutlookMini()); case NavigatorMode.HeaderGroup: return(new ViewBuilderHeaderGroup()); case NavigatorMode.Group: return(new ViewBuilderGroup()); case NavigatorMode.Panel: return(new ViewBuilderPanel()); default: // Should never happen! Debug.Assert(false); throw new ArgumentOutOfRangeException(nameof(mode)); } }
private void MemoEditorForm1_Load(object sender, EventArgs e) { // Try and open the saved settings for memo editor RegistryKey memoEditorSettings = Registry.CurrentUser.OpenSubKey(_memoEditorPath); if (memoEditorSettings != null) { try { // Look for each of the maximum number of entries for (int i = 1; i <= _maxRecentDocs; i++) { // If we managed to get an entry string filename = memoEditorSettings.GetValue(i.ToString()) as string; if (!string.IsNullOrEmpty(filename)) { KryptonRibbonRecentDoc recentDoc = new KryptonRibbonRecentDoc(); recentDoc.Click += new EventHandler(buttonRecentFile_Clicked); recentDoc.Text = filename; // Add to end of the recent docs collection kryptonRibbon.RibbonAppButton.AppButtonRecentDocs.Add(recentDoc); } } } catch { }; try { // Restore the global palette selected previously string globalPalette = memoEditorSettings.GetValue("GlobalPalette") as string; if (!string.IsNullOrEmpty(globalPalette)) { kryptonManager.GlobalPaletteMode = (PaletteModeManager)Enum.Parse(typeof(PaletteModeManager), globalPalette); } // Restore the cell mode selected previously string cellMode = memoEditorSettings.GetValue("CellMode") as string; if (!string.IsNullOrEmpty(cellMode)) { _cellMode = (NavigatorMode)Enum.Parse(typeof(NavigatorMode), cellMode); } } catch { }; memoEditorSettings.Close(); } // Add the three predefined memos as content buttonReadMe_Click(null, EventArgs.Empty); buttonShortcuts_Click(null, EventArgs.Empty); buttonPersistence_Click(null, EventArgs.Empty); // Organize them buttonGridArrange_Click(null, EventArgs.Empty); // Make the first cell the selected one kryptonWorkspace.ActiveCell = kryptonWorkspace.FirstCell(); UpdateCellsFromGrouping(); UpdateButtonsFromGrouping(); UpdateButtonsFromPalette(); UpdateApplicationTitle(); UpdateOptions(); }
private void UpdateModeFromRadioButtons() { NavigatorMode mode = NavigatorMode.BarTabGroup; // Work out the new mode we want if (radioBarTabGroup.Checked) { mode = NavigatorMode.BarTabGroup; } else if (radioBarTabOnly.Checked) { mode = NavigatorMode.BarTabOnly; } else if (radioBarRibbonTabGroup.Checked) { mode = NavigatorMode.BarRibbonTabGroup; } else if (radioBarRibbonTabOnly.Checked) { mode = NavigatorMode.BarRibbonTabOnly; } else if (radioBarCheckButtonGroupInside.Checked) { mode = NavigatorMode.BarCheckButtonGroupInside; } else if (radioBarCheckButtonGroupOutside.Checked) { mode = NavigatorMode.BarCheckButtonGroupOutside; } else if (radioBarCheckButtonGroupOnly.Checked) { mode = NavigatorMode.BarCheckButtonGroupOnly; } else if (radioBarCheckButtonOnly.Checked) { mode = NavigatorMode.BarCheckButtonOnly; } else if (radioHeaderBarCheckButtonGroup.Checked) { mode = NavigatorMode.HeaderBarCheckButtonGroup; } else if (radioHeaderBarCheckButtonHeaderGroup.Checked) { mode = NavigatorMode.HeaderBarCheckButtonHeaderGroup; } else if (radioHeaderBarCheckButtonOnly.Checked) { mode = NavigatorMode.HeaderBarCheckButtonOnly; } else if (radioStackCheckButtonGroup.Checked) { mode = NavigatorMode.StackCheckButtonGroup; } else if (radioStackCheckButtonHeaderGroup.Checked) { mode = NavigatorMode.StackCheckButtonHeaderGroup; } else if (radioOutlookFull.Checked) { mode = NavigatorMode.OutlookFull; } else if (radioOutlookMini.Checked) { mode = NavigatorMode.OutlookMini; } else if (radioHeaderGroup.Checked) { mode = NavigatorMode.HeaderGroup; } else if (radioHeaderGroupTab.Checked) { mode = NavigatorMode.HeaderGroupTab; } else if (radioGroup.Checked) { mode = NavigatorMode.Group; } else if (radioPanel.Checked) { mode = NavigatorMode.Panel; } // Set the mode into the navigator itself kryptonNavigator1.NavigatorMode = mode; // Set the AutoSize to show that tabstrip functionality works switch (mode) { case NavigatorMode.BarCheckButtonGroupOnly: case NavigatorMode.BarCheckButtonOnly: case NavigatorMode.BarTabOnly: case NavigatorMode.HeaderBarCheckButtonOnly: case NavigatorMode.OutlookMini: kryptonNavigator1.AutoSize = true; break; default: kryptonNavigator1.AutoSize = false; break; } // Set mode specific properties switch (mode) { case NavigatorMode.BarRibbonTabGroup: case NavigatorMode.BarRibbonTabOnly: kryptonNavigator1.PageBackStyle = PaletteBackStyle.ControlRibbon; kryptonNavigator1.Group.GroupBackStyle = PaletteBackStyle.ControlRibbon; kryptonNavigator1.Group.GroupBorderStyle = PaletteBorderStyle.ControlRibbon; break; default: kryptonNavigator1.PageBackStyle = PaletteBackStyle.ControlClient; kryptonNavigator1.Group.GroupBackStyle = PaletteBackStyle.ControlClient; kryptonNavigator1.Group.GroupBorderStyle = PaletteBorderStyle.ControlClient; break; } kryptonNavigator1.Dock = (mode == NavigatorMode.OutlookMini ? DockStyle.Left : DockStyle.Top); // Update the radio buttons to reflect the new mode UpdateRadioButtonsFromMode(); }
private void UpdateCellMode(NavigatorMode mode) { // Cache new mode _mode = mode; // Update all existing cells with new mode KryptonWorkspaceCell cell = kryptonWorkspace.FirstCell(); while (cell != null) { cell.NavigatorMode = _mode; cell = kryptonWorkspace.NextCell(cell); } }
private void AssignDefaultFields() { // Assign the default values _mode = NavigatorMode.BarTabGroup; _pageBackStyle = PaletteBackStyle.ControlClient; _allowPageReorder = true; _allowTabFocus = true; _allowTabSelect = true; _useMnemonic = true; }
private void kryptonRibbonModeButton_Click(object sender, EventArgs e) { // Extract the navigator mode from the tag field of the ribbon button KryptonRibbonGroupButton button = (KryptonRibbonGroupButton)sender; _mode = (NavigatorMode)Enum.Parse(typeof(NavigatorMode), (string)button.Tag); UpdateModeButtons(); UpdateAllCells(); }
private void MemoEditorForm1_Load(object sender, EventArgs e) { // Try and open the saved settings for memo editor RegistryKey memoEditorSettings = Registry.CurrentUser.OpenSubKey(_memoEditorPath); if (memoEditorSettings != null) { try { // Look for each of the maximum number of entries for (int i = 1; i <= _maxRecentDocs; i++) { // If we managed to get an entry string filename = memoEditorSettings.GetValue(i.ToString()) as string; if (!string.IsNullOrEmpty(filename)) { KryptonRibbonRecentDoc recentDoc = new KryptonRibbonRecentDoc(); recentDoc.Click += new EventHandler(buttonRecentFile_Clicked); recentDoc.Text = filename; // Add to end of the recent docs collection kryptonRibbon.RibbonAppButton.AppButtonRecentDocs.Add(recentDoc); } } } catch { }; try { // Restore the global palette selected previously string globalPalette = memoEditorSettings.GetValue("GlobalPalette") as string; if (!string.IsNullOrEmpty(globalPalette)) kryptonManager.GlobalPaletteMode = (PaletteModeManager)Enum.Parse(typeof(PaletteModeManager), globalPalette); // Restore the cell mode selected previously string cellMode = memoEditorSettings.GetValue("CellMode") as string; if (!string.IsNullOrEmpty(cellMode)) _cellMode = (NavigatorMode)Enum.Parse(typeof(NavigatorMode), cellMode); } catch { }; memoEditorSettings.Close(); } // Add the three predefined memos as content buttonReadMe_Click(null, EventArgs.Empty); buttonShortcuts_Click(null, EventArgs.Empty); buttonPersistence_Click(null, EventArgs.Empty); // Organize them buttonGridArrange_Click(null, EventArgs.Empty); // Make the first cell the selected one kryptonWorkspace.ActiveCell = kryptonWorkspace.FirstCell(); UpdateCellsFromGrouping(); UpdateButtonsFromGrouping(); UpdateButtonsFromPalette(); UpdateApplicationTitle(); UpdateOptions(); }
private void buttonGrouping_Click(object sender, EventArgs e) { // Cache the new mode setting KryptonRibbonGroupButton button = (KryptonRibbonGroupButton)sender; _cellMode = (NavigatorMode)Enum.Parse(typeof(NavigatorMode), (string)button.Tag); UpdateCellsFromGrouping(); UpdateButtonsFromGrouping(); }