Microsoft.Samples.DirectX.UtilityToolkit.ListBox Class Reference

List box control. More...

Inherits Microsoft::Samples::DirectX::UtilityToolkit::Control, Microsoft::Samples::DirectX::UtilityToolkit::Control, and Microsoft::Samples::DirectX::UtilityToolkit::Control.

Collaboration diagram for Microsoft.Samples.DirectX.UtilityToolkit.ListBox:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ListBox (Dialog parent)
 Create a new list box control.
void SetScrollbarWidth (int width)
 Sets the scroll bar width of this control.
override void OnInitialize ()
 Initialize the scrollbar control here.
override bool HandleKeyboard (NativeMethods.WindowMessage msg, IntPtr wParam, IntPtr lParam)
 Called when the control needs to handle the keyboard.
override bool HandleMouse (NativeMethods.WindowMessage msg, System.Drawing.Point pt, IntPtr wParam, IntPtr lParam)
 Called when the control should handle the mouse.
override void Render (Device device, float elapsedTime)
 Called when the control should be rendered.
void AddItem (string text, object data)
 Adds an item to the list box control.
void InsertItem (int index, string text, object data)
 Inserts an item to the list box control.
void RemoveAt (int index)
 Removes an item at a particular index.
void Clear ()
 Removes all items from the control.
int GetSelectedIndex (int previousSelected)
 For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected.
ListBoxItem GetSelectedItem (int previousSelected)
 Gets the selected item.
ListBoxItem GetSelectedItem ()
 Gets the selected item.
void SetBorder (int borderSize, int marginSize)
 Sets the border and margin sizes.
void SelectItem (int newIndex)
 Selects this item.
 ListBox (Dialog parent)
 Create a new list box control.
void SetScrollbarWidth (int width)
 Sets the scroll bar width of this control.
override void OnInitialize ()
 Initialize the scrollbar control here.
override bool HandleKeyboard (NativeMethods.WindowMessage msg, IntPtr wParam, IntPtr lParam)
 Called when the control needs to handle the keyboard.
override bool HandleMouse (NativeMethods.WindowMessage msg, System.Drawing.Point pt, IntPtr wParam, IntPtr lParam)
 Called when the control should handle the mouse.
override void Render (Device device, float elapsedTime)
 Called when the control should be rendered.
void AddItem (string text, object data)
 Adds an item to the list box control.
void InsertItem (int index, string text, object data)
 Inserts an item to the list box control.
void RemoveAt (int index)
 Removes an item at a particular index.
void Clear ()
 Removes all items from the control.
int GetSelectedIndex (int previousSelected)
 For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected.
ListBoxItem GetSelectedItem (int previousSelected)
 Gets the selected item.
ListBoxItem GetSelectedItem ()
 Gets the selected item.
void SetBorder (int borderSize, int marginSize)
 Sets the border and margin sizes.
void SelectItem (int newIndex)
 Selects this item.
 ListBox (Dialog parent)
 Create a new list box control.
void SetScrollbarWidth (int width)
 Sets the scroll bar width of this control.
override void OnInitialize ()
 Initialize the scrollbar control here.
override bool HandleKeyboard (NativeMethods.WindowMessage msg, IntPtr wParam, IntPtr lParam)
 Called when the control needs to handle the keyboard.
override bool HandleMouse (NativeMethods.WindowMessage msg, System.Drawing.Point pt, IntPtr wParam, IntPtr lParam)
 Called when the control should handle the mouse.
override void Render (Device device, float elapsedTime)
 Called when the control should be rendered.
void AddItem (string text, object data)
 Adds an item to the list box control.
void InsertItem (int index, string text, object data)
 Inserts an item to the list box control.
void RemoveAt (int index)
 Removes an item at a particular index.
void Clear ()
 Removes all items from the control.
int GetSelectedIndex (int previousSelected)
 For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected.
ListBoxItem GetSelectedItem (int previousSelected)
 Gets the selected item.
ListBoxItem GetSelectedItem ()
 Gets the selected item.
