MaxCustomControls::MaxTreeList Class Reference


Detailed Description

<exclude>

Derived version of the DevExpress TreeList control to customize some behaviour for Max's purposes.

Inheritance diagram for MaxCustomControls::MaxTreeList:
Inheritance graph
[legend]

List of all members.

Classes

class   FindTopmostNodeOperation
  <exclude>
class   TreeListAccumulateNodes
  <exclude>

Public Member Functions

  MaxTreeList ()
  <exclude>
void  DeactivateEditingEnabled ()
  <exclude>
void  ResetEditingEnabled ()
  <exclude>
void  DeactivateDragAndDrop ()
  <exclude>
void  ResetDragAndDrop ()
  <exclude>
void  DeactivateShowRoot ()
  <exclude>
void  ResetShowRoot ()
  <exclude>
void  InvalidateData ()
  <exclude>
void  SetSelection (IEnumerable< TreeListNode > nodeList)
  <exclude>
void  AddToSelection (IEnumerable< TreeListNode > nodeList)
  <exclude>
void  AddToSelection (TreeListNode node)
  <exclude>
void  RemoveFromSelection (IEnumerable< TreeListNode > nodeList)
  <exclude>
void  RemoveFromSelection (TreeListNode node)
  <exclude>
void  ClearSelection ()
  <exclude>
void  SelectAll ()
void  InvertSelection ()
  <exclude>
void  RevealNodes (IEnumerable< TreeListNode > nodeList)
  <exclude>
void  RaiseRoutedKeyEvent (object source, RoutedKeyEventArgs.KeyEvent aEvent, KeyEventArgs e)
  <exclude>
List< TreeListNode >  GetAllNodes ()
  <exclude>
virtual void  UpdateColors ()
  <exclude>
void  CloseEditorOnEvent (Object sender, EventArgs e)
  <exclude>
override void  PostEditor ()
  <exclude>
override void  BestFitColumns ()
  <exclude>

Static Public Attributes

static readonly String  EditingEnabledPropertyName = "EditingEnabled"
static readonly String  SelectChildrenPropertyName = "SelectChildren"

Protected Member Functions

virtual void  OnPropertyChanged (String propertyName)
virtual void  OnEditingEnabledChanged (CSharpUtilities.ValueChangedEventArgs< bool > e)
  <exclude>
override void  UpdateDataSource (bool updateContent)
  <exclude>
virtual void  OnDataSourceChanged ()
  <exclude>
virtual void  OnRoutedKeyEvent (RoutedKeyEventArgs e)
  <exclude>
virtual void  OnUserSelectionChanged (EventArgs e)
  <exclude>
override void  OnItemChanged (int index)
  <exclude>
override void  OnPaint (PaintEventArgs e)
  <exclude>
override void  OnVisibleChanged (EventArgs e)
  <exclude>
override TreeListColumnCollection  CreateColumns ()
  <exclude>
override TreeListViewInfo  CreateViewInfo ()
  <exclude>
override void  OnMouseDown (MouseEventArgs e)
  <exclude>
override TreeListHandler  CreateHandler ()
  <exclude>
virtual void  SelectChildrenOnSelection (object sender, EventArgs e)
  <exclude>
override void  OnResize (EventArgs e)
  <exclude>

Properties

bool  EditingEnabled [get, set]
  <exclude>
bool  DragAndDropEnabled [get, set]
  <exclude>
bool  ShowRoot [get, set]
  <exclude>
override bool  EnableEnhancedSorting [get]
  <exclude>
bool  UserSelectionChangedEnabled [get, set]
  <exclude>
virtual bool  DataDirty [get, set]
  <exclude>
override ContextMenuStrip  ContextMenuStrip [set]
  <exclude>
bool  SelectChildren [get, set]
  <exclude>

Events

PropertyChangedEventHandler  PropertyChanged
EventHandler
< CSharpUtilities.ValueChangedEventArgs
< bool > > 
EditingEnabledChanged
  <exclude>
EventHandler  DataSourceChanged
  <exclude>
EventHandler< RoutedKeyEventArgs RoutedKeyEvent
  <exclude>
EventHandler  UserSelectionChanged
  <exclude>

Constructor & Destructor Documentation

MaxCustomControls::MaxTreeList::MaxTreeList ( ) [inline]

<exclude>

Constructor.


Member Function Documentation

virtual void MaxCustomControls::MaxTreeList::OnPropertyChanged ( String  propertyName ) [inline, protected, virtual]
virtual void MaxCustomControls::MaxTreeList::OnEditingEnabledChanged ( CSharpUtilities.ValueChangedEventArgs< bool >  e ) [inline, protected, virtual]

