Commit Graph
52 Commits
Author SHA1 Message Date
Jackson Harper 7aae568a02 * TreeView.cs: Do not create the treeview's handle when setting
the scroll position.
        - ExpandAll needs to compute the scrollbars so it knows which
        position to set the bar too.
        * TreeNode.cs: 
        * TreeNodeCollection.cs: Pass new flag to UpdateScrollBars


svn path=/trunk/mcs/; revision=76152
2007-04-23 21:00:20 +00:00
Jackson Harper 2c38b4cb56 Only returns true after the handle has been created.
svn path=/trunk/mcs/; revision=74306
2007-03-14 21:15:47 +00:00
Jackson Harper 24226f23fb * TreeNode.cs: We need to start nodes with a zero visible order,
because the order calcs are based on the first nodes order.


svn path=/trunk/mcs/; revision=74151
2007-03-12 22:14:09 +00:00
Jackson Harper 18309f0c33 * TreeView.cs:
* TreeNode.cs:
        * OpenTreeNodeEnumerator: Match MS better for IsVisible and
        IsExpanded.


svn path=/trunk/mcs/; revision=74099
2007-03-12 07:37:49 +00:00
Jackson Harper 8a2de72167 * TreeNode.cs: Add the 2.0 collapse method.
svn path=/trunk/mcs/; revision=73899
2007-03-07 18:59:23 +00:00
Jackson Harper 11cb775c70 * TreeNode.cs: When a node is expanded, set its is_expanded flag
even if it doesn't have any children.


svn path=/trunk/mcs/; revision=73334
2007-02-22 19:55:00 +00:00
Andreia Gaita 34ef8c5e22 * TreeNode.cs: Add new 2.0 ImageKey and SelectedImageKey properties.
* TreeNodeCollection.cs: New Add() methods, ContainsKey and
IndexOfKey() for 2.0

Tests:

* BindingTest.cs (BindingContextChangedTest2): Added 2.0-specific check,
was failing under ms.net.

* ComboBoxText.cs (FindStringExactMatchException): Add check for exception 
only for 1.1 - was failing under ms.net

* ControlTest.cs: 
  - AnchorDockTest: Fix incorrect assertion #5 - was failing 
  under ms.net
  - TestForm: Fix incorrect assertion #4 - was failing 
  under ms.net
* TreeNodeCollectionTest.cs: Add new tests for 2.0	

2007-01-23  Andreia Gaita  <[email protected]>

svn path=/trunk/mcs/; revision=71515
2007-01-23 15:24:09 +00:00
Jonathan Pobst 6ee6c8f9c7 2007-01-19 Jonathan Pobst <[email protected]>
* TreeNode.cs: Apply Alan's patch for Name property.

svn path=/trunk/mcs/; revision=71375
2007-01-20 00:07:14 +00:00
Gert Driesen d2ee61459f * TreeNode.cs: On 2.0 profile, throw InvalidOperationException instead
of Exception in FullPath property if no TreeView is associated with
the TreeNode.
* TreeNodeTest.cs: Fixed FullPathException test on 2.0 profile.

svn path=/trunk/mcs/; revision=70206
2006-12-29 13:32:20 +00:00
Jackson Harper 09f452f052 * TreeView.cs: ActualItemHeight factors in the image height
- compute left edge of checkboxes correctly
        - when expanding/collapsing move the bottom down one pixel, so
          we
        aren't moving part of the node


svn path=/trunk/mcs/; revision=67783
2006-11-13 19:53:20 +00:00
Jackson Harper cc2d5ecd5b * TreeNode.cs:
* TreeView.cs: Make the editing work similar to MSs, firing the
        events correctly and ending edits correctly.


svn path=/trunk/mcs/; revision=62630
2006-07-15 04:52:36 +00:00
Jackson Harper d5ced3f269 * TreeView.cs: Use LostFocus instead of Leave for
* detecting when
        the edit box has lost focus (duh).
        - Just make the edit box not visible when we get return, that
          will
        take the focus, which will call EndEdit
        * TreeNode.cs When we start editing, notify the treeview.


