SkyGI::ListView Class Reference

Inheritance diagram for SkyGI::ListView:
[legend]
Collaboration diagram for SkyGI::ListView:
[legend]
List of all members.

Public Member Functions

 ListView (Window *pParent, const Rect rFrame, unsigned int nWindowLayoutFlags, unsigned int uiListViewFlags=0, unsigned int uiWindowFlags=0)
virtual ~ListView ()
void Paint (const Rect &rDirty)
void HandleMessage (const Message *pMessage)
void KeyDown (const InputEvent &nInputEvent)
bool FocusGet ()
bool FocusLost ()
void MouseDown (const InputEvent &nInputEvent)
void MouseUp (const InputEvent &nInputEvent)
void MouseWheel (const InputEvent &nInputEvent)
void MouseEnter (const InputEvent &nInputEvent)
void MouseLeave (const InputEvent &nInputEvent)
void Sized (const Point &pDelta)
void Append (ListViewRow *pListViewRow)
void Append (ListViewRow *pListViewRow, ListViewRow *pParent)
void Select (ListViewRow *pRow, bool bSelect, bool bOnSelected, const InputEvent &nInputEvent)
void Select (ListViewRow *pRow, bool bSelect, bool bClearSelection=false)
void ClearSelection (ListViewRow *pRow)
void SelectRange (ListViewRow *pStart, ListViewRow *pEnd, bool bOnSelected, const InputEvent &nInputEvent)
ListViewRowGetSelected ()
std::vector< ListViewRow * > GetSelection ()
void ShowIcons (bool bShow)
bool HasIcons ()
void SetIconSpacing (int iSpacing)
int GetIconSpacing ()
void ShowHeader (bool bShow)
bool HasHeader ()
ListViewColumnGetColumn (int iIndex)
void AppendColumn (ListViewColumn *pColumn)
void RemoveColumn (int iIndex)
int GetColumnIndexAt (const Point &pPos)
int GetColumns ()
void LayoutColumns ()
void SetCursor (ListViewRow *pRow)
int GetCursor ()
void RemoveAll (bool bDelete=true)
virtual void OnSelected (ListViewRow *pRow, const InputEvent &nInputEvent)
void RemoveColumns ()
virtual void SortRows (ListViewRow *pRow, bool bSortChildren=false)
void Sort (ListViewRow *pRow=NULL, bool bSortChildren=false)
void SetSortColumn (int iColumnIndex)
int GetSortColumn ()
SortOrder GetSortOrder ()
void SetSortOrder (SortOrder nSortOrder)
void SetAutoSort (bool bAutoSort=true)
bool GetAutoSort ()
void SetKeyLookupColumn (int iColumn=-1)
void RemoveRow (ListViewRow *pRow, bool bDelete=true)
void InvalidateRow (ListViewRow *pRow)
void InvalidateNode (ListViewNode *pNode)
void InvalidateHeader ()
int GetSelectionCount ()
void MouseMove (const InputEvent &nInputEvent)
void Refresh ()
int GetDefaultRowHeight ()
ListViewRowGetFirst ()
int GetRowCount (bool bRecursive=false)
void SetAutoSortChildren (bool bAutoSortChildren=true)
bool GetAutoSortChildren ()
void SetShowTree (bool bShowTree)
bool GetShowTree ()
void ScrollToEnd ()
void ScrollToBegin ()
void EnsureCursorVisible ()
virtual void DragStart (const InputEvent &nInputEvent)
virtual void SetColumnSeparator (bool bDraw)
virtual bool GetColumnSeparator ()
virtual void OnContextMenu (ListViewRow *pRow, const InputEvent &nInputEvent)
virtual void OnDragStart (const InputEvent &nInputEvent, ListViewRow *pRow)

Public Attributes

signal2< ListViewRow *, const
InputEvent & > 
Selected
signal2< ListViewRow *, const
InputEvent & > 
ContextMenu
signal2< const InputEvent &,
ListViewRow * > 
dragStart

Protected Member Functions

ListViewRow_PixelToRow (ListViewRow *pRow, int iY)

Friends

class ListViewRow

Classes

class  Private

Detailed Description

List/TreeView

Description:
This class implementes a full featured ListView.
Properties:
Examples:

listview.cpp, and networkinterface.cpp.


Constructor & Destructor Documentation

ListView::ListView ( Window pParent,
const Rect  rFrame,
unsigned int  nWindowLayoutFlags,
unsigned int  uiListViewFlags = 0,
unsigned int  uiWindowFlags = 0 
)

ListView::~ListView (  )  [virtual]


Member Function Documentation

void ListView::Paint ( const Rect rDirty  )  [virtual]

Paint window content

Description:
This function gets called whenever an area of the window has to be redrawn. Usually you should only draw from inside the Paint function. If you need to redraw a window (when lets say some content must be updated), simply call Invalidate() which will then (asynchronly) call this paint function.

