Commit Graph
209 Commits
Author SHA1 Message Date
Marek Safar 6b0a20f940 2007-04-26 Marek Safar <[email protected]>
* TextBoxBase.cs (CaretMoved): Consider scroll maximum when scroll
	value is set.


svn path=/trunk/mcs/; revision=76361
2007-04-26 23:11:08 +00:00
Jackson Harper 3054d2ebe4 * TextBoxBase.cs: Fixup the height of textboxes when the control
is created.


svn path=/trunk/mcs/; revision=76206
2007-04-24 17:45:28 +00:00
Jackson Harper e225c391ed * TextBoxBase.cs: Non multiline textboxes shouldn't take the
* enter
        key. Fixes #81408.


svn path=/trunk/mcs/; revision=76143
2007-04-23 18:23:31 +00:00
Jackson Harper 5ac7b5789b * UpDownBase.cs:
* TextBoxBase.cs:
        * ListView.cs:
        * ListBox.cs:
        * TreeView.cs: Use the InternalBorderStyle property to set the
        initial border style, this forces the client rectangle to be
sized
        correctly.


svn path=/trunk/mcs/; revision=76034
2007-04-21 05:17:20 +00:00
Jackson Harper 112fdecfbf * TextBox.cs: Move the has_been_focused into the base control,
* 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
2007-04-19 23:12:56 +00:00
Jackson Harper c053b3ba10 * TextControl.cs: Move the margins to the document, add a method
so the margin sizes can be updated.
        * TextBoxBase.cs: When the border style is changed, update the
        border sizes.


svn path=/trunk/mcs/; revision=75961
2007-04-19 16:02:33 +00:00
Jackson Harper 27f72ba483 * TextControl.cs: Pressing the end key shouldn't move the caret
past the line ending.
        * TextBoxBase.cs: We can still delete if we are in the line
        ending and the combine will just kill the existing line ending.


svn path=/trunk/mcs/; revision=75899
2007-04-18 18:50:05 +00:00
Jackson Harper 61c4e74dfd Before combining two lines for a delete, we need
to invalidate the area of the old line, since that will be moved
        in the combine operation.


svn path=/trunk/mcs/; revision=75898
2007-04-18 18:19:52 +00:00
Jackson Harper 45e71bb937 * TextControl.cs: We can't move lines, then invalidate their
bounds, we need to get the old bounds and combine that with the
        new bounds.
        * TextBoxBase.cs: Before combining two lines for a delete, we
        * need
        to invalidate the area of the old line, since that will be moved
        in the combine operation.


svn path=/trunk/mcs/; revision=75897
2007-04-18 17:56:39 +00:00
Jackson Harper 26316e86b2 * TextBoxBase.cs: When enter is pressed, we need to update all
lines below the current.


svn path=/trunk/mcs/; revision=75769
2007-04-16 15:34:46 +00:00
Jackson Harper 7f32d19790 * TextBoxBase.cs: When a delete removes a line,
* recalculate all
        lines below that line (they need to get offsets setup correctly)
        and invalidate.


svn path=/trunk/mcs/; revision=75471
2007-04-06 04:43:10 +00:00
Jackson Harper 55f6089ef0 * TextBoxBase.cs: Don't delete into the line ending.
svn path=/trunk/mcs/; revision=75470
2007-04-06 04:22:21 +00:00
Jackson Harper 40983e0c10 * TextControl.cs:
* TextBoxBase.cs: Try to never move the cursor into the line
        ending.


svn path=/trunk/mcs/; revision=75450
2007-04-05 15:39:13 +00:00
Jackson Harper 085eabbfa8 * TextBoxBase.cs: When the user presses enter, insert a line
ending into the text. (Maybe this would be a good spot for
        Environment.NewLine).
        * TextControl.cs: Remove undo manager hack, line endings get
        inserted properly now.


svn path=/trunk/mcs/; revision=75398
2007-04-04 17:03:04 +00:00
Jackson Harper 9e3c76bd6a * TextBoxBase.cs: Calculate the scrollbars before calculating
* the
        document, because this sets some of the document size properties
        that are needed.


svn path=/trunk/mcs/; revision=75362
2007-04-03 21:13:14 +00:00
Jackson Harper d9b0f3d89f - Display the caret after doing a page up/down, we need to
manually display it because a proper CaretMoved event isn't
        triggered (this is because of the way the math is done to
        determine how far to scroll).


svn path=/trunk/mcs/; revision=75355
2007-04-03 18:53:09 +00:00
Jackson Harper f16bf35828 * TextBoxBase.cs: We need to calculate maximums even if this is
not a multiline control, because the maxs are used for
scrolling.


