A
download ContainerControl.cs
Language: C#
Copyright: (c) 2004 Novell, Inc.
LOC: 322
Project Info
mcs
Server: Mono
Type: svn
...Forms\System.Windows.Forms\
   AccessibleEvents.cs
   AccessibleNavigation.cs
   AccessibleObject.cs
   AccessibleRole.cs
   AccessibleSelection.cs
   AccessibleStates.cs
   AmbientProperties.cs
   AnchorStyles.cs
   Appearance.cs
   Application.cs
   ApplicationContext.cs
   ArrangeDirection.cs
   ArrangeStartingPosition.cs
   ArrowDirection.cs
   AsyncMethodData.cs
   AsyncMethodResult.cs
   AutoCompleteMode.cs
   AutoCompleteSource.cs
   AutoScaleMode.cs
   AutoSizeMode.cs
   AutoValidate.cs
   AxHost.cs
   BaseCollection.cs
   BatteryChargeStatus.cs
   Binding.cs
   BindingCompleteContext.cs
   ...ingCompleteEventArgs.cs
   ...CompleteEventHandler.cs
   BindingCompleteState.cs
   BindingContext.cs
   BindingManagerBase.cs
   ...erDataErrorEventArgs.cs
   ...ataErrorEventHandler.cs
   BindingMemberInfo.cs
   BindingsCollection.cs
   BootMode.cs
   Border3DSide.cs
   Border3DStyle.cs
   BorderStyle.cs
   BoundsSpecified.cs
   Button.cs
   ButtonBase.cs
   ButtonBorderStyle.cs
   ButtonRenderer.cs
   ButtonState.cs
   ...irtualItemsEventArgs.cs
   ...ualItemsEventHandler.cs
   CaptionButton.cs
   CategoryGridEntry.cs
   CharacterCasing.cs
   CheckBox.cs
   CheckBoxRenderer.cs
   CheckedListBox.cs
   CheckState.cs
   Clipboard.cs
   CloseReason.cs
   ColorDepth.cs
   ColorDialog.cs
   ColumnClickEventArgs.cs
   ColumnClickEventHandler.cs
   ColumnHeader.cs
   ...eaderAutoResizeStyle.cs
   ColumnHeaderStyle.cs
   ...mnReorderedEventArgs.cs
   ...eorderedEventHandler.cs
   ColumnStyle.cs
   ...idthChangedEventArgs.cs
   ...hChangedEventHandler.cs
   ...dthChangingEventArgs.cs
   ...ChangingEventHandler.cs
   ComboBox.cs
   ComboBoxRenderer.cs
   ComboBoxStyle.cs
   CommonDialog.cs
   ComponentModel.cs
   ContainerControl.cs
   ...entsResizedEventArgs.cs
   ...sResizedEventHandler.cs
   ContextMenu.cs
   Control.cs
   ...olBindingsCollection.cs
   ControlEventArgs.cs
   ControlEventHandler.cs
   ControlPaint.cs
   ControlStyles.cs
   ControlUpdateMode.cs
   ConvertEventArgs.cs
   ConvertEventHandler.cs
   CreateParams.cs
   CurrencyManager.cs
   Cursor.cs
   CursorConverter.cs
   Cursors.cs
   DataFormats.cs
   DataGrid.cs
   DataGridBoolColumn.cs
   DataGridCell.cs
   DataGridColumnStyle.cs
   DataGridLineStyle.cs
   ...ParentRowsLabelStyle.cs
   ...mnWidthTypeConverter.cs
   DataGridTableStyle.cs
   DataGridTextBox.cs
   DataGridTextBoxColumn.cs
   DataGridView.cs
   ...wAdvancedBorderStyle.cs
   ...ancedCellBorderStyle.cs
   ...ewAutoSizeColumnMode.cs
   ...eColumnModeEventArgs.cs
   ...lumnModeEventHandler.cs
   ...wAutoSizeColumnsMode.cs
   ...ColumnsModeEventArgs.cs
   ...umnsModeEventHandler.cs
   ...utoSizeModeEventArgs.cs
   ...SizeModeEventHandler.cs
   ...dViewAutoSizeRowMode.cs
   ...ViewAutoSizeRowsMode.cs
   DataGridViewBand.cs
   ...ingCompleteEventArgs.cs
   ...CompleteEventHandler.cs
   DataGridViewButtonCell.cs
   ...GridViewButtonColumn.cs
   DataGridViewCell.cs
   ...dViewCellBorderStyle.cs
   ...wCellCancelEventArgs.cs
   ...llCancelEventHandler.cs
   ...idViewCellCollection.cs
   ...StripNeededEventArgs.cs
   ...ipNeededEventHandler.cs
   ...rTextNeededEventArgs.cs
   ...xtNeededEventHandler.cs
   ...ridViewCellEventArgs.cs
   ...ViewCellEventHandler.cs
   ...lFormattingEventArgs.cs
   ...rmattingEventHandler.cs
   ...ewCellMouseEventArgs.cs
   ...ellMouseEventHandler.cs
   ...ellPaintingEventArgs.cs
   ...PaintingEventHandler.cs
   ...CellParsingEventArgs.cs
   ...lParsingEventHandler.cs
   ...tateChangedEventArgs.cs
   ...eChangedEventHandler.cs
   DataGridViewCellStyle.cs
   ...tentChangedEventArgs.cs
   ...tChangedEventHandler.cs
   ...ewCellStyleConverter.cs
   ...dViewCellStyleScopes.cs
   ...pTextNeededEventArgs.cs
   ...xtNeededEventHandler.cs
   ...lValidatingEventArgs.cs
   ...lidatingEventHandler.cs
   ...ewCellValueEventArgs.cs
   ...ellValueEventHandler.cs
   ...GridViewCheckBoxCell.cs
   ...idViewCheckBoxColumn.cs
   ...iewClipboardCopyMode.cs
   DataGridViewColumn.cs
   ...ViewColumnCollection.cs
   ...TimeVisibleAttribute.cs
   ...DoubleClickEventArgs.cs
   ...bleClickEventHandler.cs
   ...dViewColumnEventArgs.cs
   ...ewColumnEventHandler.cs
   ...ViewColumnHeaderCell.cs
   ...eadersHeightSizeMode.cs
   ...idViewColumnSortMode.cs
   ...tateChangedEventArgs.cs
   ...eChangedEventHandler.cs
   ...GridViewComboBoxCell.cs
   ...idViewComboBoxColumn.cs
   ...ComboBoxDisplayStyle.cs
   ...mboBoxEditingControl.cs
   ...ViewContentAlignment.cs
   ...iewDataErrorContexts.cs
   ...ewDataErrorEventArgs.cs
   ...ataErrorEventHandler.cs
   ...trolShowingEventArgs.cs
   ...lShowingEventHandler.cs
   DataGridViewEditMode.cs
   DataGridViewElement.cs
   ...ridViewElementStates.cs
   ...iewHeaderBorderStyle.cs
   DataGridViewHeaderCell.cs
   DataGridViewHitTestType.cs
   DataGridViewImageCell.cs
   ...dViewImageCellLayout.cs
   DataGridViewImageColumn.cs
   DataGridViewPaintParts.cs
   DataGridViewRow.cs
   ...ewRowCancelEventArgs.cs
   ...owCancelEventHandler.cs
   ...ridViewRowCollection.cs
   ...StripNeededEventArgs.cs
   ...ipNeededEventHandler.cs
   ...DoubleClickEventArgs.cs
   ...bleClickEventHandler.cs
   ...rTextNeededEventArgs.cs
   ...xtNeededEventHandler.cs
   ...GridViewRowEventArgs.cs
   ...dViewRowEventHandler.cs
   ...ridViewRowHeaderCell.cs
   ...HeadersWidthSizeMode.cs
   ...tInfoNeededEventArgs.cs
   ...foNeededEventHandler.cs
   ...tInfoPushedEventArgs.cs
   ...foPushedEventHandler.cs
   ...owPostPaintEventArgs.cs
   ...ostPaintEventHandler.cs
   ...RowPrePaintEventArgs.cs
   ...PrePaintEventHandler.cs
   ...ewRowsAddedEventArgs.cs
   ...owsAddedEventHandler.cs
   ...RowsDeletedEventArgs.cs
   ...RowsRemovedEventArgs.cs
   ...sRemovedEventHandler.cs
   ...tateChangedEventArgs.cs
   ...eChangedEventHandler.cs
   ...lectedCellCollection.cs
   ...ctedColumnCollection.cs
   ...electedRowCollection.cs
   ...ridViewSelectionMode.cs
   ...SortCompareEventArgs.cs
   ...tCompareEventHandler.cs
   DataGridViewTextBoxCell.cs
   ...ridViewTextBoxColumn.cs
   ...extBoxEditingControl.cs
   ...iewTopLeftHeaderCell.cs
   DataGridViewTriState.cs
   DataObject.cs
   DataSourceUpdateMode.cs
   DateBoldEventArgs.cs
   DateBoldEventHandler.cs
   DateRangeEventArgs.cs
   DateRangeEventHandler.cs
   DateTimePicker.cs
   DateTimePickerFormat.cs
   Day.cs
   DialogResult.cs
   DockingBehavior.cs
   DockStyle.cs
   DomainUpDown.cs
   DragAction.cs
   DragDropEffects.cs
   DragEventArgs.cs
   DragEventHandler.cs
   DrawItemEventArgs.cs
   DrawItemEventHandler.cs
   DrawItemState.cs
   DrawMode.cs
   ErrorBlinkStyle.cs
   ErrorIconAlignment.cs
   ErrorProvider.cs
   FeatureSupport.cs
   FileDialog.cs
   FixedPanel.cs
   FixedSizeTextBox.cs
   FlatStyle.cs
   FlowDirection.cs
   FolderBrowserDialog.cs
   FontDialog.cs
   Form.cs
   FormBorderStyle.cs
   FormClosedEventArgs.cs
   FormClosedEventHandler.cs
   FormClosingEventArgs.cs
   FormClosingEventHandler.cs
   FormStartPosition.cs
   FormWindowState.cs
   FrameStyle.cs
   GetChildAtPointSkip.cs
   GiveFeedbackEventArgs.cs
   ...FeedbackEventHandler.cs
   ...lumnStylesCollection.cs
   GridEntry.cs
   GridItem.cs
   GridItemCollection.cs
   GridItemType.cs
   GridTablesFactory.cs
   ...ableStylesCollection.cs
   GroupBox.cs
   GroupBoxRenderer.cs
   HandledMouseEventArgs.cs
   Help.cs
   HelpEventArgs.cs
   HelpEventHandler.cs
   HelpNavigator.cs
   HelpProvider.cs
   HorizontalAlignment.cs
   HScrollBar.cs
   ...InsertionOrientation.cs
   Hwnd.cs
   IButtonControl.cs
   ICommandExecutor.cs
   ...ponentEditorPageSite.cs
   IContainerControl.cs
   ...gNotificationService.cs
   IDataGridEditingService.cs
   ...aGridViewEditingCell.cs
   ...idViewEditingControl.cs
   IDataObject.cs
   IDropTarget.cs
   IFeatureSupport.cs
   IFileReaderService.cs
   ImageIndexConverter.cs
   ImageLayout.cs
   ImageList.cs
   ImageListConverter.cs
   ImageListStreamer.cs
   ImeMode.cs
   IMessageFilter.cs
   ImplicitHScrollBar.cs
   ImplicitVScrollBar.cs
   InputLanguage.cs
   ...uageChangedEventArgs.cs
   ...eChangedEventHandler.cs
   ...ageChangingEventArgs.cs
   ...ChangingEventHandler.cs
   InputLanguageCollection.cs
   InsertKeyMode.cs
   InternalWindowManager.cs
   InvalidateEventArgs.cs
   InvalidateEventHandler.cs
   IRootGridEntry.cs
   ItemActivation.cs
   ItemBoundsPortion.cs
   ItemChangedEventArgs.cs
   ItemChangedEventHandler.cs
   ItemCheckedEventArgs.cs
   ItemCheckedEventHandler.cs
   ItemCheckEventArgs.cs
   ItemCheckEventHandler.cs
   ItemDragEventArgs.cs
   ItemDragEventHandler.cs
   IWin32Window.cs
   IWindowTarget.cs
   KeyboardLayouts.cs
   KeyEventArgs.cs
   KeyEventHandler.cs
   KeyPressEventArgs.cs
   KeyPressEventHandler.cs
   Keys.cs
   KeysConverter.cs
   Label.cs
   LabelEditEventArgs.cs
   LabelEditEventHandler.cs
   LabelEditTextBox.cs
   LayoutEngine.cs
   LayoutEventArgs.cs
   LayoutEventHandler.cs
   LayoutSettings.cs
   LeftRightAlignment.cs
   LibSupport.cs
   LinkArea.cs
   LinkBehavior.cs
   LinkClickedEventArgs.cs
   LinkClickedEventHandler.cs
   LinkLabel.cs
   ...LinkClickedEventArgs.cs
   ...kClickedEventHandler.cs
   LinkState.cs
   ListBindingConverter.cs
   ListBox.cs
   ListControl.cs
   ...trolConvertEventArgs.cs
   ...lConvertEventHandler.cs
   ListView.cs
   ListViewAlignment.cs
   ...ViewHitTestLocations.cs
   ListViewItem.cs
   ListViewItemConverter.cs
   ...mMouseHoverEventArgs.cs
   ...useHoverEventHandler.cs
   ...tionChangedEventArgs.cs
   ...nChangedEventHandler.cs
   ListViewItemStates.cs
   ...angeChangedEventArgs.cs
   ...eChangedEventHandler.cs
   MainMenu.cs
   MaskFormat.cs
   ...putRejectedEventArgs.cs
   ...RejectedEventHandler.cs
   MdiChildContext.cs
   MdiClient.cs
   MdiLayout.cs
   MdiWindowManager.cs
   MeasureItemEventArgs.cs
   MeasureItemEventHandler.cs
   Menu.cs
   MenuAPI.cs
   MenuGlyph.cs
   MenuItem.cs
   MenuMerge.cs
   MenuStrip.cs
   MergeAction.cs
   Message.cs
   MessageBox.cs
   MessageBoxButtons.cs
   MessageBoxDefaultButton.cs
   MessageBoxIcon.cs
   MessageBoxOptions.cs
   MethodInvoker.cs
   Mime.cs
   MimeIcon.cs
   MonthCalendar.cs
   MouseButtons.cs
   MouseEventArgs.cs
   MouseEventHandler.cs
   MWFCategoryAttribute.cs
   MWFDescriptionAttribute.cs
   NativeWindow.cs
   NavigateEventArgs.cs
   NavigateEventHandler.cs
   NodeLabelEditEventArgs.cs
   ...abelEditEventHandler.cs
   NotifyIcon.cs
   NumericUpDown.cs
   OpacityConverter.cs
   OpenFileDialog.cs
   OpenTreeNodeEnumerator.cs
   Orientation.cs
   OSFeature.cs
   OSXStructs.cs
   OwnerDrawPropertyBag.cs
   Padding.cs
   PageSetupDialog.cs
   PaintEventArgs.cs
   PaintEventHandler.cs
   Panel.cs
   PictureBox.cs
   PictureBoxSizeMode.cs
   PopupEventArgs.cs
   PopupEventHandler.cs
   PowerLineStatus.cs
   PowerState.cs
   PreProcessControlState.cs
   PreviewKeyDownEventArgs.cs
   ...wKeyDownEventHandler.cs
   ...llerWithStatusDialog.cs
   PrintDialog.cs
   PrintPreviewControl.cs
   PrintPreviewDialog.cs
   ProfessionalColors.cs
   ProfessionalColorTable.cs
   ProgressBar.cs
   ProgressBarRenderer.cs
   ProgressBarStyle.cs
   PropertiesTab.cs
   PropertyGrid.cs
   PropertyGridCommands.cs
   PropertyGridEntry.cs
   PropertyGridTextBox.cs
   PropertyGridView.cs
   PropertyManager.cs
   PropertySort.cs
   ...yTabChangedEventArgs.cs
   ...bChangedEventHandler.cs
   ...alueChangedEventArgs.cs
   ...eChangedEventHandler.cs
   ...ibilityHelpEventArgs.cs
   ...lityHelpEventHandler.cs
   ...ontinueDragEventArgs.cs
   ...inueDragEventHandler.cs
   QuestionEventArgs.cs
   QuestionEventHandler.cs
   RadioButton.cs
   RadioButtonRenderer.cs
   RelatedCurrencyManager.cs
   RelatedPropertyManager.cs
   ...VirtualItemEventArgs.cs
   ...tualItemEventHandler.cs
   RichTextBox.cs
   RichTextBoxFinds.cs
   ...xtBoxLanguageOptions.cs
   RichTextBoxScrollBars.cs
   ...oxSelectionAttribute.cs
   ...extBoxSelectionTypes.cs
   RichTextBoxStreamType.cs
   ...tBoxWordPunctuations.cs
   RightToLeft.cs
   RowStyle.cs
   SaveFileDialog.cs
   Screen.cs
   ScreenOrientation.cs
   ScrollableControl.cs
   ScrollBar.cs
   ScrollBarRenderer.cs
   ScrollBars.cs
   ScrollButton.cs
   ScrollEventArgs.cs
   ScrollEventHandler.cs
   ScrollEventType.cs
   ScrollOrientation.cs
   SearchDirectionHint.cs
   ...VirtualItemEventArgs.cs
   ...tualItemEventHandler.cs
   SecurityIDType.cs
   ...ItemChangedEventArgs.cs
   ...mChangedEventHandler.cs
   SelectionMode.cs
   SelectionRange.cs
   SelectionRangeConverter.cs
   SendKeys.cs
   Shortcut.cs
   SizeGrip.cs
   SizeGripStyle.cs
   SizeType.cs
   SortOrder.cs
   Splitter.cs
   SplitterCancelEventArgs.cs
   ...erCancelEventHandler.cs
   SplitterEventArgs.cs
   SplitterEventHandler.cs
   StatusBar.cs
   ...BarDrawItemEventArgs.cs
   ...DrawItemEventHandler.cs
   StatusBarPanel.cs
   StatusBarPanelAutoSize.cs
   ...sBarPanelBorderStyle.cs
   ...rPanelClickEventArgs.cs
   ...nelClickEventHandler.cs
   StatusBarPanelStyle.cs
   StructFormat.cs
   SWF.csproj.user
   SystemInformation.cs
   SystemParameter.cs
   TabAlignment.cs
   TabAppearance.cs
   TabControl.cs
   TabControlAction.cs
   ...ntrolCancelEventArgs.cs
   ...olCancelEventHandler.cs
   TabControlEventArgs.cs
   TabControlEventHandler.cs
   TabDrawMode.cs
   TableLayout.cs
   ...utCellPaintEventArgs.cs
   ...ellPaintEventHandler.cs
   TableLayoutPanel.cs
   ...PanelCellBorderStyle.cs
   ...LayoutPanelGrowStyle.cs
   TableLayoutSettings.cs
   TabPage.cs
   TabRenderer.cs
   TabSizeMode.cs
   TextBox.cs
   TextBoxBase.cs
   TextBoxRenderer.cs
   TextControl.cs
   TextDataFormat.cs
   TextFormatFlags.cs
   TextImageRelation.cs
   TextRenderer.cs
   Theme.cs
   ThemeClearlooks.cs
   ThemeEngine.cs
   ThemeGtk.cs
   ThemeNice.cs
   ThemeWin32Classic.cs
   ThreadExceptionDialog.cs
   TickStyle.cs
   Timer.cs
   ToolBar.cs
   ToolBarAppearance.cs
   ToolBarButton.cs
   ...ButtonClickEventArgs.cs
   ...tonClickEventHandler.cs
   ToolBarButtonStyle.cs
   ToolBarTextAlign.cs
   ToolStrip.cs
   ...pDownClosedEventArgs.cs
   ...wnClosedEventHandler.cs
   ...pDropDownCloseReason.cs
   ...DownClosingEventArgs.cs
   ...nClosingEventHandler.cs
   ...ripDropDownDirection.cs
   ToolStripDropDownItem.cs
   ...tripGripDisplayStyle.cs
   ToolStripGripStyle.cs
   ToolStripItem.cs
   ToolStripItemAlignment.cs
   ...tripItemDisplayStyle.cs
   ...tripItemImageScaling.cs
   ToolStripItemOverflow.cs
   ToolStripItemPlacement.cs
   ToolStripLayoutStyle.cs
   ...ripManagerRenderMode.cs
   ToolStripMenuItem.cs
   ToolStripRenderMode.cs
   ...atusLabelBorderSides.cs
   ToolStripTextDirection.cs
   ToolTip.cs
   ToolTipIcon.cs
   TrackBar.cs
   TrackBarRenderer.cs
   TreeNode.cs
   TreeNodeCollection.cs
   TreeNodeConverter.cs
   ...eMouseClickEventArgs.cs
   ...useClickEventHandler.cs
   ...eMouseHoverEventArgs.cs
   ...useHoverEventHandler.cs
   TreeNodeStates.cs
   TreeView.cs
   TreeViewAction.cs
   TreeViewCancelEventArgs.cs
   ...ewCancelEventHandler.cs
   TreeViewDrawMode.cs
   TreeViewEventArgs.cs
   TreeViewEventHandler.cs
   ...ViewHitTestLocations.cs
   ...wImageIndexConverter.cs
   TypeValidationEventArgs.cs
   ...lidationEventHandler.cs
   UICues.cs
   UICuesEventArgs.cs
   UICuesEventHandler.cs
   UnhandledExceptionMode.cs
   UpDownBase.cs
   UpDownEventArgs.cs
   UpDownEventHandler.cs
   UserControl.cs
   ValidationConstraints.cs
   View.cs
   VScrollBar.cs
   ...ntCompletedEventArgs.cs
   ...ompletedEventHandler.cs
   ...owserEncryptionLevel.cs
   ...erNavigatedEventArgs.cs
   ...avigatedEventHandler.cs
   ...rNavigatingEventArgs.cs
   ...vigatingEventHandler.cs
   ...ressChangedEventArgs.cs
   ...sChangedEventHandler.cs
   WebBrowserReadyState.cs
   WebBrowserRefreshOption.cs
   Win32DnD.cs
   X11DesktopColors.cs
   X11Dnd.cs
   X11Keyboard.cs
   X11Structs.cs
   XEventQueue.cs
   XplatUI.cs
   XplatUIDriver.cs
   XplatUIOSX.cs
   XplatUIStructs.cs
   XplatUIWin32.cs
   XplatUIX11.cs
   XplatUIX11GTK.cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// 
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2004 Novell, Inc.
//
// Authors:
//	Peter Bartok	pbartok@novell.com
//
//