svn path=/trunk/mcs/; revision=62575
2006-07-13 19:01:34 +00:00
Jackson Harper 9077584f18 * TreeNode.cs: Recalculate the visible order before doing the
Expand/Collapse Below calls, because those calls generate an
        expose.
        - Reduce calls to the TreeView property, which is mildly
          expensive
        by using a local var.


svn path=/trunk/mcs/; revision=61600
2006-06-09 17:41:55 +00:00
Jackson Harper 9ac64f09da * TreeNode.cs: Compute the next node for expanding/collapsing
correctly. We now factor in nodes without a NextNode
        correctly. (Fixes somes cases in nunit-gui).


svn path=/trunk/mcs/; revision=61472
2006-06-05 23:29:52 +00:00
Jackson Harper 3332c81dc6 * TreeNode.cs: We can't expand/collapse nodes with no children.
svn path=/trunk/mcs/; revision=61464
2006-06-05 19:10:37 +00:00
Jackson Harper 49d30fcf12 TreeNode.cs: Make is_expanded internal so the treenode
collection can change it without firing the whole event chain.
        * TreeNodeCollection.cs: When clearing all the child nodes make
        sure to recalc the visible order.
        - Improve algo for remove the top node


svn path=/trunk/mcs/; revision=61387
2006-06-01 20:53:10 +00:00
Jackson Harper 4453e46a66 * BindingManagerBase.cs: Remove somedebug code that creeped into
SVN.
        * TreeNode.cs: We get the indent level dynamically right now, so
        don't track it as a member.
        * TreeNodeCollection.cs: Make sure all nodes added to the list
        have parents, treeviews/topnodes setup properly.
        - Don't attempt to track indent level.


svn path=/trunk/mcs/; revision=61349
2006-05-31 19:19:20 +00:00
Jackson Harper bc915ff706 * TreeNode.cs: Bounds are computed 'on the fly' now. This
* allows
        treenode calculations to be independant of the painting code. To
        do this nodes track a visible order which is calculated by the
        treeview.
        - Call new methods for expanding/collapsing nodes.  These
          methods
        use scrollwindow so we don't have to update everything below the
        node.
        * TreeView.cs: Refactored drawing and scrolling code.  We don't
        need to update nodes when drawing anymore or calculate scrollbar
        stuff.
        - Added new methods for expanding/collapsing nodes. These
          methods
        use ScrollWindow so as to not have to redraw all the nodes
below.
        * TreeNodeCollection.cs: Recalc visible order and scrollbars
        * when
        we add/remove nodes or sort.
        - Handle removing the selected and the top node properly.