Usually you should draw the background using Window::DrawBackground(rDirty) and the border with DrawBorder(rRect). This way the user has full control over the appearance of your window, meaning he can change the background and border style.
The window content area itself is defined by the border margin and the window margin. Every window may define a margin. If you draw content into this window always make sure to not draw into the margin area. Additionally, the border has a margin too. As the user has full control to select any border for your window make sure to user the current borders margin when drawing window content. the dra Window::Paint() just redraws the background using DrawBackground. Overload this member function to add custom dawing code
Overload this member function to add custom dawing code
Parameters:
rDirty - Dirty rectangular region which has to be redrawn. Prior entering this function the painters clip region is automatically set to this dirty region.
See also:
DrawBorder, DrawBackground, Border, GetBorder, GetBorder::Margin, GetMargin

Reimplemented from SkyGI::Window.

void ListView::HandleMessage ( const Message pMessage  )  [virtual]

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::DirectoryView, SkyGI::QueryResultView, and SkyGI::QueryView.

void ListView::KeyDown ( const InputEvent nInputEvent  )  [virtual]

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::DirectoryView, and SkyGI::QueryView.

bool ListView::FocusGet (  )  [virtual]

Reimplemented from SkyGI::Window.

bool ListView::FocusLost (  )  [virtual]

Reimplemented from SkyGI::Window.

void ListView::MouseDown ( const InputEvent nInputEvent  )  [virtual]

Mouse pressed

Description:
This function gets called when a mouse press occured inside this window.
Overload this member function to react on mouse presses.
Parameters:
nButton - MouseButton which was pressed
nMouseButtonMask - Mask showing which mouse buttons were pressed when the mouse press occured
nInputEvent - INPUT_EVENT_MOUSE_PRESS for a single and INPUTE_EVENT_MOUSE_DOUBLECLICK for a doubleclick

Reimplemented from SkyGI::Window.

void ListView::MouseUp ( const InputEvent nInputEvent  )  [virtual]

Mouse release

Description:
This function gets called when a mouse release occured inside this window.
Overload this member function to react on mouse releases.
Parameters:
nButton - MouseButton which was released
nMouseButtonMask - Mask showing which additional mouse buttons were pressed when the mouse release occured
nInputEvent - INPUT_EVENT_MOUSE_RELEASE

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::DirectoryView, and SkyGI::NavigationView.

void ListView::MouseWheel ( const InputEvent nInputEvent  )  [virtual]

Reimplemented from SkyGI::Window.

void ListView::MouseEnter ( const InputEvent nInputEvent  )  [virtual]

Mouse enter

Description:
This function gets called when the mouse first enters the window.
Overload this member function to react on mouse enter events.
Parameters:
pPosEnter - Position the mouse cursor entered the window
nMouseButtonMask - Mask showing which mouse buttons were pressed when the mouse enter occured

Reimplemented from SkyGI::Window.

void ListView::MouseLeave ( const InputEvent nInputEvent  )  [virtual]

Mouse leave

Description:
This function gets called when the mouse leaves the window.
Overload this member function to react on mouse leave events.
Parameters:
pPosLeave - Position the mouse cursor leaved the window at
nMouseButtonMask - Mask showing which mouse buttons were pressed when the mouse leave occured

Reimplemented from SkyGI::Window.

void ListView::Sized ( const Point pDelta  )  [virtual]

Called when window is resized

Description:
Overload this function to get notified when the window is resized
Note:
Call this function from the overloaded function to perform automatic window layout on child windows
Parameters:
pDelta - Size the window was resized
See also:
MoveTo, MoveBy, SetRect, Moved, Layout

Reimplemented from SkyGI::Window.

void ListView::Append ( ListViewRow pListViewRow  ) 

void ListView::Append ( ListViewRow pListViewRow,
ListViewRow pParent 
)

void ListView::Select ( ListViewRow pRow,
bool  bSelect,
bool  bOnSelected,
const InputEvent nInputEvent 
)

void ListView::Select ( ListViewRow pRow,
bool  bSelect,
bool  bClearSelection = false 
)

void ListView::ClearSelection ( ListViewRow pRow  ) 

void ListView::SelectRange ( ListViewRow pStart,
ListViewRow pEnd,
bool  bOnSelected,
const InputEvent nInputEvent 
)

ListViewRow * ListView::GetSelected (  ) 

std::vector< ListViewRow * > ListView::GetSelection (  ) 

void ListView::ShowIcons ( bool  bShow  ) 

bool ListView::HasIcons (  ) 

void ListView::SetIconSpacing ( int  iSpacing  ) 

int ListView::GetIconSpacing (  ) 

void ListView::ShowHeader ( bool  bShow  ) 

bool ListView::HasHeader (  ) 

ListViewColumn * ListView::GetColumn ( int  iIndex  ) 

void ListView::AppendColumn ( ListViewColumn pColumn  ) 

void ListView::RemoveColumn ( int  iIndex  ) 

int ListView::GetColumnIndexAt ( const Point pPos  ) 

int ListView::GetColumns (  ) 

void ListView::LayoutColumns (  ) 

void ListView::SetCursor ( ListViewRow pRow  ) 

int ListView::GetCursor (  ) 

void ListView::RemoveAll ( bool  bDelete = true  ) 

Remove all rows

Description:
Removes all rows from the ListView. If bDelete is true all ListViewRow objects gets deleted, else they are just unlinked.

