I am testing for make an query builder by using wxShapeFramework.
Everything work fine. Now face the problem to serialize the list items.
The table and field name , is used "class QBListBox : public wxSFRectShape" to draw it as wxCheckListBox.
Now, I need to serialize the list items (m_items), it store in array of QBlistItem.
How can i make it ?
Thank
Code: Select all
class QBListItem: public wxObject
{
DECLARE_CLASS(QBListItem)
public:
// Constructors
QBListItem(const wxString& fieldname, bool check = false)
{ m_fieldname = fieldname; m_check = check; m_selected = false; }
// Accessors
void SetCheck(bool check) { m_check = check; }
bool IsCheck() const { return m_check; }
bool IsSelected() const { return m_selected; }
void SetSelected(bool select) { m_selected = select;}
/// Draw the item
virtual bool Draw(wxDC& dc,const wxRect& rect, int style) ;
/// Draw the background
virtual bool DrawBackground(wxDC& dc,const wxRect& rect,int style, int index) ;
wxString GetText() const { return m_fieldname;}
protected:
wxString m_fieldname;
bool m_check;
bool m_selected;
};
/*
* Class : QBListBox
*
*/
WX_DECLARE_OBJARRAY( QBListItem, QBListItemArray);
class QBListBox : public wxSFRectShape
{
public:
XS_DECLARE_CLONABLE_CLASS(QBListBox);
QBListBox();
QBListBox(const wxRealPoint& pos, const wxRealPoint& size, wxSFDiagramManager* manager);
QBListBox(const QBListBox& obj);
virtual ~QBListBox();
private:
QBListItemArray m_items;
};