Files
mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridTextBox.cs
T
Peter Dennis Bartok 915b0c9619 2005-09-21 Peter Dennis Bartok <[email protected]>
* OpenFileDialog.cs, ContentsResizedEventArgs.cs, LibSupport.cs, GridItem.cs,
	  CursorConverter.cs, SplitterEventHandler.cs, PropertyGridTextBox.cs,
	  GridTablesFactory.cs, MethodInvoker.cs, AccessibleEvents.cs,
	  SplitterEventArgs.cs, XplatUI.cs, Mime.cs, PropertySort.cs,
	  TreeViewCancelEventHandler.cs, Form.cs, PropertyGridCommands.cs,
	  IDataGridEditingService.cs, DateBoldEventHandler.cs, Label.cs,
	  KeyboardLayouts.cs, TextControl.cs, ProgressBar.cs, ToolTip.cs,
	  RadioButton.cs, OSFeature.cs, LinkLabel.cs, ColorDialog.cs,
	  ThemeNice.cs, ErrorIconAlignment.cs, TreeNode.cs, MimeGenerated.cs,
	  ComboBox.cs, DataGridTextBoxColumn.cs, ArrangeStartingPosition.cs,
	  GridColumnStylesCollection.cs, 
	  IDataGridColumnStyleEditingNotificationService.cs,
	  PropertyGrid.cs, IFeatureSupport.cs, ICommandExecutor.cs,
	  MdiLayout.cs, GridEntry.cs, ControlBindingsCollection.cs,
	  GridTableStylesCollection.cs, TreeViewCancelEventArgs.cs, 
	  TreeNodeCollection.cs, AmbientProperties.cs, 
	  RichTextBoxSelectionAttribute.cs, RichTextBoxSelectionTypes.cs,
	  DataObject.cs, ErrorProvider.cs, Splitter.cs,
	  DataGridLineStyle.cs, Shortcut.cs, Control.cs,
	  FontDialog.cs, SecurityIDType.cs, GridItemType.cs,
	  BindingMemberInfo.cs, DataGridCell.cs, MdiChildContext.cs,
	  IRootGridEntry.cs, PropertyGridView.cs, DataGridParentRowsLabelStyle.cs,
	  FolderBrowserDialog.cs, OpacityConverter.cs, HelpProvider.cs,
	  IComponentEditorPageSite.cs, DataGridTableStyle.cs, NavigateEventArgs.cs,
	  NotifyIcon.cs, ContentsResizedEventHandler.cs, MenuItem.cs,
	  PropertyTabChangedEventHandler.cs, TextBoxBase.cs, OpenTreeNodeEnumerator.cs,
	  SelectionMode.cs, TextBox.cs, ListBindingConverter.cs,
	  FileDialog.cs, KeysConverter.cs, DomainUpDown.cs,
	  DataFormats.cs, SaveFileDialog.cs, GridItemCollection.cs,
	  ArrangeDirection.cs, FeatureSupport.cs, SelectionRangeConverter.cs,
	  RichTextBoxScrollBars.cs, NodeLabelEditEventHandler.cs, TreeNodeConverter.cs,
	  MimeIcon.cs, X11Structs.cs, PropertyGridEntry.cs,
	  ImageList.cs, ThemeWin32Classic.cs, X11Keyboard.cs,
	  CheckedListBox.cs, HelpNavigator.cs, DateTimePickerFormat.cs,
	  MdiClient.cs, DataGridDrawingLogic.cs, DataGridBoolColumn.cs,
	  NodeLabelEditEventArgs.cs, Screen.cs, PropertyManager.cs,
	  ComponentModel.cs, PropertiesTab.cs, CurrencyManager.cs,
	  SizeGrip.cs, DateBoldEventArgs.cs, X11Dnd.cs, Panel.cs,
	  Hwnd.cs, OSXStructs.cs, DrawMode.cs, XplatUIDriver.cs,
	  RichTextBox.cs, PropertyTabChangedEventArgs.cs, CommonDialog.cs,
	  DataGrid.cs, XplatUIX11.cs, RichTextBoxStreamType.cs, Win32DnD.cs,
	  ErrorBlinkStyle.cs, TreeViewEventHandler.cs,
	  PropertyValueChangedEventHandler.cs, IFileReaderService.cs,
	  DataGridTextBox.cs, SelectedGridItemChangedEventArgs.cs, ScrollBar.cs,
	  ListBox.cs, TreeViewAction.cs, Help.cs, TrackBar.cs,
	  AxHost.cs, PropertyValueChangedEventArgs.cs, XplatUIOSX.cs,
	  RichTextBoxFinds.cs, UpDownEventArgs.cs, Cursors.cs,
	  CategoryGridEntry.cs, RichTextBoxWordPunctuations.cs, DataGridColumnStyle.cs,
	  SelectedGridItemChangedEventHandler.cs, DateTimePicker.cs, NavigateEventHandler.cs,
	  Clipboard.cs, UpDownEventHandler.cs, MonthCalendar.cs,
	  SendKeys.cs, DataGridPreferredColumnWidthTypeConverter.cs, TreeView.cs,
	  ThreadExceptionDialog.cs, ImageListConverter.cs, XplatUIWin32.cs,
	  TreeViewEventArgs.cs: Fixed whitespace and set eol-style:native attribute


