]> git.saurik.com Git - wxWidgets.git/blob - samples/xti/classlist.h
Make storing non-trivial data in wxThreadSpecificInfo possible.
[wxWidgets.git] / samples / xti / classlist.h
1 ////////////////////////////////////////////////////
2 // Name: classlist.h
3 // Purpose: ClassListDialog definition
4 // Author: Francesco Montorsi
5 // Modified by:
6 // Created: 03/06/2007 14:49:55
7 // Copyright: (c) 2007 Francesco Montorsi
8 // Licence: wxWindows licence
9 ////////////////////////////////////////////////////
10
11 #ifndef _CLASSLIST_H_
12 #define _CLASSLIST_H_
13
14
15 // ----------------------------------------------------------------------------
16 // includes
17 // ----------------------------------------------------------------------------
18
19 #include "wx/choicebk.h"
20 #include "wx/treectrl.h"
21
22 // ----------------------------------------------------------------------------
23 // IDs
24 // ----------------------------------------------------------------------------
25
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
38
39
40 // ----------------------------------------------------------------------------
41 // ClassListDialog
42 // ----------------------------------------------------------------------------
43
44 class ClassListDialog: public wxDialog
45 {
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!
50 DECLARE_EVENT_TABLE()
51
52 public:
53 // Constructors
54 ClassListDialog();
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 );
60
61 // Creation
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 );
67
68 // Destructor
69 ~ClassListDialog();
70
71 public: // misc
72
73 void Init();
74 void CreateControls();
75 void InitControls();
76
77 void UpdateClassInfo(const wxString &itemName);
78 void UpdateFilterText();
79 bool IsToDiscard(const wxString &classname) const;
80
81 int AddClassesWithParent(const wxClassInfo *parent, const wxTreeItemId &id);
82
83 public: // event handlers
84
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 );
90
91 // Should we show tooltips?
92 static bool ShowToolTips();
93
94 protected:
95 wxChoicebook* m_pChoiceBook;
96 wxStaticText* m_pClassCountText;
97 wxListBox* m_pRawListBox;
98 wxTreeCtrl* m_pParentTreeCtrl;
99 wxListBox* m_pSizeListBox;
100 wxTextCtrl* m_pTextCtrl;
101
102 int m_nTotalCount; // number of classes in wxXTI system
103 int m_nCount; // number of shown classes
104 };
105
106 #endif
107 // _CLASSLIST_H_