void ListView::OnSelected ( ListViewRow pRow,
const InputEvent nInputEvent 
) [virtual]

Called when an entry was selected

Description:
Emitts the Select signal
Parameters:
iRowIndex Selected row index
nInputEvent InputEvent
See also:
Selected

void ListView::RemoveColumns (  ) 

void ListView::SortRows ( ListViewRow pRow,
bool  bSortChildren = false 
) [virtual]

void ListView::Sort ( ListViewRow pRow = NULL,
bool  bSortChildren = false 
)

void ListView::SetSortColumn ( int  iColumnIndex  ) 

int ListView::GetSortColumn (  ) 

SortOrder ListView::GetSortOrder (  ) 

void ListView::SetSortOrder ( SortOrder  nSortOrder  ) 

void ListView::SetAutoSort ( bool  bAutoSort = true  ) 

Set auto sort

Description:
If enabled Append() and Remove() will automatically sort the listview. This can be rather slow when inserting/removing multiple items at once. Using SetAutoSort(false) before and SetAutoSort(true) after modifing the items will drastically speedup the operation. Optionally you can always use SetAutoSort(false) and manually sort the list with Sort()
See also:
GetAutoSort, Sort, GetAutoSortChildren, SetAutoSortChildren

bool ListView::GetAutoSort (  ) 

Get auto sort

See also:
SetAutoStart

void ListView::SetKeyLookupColumn ( int  iColumn = -1  ) 

void ListView::RemoveRow ( ListViewRow pRow,
bool  bDelete = true 
)

Remove a row

Description:
Removes a row from the ListView. If bDelete is true the ListViewRow object gets deleted, else it is just unlinked

void ListView::InvalidateRow ( ListViewRow pRow  ) 

void ListView::InvalidateNode ( ListViewNode pNode  ) 

void ListView::InvalidateHeader (  ) 

int ListView::GetSelectionCount (  ) 

void ListView::MouseMove ( const InputEvent nInputEvent  )  [virtual]

Mouse move

Description:
This function gets called when the mouse cursor was moved inside the window. Mouse move events are only generated after a call to EnableMouseMoveEvents(). Use DisableMouseMoveEvents() to disable further generation of mouse move events.
Overload this member function to react on mouse move events.
Parameters:
pNewPosition - Current mouse cursor position
pOldPosition - Old mouse cursor position
nMouseButtonMask - Mask showing which mouse buttons were pressed when the mouse move occured

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::DirectoryView, and SkyGI::NavigationView.

void ListView::Refresh (  ) 

Reimplemented in SkyGI::DirectoryView.

int ListView::GetDefaultRowHeight (  ) 

ListViewRow * ListView::GetFirst (  ) 

int ListView::GetRowCount ( bool  bRecursive = false  ) 

void ListView::SetAutoSortChildren ( bool  bAutoSortChildren = true  ) 

Set auto sort children

Description:
If enabled and a listview gets sorted child rows will also be sorted. This can be rather slow when inserting/removing multiple items at once. Using SetAutoSortChildren(false) before and SetAutoSortChildren(true) after modifing the items will drastically speed the operation. Optionally you can always use SetAutoSortChildren(false) and manually sort the list with Sort()
See also:
GetAutoSortChildren, Sort, GetAutoSort, SetAutoSort

bool ListView::GetAutoSortChildren (  ) 

Set auto sort children

See also:
SetAutoSortChildren

void ListView::SetShowTree ( bool  bShowTree  ) 

bool ListView::GetShowTree (  ) 

void ListView::ScrollToEnd (  ) 

void ListView::ScrollToBegin (  ) 

void ListView::EnsureCursorVisible (  ) 

void ListView::DragStart ( const InputEvent nInputEvent  )  [virtual]

Reimplemented from SkyGI::Window.

void ListView::SetColumnSeparator ( bool  bDraw  )  [virtual]

bool ListView::GetColumnSeparator (  )  [virtual]

void ListView::OnContextMenu ( ListViewRow pRow,
const InputEvent nInputEvent 
) [virtual]

void ListView::OnDragStart ( const InputEvent nInputEvent,
ListViewRow pRow 
) [virtual]

Reimplemented in SkyGI::DirectoryView, and SkyGI::QueryView.

ListViewRow * ListView::_PixelToRow ( ListViewRow pRow,
int  iY 
) [protected]


Friends And Related Function Documentation

friend class ListViewRow [friend]


Member Data Documentation

signal2<ListViewRow* , const InputEvent&> SkyGI::ListView::Selected

Emitted when an entry was selected

Parameters:
iRowIndex Selected row index
nInputEvent InputEvent
See also:
OnSelected

Reimplemented in SkyGI::QueryResultView.

signal2<ListViewRow*, const InputEvent&> SkyGI::ListView::ContextMenu

Emitted when context menu is requested

Parameters:
iRowIndex Current selected row index
nInputEvent InputEvent
See also:
OnSelected

signal2<const InputEvent&, ListViewRow *> SkyGI::ListView::dragStart


Generated on Thu Dec 13 18:14:32 2007 for SkyGI by  doxygen 1.5.1-p1