svn path=/trunk/mcs/; revision=50399
2005-09-21 18:35:43 +00:00

147 lines
4.1 KiB
C#

using System;
namespace System.Windows.Forms.PropertyGridInternal {
internal class PropertyGridTextBox : System.Windows.Forms.UserControl {
private TextBox textbox;
private Button dialog_button;
private Button dropdown_button;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public PropertyGridTextBox() {
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
dropdown_button.Paint+=new PaintEventHandler(dropdown_button_Paint);
// TODO: Add any initialization after the InitializeComponent call
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing ) {
if( disposing ) {
if(components != null) {
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.dialog_button = new System.Windows.Forms.Button();
this.dropdown_button = new System.Windows.Forms.Button();
this.textbox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// dialog_button
//
this.dialog_button.Dock = System.Windows.Forms.DockStyle.Right;
this.dialog_button.Location = new System.Drawing.Point(256, 0);
this.dialog_button.Name = "dialog_button";
this.dialog_button.Size = new System.Drawing.Size(16, 16);
this.dialog_button.TabIndex = 1;
this.dialog_button.Text = "D";
this.dialog_button.Visible = false;
this.dialog_button.Click += new System.EventHandler(this.dialog_button_Click);
//
// dropdown_button
//
this.dropdown_button.Dock = System.Windows.Forms.DockStyle.Right;
this.dropdown_button.Location = new System.Drawing.Point(240, 0);
this.dropdown_button.Name = "dropdown_button";
this.dropdown_button.Size = new System.Drawing.Size(16, 16);
this.dropdown_button.TabIndex = 2;
this.dropdown_button.Visible = false;
this.dropdown_button.Click += new System.EventHandler(this.dropdown_button_Click);
//
// textbox
//
this.textbox.AutoSize = false;
this.textbox.BackColor = System.Drawing.SystemColors.Window;
this.textbox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textbox.Dock = System.Windows.Forms.DockStyle.Fill;
this.textbox.Location = new System.Drawing.Point(0, 0);
this.textbox.Name = "textbox";
this.textbox.Size = new System.Drawing.Size(240, 16);
this.textbox.TabIndex = 3;
this.textbox.Text = "textbox";
//
// PropertyGridTextBox
//
this.Controls.Add(this.textbox);
this.Controls.Add(this.dropdown_button);
this.Controls.Add(this.dialog_button);
this.Name = "PropertyGridTextBox";
this.Size = new System.Drawing.Size(272, 16);
this.ResumeLayout(false);
}
#endregion
private void dropdown_button_Click(object sender, System.EventArgs e) {
if (DropDownButtonClicked != null)
DropDownButtonClicked(this, EventArgs.Empty);
}
private void dialog_button_Click(object sender, System.EventArgs e) {
if (DialogButtonClicked != null)
DialogButtonClicked(this, EventArgs.Empty);
}
public event EventHandler DropDownButtonClicked;
public event EventHandler DialogButtonClicked;
public bool DialogButtonVisible {
get{
return dialog_button.Visible;
}
set {
dialog_button.Visible = value;
dropdown_button.Redraw();
}
}
public bool DropDownButtonVisible {
get{
return dropdown_button.Visible;
}
set {
dropdown_button.Visible = value;
dropdown_button.Redraw();
}
}
public bool ReadOnly {
get {
return textbox.ReadOnly;
}
set {
textbox.ReadOnly = value;
}
}
public new string Text {
get {
return textbox.Text;
}
set {
textbox.Text = value;
}
}
private void dropdown_button_Paint(object sender, PaintEventArgs e)
{
ThemeEngine.Current.CPDrawComboButton(e.Graphics, dropdown_button.ClientRectangle, dropdown_button.ButtonState);
}
}
}