ToolMap
Loading...
Searching...
No Matches
tmCheckListBoxRank Class Reference

Enhance the tmCheckListBox class. More...

#include <tmchecklistboxrank.h>

Inheritance diagram for tmCheckListBoxRank:
tmCheckListBox

Public Member Functions

 ~tmCheckListBoxRank ()
 Destructor Do nothing actually.
 
 tmCheckListBoxRank (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int nStrings=0, const wxString *choices=nullptr, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListBoxNameStr)
 Constructor for one steps creation.
 
bool Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int nStrings=0, const wxString *choices=nullptr, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListBoxNameStr)
 Constructor for two steps creation.
 
wxString GetRankColName ()
 
void SetRankColName (const wxString &colrank=_T("RANK"))
 Set the rank column name.
 
wxString GetTableName ()
 
void SetTableName (const wxString &tabname=TABLE_NAME_OBJECTS)
 Set the table name.
 
void SetDataBase (DataBaseTM *pDB)
 
- Public Member Functions inherited from tmCheckListBox
 ~tmCheckListBox ()
 Destructor.
 
 tmCheckListBox (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int nStrings=0, const wxString *choices=nullptr, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListBoxNameStr)
 
bool Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int nStrings=0, const wxString *choices=nullptr, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListBoxNameStr)
 Creator for two steps creation.
 
bool AddItem (long index=-1, long id=-1, const wxString &name=wxEmptyString, bool checked=false, bool keepFilters=false)
 Add an item in the list.
 
bool RemoveItem (long index=-1)
 Remove an item in the list.
 
bool EditItem (long index, long id=-1, const wxString &name=wxEmptyString, short checked=2)
 Modify an item.
 
bool SwapItem (long index1, long index2=-1)
 Switch two items.
 
bool MoveItem (long index1, long index2)
 Move an items to a specified position.
 
bool GetItem (long index, long &id, wxString &name, bool &bcheck)
 Get value for item at the specified position.
 
bool GetItemId (long index, long &id)
 
bool SetItemCheck (long index, short checked=2)
 
void ClearItems ()
 Empty the checklist and associated array.
 
void ClearFilters ()
 Clear the filters and restore original arrays.
 
void ClearCheckMarks ()
 Uncheck all items.
 
void Filter (wxString filter)
 Filter the list and keep only the labels containing the string.
 
void ResetOriginalArrays ()
 
bool StoreActualChecks ()
 

Protected Member Functions

bool PrepareOrderStatement (wxString &sqlstatement)
 Prepare the statement for setting order.
 
void EnableRelevantMenuEntries ()
 
- Protected Member Functions inherited from tmCheckListBox
void Init ()
 
wxMenu * GetPopupMenu ()
 

Additional Inherited Members

- Protected Attributes inherited from tmCheckListBox
bool m_IsFiltered
 

Detailed Description

Enhance the tmCheckListBox class.

This derivated class add the ability to save the order of the list in a database in a rank column

Todo:
add sample here !
See also
For all database function DataBaseTM
Author
Lucien Schreiber (c) CREALP 2008
Date
20 May 2008

Constructor & Destructor Documentation

◆ ~tmCheckListBoxRank()

tmCheckListBoxRank::~tmCheckListBoxRank ( )

Destructor Do nothing actually.

Author
Lucien Schreiber (c) CREALP 2008
Date
20 May 2008

◆ tmCheckListBoxRank()

tmCheckListBoxRank::tmCheckListBoxRank ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
int  nStrings = 0,
const wxString *  choices = nullptr,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
const wxString &  name = wxListBoxNameStr 
)

Constructor for one steps creation.

see documentation for wxCheckListBox for parameters description

Author
Lucien Schreiber (c) CREALP 2008
Date
20 May 2008

Member Function Documentation

◆ Create()

bool tmCheckListBoxRank::Create ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
int  nStrings = 0,
const wxString *  choices = nullptr,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
const wxString &  name = wxListBoxNameStr 
)

Constructor for two steps creation.

see documentation for wxCheckListBox for parameters description

Author
Lucien Schreiber (c) CREALP 2008
Date
20 May 2008

◆ EnableRelevantMenuEntries()

void tmCheckListBoxRank::EnableRelevantMenuEntries ( )
protectedvirtual

Reimplemented from tmCheckListBox.

◆ PrepareOrderStatement()

bool tmCheckListBoxRank::PrepareOrderStatement ( wxString &  sqlstatement)
protected

Prepare the statement for setting order.

Create the sql statement for setting the item's order in the database

Parameters
sqlstatementstring will be filled with the issued statement for setting the item's order
Returns
TRUE if the list isn't empty
Author
Lucien Schreiber (c) CREALP 2008
Date
20 May 2008

◆ SetRankColName()

void tmCheckListBoxRank::SetRankColName ( const wxString &  colrank = _T("RANK"))

Set the rank column name.

If your rank column has default name "RANK", no need to call this function

Parameters
colrankThe name of the rank column (default is RANK)
Author
Lucien Schreiber (c) CREALP 2008
Date
20 May 2008

◆ SetTableName()

void tmCheckListBoxRank::SetTableName ( const wxString &  tabname = TABLE_NAME_OBJECTS)

Set the table name.

The table name will be used for setting order when user press the "Save order" popup menu.

Parameters
tabnameThe name of the table. Default is the value of TABLE_NAME_OBJECTS
Author
Lucien Schreiber (c) CREALP 2008
Date
20 May 2008

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