svn path=/trunk/mcs/; revision=75349
2007-04-03 17:14:00 +00:00
Jackson Harper bda3d3c36c * TextBoxBase.cs: Scroll faster!
svn path=/trunk/mcs/; revision=75316
2007-04-02 21:37:52 +00:00
Gert Driesen 8539171ea9 * RichTextBoxTest.cs: Added BackColor test. Improved ReadOnly tests.
Added ScrollBars tests.
* TextBoxTest.cs: Improve BackColor test. Added ScrollBars tests.
Improved ReadOnly tests.
* TextBox.cs: Added internal ChangeBackColor method to special-case
Color.Empty. Added check for invalid ScrollBars value.
* TextBoxBase.cs: Added internal ChangeBackColor method.
* RichTextBox.cs: Only set backcolor_set on 2.0 profile. Added
internal ChangeBackColor method to special-case Color.Empty. Added
check for invalid ScrollBars value.

svn path=/trunk/mcs/; revision=75239
2007-03-31 12:32:38 +00:00
Jackson Harper dbb50a8fb2 * TextControl.cs:
* TextBoxBase.cs:
        * RichTextBox.cs: Preserve line endings in the lines text
        * buffer,
        also added an enum that represents the line ending type. 


svn path=/trunk/mcs/; revision=74920
2007-03-23 20:30:01 +00:00
Jackson Harper e5c508bce9 * TextControl.cs:
* TextBoxBase.cs: Allow different types of line endings. \r,
        * \r\n, \r\r\n, and \n.


svn path=/trunk/mcs/; revision=74708
2007-03-20 21:48:08 +00:00
Jackson Harper 0d8caf7a85 * TextControl.cs: Need to use SelectionLength () not
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
2007-03-20 04:46:56 +00:00
Jackson Harper aff37c7788 * TextBox.cs: Reduce the amount of invalidation we do.
* 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
2007-03-19 21:02:46 +00:00
Jackson Harper e8de283a43 * RichTextBox.cs: Enable shortcuts by default.
* TextBoxBase.cs: Add conditional shortcuts.  


svn path=/trunk/mcs/; revision=74608
2007-03-19 14:57:15 +00:00
Jackson Harper 714ae01c7e * TextBoxBase.cs: Allow updating the selection position when the
cursor is outside the textarea, but we have a capture.
        * TextControl.cs: A special case for when the cursor is outside
        the bounds of the TB.


svn path=/trunk/mcs/; revision=74575
2007-03-18 23:01:21 +00:00
Jackson Harper ebdd905067 * RTF.cs: Added support for metafiles and use the new picture
class.
        * Picture.cs: New class for handling pictures and their
        attributes.

        * TextBoxBase.cs: Remove image pasting code for now.  There is
        * no
        way to get an image on the clipboard right now anyways.
        * TextControl.cs:
        * RichTextBox.cs: Use the new RTF Picture class for pictures.


svn path=/trunk/mcs/; revision=74572
2007-03-18 21:53:27 +00:00
Gert Driesen 7a600c9621 * TextBoxBase.cs: In setter for ReadOnly, only chance BackColor if
none was explicitly set. Fixes part of bug #79949.
* RichTextBoxTest.cs: Added tests for ReadOnly effect on BackColor.
* TextBoxTest.cs: Added tests for ReadOnly effect on BackColor.

svn path=/trunk/mcs/; revision=74553
2007-03-18 11:00:48 +00:00
Jackson Harper e6a25b01af - Set the background color to gray on 2.0 when we are readonly.
svn path=/trunk/mcs/; revision=74423
2007-03-15 21:07:56 +00:00
Jackson Harper 4845bc0398 * TextControl.cs:
* TextBoxBase.cs: On MS, a fixed single border is not in NC
        * area,
        it is drawn on the controls client window and there is no NC
        area.


svn path=/trunk/mcs/; revision=74416
2007-03-15 19:39:40 +00:00
Jackson Harper 36d5450f54 * TextBoxBase.cs: Mess with the creation stuff a little. We need
to calculate the document before the handle is created, in some
        cases. (Actually just one case).        


svn path=/trunk/mcs/; revision=74309
2007-03-14 21:30:00 +00:00
Jackson Harper 704fa2daed * TextBoxBase.cs: Need to display the caret after letting the
* base
        wndproc handle the focus methods, because the caret display
        methods check the focus state.
        - Try to display the caret after updating it's position with
          SelectWord.
        - Don't need to do an immediate update on this recalc, since
          there
        will be an invalidate anyways.


svn path=/trunk/mcs/; revision=74304
2007-03-14 21:07:23 +00:00
Jackson Harper 9cc27672d3 * TextBoxBase.cs: Calculate the document before the handle is
created, so there isn't an extra invalidate called.


svn path=/trunk/mcs/; revision=74204
2007-03-13 20:17:51 +00:00
Jackson Harper b1b79749ed * TextBoxBase.cs: Now that the handles are being created a
* little
        later, we need to make sure that the document is recalculated
when
        the handle is created.