void SetBorder (int borderSize, int marginSize)
 Sets the border and margin sizes.
void SelectItem (int newIndex)
 Selects this item.

Public Attributes

const int MainLayer = 0
const int SelectionLayer = 1

Protected Member Functions

void RaiseContentsChangedEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the contents changed event.
void RaiseDoubleClickEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the double click event.
void RaiseSelectionEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the selection event.
override void UpdateRectangles ()
 Update the rectangles for the list box control.
void RaiseContentsChangedEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the contents changed event.
void RaiseDoubleClickEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the double click event.
void RaiseSelectionEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the selection event.
override void UpdateRectangles ()
 Update the rectangles for the list box control.
void RaiseContentsChangedEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the contents changed event.
void RaiseDoubleClickEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the double click event.
void RaiseSelectionEvent (ListBox sender, bool wasTriggeredByUser)
 Raises the selection event.
override void UpdateRectangles ()
 Update the rectangles for the list box control.

Protected Attributes

System.Drawing.Rectangle textRect
System.Drawing.Rectangle selectionRect
ScrollBar scrollbarControl
int scrollWidth
int border
int margin
int textHeight
int selectedIndex
int selectedStarted
bool isDragging
ListBoxStyle style
ArrayList itemList

Properties

override bool CanHaveFocus [get]
 Can this control have focus.
ListBoxStyle Style [get, set]
 Sets the style of the listbox.
int NumberItems [get]
 Number of items current in the list.
ListBoxItem this [int index] [get]
 Indexer for items in the list.

Events

EventHandler ContentsChanged
EventHandler DoubleClick
EventHandler Selection


Detailed Description

List box control.

Definition at line 3769 of file dxmutgui.cs.


Constructor & Destructor Documentation

Microsoft.Samples.DirectX.UtilityToolkit.ListBox.ListBox ( Dialog  parent  ) 

Create a new list box control.

Definition at line 3834 of file dxmutgui.cs.

Microsoft.Samples.DirectX.UtilityToolkit.ListBox.ListBox ( Dialog  parent  ) 

Create a new list box control.

Definition at line 3834 of file dxmutgui.cs.

Microsoft.Samples.DirectX.UtilityToolkit.ListBox.ListBox ( Dialog  parent  ) 

Create a new list box control.

Definition at line 3841 of file wdxmutgui.cs.


Member Function Documentation

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.AddItem ( string  text,
object  data 
)

Adds an item to the list box control.

Definition at line 4326 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.AddItem ( string  text,
object  data 
)

Adds an item to the list box control.

Definition at line 4318 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.AddItem ( string  text,
object  data 
)

Adds an item to the list box control.

Definition at line 4318 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.Clear (  ) 

Removes all items from the control.

Definition at line 4374 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.Clear (  ) 

Removes all items from the control.

Definition at line 4366 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.Clear (  ) 

Removes all items from the control.

Definition at line 4366 of file dxmutgui.cs.

int Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedIndex ( int  previousSelected  ) 

For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected.

Definition at line 4392 of file wdxmutgui.cs.

int Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedIndex ( int  previousSelected  ) 

For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected.

Definition at line 4384 of file dxmutgui.cs.

int Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedIndex ( int  previousSelected  ) 

For single-selection listbox, returns the index of the selected item. For multi-selection, returns the first selected item after the previousSelected position. To search for the first selected item, the app passes -1 for previousSelected. For subsequent searches, the app passes the returned index back to GetSelectedIndex as. previousSelected. Returns -1 on error or if no item is selected.

Definition at line 4384 of file dxmutgui.cs.

ListBoxItem Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedItem (  ) 

Gets the selected item.

Definition at line 4421 of file wdxmutgui.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

ListBoxItem Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedItem ( int  previousSelected  ) 

Gets the selected item.

Definition at line 4416 of file wdxmutgui.cs.

ListBoxItem Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedItem (  ) 

Gets the selected item.

Definition at line 4413 of file dxmutgui.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

ListBoxItem Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedItem ( int  previousSelected  ) 

Gets the selected item.

