classlist.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. #ifndef _CLASSLIST_H_
  11. #define _CLASSLIST_H_
  12. // ----------------------------------------------------------------------------
  13. // includes
  14. // ----------------------------------------------------------------------------
  15. #include "wx/choicebk.h"
  16. #include "wx/treectrl.h"
  17. // ----------------------------------------------------------------------------
  18. // IDs
  19. // ----------------------------------------------------------------------------
  20. #define ID_LISTMODE 10006
  21. #define ID_LISTBOX 10003
  22. #define ID_PANEL 10007
  23. #define ID_TREECTRL 10008
  24. #define ID_TEXTCTRL 10004
  25. #define ID_SHOW_ONLY_XTI 10005
  26. #define ID_SHOW_PROPERTIES_RECURSIVELY 10002
  27. #define SYMBOL_CLASSLISTDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
  28. #define SYMBOL_CLASSLISTDIALOG_TITLE _("wxWidgets class list")
  29. #define SYMBOL_CLASSLISTDIALOG_IDNAME wxID_ANY
  30. #define SYMBOL_CLASSLISTDIALOG_SIZE wxSize(400, 300)
  31. #define SYMBOL_CLASSLISTDIALOG_POSITION wxDefaultPosition
  32. // ----------------------------------------------------------------------------
  33. // ClassListDialog
  34. // ----------------------------------------------------------------------------
  35. class ClassListDialog: public wxDialog
  36. {
  37. // we explicitly don't want to use the following macro:
  38. // wxDECLARE_DYNAMIC_CLASS( ClassListDialog );
  39. // as otherwise the ClassListDialog class would appear in the list
  40. // shown by this dialog!
  41. wxDECLARE_EVENT_TABLE();
  42. public:
  43. // Constructors
  44. ClassListDialog();
  45. ClassListDialog( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME,
  46. const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE,
  47. const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION,
  48. const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE,
  49. long style = SYMBOL_CLASSLISTDIALOG_STYLE );
  50. // Creation
  51. bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME,
  52. const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE,
  53. const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION,
  54. const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE,
  55. long style = SYMBOL_CLASSLISTDIALOG_STYLE );
  56. // Destructor
  57. ~ClassListDialog();
  58. public: // misc
  59. void Init();
  60. void CreateControls();
  61. void InitControls();
  62. void UpdateClassInfo(const wxString &itemName);
  63. void UpdateFilterText();
  64. bool IsToDiscard(const wxString &classname) const;
  65. int AddClassesWithParent(const wxClassInfo *parent, const wxTreeItemId &id);
  66. public: // event handlers
  67. void OnListboxSelected( wxCommandEvent& event );
  68. void OnTreectrlSelChanged( wxTreeEvent& event );
  69. void OnChoiceBookPageChange( wxChoicebookEvent& event );
  70. void OnShowOnlyXTICheckbox( wxCommandEvent& event );
  71. void OnShowRecursiveInfoCheckbox( wxCommandEvent& event );
  72. // Should we show tooltips?
  73. static bool ShowToolTips();
  74. protected:
  75. wxChoicebook* m_pChoiceBook;
  76. wxStaticText* m_pClassCountText;
  77. wxListBox* m_pRawListBox;
  78. wxTreeCtrl* m_pParentTreeCtrl;
  79. wxListBox* m_pSizeListBox;
  80. wxTextCtrl* m_pTextCtrl;
  81. int m_nTotalCount; // number of classes in wxXTI system
  82. int m_nCount; // number of shown classes
  83. };
  84. #endif
  85. // _CLASSLIST_H_