svn path=/trunk/mcs/; revision=74097
2007-03-12 05:31:26 +00:00
Gert Driesen b400eaac8a * FormHandleTest.cs: Fixed build using csc 1.x.
* 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
2007-03-10 19:00:18 +00:00
Jackson Harper 10cc5b5d31 - Need to invalidate when backcolor or readonly are changed.
svn path=/trunk/mcs/; revision=74037
2007-03-09 23:54:18 +00:00
Jackson Harper 4106790984 * TextBox.cs: Don't explicitly set our background colors.
* TextControl.cs:
        * TextBoxBase.cs: Draw readonly text.


svn path=/trunk/mcs/; revision=74035
2007-03-09 22:40:33 +00:00
Jackson Harper 85e387b33c - Do not raise OnPaint, and removed some old debug code.
svn path=/trunk/mcs/; revision=74034
2007-03-09 22:02:11 +00:00
Jackson Harper 49f1ca3f63 * TextBoxBase.cs: Don't set the forecolor until the handle is
* created.


svn path=/trunk/mcs/; revision=74031
2007-03-09 21:28:40 +00:00
Jackson Harper be14705959 * TextBoxBase.cs: Update the caret.
svn path=/trunk/mcs/; revision=73512
2007-02-27 19:17:22 +00:00
Jackson Harper e4bbd2bc8f * TextBoxBase.cs: Modified the method for inserting images to
taking a line and position instead of tag and position.
        * RichTextBox.cs: Handle PngBlip data by inserting the png image
        into the RTF file.
        * TextControl.cs: Allow images to be inserted as the first tag
        * of
        a line.
        - Fix some off by one issues when we assume the first tag is a
        text tag, not an image tag.


svn path=/trunk/mcs/; revision=73021
2007-02-16 15:13:41 +00:00
Jackson Harper 1ef293b497 * RichTextBox.cs:
* 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
2007-02-12 23:22:33 +00:00
Jackson Harper e512afdd51 * TextBoxBase.cs: Deleting sections of text is undoable.
* Deleting
        single chars is not.


svn path=/trunk/mcs/; revision=71893
2007-01-29 16:02:43 +00:00
Rolf Bjarne Kvinge 3aef24f36e 2007-01-25 Rolf Bjarne Kvinge <[email protected]>
* ComboBox.cs: Implemented 2.0 methods and events.
	* TextBoxBase.cs: Added OnTextUpdate, so that
	ComboBox.ComboTextBox can inform ComboBox of it.


svn path=/trunk/mcs/; revision=71701
2007-01-25 19:10:17 +00:00
Rolf Bjarne Kvinge 510d6adcea * TextBoxBase.cs: Don't antialias text. Makes it look way better
on Windows (no difference on Linux).	
2007-01-25  Rolf Bjarne Kvinge  <[email protected]>


svn path=/trunk/mcs/; revision=71679
2007-01-25 16:41:12 +00:00
Jackson Harper f8a3befa34 * TextControl.cs: Add a Suspend/Resume for updating, basically
* the
        same as the Suspend/Resume for recalc, except this will do
actual
        Invalidates.
        - New Undo manager, works much like the MS version.
        - Implemented Redo
        * TextBoxBase.cs: The Cut operation is undoable.


svn path=/trunk/mcs/; revision=71677
2007-01-25 16:39:01 +00:00
Jackson Harper 6cf8ebf05e * TextBoxBase.cs: When we move the caret we also need to move
* the
        selection, this fixes some random crashing after doing select
        text, unselect, delete a char, paste.


svn path=/trunk/mcs/; revision=71611
2007-01-24 17:05:29 +00:00
Jackson Harper 626260e384 * TextControl.cs:
* TextBoxBase.cs: Checking in some pieces of the undo stuff so
        that I can fix a broken unit test (TextBoxTest::ClearUndo)


svn path=/trunk/mcs/; revision=71527
2007-01-23 17:32:24 +00:00
Jackson Harper f7983dc177 * TextBox.cs:
* RichTextBox.cs:
        * TextControl.cs: Starting to merge in some pieces of my older
        undo work.  Basically just some slight cleanup of the undo API.


svn path=/trunk/mcs/; revision=71309
2007-01-18 19:34:18 +00:00
Jackson Harper 8bc19671ee * TextBoxBase.cs: Use the new SuspendRecalc/ResumeRecalc methods
that allow us to have nested recalc = false blocks.
        - Add paste support for images in the RichTextBox
        * RichTextBox.cs: flush the text after the color is changed, so
        the change takes effect.
        - Use SuspendRecalc
        - Some extra debugging info
        * TextControl.cs: Tags no longer track their length, it is just
        computed from the next tags length, this makes things a little
        simpler and reduces places that we have to track length changes.
        - Refactored the linetag class a little so we could make it
        a base class for different kinds of tags
        - Created a image tag, a tag that can have a single image
          inserted
        into it
        - Replace the norecalc flag with a Suspend/Resume Recalc pair,
          so
        that we can call suspend multiple times.
        - Add some debugging methods



svn path=/trunk/mcs/; revision=71170
2007-01-16 20:23:42 +00:00
Chris Toshok cf0ecf8fb6 2007-01-15 Chris Toshok <[email protected]>
* 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
2007-01-16 02:04:30 +00:00