// NOT COMPLETE

using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;

namespace System.Windows.Forms {
	public class ContainerControl : ScrollableControl, IContainerControl {
		private Control		active_control;
		private Control		focused_control;
		private Control		unvalidated_control;

		// This is an internal hack that allows some container controls
		// to not auto select their child when they are activated
		internal bool 		auto_select_child = true;
#if NET_2_0
		private SizeF		auto_scale_dimensions;
		private AutoScaleMode	auto_scale_mode;
#endif

		#region Public Constructors
		public ContainerControl() {
			active_control = null;
			focused_control = null;
			unvalidated_control = null;
			ControlRemoved += new ControlEventHandler(OnControlRemoved);
#if NET_2_0
			auto_scale_dimensions = SizeF.Empty;
			auto_scale_mode = AutoScaleMode.None;
#endif
		}
		#endregion	// Public Constructors

		#region Public Instance Properties
		[Browsable (false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public Control ActiveControl {
			get {
				return active_control;
			}

			set {
				if ((active_control==value) || (value==null)) {
					return;
				}

				if (!Contains(value) && this != value) {
					throw new ArgumentException("Not a child control");
				}

				// Fire the enter and leave events if possible
				Form form = FindForm ();
				if (form != null) {
					Control active = form.ActiveControl;
					Control common_container = GetCommonContainer (form.ActiveControl, value);
					ArrayList chain = new ArrayList ();
					Control walk = active;

					// Generate the leave messages	
					while (walk != common_container) {
						walk.FireLeave ();
						if (walk.CausesValidation && !ValidateControl (walk))
							return;
						walk = walk.Parent;
					}

					walk = value;
					while (walk != common_container) {
						chain.Add (walk);
						walk = walk.Parent;
					}

					for (int i = chain.Count - 1; i >= 0; i--) {
						walk = (Control) chain [i];
						walk.FireEnter ();
					}
				}

				active_control = value;

				if (this is Form)
					CheckAcceptButton();

				// Scroll control into view
				ScrollControlIntoView(active_control);

				// Let the control know it's selected
				SendControlFocus (value);
			}
		}

		private bool ValidateControl (Control c)
		{
			CancelEventArgs e = new CancelEventArgs ();

			c.FireValidating (e);

			if (e.Cancel)
				return false;

			c.FireValidated ();
			return true;
		}

		// Just in a separate method to make debugging a little easier,
		// should eventually be rolled into ActiveControl setter
		private Control GetCommonContainer (Control active_control, Control value)
		{
			Control new_container = null;
			Control prev_container = active_control;

			while (prev_container != null) {
				new_container = value.Parent;
				while (new_container != null) {
					if (new_container == prev_container)
						return new_container;
					new_container = new_container.Parent;
				}

				prev_container = prev_container.Parent;
			}

			return null;
		}

		private void SendControlFocus (Control c)
		{
			if (c.IsHandleCreated) {
				XplatUI.SetFocus (c.window.Handle);
			}
		}

#if NET_2_0
		public SizeF AutoScaleDimensions {
			get {
				return auto_scale_dimensions;
			}

			set {
				auto_scale_dimensions = value;
			}
		}

		public SizeF AutoScaleFactor {
			get {
				if (auto_scale_dimensions.IsEmpty) {
					return new SizeF(1f, 1f);
				}
				return new SizeF(CurrentAutoScaleDimensions.Width / auto_scale_dimensions.Width, 
					CurrentAutoScaleDimensions.Height / auto_scale_dimensions.Height);
			}
		}


		[MonoTODO("Call scaling method")]
		public virtual AutoScaleMode AutoScaleMode {
			get {
				return auto_scale_mode;
			}
			set {
				if (auto_scale_mode != value) {
					auto_scale_mode = value;

					// Trigger scaling
				}
			}
		}
#endif // NET_2_0

		[Browsable (false)]
		public override BindingContext BindingContext {
			get {
				if (base.BindingContext == null) {
					base.BindingContext = new BindingContext();
				}
				return base.BindingContext;
			}

			set {
				base.BindingContext = value;
			}
		}

#if NET_2_0
		[MonoTODO("Revisit when System.Drawing.GDI.WindowsGraphics.GetTextMetrics is done or come up with other cross-plat avg. font width calc method")]
		public SizeF CurrentAutoScaleDimensions {
			get {
				switch(auto_scale_mode) {
					case AutoScaleMode.Dpi: {
						Bitmap		bmp;
						Graphics	g;
						SizeF		size;

						bmp = new Bitmap(1, 1, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
						g = Graphics.FromImage(bmp);
						size = new SizeF(g.DpiX, g.DpiY);
						g.Dispose();
						bmp.Dispose();
						return size;
					}

					case AutoScaleMode.Font: {
						// http://msdn2.microsoft.com/en-us/library/system.windows.forms.containercontrol.currentautoscaledimensions(VS.80).aspx
						// Implement System.Drawing.GDI.WindowsGraphics.GetTextMetrics first...
						break;
					}
				}

				return auto_scale_dimensions;
			}
		}
#endif

		[Browsable (false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public Form ParentForm {
			get {
				Control parent;

				parent = this.parent;

				while (parent != null) {
					if (parent is Form) {
						return (Form)parent;
					}
					parent = parent.parent;
				}

				return null;
			}
		}
		#endregion	// Public Instance Properties

		#region Protected Instance Methods
		protected override CreateParams CreateParams {
			get {
				return base.CreateParams;
			}
		}
		#endregion	// Public Instance Methods

		#region Public Instance Methods
		[MonoTODO]
		static bool ValidateWarned;
		public bool Validate() {
			//throw new NotImplementedException();
			if (!ValidateWarned) {
				Console.WriteLine("ContainerControl.Validate is not yet implemented");
				ValidateWarned = true;
			}
			return true;
		}

		bool IContainerControl.ActivateControl(Control control) {
			return Select(control);
		}
		#endregion	// Public Instance Methods

		#region Protected Instance Methods
		[EditorBrowsable (EditorBrowsableState.Advanced)]
		protected override void AdjustFormScrollbars(bool displayScrollbars) {
			base.AdjustFormScrollbars(displayScrollbars);
		}

		protected override void Dispose(bool disposing) {
			base.Dispose(disposing);
		}

		// LAMESPEC This used to be documented, but it's not in code 
		// and no longer listed in MSDN2
		// [EditorBrowsable (EditorBrowsableState.Advanced)]
		// protected override void OnControlRemoved(ControlEventArgs e) {
		private void OnControlRemoved(object sender, ControlEventArgs e) {
			if (e.Control == this.unvalidated_control) {
				this.unvalidated_control = null;
			}

			if (e.Control == this.active_control) {
				this.unvalidated_control = null;
			}

			// base.OnControlRemoved(e);
		}

		protected override void OnCreateControl() {
			base.OnCreateControl();
			// MS seems to call this here, it gets the whole databinding process started
			OnBindingContextChanged (EventArgs.Empty);
		}

		[EditorBrowsable (EditorBrowsableState.Advanced)]
		protected override bool ProcessDialogChar(char charCode) {
			if (GetTopLevel()) {
				if (ProcessMnemonic(charCode)) {
					return true;
				}
			}
			return base.ProcessDialogChar(charCode);
		}

		protected override bool ProcessDialogKey(Keys keyData) {
			Keys	key;
			bool	forward;

			key = keyData & Keys.KeyCode;
			forward = true;

			switch (key) {
				case Keys.Tab: {
					if (ProcessTabKey((Control.ModifierKeys & Keys.Shift) == 0)) {
						return true;
					}
					break;
				}

				case Keys.Left: {
					forward = false;
					goto case Keys.Down;
				}

				case Keys.Up: {
					forward = false;
					goto case Keys.Down;
				}

				case Keys.Right: {
					goto case Keys.Down;
				}
				case Keys.Down: {
					if (SelectNextControl(active_control, forward, false, false, true)) {
						return true;
					}
					break;
				} 


			}
			return base.ProcessDialogKey(keyData);
		}

		protected override bool ProcessMnemonic(char charCode) {
			bool	wrapped;
			Control	c;

			wrapped = false;
			c = active_control;

			do {
				c = GetNextControl(c, true);
				if (c != null) {
					// This is stupid. I want to be able to call c.ProcessMnemonic directly
					if (c.ProcessControlMnemonic(charCode)) {
						return(true);
					}
					continue;
				} else {
					if (wrapped) {
						break;
					}
					wrapped = true;
				}
			} while (c != active_control);
			
			return false;
		}

		protected virtual bool ProcessTabKey(bool forward) {
			return SelectNextControl(active_control, forward, true, true, false);
		}

		protected override void Select(bool directed, bool forward)
		{
			if (Parent != null) {
				IContainerControl parent = Parent.GetContainerControl ();
				if (parent != null) {
					parent.ActiveControl = this;
				}
			}

			if (directed && auto_select_child) {
				SelectNextControl (null, forward, true, true, false);
			}
		}

		protected virtual void UpdateDefaultButton() {
			// MS Internal
		}

		[EditorBrowsable (EditorBrowsableState.Advanced)]
		protected override void WndProc(ref Message m) {
			switch ((Msg) m.Msg) {
			case Msg.WM_LBUTTONDOWN:
				OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), 
				        mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()),
					HighOrder ((int) m.LParam.ToInt32 ()), 0));
				return;
				/*
			case Msg.WM_SETFOCUS:
				if (active_control != null)
					Select (active_control);
				else
					SelectNextControl (null, true, true, true, false);
				break;
				*/
			case Msg.WM_KILLFOCUS:
				break;
			}
			base.WndProc(ref m);
		}
		#endregion	// Protected Instance Methods

		#region Internal Methods
		internal virtual void CheckAcceptButton()
		{
			// do nothing here, only called if it is a Form
		}
		#endregion	// Internal Methods
	}
}

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us