Fixes#80163.
* Control.cs: Replace GetContextMenuInternal() with ContextMenuInternal
property, so that the setter can be overriden too.
* TextBox.cs: Change GetContextMenuInternal() to use
ContextMenuInternal.
svn path=/trunk/mcs/; revision=76200
* so
some of the text adding methods can manipulate it (probably time
for a better name for this flag too).
- Call a new version of selectall that doesn't scroll
* TextBoxBase.cs: When we append text, if the document is empty,
don't scroll. If the document has text already, we scroll to
the
end of the appended text.
- When the text is changed, we reset the has_been_focused, so
the
next time the control gets focused, all the text is selected.
svn path=/trunk/mcs/; revision=75971
selection_length, since that var is reset to -1.
- Draw the caret when we don't have focus.
* TextBox.cs: The selectall actually doesn't occur until the
* first
focus.
* TextBoxBase.cs: Need to update the caret position after a
selectall.
svn path=/trunk/mcs/; revision=74659
* TextBoxBase.cs: Make shortcuts enabled true by default, at
* least
some of them are true by default on MS.
- Add some functions to reduce the amount of invalidates we do.
* TextControl.cs: Less invalidation.
svn path=/trunk/mcs/; revision=74636
will be given.
- Make sure to use the align shift when calculating the line's X
position.
* TextBox.cs: Set the alignment on the document as well as on
* all
the document lines.
svn path=/trunk/mcs/; revision=74613
casts and throw if setting the parent of an mdichild that already
has an mdiparent. Update signature for 2.0 profile. ProductName: If
there's no AssemblyProductAttribute in the assembly, use the type's
namespace (as MS seems to do). CreateControl: don't create the
handle if the control is not visible (according to MS behaviour and
spec). SetTopLevel: Only create handle if the control is not a
form. Change FocusInternal to virtual so that it can be overriden
by Form.
* TextBox.cs: Update call to FocusInternal.
* Form.cs: Always create the handle when calling Focus on a MdiChild.
The form is not a toplevel form when it's a mdi child, so update
is_toplevel accordingly. ShowIcon/TransparencyKey: avoid creating
the handle if it hasn't been created. Show (IWin32Window): Don't
allow this overload for toplevel windows.
CenterToParent/CenterToScreen/Select: create the handle as MS does.
SetVisibleCore: if called on a MdiChild and the parent isn't
visible yet, save the visibility and restore it when the parent is
made visible.
* ScrollableControl.cs: Refactor out scrollbar visibility code to
separate methods, since the visibility of the scrollbars can be
changed from several places, not only from AutoScroll.
svn path=/trunk/mcs/; revision=74609
* MdiFormHandleTest.cs: Fixed build using csc 1.x. Removed extra tabs.
* ControlHandleTest.cs: Fixed build using csc 1.x.
* TextBoxTest.cs: Improved test for BackColor. Added test for
ForeColor.
* TextBox.cs: Set for foreground color.
* TextBoxBase.cs: Remove Invalidate when setting BackColor, since
this is already done in Control.
svn path=/trunk/mcs/; revision=74052
* TextBox.cs: By default we have a non multiline document
- use the multiline property instead of the internal variable
* TextBoxBase.cs: Treat multiline and non multiline the same in
most places.
- Use the documents multiline flag instead of tracking it
ourself
* TextControl.cs: Attempt at getting multiline to match MS
behavior. Lines now track an offset, which is either their X or
Y
offset depending on whether or not we are in multiline mode.
- Update all the methods to understand that lines have an X
value.
- Fix crash in Undo::Duplicate when empty lines are deleted.
svn path=/trunk/mcs/; revision=72723
* TextBox.cs: Redraw when the password characters changes
* TextControl.cs: Check if textbox has a password char and draw
a line of password chars instead of the text in the line. LineTag gets
an extra Draw() method which allows document.Draw to override the text
that will be drawn. Removes 1024 char limitation on length of passworded
lines.
svn path=/trunk/mcs/; revision=71896
* ListView.cs: drop the *Internal overrides, just do our work in
ItemControl's WndProc instead.
* UpDownBase.cs: a few large changes. Fix up the Selectable state
of the various controls, and forward the events properly (in the
same manner as MS) from the textbox to the UpDown. Also the
ActiveControl of the UpDownBase gets set properly now. Finally,
we don't call UpdateEditText from the ctor. Fixes bug #79957.
* NumericUpDown.cs: set Text in the ctor.
* DomainUpDown.cs: call UpdateEditText in the ctor.
* TextBox.cs: on ms.net, WM_LBUTTONDOWN sets focus on the textbox,
so even a Selectable = false textbox can be focused if you click
in it. Go figure.
* Control.cs: remove On{Got,Lost}FocusInternal. Subclasses can
just add their handling in their respective WndProc's. Also add
an explicit FocusInternal method that doesn't consult CanFocus
before calling Select(this).
* TextBoxBase.cs: deal with removal of the FocusInternal calls -
do our work in WndProc instead.
* TabControl.cs: same.
svn path=/trunk/mcs/; revision=71103
* is
set on the owner.
* TextBoxBase.cs: We want to draw the caret and the selection
* for
TextBox but not for TextBoxBase.
- If the window is resized and scrolling is no longer needed
(the
whole doc is visible) set the scroll position to zero.
- Scroll to the caret when the document is recalculated (this
might be wrong, need a lot of testing here)
- The default SelectWord (the one TextBox uses) should move the
caret to the end of the word.
- SelectAll moves the caret to the end of the selection.
* TextBox.cs: We don't selectall on focus, we just do it when
* the
control is created.
svn path=/trunk/mcs/; revision=69348
Control does that.
* ButtonBase.cs: remove the assignment to has_focus. Control will
manage that.
2006-12-06 Chris Toshok <[email protected]>
svn path=/trunk/mcs/; revision=69143
* Form.cs(ScaleCore): No longer calling base.ScaleCore since that
method also moves the window; instead implemented a copy of
Control.ScaleCore (Part of fix for #77456)
* TextBoxBase.cs:
- Created new CreateGraphicsInternal method to allow providing
a graphics context when no handle is created without triggering
handle creation. (Part of fix for #77456)
- Replaced use of Control.CreateGraphics with CreateGraphicsInternal
* TextControl.cs:
- Switched Constructor to require TextBoxBase instead of Control (to
allow uncast access to CreateGraphicsInternal)
- Safeguarded use of owner.Handle property. No longer accessing it
unless the handle is already created.
- Replaced use of Control.CreateGraphics with CreateGraphicsInternal
- Now triggering a recalc when owning control becomes visible
* TextBox.cs, RichTextBox.cs: Switched to use new internal
TextBoxBase.CreateGraphicsInternal() method to avoid triggering
premature handle creation (Part of fix for #77456)
* Control.cs:
- We now only destroy our double-buffering buffers when the
control is resized or disposed, but not when visibility
changes. (The code even re-created them twice every time)
- Now requiring a redraw of the buffer on visibility changes
(fixes bug 77654 part 2)
- Not passing OnParentVisibleChanged up unless the control
is visible
- CanFocus: Fixed to match MS documentation
- Focus: Fixed to return actual focus state and to check if
setting focus is legal before setting it
svn path=/trunk/mcs/; revision=57716
* TextBox.cs:
- Removed local password_char field (moved to TextBoxBase)
- Now setting the document's password var when password is
set
* TextBoxBase.cs:
- Added password_char field (needed here so MultiLine can
access it)
- Added logic to MultiLine property setter to set the document's
variable when password display is allowed
- Removed debug code and made some debug code conditional
* TextControl.cs:
- Added RecalculatePasswordLine() method to handle special password
char only lines
- Added PasswordChar property, also added related tracking vars
- Draw() method now uses local text var for grabbing text to draw,
this var is set to line.text unless we're doing password display,
then it is set to the pre-generated all-password-chars line
- Added calling RecalculatePasswordLine() method for password
lines
svn path=/trunk/mcs/; revision=54484
* XplatUIWin32.cs:
- Clipboard methods now can translate Rtf format
- No longer removes clipboard contents whenever a new format is added
to allow placing multiple formats on the clipboard
* Clipboard.cs: Clipboard now supports getting a IDataObject and
will place all formats contained in it onto the clipboard. Also
now cleans the clipboard before placing a new object onto it
* RichTextBox.cs:
- Implemented set_Rtf
- Implemented set_SelectedRtf
- Created InsertRTFFromStream() method to allow single code base
for all properties and methods that insert RTF into document
- Removed debug output
* TextControl.cs:
- Fixed Delete(int) to fix up line numbers
- Fixed ReplaceSelection to combine start and end line
- Fixed serious DeleteChars bug that would leave the document tree
broken
- Improved DumpTree with several logic checks to detect broken
document trees
- Removed debug lines
- Fixed Caret.WordForward/WordBack moving code, now always also
updates caret.tag (fixes crash when word-selecting across tag
boundaries via keyboard)
- Added Insert() method for inserting multiline text into documents
- Fixed DeleteChars() calculation errors that would cause a broken
tag chain with multiple tag lines
- DeleteChars() no longer crashes on multi-tag lines if not all tags
- Split() no longer moves caret if split is at caret location
- ReplaceSelection() now updates the cursor and re-displays it
- ReplaceSelection() now uses new Insert() method to avoid code
duplication
- FormatText() can now handle formatting partial lines
* TextBoxBase.cs:
- Append now uses new TextControl.Insert() method (this avoids
duplicate code)
- Implemented Ctrl-X (Cut) (
- Implemented Ctrl-C (Copy)
- Implemented Ctrl-V (Paste) (Still some bugs related to screen
regeneration when pasting text; roundtripping Copy&Paste within
edit control still fails due to some calculation bugs in GenerateRTF)
- The Delete key will now remove the current selection if it is visible
* TextBox.cs: Removed debug lines
* XplatUI.cs: Trigger initialization of DataFormats (which requires the
driver to be initialized and can't therefore be done via a static ctor)
svn path=/trunk/mcs/; revision=52940
* XplatUI.cs, XplatUIDriver.cs: Removed EraseWindowBackground
and SetWindowBackground methods
* Control.cs:
- Setting proper ControlStyles
- We no longer call XplatUI.SetWindowBackground and XplatUI.
EraseWindowBackground, instead we draw the window background
ourselves in PaintControlBackground. This behaviour is
required to match MS, where, when OnPaintBackground is not
called, the background is not drawn.
- Removed unneeded Refresh() in set_Text
* Hwnd.cs: Dropped the ErasePending support. No longer needed
* XplatUIX11.cs:
- Created DeriveStyles method to translate from CreateParams to
FormBorderStyle and TitleStyle, also handles BorderStyle (which
matches FormBorderStyle enum values)
- Consolidated SetHwndStyles and CalculateWindowRect border/title
style calculations into single DeriveStyles method
- Fixed CreateWindow to (finally) use Gravity. This prevents X11
from redrawing the whole window on any resize or expose.
- Fixed CreateWindow usage of SetWindowValuemask. Before not
all styles were applied to our whole/client window appropriately
- Removed EraseWindowBackground() and SetWindowBackground() methods
- Removed handling of WM_ERASEBKGND message from DefWndProc, we
no longer clear/redraw the background through X
- Removed handling of erase_pending bit, we have no use for it (or
so it seems)
* XplatUIOSX.cs:
- Removed generation and handling of WM_ERASEBKGND message
- Removed EraseWindowBackground() and SetWindowBackground() methods
- Removed handling of hwnd.ErasePending flag
* XplatUIWin32.cs:
- Removed EraseWindowBackground() and SetWindowBackground() methods
- We no longer call EraseWindowBackground on PaintEventStart, we
ignore the fErase flag, erasing is handled in Control in the
background handler
* Button.cs, GroupBox.cs, Label.cs, CheckBox.cs, ProgressBar.cs,
LinkLabel.cs, ListControl.cs, TabPage.cs, UpDownBase.cs,
TextBoxBase.cs, TextBox.cs, ListView.cs, ButtonBase.cs,
CheckedListBox.cs, MdiClient.cs, Panel.cs, DataGrid.cs,
DataGridTextBox.cs, ScrollBar.cs, ListBox.cs, TrackBar.cs,
TabControl.cs, ScrollableControl.cs, ToolBar.cs, PictureBox.cs,
DateTimePicker.cs, StatusBar.cs, MonthCalendar.cs: Setting proper ControlStyles
svn path=/trunk/mcs/; revision=51670
* TextControl.cs:
- Made line ending size configurable (now allows for counting
lineendings as \n or \r\n)
- Added margin to viewport to keep caret visible on right side
- Fixed translation routines for line/pos to documentpos to consider
cr/lf when counting (Fixes RichTextBox.SelectionFont issues)
- Fixed some line-endings to be unix style
- Fixed Document.FormatText to perform it's calculations 1-based
- Added descriptions for a few methods that might otherwise get
used wrong
- Added NOTE section with some basic conventions to remember at
the top of the file
- Major fixup for RichTextBox selection drawing:
* Fixed crashes when multiple tags on a single line were selected
* fixed selection box drawing not overlaying text
* fixed bogus offset calculation for tags not starting at index 1
* Switched behaviour from using multiple Substrings of a
StringBuilder.ToString() to using multiple
StringBuilder.ToString(start, length) statements, hoping this is
faster (kept original version commented out in the code, in case
original version was faster)
* TextBox.cs (set_TextAlignment): TextBox always needs to wrap if
alignment != Left
* TextBoxBase.cs (CalculateDocument): Made protected so RichTextBox can
call it as well
svn path=/trunk/mcs/; revision=46618
* Form.cs: Set focus to active control when form is activated
* TextControl.cs:
- Added word-wrap functionality to RecalculateLine()
- Added some short function descriptions for VS.Net to aid in
writing dependent controls
- Added Caret property, returning the current coords of the caret
- Added ViewPortWidth and ViewPortHeight properties
- Added Wrap property
- Added CaretMoved event
- Removed some old debug code
- Split() can now create soft splits
- Added PreviousTag()/NextTag() to allow walking "tag-lists"
- Added method to format existing text
- Fixed size/alignment calculations to use viewport
- RecalculateDocument now can handle changing line-numbers while
calculating lines
* TextBox.cs:
- Added some wrap logic, we don't wrap if alignment is not left
- Added casts for scrollbar var, base class switched types to
also support RichTextBoxA
- Implemented handling of scrollbar visibility flags
* TextBoxBase.cs:
- Switched scrollbars type to RichTextBoxScrollBars to support
RichTextBox
- Added tracking of canvas width/height
- Switched scrollbars to be not selectable (to keep focus on text)
- Added central CalculateDocument() method to handle all redraw
requirements
- Added ReadOnly support
- Added WordWrap support
- Fixed handling of Enter key (we now treat it as a DialogKey)
- Fixed caret positioning when h or v scroll is not zero
- Fixed placing/generation of vertical scrollbar
- Added CalculateScrollBars() method to allow updating scrollbar
limits and visibility
- Fixed handling of horizontal scroll
- Added handling of vertical scroll
- Implemented auto-'jump' when caret moves to close to a left or
right border and there is text to be scrolled into view (currently
there's the potential for a stack overflow, until a bug in
scrollbar is fixed)
svn path=/trunk/mcs/; revision=46335
- Setting proper foreground and background color for TextBox
- Added workaround for Form VisibleChanged notifications
svn path=/trunk/mcs/; revision=39816
- Removed unused vars
- Added required overrides for TextControl
- Finished Text property implementation for Text control
- Finished Selection implementation for Text Control
svn path=/trunk/mcs/; revision=38303