<exclude>

Raises the EditingEnabledChanged event.

Parameters:
e An args object that contains the old and new parameters.
void MaxCustomControls::MaxTreeList::DeactivateEditingEnabled ( ) [inline]

<exclude>

Deactivates editing on this control until ResetEditingEnabled is called.

Used to temporarily deactivate editing on the treelist. Call ResetEditingEnabled() to reset editing to the last value of EditingEnabled.

void MaxCustomControls::MaxTreeList::ResetEditingEnabled ( ) [inline]

<exclude>

Resets editing on this control to the policy setting set through the EditingEnabled property.

See DeactivateEditingEnabled().

void MaxCustomControls::MaxTreeList::DeactivateDragAndDrop ( ) [inline]

<exclude>

Temporarily turn off drag and drop in this tree list without affecting the actual policy.

The behaviour as specified by the DragAndDropEnabled option can be reset later using ResetDragAndDrop.

void MaxCustomControls::MaxTreeList::ResetDragAndDrop ( ) [inline]

<exclude>

Reset deactivated drag and drop behaviour to the policy as set through the DragAndDropEnabled option.

See DeactivateDragAndDrop().

void MaxCustomControls::MaxTreeList::DeactivateShowRoot ( ) [inline]

<exclude>

Temporarily turn off tree root display in this tree list without affecting the actual policy.

The behaviour as specified by the ShowRoot option can be reset later using ResetShowRoot.

void MaxCustomControls::MaxTreeList::ResetShowRoot ( ) [inline]

<exclude>

Reset deactivated root node display to the policy as set through the ShowRoot option.

See DeactivateShowRoot().

override void MaxCustomControls::MaxTreeList::UpdateDataSource ( bool  updateContent ) [inline, protected]

<exclude>

Overridden from TreeList to fire DataSourceChanged.

The base TreeList does not expose a DataSource changed event and the DataSource property itself is not virtual. This method is our first opportunity to hook into the DataSource changing pipeline to add the event.

Parameters:
updateContent See TreeList.UpdateDataSource(bool) The parameter is passed to this base method.

Reimplemented in MaxCustomControls::ExplorerTreeList.

virtual void MaxCustomControls::MaxTreeList::OnDataSourceChanged ( ) [inline, protected, virtual]

<exclude>

Raises the DataSourceChanged event.

void MaxCustomControls::MaxTreeList::InvalidateData ( ) [inline]

<exclude>

Marks the DataDirty property and calls Invalidate on TreeList.

This will schedule a refresh of the data set. The refresh will be performed at the beginning of the next repaint. Repaints occur after the application finishes its current processing job and control returns to the main message loop. In this way, multiple refreshes can be batched together and performed all at once, when the application is no longer busy.

void MaxCustomControls::MaxTreeList::SetSelection ( IEnumerable< TreeListNode >  nodeList ) [inline]

<exclude>

Sets the selection in this tree list to the passed in list of TreeListNodes.

Intended for programmatically changing the selection set, this method differs from manipulating the Selection list directly on the base class by disabling the UserSelectionChanged event while changing the selection.

Parameters:
nodeList An enumerable list of nodes to set as the selection.
void MaxCustomControls::MaxTreeList::AddToSelection ( IEnumerable< TreeListNode >  nodeList ) [inline]

<exclude>

Adds the passed in list of TreeListNodes to the selection in this tree list.

Intended for programmatically changing the selection set, this method differs from manipulating the Selection list directly on the base class by disabling the UserSelectionChanged event while changing the selection.

Parameters:
nodeList An enumerable list of nodes to add to the selection.
void MaxCustomControls::MaxTreeList::AddToSelection ( TreeListNode  node ) [inline]

<exclude>

Adds the passed in TreeListNode to the selection in this tree list.

Intended for programmatically changing the selection set, this method differs from manipulating the Selection list directly on the base class by disabling the UserSelectionChanged event while changing the selection.

Parameters:
node A node to add to the selection.
void MaxCustomControls::MaxTreeList::RemoveFromSelection ( IEnumerable< TreeListNode >  nodeList ) [inline]

<exclude>

Remove the passed in list of TreeListNodes from the selection in this tree list.

Intended for programmatically changing the selection set, this method differs from manipulating the Selection list directly on the base class by disabling the UserSelectionChanged event while changing the selection.

Parameters:
nodeList An enumerable list of nodes to remove from the selection.
void MaxCustomControls::MaxTreeList::RemoveFromSelection ( TreeListNode  node ) [inline]