svn path=/trunk/mcs/; revision=61021
2006-05-23 22:21:17 +00:00
Peter Dennis Bartok 772b5fc119 2006-05-08 Peter Dennis Bartok <[email protected]>
* TreeNode.cs: Changed serialization .ctor to not require every field
	  to be present. (#78265)
	* OwnerDrawPropertyBag.cs: Added serialization .ctor


svn path=/trunk/mcs/; revision=60416
2006-05-08 18:36:17 +00:00
Jackson Harper 38cb26537d * TreeView.cs:
* TreeNode.cs: Raise events no matter how the treenode is
        checked. Patch by Don Edvalson.


svn path=/trunk/mcs/; revision=56276
2006-01-30 19:52:31 +00:00
Jackson Harper 18280654cb * TreeNode.cs: Signature fix.
svn path=/trunk/mcs/; revision=56271
2006-01-30 19:41:47 +00:00
Jackson Harper 1ee9a558e9 * TreeView.cs: Use the property for setting the selected node so
the correct events get raised.
        * TreeNode.cs: Update the tree when the fore/back colours of a
        node are set.



svn path=/trunk/mcs/; revision=55395
2006-01-11 18:50:35 +00:00
Jackson Harper a8fa041179 * TreeNode.cs: redraw the node when its image index is changed.
svn path=/trunk/mcs/; revision=55089
2006-01-05 01:15:21 +00:00
Jackson Harper 4e145f2af9 * TreeNode.cs : Fixed bugs that caused FullPathTest + Traverse to
fail. Dieter Bremes


svn path=/trunk/mcs/; revision=53779
2005-12-01 18:21:33 +00:00
Jackson Harper d46aedeb9c * TreeNode.cs: Don't cache the tree_view or index anymore, now
that nodes can be moved from tree to tree easily this just causes
	all sorts of problems.
	* TreeNodeCollection: Don't need to give treenodes an index and
	treeview anymore when they are added, these are computed on the
	fly. Also make sure to remove a node before its added.


svn path=/trunk/mcs/; revision=52522
2005-11-03 20:03:37 +00:00
Jackson Harper 4bd39d1203 * TreeNode.cs: Implement serialization so my DnD examples will
work.


svn path=/trunk/mcs/; revision=52297
2005-10-27 19:10:30 +00:00
Jackson Harper 08d0f7a192 * TreeNode.cs: Use the viewport rect for determining if a node
needs to be moved for visibility. Don't use Begin/End edit. This
	calls a full refresh when its done.
	* TreeView.cs: New SetBottom works correctly.  Make the viewport
	rect property internal so the treenodes can see it. When clicking
	on a node we need to ensure that its visible because it might just
	be partly visible when clicked.


svn path=/trunk/mcs/; revision=52014
2005-10-20 23:25:53 +00:00
Jackson Harper 869c528ce4 * TreeView.cs: Implement Begin/EndEdit more correctly so refreshes
are reduced when adding nodes.
	* TreeNode.cs:
	* TreeNodeCollection.cs: Use UpdateNode instead of refreshing the
	tree.


svn path=/trunk/mcs/; revision=51959
2005-10-20 02:43:21 +00:00
Rafael Teixeira 99247d8a08 2005-10-17 Rafael Teixeira <[email protected]>
* TreeNode.cs : small logical fix (was using local var instead of field)
	

svn path=/trunk/mcs/; revision=51806
2005-10-17 16:49:31 +00:00
Jackson Harper 2841a73b10 * XEventQueue.cs: Increase the default queue size (very simple
apps needed to grow the queue).
	* Hwnd.cs: No finalizer so we don't need to suppress
	finalization. Compute the invalid area manually so a new rectangle
	does not newto be created.
	* ScrollableControl.cs: Don't set any params (otherwise visibility
	isn't set correctly).
	* MdiChildContext.cs: New constructor takes the mdi parent so it
	doesn't have to be computed and avoids a crash on windows. Draw
	the window icon properly, and allow the text to be seen.
	* Form.cs: Use new MdiChildContext constructor. Make sure the
	child context isn't null in wndproc.
	* TabControl.cs: Don't set focus, this is muddling keyboard
	behavoir. Expand the tab rows when a window size increase will
	allow extra tabs to be seen. Don't allow tabs smaller than the
	width of a window to be scrolled out of view.
	* TreeNode.cs:
	* TreeView.cs: Use measure string to calculate a nodes width, the
	width is cached and only updated when the text or the font is
	changed. Don't check for expand/collapse clicks on the first level
	nodes if root lines are disabled.


svn path=/trunk/mcs/; revision=51769
2005-10-16 18:26:11 +00:00
Jackson Harper 3b6582ba41 * TreeView.cs: If updating the root node do a full refresh.
* TreeNode.cs: The root node should be expanded by default. Also
	added a utility prop to tell if we are the root node.
	* TreeNodeCollection.cs: Only refresh if the node we are being
	added to is expanded. Also added a comment on a potential
	optimization.


svn path=/trunk/mcs/; revision=51231
2005-10-05 08:42:55 +00:00
Jackson Harper 2af9ce5491 * TreeNode.cs: Call Before/After Expand not Collapse when
expanding.
        

svn path=/trunk/mcs/; revision=50395
2005-09-21 17:39:46 +00:00
Jackson Harper a4bf822048 * TreeNode.cs: Implement Handle stuff.
* TreeView.cs: Utility methods so nodes can get/lookup by handle.


svn path=/trunk/mcs/; revision=43508
2005-04-23 19:43:04 +00:00
Jackson Harper ae3d719d86 * TreeView.cs: Calculate plus minus and checkbox bounds when
there is a click. This handles offsets for scrolling properly 
	and reduces memory. Also fixed GetNode to not offset now that 
	TopNode works properly.
	* TreeNode.cs: No longer need to track the plus minus or 
	checkbox bounds.


svn path=/trunk/mcs/; revision=43191
2005-04-18 04:56:03 +00:00
Jackson Harper e163612962 * TreeView.cs: Calculate plus minus bounds when there is a
click. This handles offsets for scrolling properly and reduces
	memory. Also fixed GetNode to not offset now that TopNode works
	properly.
	* TreeNode.cs: No longer need to track the plus minus bounds.


svn path=/trunk/mcs/; revision=43183
2005-04-18 04:41:13 +00:00
Jackson Harper 4f5d105f8a * TreeView.cs: Add methods for setting the top and bottom visible
nodes. TreeNode::EnsureVisible uses these methods.
	* TreeNode.cs: Implement EnsureVisible


svn path=/trunk/mcs/; revision=43010
2005-04-14 20:16:40 +00:00
Peter Dennis Bartok 3e8edd5d91 - Fixed visibility
svn path=/trunk/mcs/; revision=40841
2005-02-18 04:11:58 +00:00
Peter Dennis Bartok 37becc5332 2005-02-17 Peter Bartok <[email protected]>
* Application.cs: Now calls registered message filters
        * DockStyle.cs: Fixed attribute
        * Form.cs: Fixed attribute
        * Menu.cs: Fixed attribute
        * ToolTip.cs: Fixed attribute
        * TreeNode.cs: Added missing attributes and arranged in regions
        * PropertyGrid.cs: Fixed signatures
        * TreeNodeCollection.cs: Added attributes
        * Splitter.cs: Added missing attributes; arranged into regions
        * TabPage.cs: Added missing attributes; arranged into regions
        * TextBoxBase.cs: Added missing attributes
        * TextBox.cs: Added missing attributes
        * ArrangeDirection.cs: Added missing attributes
        * TreeNodeConverter.cs: Added stub (needed for TreeNode)
        * ToolBarButton.cs: Fixed attributes
        * AnchorStyles.cs: Fixed attribute
        * TrackBar.cs: Fixed attributes
        * TabControl.cs: Added missing attributes and arranged into regions
        * ToolBar.cs: Fixed attribute
        * StatusBar.cs: Fixed signature, organized into regions and added
          attributes
        * StatusBarPanel.cs: Fixed attributes
        * ContentsResizedEventArgs.cs: Implemented
        * ContentsResizedEventHandler.cs: Implemented
        * DateBoldEventArgs.cs: Implemented
        * DateBoldEventHandler.cs: Implemented
        * UpDownEventArgs.cs: Implemented
        * UpDownEventHandler.cs: Implemented


svn path=/trunk/mcs/; revision=40801
2005-02-17 11:12:28 +00:00
Jackson Harper 48bcdbbd21 * TreeNode.cs: Implement editing. Add missing properties selected
and visible.
	* TreeView.cs: Implement node editing. Also some fixes to use
	Invalidate (invalid area) instead of Refresh when selecting.


svn path=/trunk/mcs/; revision=39066
2005-01-18 02:23:11 +00:00
Jackson Harper 30cdaf4c14 * TreeView.cs: Refresh the tree after sorting the nodes. Always
draw the connecting node lines (when ShowLines is true).
	* TreeNode.cs: The nodes index can now be updated. This is used
	when a node collection is sorted.
	* TreeNodeCollection.cs: Implement sorting. Nodes can be sorted on
	insert or an existing unsorted node collection can be sorted.


svn path=/trunk/mcs/; revision=38837
2005-01-12 23:49:09 +00:00
Jackson Harper 470be3c37c * TreeNode.cs: Just update the single node when it is
checked. Don't refresh after toggling, the Expand/Collapse already
	handles this.
	* TreeView.cs: Respect clipping a little more when drawing. Try
	not to redraw things that don't need to be redrawn. Just hide the
	scrollbars when they are no longer needed instead of removing
	them, so they don't have to be created again and again.


svn path=/trunk/mcs/; revision=38516
2005-01-08 04:53:06 +00:00
Jackson Harper d7e486f7e1 * TreeNode.cs: Patches by Kazuki Oikawa ([email protected])
for
	handling focus, return correct colors and fonts, 
	* TreeView.cs: Patches by Kazuki Oikawa ([email protected]) to
	handle selection, horizontal scrolling, and mouse interaction.



svn path=/trunk/mcs/; revision=38330
2005-01-04 22:16:16 +00:00
Jackson Harper af2d82193c * TreeView.cs:
- Collapse and uncheck all nodes when CheckBoxes is disabled.
	  - Checkboxes are always aligned to the bottom of the node,
	  regardless of item height.
	  - Use the node bounds to draw the text so we can center it when
	  the item height is greater then the font height.
	  - Node::Bounds are only the text part of the node.
	* TreeNode.cs: New method to combine collapsing and unchecking all
	  nodes recursively.


svn path=/trunk/mcs/; revision=38285
2005-01-03 19:21:09 +00:00
Jackson Harper 017d26d7f9 * TreeView.cs: Draw checkmarks, handle detecting check mark clicks
* TreeNode.cs: Add a bounding box for the checkbox, refresh the
	tree when a check is changed. TODO: Only refresh the checked node.


svn path=/trunk/mcs/; revision=38243
2005-01-02 23:41:01 +00:00
Jackson Harper a19add6d60 * TreeView.cs: Draw checkbox boxes when checkboxes are enabled.
* TreeNode.cs: When collapsing make sure to never collapse the
	root node.


svn path=/trunk/mcs/; revision=38196
2004-12-30 18:52:08 +00:00
Jackson Harper 2b3e2b2772 * TreeNode.cs:
* MonthCalendar.cs: Signature fixes


svn path=/trunk/mcs/; revision=37913
2004-12-17 23:14:03 +00:00
Jackson Harper 16c25a1c35 * TreeNode.cs:
* TreeView.cs: Fix build on csc (second time today ;-))


svn path=/trunk/mcs/; revision=37816
2004-12-15 23:55:29 +00:00
Jackson Harper 3d63116e9c * TreeView.cs: Store the treenodes plus/minus box bounds when it
is calculated and use this for click testing.
	* TreeNode.cs: Add functionality to store the nodes plus minus box bounds.


svn path=/trunk/mcs/; revision=37805
2004-12-15 20:05:02 +00:00
Marek Safar 907a18f667 2004-12-03 Marek Safar <[email protected]>
* OwnerDrawPropertyBag.cs: New internal parameterless ctor.

	* TreeNode.cs: Implemented ICloneable, Fixed to pass my simple
	tests.
	
	* TreeNodeCollection.cs: Add exception throwing for Add,AddRange.
	
	* TreeView.cs: BackColor is Colors.Window.

svn path=/trunk/mcs/; revision=36999
2004-12-03 09:55:02 +00:00
Jackson Harper 322faf65e9 Initial Implementation
svn path=/trunk/mcs/; revision=36922
2004-12-02 07:32:11 +00:00