Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

os::ListView Class Reference

Flexible multicolumn list view. More...

#include <listview.h>

Inheritance diagram for os::ListView::

os::Control os::View os::Invoker os::Handler os::DirectoryView List of all members.

Public Types

typedef std::vector< ListViewRow
*>::const_iterator 
const_iterator
typedef std::vector< int > column_map
enum  scroll_direction {
  SCROLL_UP,
  SCROLL_DOWN
}
enum  { AUTOSCROLL_BORDER = 20 }
enum  {
  F_MULTI_SELECT = 0x0001,
  F_NO_AUTO_SORT = 0x0002,
  F_RENDER_BORDER = 0x0004,
  F_DONT_SCROLL = 0x0008,
  F_NO_HEADER = 0x0010,
  F_NO_COL_REMAP = 0x0020
}
enum  {
  INV_HEIGHT = 0x01,
  INV_WIDTH = 0x02,
  INV_VISUAL = 0x04
}

Public Methods

 ListView (const Rect &cFrame, const char *pzTitle, uint32 nModeFlags=F_MULTI_SELECT|F_RENDER_BORDER, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE)
 ~ListView ()
virtual void LabelChanged (const std::string &cNewLabel)
virtual void EnableStatusChanged (bool bIsEnabled)
virtual bool Invoked (Message *pcMessage)
 Intercept outgoing messages. More...

virtual void Invoked (int nFirstRow, int nLastRow)
virtual void SelectionChanged (int nFirstRow, int nLastRow)
virtual bool DragSelection (const Point &cPos)
virtual void __reserved1__ ()
virtual void __reserved2__ ()
virtual void __reserved3__ ()
virtual void __reserved4__ ()
void StartScroll (scroll_direction eDirection, bool bSelect)
void StopScroll ()
bool IsMultiSelect () const
void SetMultiSelect (bool bMulti)
bool IsAutoSort () const
void SetAutoSort (bool bAuto)
bool HasBorder () const
void SetRenderBorder (bool bRender)
bool HasColumnHeader () const
void SetHasColumnHeader (bool bFlag)
void MakeVisible (int nRow, bool bCenter=true)
int InsertColumn (const char *pzTitle, int nWidth, int nPos=-1)
const column_mapGetColumnMapping () const
void SetColumnMapping (const column_map &cMap)
void InsertRow (int nPos, ListViewRow *pcRow, bool bUpdate=true)
void InsertRow (ListViewRow *pcRow, bool bUpdate=true)
ListViewRowRemoveRow (int nIndex, bool bUpdate=true)
void InvalidateRow (int nRow, uint32 nFlags)
uint GetRowCount () const
ListViewRowGetRow (const Point &cPos) const
ListViewRowGetRow (uint nIndex) const
int HitTest (const Point &cPos) const
float GetRowPos (int nRow)
void Clear ()
bool IsSelected (uint nRow) const
void Select (int nFirst, int nLast, bool bReplace=true, bool bSelect=true)
void Select (int nRow, bool bReplace=true, bool bSelect=true)
void ClearSelection ()
void Highlight (int nFirst, int nLast, bool bReplace, bool bHighlight=true)
void Highlight (int nRow, bool bReplace, bool bHighlight=true)
void SetCurrentRow (int nRow)
void Sort ()
int GetFirstSelected () const
int GetLastSelected () const
void SetSelChangeMsg (Message *pcMsg)
void SetInvokeMsg (Message *pcMsg)
MessageGetSelChangeMsg () const
MessageGetInvokeMsg () const
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view. More...

virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized. More...

virtual void KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is pressed while the view has focus. More...

virtual void AllAttached ()
virtual bool HasFocus (void) const
const_iterator begin () const
const_iterator end () const

Friends

class ListViewContainer
class ListViewHeader

Detailed Description

Description:
See also:
Author:
Kurt Skauen (kurt@atheos.cx)


Member Typedef Documentation

typedef std::vector<int> os::ListView::column_map
 

typedef std::vector<ListViewRow*>::const_iterator os::ListView::const_iterator
 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
AUTOSCROLL_BORDER  

anonymous enum
 

Enumeration values:
F_MULTI_SELECT  
F_NO_AUTO_SORT  
F_RENDER_BORDER  
F_DONT_SCROLL  
F_NO_HEADER  
F_NO_COL_REMAP  

anonymous enum
 

Enumeration values:
INV_HEIGHT  
INV_WIDTH  
INV_VISUAL  

enum os::ListView::scroll_direction
 

Enumeration values:
SCROLL_UP  
SCROLL_DOWN  


Constructor & Destructor Documentation

ListView::ListView const Rect & cFrame,
const char * pzTitle,
uint32 nModeFlags = F_MULTI_SELECT | F_RENDER_BORDER,
uint32 nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32 nFlags = WID_WILL_DRAW | WID_FULL_UPDATE_ON_RESIZE
 

ListView::~ListView
 


Member Function Documentation

void ListView::AllAttached void [virtual]
 

Reimplemented from os::View.

void ListView::Clear
 

void ListView::ClearSelection
 

bool ListView::DragSelection const Point & cPos [virtual]
 

Reimplemented in os::DirectoryView.

void ListView::EnableStatusChanged bool bIsEnabled [virtual]
 

Reimplemented from os::Control.

void ListView::FrameSized const Point & cDelta [virtual]
 

Description:
Overload this member if you need to know when the view is resized.
Note:
This member is called after the view is resized. If you need the old size you can subtract the cDelta calue from the current size.
Parameters:
cDelta   The distance the bottom/right corner was moved relative to the upper/left corner.
See also:
FrameMoved(), SetFrame, ResizeBy(), ResizeTo()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