Definition at line 4408 of file dxmutgui.cs.

ListBoxItem Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedItem (  ) 

Gets the selected item.

Definition at line 4413 of file dxmutgui.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

ListBoxItem Microsoft.Samples.DirectX.UtilityToolkit.ListBox.GetSelectedItem ( int  previousSelected  ) 

Gets the selected item.

Definition at line 4408 of file dxmutgui.cs.

override bool Microsoft.Samples.DirectX.UtilityToolkit.ListBox.HandleKeyboard ( NativeMethods.WindowMessage  msg,
IntPtr  wParam,
IntPtr  lParam 
) [virtual]

Called when the control needs to handle the keyboard.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3913 of file wdxmutgui.cs.

override bool Microsoft.Samples.DirectX.UtilityToolkit.ListBox.HandleKeyboard ( NativeMethods.WindowMessage  msg,
IntPtr  wParam,
IntPtr  lParam 
) [virtual]

Called when the control needs to handle the keyboard.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3905 of file dxmutgui.cs.

override bool Microsoft.Samples.DirectX.UtilityToolkit.ListBox.HandleKeyboard ( NativeMethods.WindowMessage  msg,
IntPtr  wParam,
IntPtr  lParam 
) [virtual]

Called when the control needs to handle the keyboard.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3905 of file dxmutgui.cs.

override bool Microsoft.Samples.DirectX.UtilityToolkit.ListBox.HandleMouse ( NativeMethods.WindowMessage  msg,
System.Drawing.Point  pt,
IntPtr  wParam,
IntPtr  lParam 
) [virtual]

Called when the control should handle the mouse.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 4015 of file wdxmutgui.cs.

override bool Microsoft.Samples.DirectX.UtilityToolkit.ListBox.HandleMouse ( NativeMethods.WindowMessage  msg,
System.Drawing.Point  pt,
IntPtr  wParam,
IntPtr  lParam 
) [virtual]

Called when the control should handle the mouse.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 4007 of file dxmutgui.cs.

override bool Microsoft.Samples.DirectX.UtilityToolkit.ListBox.HandleMouse ( NativeMethods.WindowMessage  msg,
System.Drawing.Point  pt,
IntPtr  wParam,
IntPtr  lParam 
) [virtual]

Called when the control should handle the mouse.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 4007 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.InsertItem ( int  index,
string  text,
object  data 
)

Inserts an item to the list box control.

Definition at line 4342 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.InsertItem ( int  index,
string  text,
object  data 
)

Inserts an item to the list box control.

Definition at line 4334 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.InsertItem ( int  index,
string  text,
object  data 
)

Inserts an item to the list box control.

Definition at line 4334 of file dxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.OnInitialize (  )  [virtual]

Initialize the scrollbar control here.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3906 of file wdxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.OnInitialize (  )  [virtual]

Initialize the scrollbar control here.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3898 of file dxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.OnInitialize (  )  [virtual]

Initialize the scrollbar control here.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3898 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseContentsChangedEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the contents changed event.

Definition at line 3786 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseContentsChangedEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the contents changed event.

Definition at line 3779 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseContentsChangedEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the contents changed event.

Definition at line 3779 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseDoubleClickEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the double click event.

Definition at line 3798 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseDoubleClickEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the double click event.

Definition at line 3791 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseDoubleClickEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the double click event.

Definition at line 3791 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseSelectionEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the selection event.

Definition at line 3810 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseSelectionEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the selection event.

Definition at line 3803 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RaiseSelectionEvent ( ListBox  sender,
bool  wasTriggeredByUser 
) [protected]

Raises the selection event.

Definition at line 3803 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RemoveAt ( int  index  ) 

Removes an item at a particular index.

Definition at line 4359 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RemoveAt ( int  index  ) 

Removes an item at a particular index.

Definition at line 4351 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.RemoveAt ( int  index  ) 

Removes an item at a particular index.

Definition at line 4351 of file dxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.Render ( Device  device,
float  elapsedTime 
) [virtual]

Called when the control should be rendered.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 4239 of file wdxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.Render ( Device  device,
float  elapsedTime 
) [virtual]

