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