const std::vector< int > & ListView::GetColumnMapping const
 

int ListView::GetFirstSelected const
 

Message * ListView::GetInvokeMsg const
 

int ListView::GetLastSelected const
 

ListViewRow * ListView::GetRow uint nIndex const
 

ListViewRow * ListView::GetRow const Point & cPos const
 

uint ListView::GetRowCount const
 

float ListView::GetRowPos int nRow
 

Message * ListView::GetSelChangeMsg const
 

bool ListView::HasBorder const
 

bool ListView::HasColumnHeader const
 

bool ListView::HasFocus void const [virtual]
 

Reimplemented from os::View.

void ListView::Highlight int nRow,
bool bReplace,
bool bHighlight = true
 

void ListView::Highlight int nFirst,
int nLast,
bool bReplace,
bool bHighlight = true
 

int ListView::HitTest const Point & cPos const
 

int ListView::InsertColumn const char * pzTitle,
int nWidth,
int nPos = -1
 

void ListView::InsertRow ListViewRow * pcRow,
bool bUpdate = true
 

void ListView::InsertRow int nPos,
ListViewRow * pcRow,
bool bUpdate = true
 

void ListView::InvalidateRow int nRow,
uint32 nFlags
 

void ListView::Invoked int nFirstRow,
int nLastRow
[virtual]
 

Reimplemented in os::DirectoryView.

bool ListView::Invoked Message * pcMessage [virtual]
 

Description:
This member is called from Invoke() just before a message is sendt to the target.

This allow classes that inherits from os::Invoker to add data to or otherwhice modify the message before it is sendt. The message can also be canceled entirely by returning false from this member.

The message passed to Invoked() is a copy of the internal message or the message passed to Invoke() (if any) so any changes made here will not affect the internal message or the message passed to Invoke(). When this method returns the message will imidiatly be sendt to the target and then discarded (unless false is returned in which case the message is simply discarded).

The default implementation of this member does nothing and return true.

Parameters:
pcMessage   Pointer to the message that is about to be sendt. You can do any modification you like to this message (but never delete it).
Returns:
Normally you should return true to indicate that the message should be sendt. You can however return false if you for some reason want to cancel the invokation.
See also:
Invoke(), SetMessage(), SetTarget()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::Control.

bool ListView::IsAutoSort const
 

bool ListView::IsMultiSelect const
 

bool ListView::IsSelected uint nRow const
 

void ListView::KeyDown const char * pzString,
const char * pzRawString,
uint32 nQualifiers
[virtual]
 

Description:
Overload this member if your view need to handle keyboard input. This member is called to allow the view to handle M_KEY_DOWN messages. The most common members are exctracted from the message and passed as parameters but you might need to obtain the raw message with os::Looper::GetCurrentMessage() and find some members yourself if you the data you needed are not passed in.

For example if you need the raw key-code for the pressed key you will have to lookup the "_raw_key" member from the message.

Parameters:
pzString   String containing a single UTF-8 encoded character. This is the character generated by the pressed key according to the current keymap accounting for any qualifiers that might be pressed.
pzRawString   Same as pzString except that the key is converted without accounting for qualifiers. Ie. if 'A' is pressed while pressing <SHIFT> pzString will contain 'A' and pzRawString will contain 'a'.
nQualifiers   Bitmask describing which qualifiers that was active when the key was pressed.

See also:
KeyUp(), os::Looper::GetCurrentMessage()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

Reimplemented in os::DirectoryView.

void ListView::LabelChanged const std::string & cNewLabel [virtual]
 

Reimplemented from os::Control.

void ListView::MakeVisible int nRow,
bool bCenter = true
 

void ListView::Paint const Rect & cUpdateRect [virtual]
 

Description:
Note:
Warning:
Parameters:
cUpdateRect   A rectangle enclosing all damaged areas. This is just a rough "worst-case", further fine-grained clipping will be performed by the Application Server to avoid updating non-damaged pixels and make the update as fast and flicker-free as possible.

See also:
Invalidate(), Flush()
Author:
Kurt Skauen (kurt@atheos.cx)

Reimplemented from os::View.

ListViewRow * ListView::RemoveRow int nIndex,
bool bUpdate = true
 

void ListView::Select int nRow,
bool bReplace = true,
bool bSelect = true
 

void ListView::Select int nFirst,
int nLast,
bool bReplace = true,
bool bSelect = true
 

void ListView::SelectionChanged int nFirstRow,
int nLastRow
[virtual]
 

void ListView::SetAutoSort bool bAuto
 

void os::ListView::SetColumnMapping const column_map & cMap
 

void ListView::SetCurrentRow int nRow
 

void ListView::SetHasColumnHeader bool bFlag
 

void ListView::SetInvokeMsg Message * pcMsg
 

void ListView::SetMultiSelect bool bMulti
 

void ListView::SetRenderBorder bool bRender
 

void ListView::SetSelChangeMsg Message * pcMsg
 

void ListView::Sort
 

void ListView::StartScroll scroll_direction eDirection,
bool bSelect
 

void ListView::StopScroll
 

void ListView::__reserved1__ [virtual]
 

void ListView::__reserved2__ [virtual]
 

void ListView::__reserved3__ [virtual]
 

void ListView::__reserved4__ [virtual]
 

ListView::const_iterator ListView::begin const
 

ListView::const_iterator ListView::end const
 


Friends And Related Function Documentation

friend class ListViewContainer [friend]
 

friend class ListViewHeader [friend]
 


Generated at Tue Sep 11 15:27:49 2001 for AtheOS higlevel API by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001