<exclude>

Remove the passed in TreeListNode from the selection in this tree list.

Intended for programmatically changing the selection set, this method differs from manipulating the Selection list directly on the base class by disabling the UserSelectionChanged event while changing the selection.

Parameters:
node A node to remove from the selection.
void MaxCustomControls::MaxTreeList::ClearSelection ( ) [inline]

<exclude>

Clears the selection set in this tree list.

Intended for programmatically changing the selection set, this method differs from manipulating the Selection list directly on the base class by disabling the UserSelectionChanged event while changing the selection.

void MaxCustomControls::MaxTreeList::SelectAll ( ) [inline]
void MaxCustomControls::MaxTreeList::InvertSelection ( ) [inline]

<exclude>

Inverts the current selection set.

If the selection set is currently empty, then all nodes are selected. If the selection set contains all nodes, then the selection is cleared. Otherwise, all nodes that are selected are removed from the selection set and vice-versa.

void MaxCustomControls::MaxTreeList::RevealNodes ( IEnumerable< TreeListNode >  nodeList ) [inline]

<exclude>

Make all nodes in the given list visible (their parents are expanded), scroll to show the topmost node, and set the focus to this topmost node.

Parameters:
nodeList A list of nodes to be revealed in the explorer. Any node in this list will have its parent expanded so that it will become visible.
virtual void MaxCustomControls::MaxTreeList::OnRoutedKeyEvent ( RoutedKeyEventArgs  e ) [inline, protected, virtual]

<exclude>

Raises the RoutedKeyEvent.

Parameters:
e Args indicating the type of key event that is being routed.
void MaxCustomControls::MaxTreeList::RaiseRoutedKeyEvent ( object  source,
RoutedKeyEventArgs.KeyEvent  aEvent,
KeyEventArgs  e 
) [inline]

<exclude>

Raises the RoutedKeyEvent.

Parameters:
source The original source of the event.
aEvent The type of key event being raised.
e The KeyEventArgs associated with that event.
List<TreeListNode> MaxCustomControls::MaxTreeList::GetAllNodes ( ) [inline]

<exclude>

Gets all the nodes currently owned by the TreeList.

Returns:
virtual void MaxCustomControls::MaxTreeList::UpdateColors ( ) [inline, virtual]

<exclude>

Updates colors of this control according to the current CUI settings.

This implements the CuiUpdatable interface.

Implements MaxCustomControls::CuiUpdatable.

Reimplemented in MaxCustomControls::SceneExplorerControls::SceneExplorerTreeList.

void MaxCustomControls::MaxTreeList::CloseEditorOnEvent ( Object  sender,
EventArgs  e 
) [inline]

<exclude>

A handler which will close the current cell editor given an event being raised.

Parameters:
sender The original source of the event.
e Not used.
override void MaxCustomControls::MaxTreeList::PostEditor ( ) [inline]

<exclude>

Overrides the TreeList PostEditor behaviour.

Prevent the value from being updated and just raise a value change event.

virtual void MaxCustomControls::MaxTreeList::OnUserSelectionChanged ( EventArgs  e ) [inline, protected, virtual]

<exclude>

Raises the UserSelectionChanged event.

Parameters:
e Args to raise this event with.
override void MaxCustomControls::MaxTreeList::OnItemChanged ( int  index ) [inline, protected]

<exclude>

Overrides TreeList.OnItemChanged method.

Though inappropriately named for our "OnBlah fires the Blah event" convention, OnItemChanged is where the base TreeList handles an ListChanged.Item event. We override it here to simply schedule a repaint and mark the data as dirty. The default action is to immediately reevaluate everything and re-sort. Reevaluation is now deferred to paint, which batches these updates and waits until control returns to the message pump. We skip resorting altogether, allowing the user to resort by clicking the column header.

Parameters:
index not used
override void MaxCustomControls::MaxTreeList::OnPaint ( PaintEventArgs  e ) [inline, protected]

<exclude>

OnPaint is overridden to handle any updating deferred earlier.

When a subject signals that it is dirty, the MaxTreeList just makes a note of it, schedules a repaint, and defers updating until Max is no longer busy and control returns to the main event loop.

Parameters:
e the event args for this paint event

Reimplemented in MaxCustomControls::ExplorerTreeList.

override void MaxCustomControls::MaxTreeList::OnVisibleChanged ( EventArgs  e ) [inline, protected]

<exclude>

Overrides the TreeList.OnVisibleChanged() method.

