void setTreeParameters(DlgTreeParameters dlg) { if (tree != null) { tree.LexGlossGapAdjustment = dlg.LexGlossGap; tree.VerticalGap = dlg.VerticalGap; tree.HorizontalGap = dlg.HorizontalGap; tree.InitialXCoord = dlg.InitialXCoord; tree.InitialYCoord = dlg.InitialYCoord; tree.NTColor = dlg.NTColor; tree.NTFont = dlg.NTFont; tree.LexColor = dlg.LexColor; tree.LexFont = dlg.LexFont; tree.GlossColor = dlg.GlossColor; tree.GlossFont = dlg.GlossFont; tree.TrySmoothing = dlg.TrySmoothing; tree.TryPixelOffset = dlg.TryPixelOffset; tree.ShowFlatView = dlg.ShowFlatView; tree.BackgroundColor = dlg.TreeBackgroundColor; tree.LinesColor = dlg.TreeLinesColor; tree.LineWidth = dlg.TreeLineWidth; tree.CustomColors = dlg.CustomColors; #if TreeNotControl pnlTree.Invalidate(); // show the changes in the tree #else tree.Invalidate(); #endif setFontsInTreeDescription(); } }
void MenuTreeParametersOnClick(object obj, EventArgs ea) { DlgTreeParameters dlg = new DlgTreeParameters(); dlg.UseAsDefaults = m_bUseAsDefaults; dlg.LexGlossGap = tree.LexGlossGapAdjustment; dlg.VerticalGap = tree.VerticalGap; dlg.HorizontalGap = tree.HorizontalGap; dlg.InitialXCoord = tree.InitialXCoord; dlg.InitialYCoord = tree.InitialYCoord; dlg.NTColor = tree.NTColor; dlg.NTFont = tree.NTFont; dlg.LexColor = tree.LexColor; dlg.LexFont = tree.LexFont; dlg.GlossColor = tree.GlossColor; dlg.GlossFont = tree.GlossFont; dlg.TreeBackgroundColor = tree.BackgroundColor; dlg.TreeLinesColor = tree.LinesColor; dlg.TreeLineWidth = tree.LineWidth; dlg.CustomColors = tree.CustomColors; dlg.ShowFlatView = tree.ShowFlatView; dlg.TrySmoothing = tree.TrySmoothing; dlg.TryPixelOffset = tree.TryPixelOffset; while (dlg.ShowDialog() == DialogResult.Retry) ; if (dlg.DialogResult == DialogResult.OK) { setTreeParameters(dlg); m_bUseAsDefaults = dlg.UseAsDefaults; if (dlg.UseAsDefaults) { m_iLexGlossGapAdjustment = dlg.LexGlossGap; m_iVerticalGap = dlg.VerticalGap; m_iHorizontalGap = dlg.HorizontalGap; m_iInitialXCoord = dlg.InitialXCoord; m_iInitialYCoord = dlg.InitialYCoord; m_clrNTColor = dlg.NTColor; m_fntNTFont = dlg.NTFont; m_clrLexColor = dlg.LexColor; m_fntLexFont = dlg.LexFont; m_clrGlossColor = dlg.GlossColor; m_fntGlossFont = dlg.GlossFont; m_clrTreeBackgroundColor = dlg.TreeBackgroundColor; m_clrTreeLinesColor = dlg.TreeLinesColor; m_dTreeLineWidth = dlg.TreeLineWidth; m_aiCustomColors = dlg.CustomColors; m_bShowFlatView = dlg.ShowFlatView; m_bTrySmoothing = dlg.TrySmoothing; m_bTryPixelOffset = dlg.TryPixelOffset; } setIsDirty(true); } }