1 ////////////////////////////////////////////////////
3 // Purpose: ClassListDialog definition
4 // Author: Francesco Montorsi
6 // Created: 03/06/2007 14:49:55
7 // Copyright: (c) 2007 Francesco Montorsi
8 // Licence: wxWindows licence
9 ////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/choicebk.h"
20 #include "wx/treectrl.h"
22 // ----------------------------------------------------------------------------
24 // ----------------------------------------------------------------------------
26 #define ID_LISTMODE 10006
27 #define ID_LISTBOX 10003
28 #define ID_PANEL 10007
29 #define ID_TREECTRL 10008
30 #define ID_TEXTCTRL 10004
31 #define ID_SHOW_ONLY_XTI 10005
32 #define ID_SHOW_PROPERTIES_RECURSIVELY 10002
33 #define SYMBOL_CLASSLISTDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
34 #define SYMBOL_CLASSLISTDIALOG_TITLE _("wxWidgets class list")
35 #define SYMBOL_CLASSLISTDIALOG_IDNAME wxID_ANY
36 #define SYMBOL_CLASSLISTDIALOG_SIZE wxSize(400, 300)
37 #define SYMBOL_CLASSLISTDIALOG_POSITION wxDefaultPosition
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 class ClassListDialog
: public wxDialog
46 // we explicitly don't want to use the following macro:
47 // DECLARE_DYNAMIC_CLASS( ClassListDialog )
48 // as otherwise the ClassListDialog class would appear in the list
49 // shown by this dialog!
55 ClassListDialog( wxWindow
* parent
, wxWindowID id
= SYMBOL_CLASSLISTDIALOG_IDNAME
,
56 const wxString
& caption
= SYMBOL_CLASSLISTDIALOG_TITLE
,
57 const wxPoint
& pos
= SYMBOL_CLASSLISTDIALOG_POSITION
,
58 const wxSize
& size
= SYMBOL_CLASSLISTDIALOG_SIZE
,
59 long style
= SYMBOL_CLASSLISTDIALOG_STYLE
);
62 bool Create( wxWindow
* parent
, wxWindowID id
= SYMBOL_CLASSLISTDIALOG_IDNAME
,
63 const wxString
& caption
= SYMBOL_CLASSLISTDIALOG_TITLE
,
64 const wxPoint
& pos
= SYMBOL_CLASSLISTDIALOG_POSITION
,
65 const wxSize
& size
= SYMBOL_CLASSLISTDIALOG_SIZE
,
66 long style
= SYMBOL_CLASSLISTDIALOG_STYLE
);
74 void CreateControls();
77 void UpdateClassInfo(const wxString
&itemName
);
78 void UpdateFilterText();
79 bool IsToDiscard(const wxString
&classname
) const;
81 int AddClassesWithParent(const wxClassInfo
*parent
, const wxTreeItemId
&id
);
83 public: // event handlers
85 void OnListboxSelected( wxCommandEvent
& event
);
86 void OnTreectrlSelChanged( wxTreeEvent
& event
);
87 void OnChoiceBookPageChange( wxChoicebookEvent
& event
);
88 void OnShowOnlyXTICheckbox( wxCommandEvent
& event
);
89 void OnShowRecursiveInfoCheckbox( wxCommandEvent
& event
);
91 // Should we show tooltips?
92 static bool ShowToolTips();
95 wxChoicebook
* m_pChoiceBook
;
96 wxStaticText
* m_pClassCountText
;
97 wxListBox
* m_pRawListBox
;
98 wxTreeCtrl
* m_pParentTreeCtrl
;
99 wxListBox
* m_pSizeListBox
;
100 wxTextCtrl
* m_pTextCtrl
;
102 int m_nTotalCount
; // number of classes in wxXTI system
103 int m_nCount
; // number of shown classes