Called when the control should be rendered.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 4231 of file dxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.Render ( Device  device,
float  elapsedTime 
) [virtual]

Called when the control should be rendered.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 4231 of file dxmutgui.cs.

Here is the call graph for this function:

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SelectItem ( int  newIndex  ) 

Selects this item.

Definition at line 4432 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SelectItem ( int  newIndex  ) 

Selects this item.

Definition at line 4424 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SelectItem ( int  newIndex  ) 

Selects this item.

Definition at line 4424 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SetBorder ( int  borderSize,
int  marginSize 
)

Sets the border and margin sizes.

Definition at line 4424 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SetBorder ( int  borderSize,
int  marginSize 
)

Sets the border and margin sizes.

Definition at line 4416 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SetBorder ( int  borderSize,
int  marginSize 
)

Sets the border and margin sizes.

Definition at line 4416 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SetScrollbarWidth ( int  width  ) 

Sets the scroll bar width of this control.

Definition at line 3892 of file wdxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SetScrollbarWidth ( int  width  ) 

Sets the scroll bar width of this control.

Definition at line 3884 of file dxmutgui.cs.

void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.SetScrollbarWidth ( int  width  ) 

Sets the scroll bar width of this control.

Definition at line 3884 of file dxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.UpdateRectangles (  )  [protected, virtual]

Update the rectangles for the list box control.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3866 of file wdxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.UpdateRectangles (  )  [protected, virtual]

Update the rectangles for the list box control.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3858 of file dxmutgui.cs.

override void Microsoft.Samples.DirectX.UtilityToolkit.ListBox.UpdateRectangles (  )  [protected, virtual]

Update the rectangles for the list box control.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3858 of file dxmutgui.cs.


Member Data Documentation

Definition at line 3822 of file dxmutgui.cs.

Definition at line 3827 of file dxmutgui.cs.

Definition at line 3830 of file dxmutgui.cs.

Definition at line 3771 of file dxmutgui.cs.

Definition at line 3823 of file dxmutgui.cs.

Definition at line 3820 of file dxmutgui.cs.

Definition at line 3821 of file dxmutgui.cs.

Definition at line 3825 of file dxmutgui.cs.

Definition at line 3826 of file dxmutgui.cs.

Definition at line 3772 of file dxmutgui.cs.

Definition at line 3819 of file dxmutgui.cs.

Definition at line 3828 of file dxmutgui.cs.

Definition at line 3824 of file dxmutgui.cs.

Definition at line 3818 of file dxmutgui.cs.


Property Documentation

override bool Microsoft::Samples::DirectX::UtilityToolkit.ListBox::CanHaveFocus [get]

Can this control have focus.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3886 of file dxmutgui.cs.

int Microsoft::Samples::DirectX::UtilityToolkit.ListBox::NumberItems [get]

Number of items current in the list.

Definition at line 3890 of file dxmutgui.cs.

ListBoxStyle Microsoft::Samples::DirectX::UtilityToolkit.ListBox::Style [get, set]

Sets the style of the listbox.

Definition at line 3888 of file dxmutgui.cs.

ListBoxItem Microsoft::Samples::DirectX::UtilityToolkit.ListBox::this [get]

Indexer for items in the list.

Reimplemented from Microsoft.Samples.DirectX.UtilityToolkit.Control.

Definition at line 3893 of file dxmutgui.cs.


Event Documentation

EventHandler Microsoft::Samples::DirectX::UtilityToolkit.ListBox::ContentsChanged

Definition at line 3775 of file dxmutgui.cs.

EventHandler Microsoft::Samples::DirectX::UtilityToolkit.ListBox::DoubleClick

Definition at line 3776 of file dxmutgui.cs.

EventHandler Microsoft::Samples::DirectX::UtilityToolkit.ListBox::Selection

Definition at line 3777 of file dxmutgui.cs.


The documentation for this class was generated from the following files:

Generated on Thu Jan 8 20:50:49 2009 for DXGfx by  doxygen 1.5.8