WidgetDataGrid Class Template Reference
[Widgets]

List View Control class. More...

Inherits MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy >, TrueWindow, AspectBorder< SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy > >, AspectClickable< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectDblClickable< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectEnabled< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectFocus< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectFont< SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy > >, AspectKeyPressed< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectMouseClicks< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectRaw< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectRightClickable< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectScrollable< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectSelection< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectSizable< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, AspectThreads< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >, and AspectVisible< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, SmartWin::MessageMapControl< EventHandlerClass, SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >, MessageMapPolicy > >.

List of all members.

Public Types

typedef bool(*) boolFunctionTakingInt (EventHandlerClass *, WidgetType *, int)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and an int returning bool.
typedef bool(*) boolFunctionTakingTstring (EventHandlerClass *, WidgetType *, const SmartUtil::tstring &)
 Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a const SmartUtil::tstring & returning bool.
typedef bool(*) boolFunctionTakingUnsigned (EventHandlerClass *, WidgetType *, unsigned)
 Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class pluss an unsigned int returning void.
typedef bool(*) boolValidationFunc (EventHandlerClass *, WidgetType *, unsigned, unsigned, SmartUtil::tstring &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, two unsigned int and a SmartUtil::tstring & returning bool.
typedef BrushPtr(*) brushFunctionTakingCanvas (EventHandlerClass *, WidgetType *, Canvas &canvas)
 Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a Canvas & returning BrushPtr.
typedef HRESULT(*) hresultFunctionTakingLparamWparam (EventHandlerClass *, WidgetType *, LPARAM, WPARAM)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget, an LPARAM and a WPARAM returning HRESULT.
typedef int(*) intCallbackCompareFunc (EventHandlerClass *, WidgetType *, LPARAM, LPARAM)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and two LPARAM returning int.
typedef bool(EventHandlerClass::*) itsBoolFunctionTakingInt (WidgetType *, int)
 Typedef of a member function to the original class taking pointer to the this Widget and an int returning bool.
typedef bool(EventHandlerClass::*) itsBoolFunctionTakingTstring (WidgetType *, const SmartUtil::tstring &)
 Typedef of a member function to the original class taking pointer to the this Widget and a const SmartUtil::tstring & returning bool.
typedef bool(EventHandlerClass::*) itsBoolFunctionTakingUnsigned (WidgetType *, unsigned)
 Typedef of a member function to the original class taking pointer to the this Widget and unsigned and returning bool.
typedef bool(EventHandlerClass::*) itsBoolValidationFunc (WidgetType *, unsigned, unsigned, SmartUtil::tstring &)
 Typedef of a member function to the original class taking pointer to the this Widget, two unsigned int and SmartUtil::tstring & returning bool.
typedef BrushPtr(EventHandlerClass::*) itsBrushFunctionTakingCanvas (WidgetType *, Canvas &)
 Typedef of a member function to the original class taking pointer to the this Widget and a Canvas & returning BrushPtr.
typedef HRESULT(EventHandlerClass::*) itsHresultFunctionTakingLparamWparam (WidgetType *, LPARAM, WPARAM)
 Typedef of a member function to the original class taking pointer to the this Widget, an LPARAM and a WPARAM returning HRESULT.
typedef int(EventHandlerClass::*) itsIntLparamLparam (WidgetType *, LPARAM, LPARAM)
 Typedef of a member function to the original class taking pointer to the this Widget, two LPARAM returning int.
typedef void(EventHandlerClass::*) itsVoidDrawItemFunction (WidgetType *, const DRAWITEMSTRUCT &)
 Typedef of a member function to the original class taking pointer to the this Widget and a const DRAWITEMSTRUCT & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTaking2Bool (WidgetType *, bool, bool)
 Typedef of a member function to the original class taking pointer to the this Widget and two bool returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingBool (WidgetType *, bool)
 Typedef of a member function to the original class taking pointer to the this Widget and a bool returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingCanvas (WidgetType *, Canvas &)
 Typedef of a member function to the original class taking pointer to the this Widget and a Canvas & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingConstString (WidgetType *, const SmartUtil::tstring &)
 Typedef of a member function to the original class taking pointer to the this Widget and a SmartUtil::tstring & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingInt (WidgetType *, int)
 Typedef of a member function to the original class taking pointer to the this Widget and an int returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingMouseEventResult (WidgetType *, const MouseEventResult &)
 Typedef of a member function to the original class taking pointer to the this Widget and a const MouseEventResult & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingPoint (WidgetType *, const Point &)
 Typedef of a member function to the original class taking pointer to the this Widget and const Point & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingString (WidgetType *, SmartUtil::tstring &)
 Typedef of a member function to the original class taking pointer to the this Widget and a SmartUtil::tstring & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingSystemTime (WidgetType *, const SYSTEMTIME &)
 Typedef of a member function to the original class taking pointer to the this Widget and a const SYSTEMTIME & returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingUInt (WidgetType *, unsigned)
 Typedef of a member function to the original class taking pointer to the this Widget and an unsigned int returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingVoid (WidgetType *)
 Typedef of a member function to the original class taking pointer to the this Widget returning void.
typedef void(EventHandlerClass::*) itsVoidFunctionTakingWindowSizedEventResult (WidgetType *, const WidgetSizedEventResult &)
 Typedef of a member function to the original class taking pointer to the this Widget and const WidgetSizedEventResult & returning void.
typedef void(EventHandlerClass::*) itsVoidGetIconFunc (WidgetType *, LPARAM, unsigned, int &)
 Typedef of a member function to the original class taking pointer to the this Widget, an unsigned int and an int & returning void.
typedef void(EventHandlerClass::*) itsVoidGetItemFunc (WidgetType *, LPARAM, unsigned, unsigned, SmartUtil::tstring &)
 Typedef of a member function to the original class taking pointer to the this Widget, two unsigned int and SmartUtil::tstring & returning void.
typedef void(EventHandlerClass::*) itsVoidMeasureItemFunction (WidgetType *, MEASUREITEMSTRUCT *)
 Typedef of a member function to the original class taking pointer to the this Widget and a MEASUREITEMSTRUCT * returning void.
typedef void(EventHandlerClass::*) itsVoidUnsignedUnsignedBoolCanvasRectangle (WidgetType *, unsigned, unsigned, bool, Canvas &, const SmartWin::Rectangle &)
 Typedef of a member function to the original class taking pointer to the this Widget, two unsigned int, a Canvas & and a const Rectangle & returning void.
typedef WidgetDataGrid< EventHandlerClass,
MessageMapPolicy > * 
ObjectType
 Object type.
typedef WidgetDataGrid< EventHandlerClass,
MessageMapPolicy > 
ThisType
 Class type.
typedef void(*) voidDrawItemFunction (EventHandlerClass *, WidgetType *, const DRAWITEMSTRUCT &)
 Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a const DRAWITEMSTRUCT & returning void.
typedef void(*) voidFunctionTaking2Bool (EventHandlerClass *, WidgetType *, bool, bool)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and two bool returning void.
typedef void(*) voidFunctionTakingBool (EventHandlerClass *, WidgetType *, bool)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a bool returning void.
typedef void(*) voidFunctionTakingCanvas (EventHandlerClass *, WidgetType *, Canvas &)
 Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a Canvas & returning void.
typedef void(*) voidFunctionTakingConstString (EventHandlerClass *, WidgetType *, const SmartUtil::tstring &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a SmartUtil::tstring & returning void.
typedef void(*) voidFunctionTakingInt (EventHandlerClass *, WidgetType *, int)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and an int returning void.
typedef void(*) voidFunctionTakingMouseEventResult (EventHandlerClass *, WidgetType *, const MouseEventResult &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const MouseEventResult & returning void.
typedef void(*) voidFunctionTakingPoint (EventHandlerClass *, WidgetType *, const Point &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const Point & returning void.
typedef void(*) voidFunctionTakingString (EventHandlerClass *, WidgetType *, SmartUtil::tstring &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a SmartUtil::tstring & returning void.
typedef void(*) voidFunctionTakingSystemTime (EventHandlerClass *, WidgetType *, const SYSTEMTIME &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const SYSTEMTIME & returning void.
typedef void(*) voidFunctionTakingUInt (EventHandlerClass *, WidgetType *, unsigned)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and an unsigned int returning void.
typedef void(*) voidFunctionTakingVoid (EventHandlerClass *, WidgetType *)
 Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class returning void.
typedef void(*) voidFunctionTakingWindowSizedEventResult (EventHandlerClass *, WidgetType *, const WidgetSizedEventResult &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class and a const WidgetSizedEventResult & returning void.
typedef void(*) voidGetIconFunc (EventHandlerClass *, WidgetType *, LPARAM, unsigned, int &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, an LPARAM, an unsigned int and an int & returning void.
typedef void(*) voidGetItemFunc (EventHandlerClass *, WidgetType *, LPARAM, unsigned, unsigned, int &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, an LPARAM, two unsigned int and a SmartUtil::tstring & returning void.
typedef void(*) voidMeasureItemFunction (EventHandlerClass *, WidgetType *, MEASUREITEMSTRUCT *)
 Typedef of a static/global function taking a pointer to the original class and a pointer to the this Widget class and a MEASUREITEMSTRUCT * returning void.
typedef void(*) voidUnsignedUnsignedBoolCanvasRectangle (EventHandlerClass *, WidgetType *, unsigned, unsigned, bool, Canvas &, const SmartWin::Rectangle &)
 Typedef of a static/global function taking a pointer to the original class, a pointer to the this Widget class, two unsigned int, a bool, a Canvas & and a const Rectangle & returning void.

Public Member Functions

void addRemoveExStyle (DWORD addStyle, bool add)
 Use this function to add or remove windows exStyles.
void addRemoveStyle (DWORD addStyle, bool add)
 Use this function to add or remove windows styles.
void bringToBottom ()
 Brings the widget to the bottom.
void bringToFront ()
 Brings the widget to the front.
void clearSelection ()
 Clears the selection of the grid.
virtual void create (const Seed &cs=getDefaultSeed())
 Actually creates the Data Grid Control.
void createColumns (const std::vector< SmartUtil::tstring > &colNames)
 Create columns in the grid.
void deleteColumn (unsigned columnNo)
 Deletes the given column.
Utilities::Thread fork (unsigned long(EventHandlerClass::*threadProc)())
 Creates a new thread on the given function.
template<class Param>
Utilities::Thread fork (const Param &par, unsigned long(EventHandlerClass::*threadProc)(Param &))
 Creates a new thread and passes the given parameter.
Rectangle getBounds () const
 Returns the position and size of the window.
bool getCapsLockOn ()
 Checks if Caps Lock is on.
SmartUtil::tstring getCellText (unsigned int column, unsigned int row)
 Returns the text of the given cell.
SmartUtil::tstring getCellTextByLParam (unsigned int column, LPARAM lParam)
 Returns the text of the given cell.
Point getClientAreaSize () const
 Returns the size of the client area of the window.
unsigned getColumnCount ()
 Returns the number of column in the grid.
SmartUtil::tstring getColumnName (unsigned col)
 Returns the name of a specific column.
bool getControlPressed ()
 Checks if control is pressed.
Utilities::CriticalSectiongetCriticalSection ()
 Returns a CriticalSection associated with the current Widget object.
HMENU getCtrlId () const
 Returns the control id of the Widget.
bool getEnabled () const
 Retrieves the enabled property of the Widget.
bool getFocus () const
 Retrieves the focus property of the Widget.
FontPtr getFont ()
 Returns the font used by the Widget.
bool getIsRowChecked (unsigned row)
 Returns the checked state of the given row.
WidgetgetParent () const
 Returns the parent Widget of the Widget.
Point getPosition () const
 Returns the position of the window.
bool getReadOnly ()
 Returns a boolean indicating if the Grid is in "read only" mode or not.
unsigned getRowCount ()
 Returns the number of rows in the grid.
unsigned getRowNumberFromLParam (unsigned lParam)
 Returns the physical rownumber from a given LPARAM number.
int getSelectedIndex () const
 Returns an unsigned integer which is the selected row of the grid.
std::vector< unsigned > getSelectedRows ()
 Returns a vector containing all the selected rows of the grid.
bool getShiftPressed ()
 Checks if shift is pressed.
Point getSize () const
 Returns the size of the window.
Point getTextSize (const SmartUtil::tstring &text)
 Fills a Point with the size of text to be drawn in the Widget's font.
bool getVisible () const
 Retrieves the visible property of the Widget.
HWND handle () const
 Returns the HWND to the Widget.
bool hasSelection ()
 Returns true if grid has got a "current selected item".
void insertCallbackRow (const LPARAM lParam)
 Inserts a callback row.
void insertRow (int index=-1, int iconIndex=-1)
 Inserts an empty row into the grid.
LPARAM insertRow (const std::vector< SmartUtil::tstring > &row, LPARAM lPar=0, int index=-1, int iconIndex=-1)
 Inserts a row into the grid.
void invalidateWidget ()
 Add this widget to the update area.
void maximize ()
 Maximize your window.
void minimize ()
 Minimize your window.
void onClicked (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Setting the event handler for the "clicked" event.
void onColumnHeaderClick (typename MessageMapType::itsVoidFunctionTakingInt)
 Event Handler for the Column Header Click event.
void onCustomPainting (typename MessageMapType::itsVoidUnsignedUnsignedBoolCanvasRectangle eventHandler)
 Event handler for the Custom Draw Event.
void onDblClicked (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Setting the event handler for the "Double Clicked" event.
void onEnabled (typename MessageMapType::itsVoidFunctionTakingBool eventHandler)
 Setting the event handler for the "enabled" event.
void onFocus (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Sets the event handler for what function to be called when control loses focus.
void onGetIcon (typename MessageMapType::itsVoidGetIconFunc eventHandler)
 Event handler for the GetIcon event.
void onGetItem (typename MessageMapType::itsVoidGetItemFunc eventHandler)
 Event handler for the GetItem event.
void onKeyPressed (typename MessageMapType::itsBoolFunctionTakingInt eventHandler)
 Setting the event handler for the "key pressed" event.
void onKillFocus (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Sets the event handler for what function to be called when control loses focus.
void onLeftMouseDown (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Left mouse button pressed event handler setter.
void onLeftMouseUp (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Left mouse button pressed and released event handler setter.
void onMiddleMouseDown (typename MessageMapType::voidFunctionTakingMouseEventResult eventHandler)
 Middle mouse button pressed event handler setter.
void onMiddleMouseUp (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Middle mouse button pressed and released event handler setter.
void onMouseMove (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Mouse moved event handler setter.
void onMoved (typename MessageMapType::itsVoidFunctionTakingPoint eventHandler)
void onRaw (typename MessageMapType::itsHresultFunctionTakingLparamWparam eventHandler, const Message &msg)
 Setting the member event handler for a "raw" event.
void onRightClicked (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Setting the event handler for the "Right Clicked" event.
void onRightMouseDown (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Right mouse button pressed event handler setter.
void onRightMouseUp (typename MessageMapType::itsVoidFunctionTakingMouseEventResult eventHandler)
 Right mouse button pressed and released event handler setter.
void onScrollHorz (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Setting the event handler for the "scrolling horizontally" event.
void onScrollVert (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Setting the event handler for the "scrolling vertically" event.
void onSelectionChanged (typename MessageMapType::itsVoidFunctionTakingVoid eventHandler)
 Setting the event handler for the "selection changed" event.
void onSized (typename MessageMapType::itsVoidFunctionTakingWindowSizedEventResult eventHandler)
void onSortItems (typename MessageMapType::itsIntLparamLparam)
 Event handler for the SortItems event.
void onValidate (typename MessageMapType::itsBoolValidationFunc eventHandler)
 Validation event handler setter.
void onVisibilityChanged (typename MessageMapType::itsVoidFunctionTakingBool eventHandler)
 Setting the event handler for the "visible" event.
void removeAllRows ()
 Removes all rows contained in the grid.
void removeRow (unsigned row)
 Remove a specific row in the grid.
void restore ()
 Restores your window.
void setAlwaysShowSelection (bool value=true)
 Adds (or removes) the always show selection style.
void setBackgroundColor (COLORREF bgColor)
 Sets the background color of the DataGrid.
void setBorder (bool value=true)
 Set or remove the simple border (solid line).
void setBounds (int x, int y, int width, int height, bool updateWindow=true)
 Sets the new size and position of the window.
void setBounds (const Point &newPos, const Point &newSize, bool updateWindow=true)
 Sets the new size and position of the window.
void setBounds (const Rectangle &rect, bool updateWindow=true)
 Sets the new size and position of the window.
void setCellText (unsigned column, unsigned row, const SmartUtil::tstring &newVal)
 Sets the text of the given cell.
void setCheckBoxes (bool value=true)
 Sets (or removes) the checkbox style.
void setColumnWidth (unsigned columnNo, int width)
 Sets the width of a given column.
void setEnabled (bool enabled)
 Sets the enabled property of the Widget.
void setFocus ()
 Gives the Widget the keyboard focus.
void setFont (PredefinedFontTypes stockObjectFont, bool forceUpdate=true)
 Function taking a PredefinedFontTypes type.
void setFont (FontPtr font, bool forceUpdate=true)
 Sets the font used by the Widget.
void setFullRowSelect (bool value=true)
 Sets (or removes) full row select.
void setGridLines (bool value=true)
 Adds (or removes) grid lines.
void setHeaderDragDrop (bool value=true)
 Adds (or removes) the header drag drop style.
void setHoover (bool value=true)
 Adds (or removes) the hoover style.
void setItemCount (unsigned size)
 Reserves a number of items to the list.
void setNormalImageList (ImageListPtr normalImageList)
 Set the normal image list for the Data Grid.
void setPositionPerPlace (SmartWin::Place &bound)
 Given a bounding Place class, place this Widget and adjust to the next position.
void setRaisedBorder (bool value=true)
 Set or remove the raised border (like in buttons).
void setReadOnly (bool value=true)
 Sets the "read only" property of the Grid.
void setRowChecked (unsigned row, bool value=true)
 Sets the checked state of the given row.
void setSelectedIndex (int idx)
 Sets the selected index of the Widget.
void setSingleRowSelection (bool value=true)
 Sets (or removes) single row select.
void setSizeAsCol (const Rectangle &rect, int rows, int rownum, int border=0, bool updateWindow=true)
 Given a bounding rectangle with rows, put this Widget in the rownum position.
void setSizeAsGridPerPlace (SmartWin::Place &bound, int rows, int cols)
 this Widget in the next cell.
void setSizeAsRow (const Rectangle &rect, int cols, int colnum, int border=0, bool updateWindow=true)
 Given a bounding rectangle with cols, put this Widget in the colnum position.
void setSizePerTextPerPlace (SmartWin::Place &bound, const SmartUtil::tstring &text, int extraX=0, int extraY=0)
 Place after sizing for the Widget's text, and adjust to the next position.
void setSmallImageList (ImageListPtr smallImageList)
 Set the small image list for the Data Grid.
void setSmoothSunkenBorder (bool value=true)
 Set or remove the smooth sunken border (generally used in read only text boxes).
void setStateImageList (ImageListPtr stateImageList)
 Set the state image list for the Data Grid.
void setSunkenBorder (bool value=true)
 Set or remove the sunken border (like in text box widgets).
void setView (int view)
 Change the view for the Data Grid.
void setVisible (bool visible)
 Sets the visibility property of the Widget.
void sortList ()
 Sorts the list.
virtual void subclass (unsigned id)
 Subclasses the dialog item with the given dialog item id.
void updateWidget ()
 Repaints the whole window.

Static Public Member Functions

static const SeedgetDefaultSeed ()
 Default values for creation.
static Point getDesktopSize ()
 Returns the screen size.
static char virtualKeyToChar (int vkey)
 Get ascii character from a Virtual Key.

Protected Member Functions

void addRemoveListViewExtendedStyle (DWORD addStyle, bool add)
 Adds or Removes extended list view styles from the list view.
void createMessageMap ()
 make the Windows Message Procedure dispatching map right.

Classes

class  Seed
 Seed class. More...


Detailed Description

template<class EventHandlerClass, class MessageMapPolicy>
class SmartWin::WidgetDataGrid< EventHandlerClass, MessageMapPolicy >

List View Control class.

You can either inherit from this class or add an instance of this class into your WidgetWindow inherited class.
If you inherit from the class you should explicitly call create e.g. in the CTOR of you class.
If you instantiate it directly (through the class Widget) you should create it by calling WidgetFactory::createxxx where xxx equals the name of the class WITHOUT the Widget part.

list.PNG
Class for creating a List View or a "DataGrid" control Widget.
A List View is a "datagrid" with one or more rows and one or more columns where users can edit text inside each cell and respond to events.
Note to get to actual rows there are two often interchanged ways of getting there, one is the LPARAM value and the other is the physical rownumber of your wanted row. Have this in mind when using the DataGrid since this is often a source of error when you get unwanted behaviour. This means you often will have to "map" an LPARAM value to a physical rownumber and vice versa.


Member Function Documentation

void addRemoveExStyle ( DWORD  addStyle,
bool  add 
) [inherited]

Use this function to add or remove windows exStyles.

The first parameter is the type of style you wish to add/remove.
The second argument is a boolean indicating if you wish to add or remove the style (if true add style, else remove)

void addRemoveStyle ( DWORD  addStyle,
bool  add 
) [inherited]

Use this function to add or remove windows styles.

The first parameter is the type of style you wish to add/remove.
The second argument is a boolean indicating if you wish to add or remove the style (if true add style, else remove)

void bringToBottom (  )  [inherited]

Brings the widget to the bottom.

Makes the widget become the bottom most widget meaning it will be obscured by all other widgets which are contained in the same container widget.
For instance if you have two widgets which partially hides eachother and you call bringToBottom on one of them it will make sure that the widget you call bringToBottom on will be the one which will be invisible and the other one will be all visible by the parts which are obscured by the this widget.

void bringToFront (  )  [inherited]

Brings the widget to the front.

Makes the widget become the front most widget meaning it will not be obscured by other widgets which are contained in the same container widget.
For instance if you have two widgets which partially hides eachother and you call bringToFront on one of them it will make sure that the widget you call bringToFront on will be the one which will be all visible and the other one will be partially hidden by the parts which are obscured by the this widget.

void create ( const Seed cs = getDefaultSeed()  )  [virtual]

Actually creates the Data Grid Control.

You should call WidgetFactory::createDataGrid if you instantiate class directly.
Only if you DERIVE from class you should call this function directly.

void createColumns ( const std::vector< SmartUtil::tstring > &  colNames  ) 

Create columns in the grid.

Normally this would be called just after creation of the grid, it MUST be called before adding items to the grid.
The vector parameter is a vector containing the column names of the columns.
Columns will be added the way they sequentially appear in the vector.

void deleteColumn ( unsigned  columnNo  ) 

Deletes the given column.

Column zero CANNOT be deleted.

Utilities::Thread fork ( unsigned long(EventHandlerClass::*)()  threadProc  )  [inherited]

Creates a new thread on the given function.

Forks execution into a member function. If you wish to later manipulate the thread in some way use the Utilities::Thread class to store the return value of this function.

Utilities::Thread fork ( const Param &  par,
unsigned long(EventHandlerClass::*)(Param &)  threadProc 
) [inherited]

Creates a new thread and passes the given parameter.

Forks execution into a member function with the given parameter of the given type. If you wish to later manipulate the thread in some way use the Utilities::Thread class to store the return value of this function.

Rectangle getBounds (  )  const [inherited]

Returns the position and size of the window.

Note that this is in screen coordinates meaning the position returned is relative to the upper left corner of the desktop screen, the function also returns in the size member of the Rectangle the size of the window and not the position of the lower right point. Values includes borders, frames and toolbar etc of the window.

bool getCapsLockOn (  )  [inherited]

Checks if Caps Lock is on.

Use this function if you need to determine if Caps Lock is ON

SmartUtil::tstring getCellText ( unsigned int  column,
unsigned int  row 
)

Returns the text of the given cell.

The column is which column you wish to retrieve the text for.
The row is which row in that column you wish to retrieve the text for.
Note this one returns the text of the "logical" column which means that if you have moved a column ( e.g. column no 3 ) and you're trying to retrieve the text of column no. 3 it will still return the text of the OLD column no. 3 which now might be moved to the beginning of the grid, NOT the NEW column no. 3
The above does NOT apply for ROWS, meaning it will get the text of the NEW row if row is moved due to a sort e.g.
If you need to get "logical" row use getCellTextByLParam instead.

SmartUtil::tstring getCellTextByLParam ( unsigned int  column,
LPARAM  lParam 
)

Returns the text of the given cell.

The column is which column you wish to retrieve the text for.
The lParam is what the LPARAM value when inserted was for the specific item, mark here that if you insert items with the default parameter the LPARAM will start from 0 and increase, meaning you can get this to map between rows which are moved due to a sort or something!
Note this one returns the text of the "logical" column which means that if you have moved a column ( e.g. column no 3 ) and you're trying to retrieve the text of column no. 3 it will still return the text of the OLD column no. 3, NOT the NEW column no. 3
Note that this function throws if it can't find the item searching for!!

Point getClientAreaSize (  )  const [inherited]

Returns the size of the client area of the window.

This differs from getSize because it disregards the border and headers, this function only returns the client area of the Widget meaning the area which it is possible to draw on.

unsigned getColumnCount (  ) 

Returns the number of column in the grid.

Returns the number of columns in the Data Grid.
Useful if you need to know how many values you must use when inserting rows into the List View

SmartUtil::tstring getColumnName ( unsigned  col  ) 

Returns the name of a specific column.

Which column you wish to retrieve the name for is supplied in the "id" parameter.

bool getControlPressed (  )  [inherited]

Checks if control is pressed.

Use this function if you need to determine if any of the CTRL keys are pressed.

Utilities::CriticalSection & getCriticalSection (  )  [inherited]

Returns a CriticalSection associated with the current Widget object.

If you need serialized thread safe access to the Widget call this function and either stuff the returned object into a Utilities::ThreadLock or call Utilities::CriticalSection::lock (then you manually have to ensure CriticalSection::unlock is called on it)

HMENU getCtrlId (  )  const [inherited]

Returns the control id of the Widget.

This one only makes sense for control items, e.g. WidgetButton, WidgetComboBox etc.
Every control in a Widget has got its own control ID, mark that for a WidgetWindow this will always be ZERO

Point getDesktopSize (  )  [static, inherited]

Returns the screen size.

This is the screen size, and useful for making applications that must adapt to different screen sizes.

bool getEnabled (  )  const [inherited]

Retrieves the enabled property of the Widget.

Use this function to check if the Widget is Enabled or not. If the Widget is enabled this function will return true.

bool getFocus (  )  const [inherited]

Retrieves the focus property of the Widget.

Use this function to check if the Widget has focus or not. If the Widget has focus this function will return true.

FontPtr getFont (  )  [inherited]

Returns the font used by the Widget.

Returns the Font object currently being used by the Widget

bool getIsRowChecked ( unsigned  row  ) 

Returns the checked state of the given row.

A list view can have checkboxes in each row, if the checkbox for the given row is CHECKED this funtion returns true.

Widget* getParent (  )  const [inherited]

Returns the parent Widget of the Widget.

Most Widgets have got a parent, this function will retrieve a pointer to the Widgets parent, if the Widget doesn't have a parent it will return a null pointer.

Point getPosition (  )  const [inherited]

Returns the position of the window.

Note that this is in screen coordinates meaning the position returned is relative to the upper left corner of the desktop screen.

Reimplemented in WidgetProgressBar, and WidgetSlider.

bool getReadOnly (  ) 

Returns a boolean indicating if the Grid is in "read only" mode or not.

If the return value is true the Grid is in "read only" mode and cannot be updated ( except programmatically )
If the return value is false the Grid is "updateable" through double clicking a cell.
< b >Note!
The "read only" property is pointless if you have defined your own validation function through calling "beenValidate"< /b >

unsigned getRowCount (  ) 

Returns the number of rows in the grid.

Returns the number of rows in the Data Grid

unsigned getRowNumberFromLParam ( unsigned  lParam  ) 

Returns the physical rownumber from a given LPARAM number.

Use this e.g. in the onCustomDraw Event Handler to find the physical row number of a given LPARAM ID. Returns - 1 if unsucessful

int getSelectedIndex (  )  const [virtual]

Returns an unsigned integer which is the selected row of the grid.

The return value defines the row in the grid that is selected.
If the grid is in "multiple selection mode" you should rather use the getSelectedRows function.
If grid does NOT have a selected item the return value is - 1.
Note!
This returns the ROW of the selected item and NOT the lparam given when inserted items meaning if you sort the grid or something this function will return another number for the same item if its position has moved due to the sort etc.

Implements AspectSelection.

std::vector< unsigned > getSelectedRows (  ) 

Returns a vector containing all the selected rows of the grid.

The return vector contains unsigned integer values, each value defines a row in the grid that is selected.
If the grid is in "single selection mode" you should rather use the getSelectedRow function.
If grid does NOT have any selected items the return vector is empty.

bool getShiftPressed (  )  [inherited]

Checks if shift is pressed.

Use this function if you need to determine if any of the SHIFT keys are pressed.

Point getSize (  )  const [inherited]

Returns the size of the window.

Includes the border, frame and toolbar etc of the window.

Point getTextSize ( const SmartUtil::tstring &  text  )  [inherited]

Fills a Point with the size of text to be drawn in the Widget's font.

getTextSize determines the height and width that text will take.
This is useful if you want to allocate enough space to fit known text.
It accounts for the set font too.

bool getVisible (  )  const [inherited]

Retrieves the visible property of the Widget.

Use this function to check if the Widget is visible or not.
If the Widget is visible this function will return true.

HWND handle (  )  const [inherited]

Returns the HWND to the Widget.

Returns the HWND to the inner window of the Widget.
If you need to do directly manipulation of the window use this function to retrieve the HWND of the Widget.

bool hasSelection (  ) 

Returns true if grid has got a "current selected item".

If the List View has got a "currently selected" row, this function will return true, if no row is selected it will return false.

void insertCallbackRow ( const LPARAM  lParam  ) 

Inserts a callback row.

A callback row is a row that doesn't contain the actual data to display.
Instead your Event Handler object will be called when the control needs data to display in a cell.
Useful for grids containing very large amounts of data since this way you don't have to store the data in memory, you can for instance use a reader from disc and read items on "demand basis" or maybe from a database etc...
Note!
If you insert callback rows you MUST handle the onGetItem event since this event handler will be called whenever the control needs data to display!
The lParam can be ANYTHING, often you cast an application defined Id or maybe a pointer of some sort to an LPARAM and pass to this function!

void insertRow ( int  index = -1,
int  iconIndex = -1 
)

Inserts an empty row into the grid.

Inserts an empty row into the grid.
Will insert an empty string as the value of all cells in the row.
The index parameter ( optionally ) defines at which index the new row will be inserted at.
If omitted it defaults to - 1 ( which means at the "end" of the grid )
The iconIndex parameter ( optionally ) defines the index of the icon on the image list that will be shown on the row.
Call createColumns before inserting items.

LPARAM insertRow ( const std::vector< SmartUtil::tstring > &  row,
LPARAM  lPar = 0,
int  index = -1,
int  iconIndex = -1 
)

Inserts a row into the grid.

The row parameter is a vector containing all the cells of the row.
This vector must ( of course ) be the same size as the number of columns in the grid.
The index parameter ( optionally ) defines at which index the new row will be inserted at.
If omitted it defaults to - 1 ( which means at the "end" of the grid )
The iconIndex parameter ( optionally ) defines the index of the icon on the image list that will be shown on the row.
Call createColumns before inserting items.

void invalidateWidget (  )  [inherited]

Add this widget to the update area.

Same as updateWidget except that this does not force an immediate redraw.

void maximize (  )  [inherited]

Maximize your window.

This will make the window fill the whole area that the window has available.
This function cannot be called for any Widget types other than those derived from WidgetWindowBase.

void minimize (  )  [inherited]

Minimize your window.

This will make the window become minimized.
This function cannot be called for any Widget types other than those derived from WidgetWindowBase.

void onColumnHeaderClick ( typename MessageMapType::itsVoidFunctionTakingInt   ) 

Event Handler for the Column Header Click event.

This Event is raised whenever one of the headers is clicked, it is useful to e.g. sort the WidgetDataGrid according to which header is being clicked.
Parameters passed is int which defines which header from left to right ( zero indexed ) is being clicked!

void onCustomPainting ( typename MessageMapType::itsVoidUnsignedUnsignedBoolCanvasRectangle  eventHandler  ) 

Event handler for the Custom Draw Event.

If you want to do custom drawing for the WidgetDataGrid use this event handler. Note that the given unsigned row number is NOT the PHYSICAL row but rather the n'th inserted row if rows are inserted with default LPARAM values or the LPARAM value given when row was inserted if LPARAM value was explicitly given. This means that if you for instance inserts 5 rows with the default given LPARAM value and removes the three rows in the middle the rows remaining will be the 0'th and the 4'th row, this will be also the values given to you in your Custom Draw Event Handler... If you need to get the PHYSICAL row number use the getRowNumberFromLParam function.

void onGetIcon ( typename MessageMapType::itsVoidGetIconFunc  eventHandler  ) 

Event handler for the GetIcon event.

If you insert callback items, this function will be called whenever the grid needs an icon to display in a row (you will need to specify the icon index in the associated image list, if you don't, no icon will be displayed).< br > The row will be given along with the LPARAM to the event handler, normally the LPARAM will be either some sort of application defined ID of some sort ( maybe a primary key to a record in a database ) or a pointer to an object of some sort casted to an LPARAM!< br >

void onGetItem ( typename MessageMapType::itsVoidGetItemFunc  eventHandler  ) 

Event handler for the GetItem event.

If you insert callback items this function will be called whenever the grid needs data to display in a row.
The row and column will be given along with the LPARAM to the event handler, normally the LPARAM will be either some sort of application defined ID of some sort ( maybe a primary key to a record in a database ) or a pointer to an object of some sort casted to an LPARAM!

void onMiddleMouseDown ( typename MessageMapType::voidFunctionTakingMouseEventResult  eventHandler  )  [inherited]

Middle mouse button pressed event handler setter.

If supplied, function will be called when user press the Middle Mouse button in the client area of the widget.
The parameter passed is const MouseEventResult & which contains the state of the mouse.

void onRaw ( typename MessageMapType::itsHresultFunctionTakingLparamWparam  eventHandler,
const Message msg 
) [inherited]

Setting the member event handler for a "raw" event.

Sets the event handler for the "raw" event handler. Use this if any of the predefined Event Handlers are not powerful enough or if you can't find the specific Event Handler you need.
Note!
This works in a special way. Unless you add the same Message twice, it will add that Event Handler and not remove the previous one. You can have "multiple" raw Event Handlers as long as the Message is not the same!
Note also!
This is an UNTYPED Event!
If there are other events which will handle the message, USE THOSE instead of this one!!!
This is a "last resort" event type.
Two parameters are passed: LPARAM and WPARAM
Return value is HRESULT which will be passed on to the System

void onSortItems ( typename MessageMapType::itsIntLparamLparam   ) 

Event handler for the SortItems event.

When you sort a WidgetDataGrid you need to supply a callback function for comparing items.
Otherwise the grid won't know how it should sort items.
Some items might be compared after their integer values while other will maybe be compared after their order in the alphabet etc...
The event handler you supply for the SortItems event should return - 1 if the first row is supposed to be before the second and 1 if the second is supposed to be before the first, if items are equal it should return 0
The two first arguments in your event handler are the LPARAM arguments supplied when inserting items for the first and second items.
This function will be called MANY times when you sort a grid so you probably will NOT want to run a costly operation within this event handler.

void onValidate ( typename MessageMapType::itsBoolValidationFunc  eventHandler  ) 

Validation event handler setter.

If supplied event handler is called after a cell has been edited but before the value is actually changed.
If the event handler returns false, the new value is NOT inserted; if the return value is true, the old value is replaced with the new. Parameters passed is unsigned column, unsigned row and SmartUtil::tstring reference which is the new value, the value can be manipulated and changed within your event handler.

void removeAllRows (  ) 

Removes all rows contained in the grid.

Removes ALL rows in the Data Grid

void removeRow ( unsigned  row  ) 

Remove a specific row in the grid.

Removes a SPECIFIC row from the Data Grid

void restore (  )  [inherited]

Restores your window.

This will make the window become restored.
This function cannot be called for any Widget types other than those derived from WidgetWindowBase.

void setAlwaysShowSelection ( bool  value = true  ) 

Adds (or removes) the always show selection style.

A grid with this style set will always show its selection, even if it does not have the focus. If omitted, parameter defaults to true.

void setBackgroundColor ( COLORREF  bgColor  ) 

Sets the background color of the DataGrid.

Sets the background color of the rows that does NOT have content! If you need to set the background color of the rows in the DataGrid that does actually have CONTENT you need to handle the onCustomDraw Event!

void setBounds ( int  x,
int  y,
int  width,
int  height,
bool  updateWindow = true 
) [inherited]

Sets the new size and position of the window.

x is the new horizontal position of your window.
y is the new vertical position of your window.
width is the new width and height is the new height of your window.
Zenith is as in all other bounds function top/left.
A call to this function will (probably) also MOVE your Widget too.

void setBounds ( const Point newPos,
const Point newSize,
bool  updateWindow = true 
) [inherited]

Sets the new size and position of the window.

The input parameter newPos of type Point defines the new position of the window.
The newSize member of type Point is the new size of the window.
A call to this function will (probably) also MOVE your Widget too.

void setBounds ( const Rectangle rect,
bool  updateWindow = true 
) [inherited]

Sets the new size and position of the window.

The input parameter Rectangle defines the new size (and position) of the window.
The pos member of the Rectangle is the position and the size member is the size.
So a call to this function will (probably) also MOVE your Widget too.

void setCellText ( unsigned  column,
unsigned  row,
const SmartUtil::tstring &  newVal 
)

Sets the text of the given cell.

Sets a new string value for a given cell.

void setCheckBoxes ( bool  value = true  ) 

Sets (or removes) the checkbox style.

If you add this style your List View will get checkboxes in the leftmost column.
This can be useful for retrieving "selected" properties on items within the List View.
Note!
You can't set a column to be a "pure" checkbox column, but you CAN avoid to put text into the column by inserting an empty ( "" ) string.

void setColumnWidth ( unsigned  columnNo,
int  width 
)

Sets the width of a given column.

Sets the width of the given column, the columnNo parameter is a zero - based index of the column you wish to change, the width parameter is number of pixels you wish the column to be.
If you submit LVSCW_AUTOSIZE as the width parameter the column is being "autosized" meaning it will aquire the width needed to display the "widest" cell content in that column, if you submit LVSCW_AUTOSIZE_USEHEADER as the width parameter it will be as wide as it needs to minimum display the complete header text of the column.
If you use the LVSCW_AUTOSIZE_USEHEADER on the last column of the list it will be resized to be as wide as it needs to completely fill the remaining width of the list which is quite useful to make the Data Grid fill its whole client area.

void setEnabled ( bool  enabled  )  [inherited]

Sets the enabled property of the Widget.

Changes the enabled property of the Widget. Use this function to change the enabled property of the Widget

void setFocus (  )  [inherited]

Gives the Widget the keyboard focus.

Use this function if you wish to give the Focus to a specific Widget

void setFont ( PredefinedFontTypes  stockObjectFont,
bool  forceUpdate = true 
) [inherited]

Function taking a PredefinedFontTypes type.

Examples are SystemFixedFont, SystemFont or DefaultGuiFont. -- credit to mm.

void setFont ( FontPtr  font,
bool  forceUpdate = true 
) [inherited]

Sets the font used by the Widget.

Changes the font of the Widget to the given font. Use the class Font to construct a font in which to set by this function.

void setFullRowSelect ( bool  value = true  ) 

Sets (or removes) full row select.

Full row select means that when a user press any place in a row the whole row will be selected instead of the activated cell.
value defines if we're supposed to set the fullrow select property of the grid or not.
If omitted, parameter defaults to true.

void setGridLines ( bool  value = true  ) 

Adds (or removes) grid lines.

A grid with grid lines will have lines surrounding every cell in it.
value defines if we're supposed to add grid lines or remove them.
If omitted, parameter defaults to true.

void setHeaderDragDrop ( bool  value = true  ) 

Adds (or removes) the header drag drop style.

A grid with header drag drop style will have the possibility for a user to actually click and hold a column header and "drag" that column to another place in the column hierarchy.
Value is parameter value defines if we're supposed to add the header drag drop style or remove it.
If omitted, parameter defaults to true.

void setHoover ( bool  value = true  ) 

Adds (or removes) the hoover style.

A grid with hoover style will "flash" the text color in the line the cursor is above.
Value is parameter value defines if we're supposed to add hoover support or remove it.
If omitted, parameter defaults to true.

void setItemCount ( unsigned  size  ) 

Reserves a number of items to the list.

To be used in combination with the "onGetItem" event
This function reserves a number of items to the list so that the control knows how many items
it need to give room for.
Has absolutely no meaning unless used in combination with the insertCallbackRow and the "onGetItem" event in which the application is queried for items when the control needs to get data to display.

void setNormalImageList ( ImageListPtr  normalImageList  ) 

Set the normal image list for the Data Grid.

normalImageList is the image list that contains the images for the data grid icons in Icon View (big icons).

void setPositionPerPlace ( SmartWin::Place bound  )  [inherited]

Given a bounding Place class, place this Widget and adjust to the next position.

This function places the Widget into the bounding rectangle specified by bound.
The size of the Widget is preserved.
The Widgets are sized and placed from left to right until a row is full, and then continues with the next row.
The internal position of bound is updated.

void setReadOnly ( bool  value = true  ) 

Sets the "read only" property of the Grid.

If passed true the Grid becomes "Read Only" and you cannot change its values ( except programmatically )
If passed false the Grid becomes "updateable".
< b >Note!
The "read only" property is pointless if you have defined your own validation event handler by calling "beenValidate"< /b >

void setRowChecked ( unsigned  row,
bool  value = true 
)

Sets the checked state of the given row.

Every row in a List View can have its own checkbox column.< br > If this checkbox is selected in the queried row this function will return true.

void setSelectedIndex ( int  idx  )  [virtual]

Sets the selected index of the Widget.

The idx parameter is the (zero indexed) value of the item to set as the selected item. You must add the items before you set the selected index.

Implements AspectSelection.

void setSingleRowSelection ( bool  value = true  ) 

Sets (or removes) single row select.

Single row select means that only ONE row can be selected at a time.
Value is parameter value defines if we're supposed to set the single row select property of the grid or not.
If omitted, parameter defaults to true.
Related functions are getSelectedRow ( single row selection mode ) or getSelectedRows ( multiple row selection mode )

void setSizeAsCol ( const Rectangle rect,
int  rows,
int  rownum,
int  border = 0,
bool  updateWindow = true 
) [inherited]

Given a bounding rectangle with rows, put this Widget in the rownum position.

The rect defines a column made up of a number of rows. The rownum specifies a zero based index of the row to place the Widget. [ row0 ]
[ row1 ]
...
[ rownum ]
[ ]

Of course you could just generate a new bounding rectangle, but this is easier.

void setSizeAsGridPerPlace ( SmartWin::Place bound,
int  rows,
int  cols 
) [inherited]

this Widget in the next cell.

Bound determines the bounding rectangle, and borders.
rows and cols determine the size and position of each cell.
The internal position of bound is updated.
The Widgets are sized and placed according to the current cell, from left to right until a row is full, and then continues with the next row.

void setSizeAsRow ( const Rectangle rect,
int  cols,
int  colnum,
int  border = 0,
bool  updateWindow = true 
) [inherited]

Given a bounding rectangle with cols, put this Widget in the colnum position.

The rect defines a row made up of a number of columns. The colnum specifies a zero based index of the column to place the Widget.
[ col0 ] [ col1 ] ... [ colnum ] [ ] [ ]

void setSizePerTextPerPlace ( SmartWin::Place bound,
const SmartUtil::tstring &  text,
int  extraX = 0,
int  extraY = 0 
) [inherited]

Place after sizing for the Widget's text, and adjust to the next position.

This function places the Widget into the bounding rectangle specified by bound.
The idea is that the size of certain Widgets should really be large enough to show their text. Buttons and text areas are examples.
The size of the Widget is calculated from the size of getText().
It is optionally adjusted by the extraX and extraY.
The Widgets are sized and placed from left to right until a row is full, and then continues with the next row.
The internal position of bound is updated.

void setSmallImageList ( ImageListPtr  smallImageList  ) 

Set the small image list for the Data Grid.

smallImageList is the image list that contains the images for the data grid icons in Report, List & Small Icon Views.

void setStateImageList ( ImageListPtr  stateImageList  ) 

Set the state image list for the Data Grid.

stateImageList is the image list that contains the images for the data grid icons states.

void setView ( int  view  ) 

Change the view for the Data Grid.

The view parameter can be one of LVS_ICON, LVS_SMALLICON, LVS_LIST or LVS_REPORT.
The Data Grid uses the report view for default.

void setVisible ( bool  visible  )  [inherited]

Sets the visibility property of the Widget.

Changes the visibility property of the Widget.
Use this function to change the visibility property of the Widget

void sortList (  ) 

Sorts the list.

Call this function to sort the list, it's IMPERATIVE that you before calling this function defines an event handler for the SortItems event.
Otherwise you will get an exception when calling this function since it expects to have a compare function to compare items with which you can define in the onSortItems Event Handler setter

void subclass ( unsigned  id  )  [virtual, inherited]

Subclasses the dialog item with the given dialog item id.

Subclasses a dialog item, the id is the dialog item id from the resource editor.
Should normally not be called directly but rather called from e.g. one of the creational functions found in the WidgetFactory class.

void updateWidget (  )  [inherited]

Repaints the whole window.

Invalidate the window and repaints it.

char virtualKeyToChar ( int  vkey  )  [static, inherited]

Get ascii character from a Virtual Key.

Use this to convert from the input to the response to onKeyPressed to a character.
Virtual Keys do not take into account the shift status of the keyboard, and always report UPPERCASE letters.

Back to SmartWin website
SourceForge.net Logo