Parameters:
e see TreeList.OnVisibleChanged(EventArgs)
override TreeListColumnCollection MaxCustomControls::MaxTreeList::CreateColumns ( ) [inline, protected]

<exclude>

Overrides the base class method to substitute in our own collection class.

Returns:
A new MaxTreeListColumncollection linked to this TreeList.
override TreeListViewInfo MaxCustomControls::MaxTreeList::CreateViewInfo ( ) [inline, protected]

<exclude>

Overrides the base class method to improve performance.

Returns:
A new MaxTreeListViewInfo linked to this TreeList.
override void MaxCustomControls::MaxTreeList::OnMouseDown ( MouseEventArgs  e ) [inline, protected]

<exclude>

Overrides the TreeList.OnMouseDown() method to store focus information before it is changed by the base class.

Parameters:
e see TreeList.OnMouseDown()

Reimplemented in MaxCustomControls::SceneExplorerControls::SceneExplorerTreeList.

override TreeListHandler MaxCustomControls::MaxTreeList::CreateHandler ( ) [inline, protected]

<exclude>

Overridden so that we can supply our own implementation of TreeListHandler.

Returns:
A MaxTreeListHandler object.
virtual void MaxCustomControls::MaxTreeList::SelectChildrenOnSelection ( object  sender,
EventArgs  e 
) [inline, protected, virtual]

<exclude>

The handler which listens to selection changes and extends the selection to all child nodes of that selection.

Parameters:
sender sender of the event
e not used

Reimplemented in MaxCustomControls::ExplorerTreeList.

override void MaxCustomControls::MaxTreeList::OnResize ( EventArgs  e ) [inline, protected]

<exclude>

Overridden to surround the base call with BeginUpdate and EndUpdate. This helps to reduce scrollbar flicker due to adjusting column sizes.

Parameters:
e Event details.
override void MaxCustomControls::MaxTreeList::BestFitColumns ( ) [inline]

<exclude>

Overridden to adjust the sizing algorithm to better fit the treelist hierarchy.


Member Data Documentation

readonly String MaxCustomControls::MaxTreeList::EditingEnabledPropertyName = "EditingEnabled" [static]
readonly String MaxCustomControls::MaxTreeList::SelectChildrenPropertyName = "SelectChildren" [static]

Property Documentation

bool MaxCustomControls::MaxTreeList::EditingEnabled [get, set]

<exclude>

Determines whether editing of properties is allowed on this treelist control.

bool MaxCustomControls::MaxTreeList::DragAndDropEnabled [get, set]

<exclude>

Determines if dragging and dropping TreeListNodes is enabled.

bool MaxCustomControls::MaxTreeList::ShowRoot [get, set]

<exclude>

Determines whether the root node is displayed in the treelist.

override bool MaxCustomControls::MaxTreeList::EnableEnhancedSorting [get, protected]

<exclude>

Speeds up sorting by disabling so-called "enhanced sorting," which really just sorts by the node's index within the original list if all other sort columns come out equal.

bool MaxCustomControls::MaxTreeList::UserSelectionChangedEnabled [get, set]

<exclude>

Controls whether the UserSelectionChanged event will fire.

The selection functions below automatically disable UserSelectionChanged when called.

virtual bool MaxCustomControls::MaxTreeList::DataDirty [get, set, protected]

<exclude>

A property which acts a dirty flag for the TreeList DataSource data.

override ContextMenuStrip MaxCustomControls::MaxTreeList::ContextMenuStrip [set]

<exclude>

Override for Control.ContextMenuStrip. Attaches a custom handler to new ContextMenuStrips.

bool MaxCustomControls::MaxTreeList::SelectChildren [get, set]

<exclude>

Determines whether a selection will also select a node's children in the treelist.


Event Documentation

PropertyChangedEventHandler MaxCustomControls::MaxTreeList::PropertyChanged
EventHandler<CSharpUtilities.ValueChangedEventArgs<bool> > MaxCustomControls::MaxTreeList::EditingEnabledChanged

<exclude>

Occurs when the EditingEnabled property value changes.

EventHandler MaxCustomControls::MaxTreeList::DataSourceChanged

<exclude>

Occurs when the DataSource property is changed to a different value.

EventHandler<RoutedKeyEventArgs> MaxCustomControls::MaxTreeList::RoutedKeyEvent

<exclude>

An event used to signal that a key event is going to be bubbled up from this control.

EventHandler MaxCustomControls::MaxTreeList::UserSelectionChanged

<exclude>

Event notifying listeners that a selection change occurred due to a user action (as opposed to a programmatic selection change).


MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList
MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList MaxCustomControls::MaxTreeList