2
// <copyright see="prj:///doc/copyright.txt"/>
3
// <license see="prj:///doc/license.txt"/>
4
// <owner name="Oakland Software Incorporated" email="general@oaklandsoftware.com"/>
5
// <version>$Revision$</version>
10
using System.Windows.Forms;
12
using ICSharpCode.Core;
13
using NoGoop.Controls;
15
namespace NoGoop.ObjBrowser.Panels
17
internal class CustObjectPanel : Panel, ICustPanel
19
protected CheckBox _showPropMethCheck;
20
protected CheckBox _showFieldsCheck;
21
protected CheckBox _showPropertiesCheck;
22
protected CheckBox _showMethodsCheck;
23
protected CheckBox _showEventsCheck;
24
protected CheckBox _showBaseClassesCheck;
25
protected CheckBox _showPublicOnlyCheck;
26
protected CheckBox _showBaseClassNamesCheck;
27
protected CheckBox _showMemberCategoriesCheck;
28
protected CheckBox _showObjectAsBaseCheck;
29
protected CheckBox _showBaseCategoriesCheck;
30
protected CheckBox _hexDisplayCheck;
31
protected TextBox _showCategoriesCount;
33
protected Panel _showCatCountPanel;
35
protected const int FIELD_WIDTH = 270;
37
internal CustObjectPanel()
42
Text = StringParser.Parse("${res:ComponentInspector.InspectorMenu.ObjectTreeOptionsPanel.Title}");
46
panel.Dock = DockStyle.Top;
50
_hexDisplayCheck = new CheckBox();
51
_hexDisplayCheck.Location = new Point(10, 0);
52
_hexDisplayCheck.Width = FIELD_WIDTH;
53
_hexDisplayCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.DisplayIntegersInHexCheckBox}");
54
panel.Controls.Add(_hexDisplayCheck);
56
_showBaseClassNamesCheck = new CheckBox();
57
_showBaseClassNamesCheck.Location = new Point(10, 20);
58
_showBaseClassNamesCheck.Width = FIELD_WIDTH;
59
_showBaseClassNamesCheck.Text = StringParser.Parse("${res:ComponentInspector.CustomObjectPanel.ShowBaseClassNamesCheckBox}");
60
panel.Controls.Add(_showBaseClassNamesCheck);
63
l.Dock = DockStyle.Top;
64
l.Text = StringParser.Parse("${res:ComponentInspector.CustomObjectPanel.OtherLabel}");
71
panel.Dock = DockStyle.Top;
75
_showMemberCategoriesCheck = new CheckBox();
76
_showMemberCategoriesCheck.Location = new Point(10, 0);
77
_showMemberCategoriesCheck.Width = FIELD_WIDTH;
78
_showMemberCategoriesCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowMemberCategoriesCheckBox}");
79
_showMemberCategoriesCheck.Click += new EventHandler(ShowCatClicked);
80
panel.Controls.Add(_showMemberCategoriesCheck);
82
_showBaseCategoriesCheck = new CheckBox();
83
_showBaseCategoriesCheck.Location = new Point(10, 20);
84
_showBaseCategoriesCheck.Width = FIELD_WIDTH;
85
_showBaseCategoriesCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowBaseClassCategoryCheckBox}");
86
_showBaseCategoriesCheck.Click += new EventHandler(ShowCatClicked);
87
panel.Controls.Add(_showBaseCategoriesCheck);
89
_showCatCountPanel = new Panel();
90
_showCatCountPanel.Location = new Point(27, 45);
91
_showCatCountPanel.Width = FIELD_WIDTH;
92
_showCategoriesCount = new NumericTextBox();
93
_showCategoriesCount.Width = 30;
94
_showCategoriesCount.Height = 25;
95
_showCategoriesCount.Dock = DockStyle.Left;
96
_showCatCountPanel.Controls.Add(_showCategoriesCount);
98
l.Dock = DockStyle.Left;
99
l.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.CategoryCountLabel}");
102
_showCatCountPanel.Controls.Add(l);
103
_showCatCountPanel.Height = _showCategoriesCount.Height;
104
panel.Controls.Add(_showCatCountPanel);
106
_showObjectAsBaseCheck = new CheckBox();
107
_showObjectAsBaseCheck.Location = new Point(10, 65);
108
_showObjectAsBaseCheck.Width = FIELD_WIDTH;
109
_showObjectAsBaseCheck.Text = StringParser.Parse("${res:ComponentInspector.CustomObjectPanel.ShowObjectAsBaseCheckBox}");
110
panel.Controls.Add(_showObjectAsBaseCheck);
113
l.Dock = DockStyle.Top;
114
l.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.CategoriesGroupBox}");
121
panel.Dock = DockStyle.Top;
125
_showBaseClassesCheck = new CheckBox();
126
_showBaseClassesCheck.Location = new Point(10, 0);
127
_showBaseClassesCheck.Width = FIELD_WIDTH;
128
_showBaseClassesCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowBaseClassMembersCheckBox}");
129
panel.Controls.Add(_showBaseClassesCheck);
131
_showPublicOnlyCheck = new CheckBox();
132
_showPublicOnlyCheck.Location = new Point(10, 20);
133
_showPublicOnlyCheck.Width = FIELD_WIDTH;
134
_showPublicOnlyCheck.Text = StringParser.Parse("${res:ComponentInspector.CustomObjectPanel.ShowPublicMembersCheckBox}");
135
panel.Controls.Add(_showPublicOnlyCheck);
137
_showPropMethCheck = new CheckBox();
138
_showPropMethCheck.Location = new Point(10, 40);
139
_showPropMethCheck.Width = FIELD_WIDTH;
140
_showPropMethCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowPropertyAccessorsMethodsCheckBox}");
141
panel.Controls.Add(_showPropMethCheck);
144
l.Dock = DockStyle.Top;
145
l.Text = StringParser.Parse("${res:ComponentInspector.CustomObjectPanel.ShowLabel}");
150
// Show members panel
152
panel.Dock = DockStyle.Top;
156
// Add these using fixed locations
157
_showFieldsCheck = new CheckBox();
158
_showFieldsCheck.Location = new Point(10, 0);
159
_showFieldsCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowFieldsCheckBox}");
160
panel.Controls.Add(_showFieldsCheck);
162
_showPropertiesCheck = new CheckBox();
163
_showPropertiesCheck.Location = new Point(10, 20);
164
_showPropertiesCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowPropertiesCheckBox}");
165
panel.Controls.Add(_showPropertiesCheck);
167
_showMethodsCheck = new CheckBox();
168
_showMethodsCheck.Location = new Point(120, 0);
169
_showMethodsCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowMethodsCheckBox}");
170
panel.Controls.Add(_showMethodsCheck);
172
_showEventsCheck = new CheckBox();
173
_showEventsCheck.Location = new Point(120, 20);
174
_showEventsCheck.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowEventsCheckBox}");
175
panel.Controls.Add(_showEventsCheck);
178
l.Dock = DockStyle.Top;
179
l.Text = StringParser.Parse("${res:ComponentInspector.ObjectTreeOptionsPanel.ShowMembersGroupBox}");
185
l.Dock = DockStyle.Top;
190
Size ICustPanel.PreferredSize {
192
return new Size(300, 450);
196
public void BeforeShow()
198
// The state of the check box needs to be refreshed
199
// from the current state in the event the dialog
200
// was previously cancelled.
201
_showPropMethCheck.Checked = ComponentInspectorProperties.ShowPropertyAccessorMethods;
203
_showFieldsCheck.Checked = ComponentInspectorProperties.ShowFields;
204
_showPropertiesCheck.Checked = (ComponentInspectorProperties.ShowProperties);
205
_showMethodsCheck.Checked = ComponentInspectorProperties.ShowMethods;
206
_showEventsCheck.Checked = ComponentInspectorProperties.ShowEvents;
208
_showBaseClassesCheck.Checked = ComponentInspectorProperties.ShowBaseClasses;
209
_showPublicOnlyCheck.Checked = ComponentInspectorProperties.ShowPublicMembersOnly;
211
_showMemberCategoriesCheck.Checked = ComponentInspectorProperties.ShowMemberCategories;
212
_showObjectAsBaseCheck.Checked = ComponentInspectorProperties.ShowObjectAsBaseClass;
213
_showBaseCategoriesCheck.Checked = ComponentInspectorProperties.ShowBaseCategories;
214
_showCategoriesCount.Text = Convert.ToString(ComponentInspectorProperties.CategoryThreshold);
215
// Compute enable of show cat count
216
ShowCatClicked(null, null);
218
_showBaseClassNamesCheck.Checked = ComponentInspectorProperties.ShowBaseClassNames;
219
_hexDisplayCheck.Checked = ComponentInspectorProperties.DisplayHex;
222
public bool AfterShow()
224
int showMemCat = Convert.ToInt32(_showCategoriesCount.Text);
226
// Set the properties
227
ComponentInspectorProperties.ShowPropertyAccessorMethods =_showPropMethCheck.Checked;
228
ComponentInspectorProperties.ShowFields = _showFieldsCheck.Checked;
229
ComponentInspectorProperties.ShowProperties = _showPropertiesCheck.Checked;
230
ComponentInspectorProperties.ShowMethods = _showMethodsCheck.Checked;
231
ComponentInspectorProperties.ShowEvents = _showEventsCheck.Checked;
233
ComponentInspectorProperties.ShowBaseClasses = _showBaseClassesCheck.Checked;
234
ComponentInspectorProperties.ShowPublicMembersOnly = _showPublicOnlyCheck.Checked;
236
ComponentInspectorProperties.ShowMemberCategories = _showMemberCategoriesCheck.Checked;
237
ComponentInspectorProperties.ShowBaseCategories = _showBaseCategoriesCheck.Checked;
238
ComponentInspectorProperties.ShowObjectAsBaseClass = _showObjectAsBaseCheck.Checked;
239
ComponentInspectorProperties.CategoryThreshold = showMemCat;
241
ComponentInspectorProperties.ShowBaseClassNames = _showBaseClassNamesCheck.Checked;
242
ComponentInspectorProperties.DisplayHex = _hexDisplayCheck.Checked;
246
protected void ShowCatClicked(Object sender, EventArgs e)
248
_showCatCountPanel.Enabled = _showMemberCategoriesCheck.Checked || _showBaseCategoriesCheck.Checked;