fix compile against newer giflib
[rofl0r-obeditor.git] / src / myControls.h
bloba2fc0aed7b054669f8cf627be2abb51152fdc5e2
1 #ifndef MYCONTROLS_H
2 #define MYCONTROLS_H
4 #include <vector>
5 #include <map>
7 #include <wx/combo.h>
8 #include <wx/listctrl.h>
10 //--------------------------------------------------------------------
11 class pListViewPopup;
12 class pComboCtrl_AutoComplete;
13 //--------------------------------------------------------------------
15 //--------------------------------------------------------------------
16 class ComboBoxAutoComplete : public wxControl
18 public:
19 ComboBoxAutoComplete(wxWindow* _parent, wxWindowID id = wxID_ANY, bool _b_insensitive = true , const wxString& value = wxString(), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int more_style = 0 );
20 ~ComboBoxAutoComplete();
22 virtual bool IsShownOnScreen()const;
23 virtual wxSize DoGetBestSize()const;
25 bool Set_Value( const wxString& that );
27 void Add(const wxString& _choice, void* data = NULL );
28 void Set_Choices(const wxArrayString& _choices, void** _datas = NULL );
29 void* Remove(const wxString& _choice );
31 bool Selection_IsAMatch();
33 wxString Get_Value()const;
34 void* GetSelection_Data();
36 const std::vector<void*>& Get_All_Datas();
38 protected:
39 pListViewPopup* thePopup;
40 pComboCtrl_AutoComplete* theCombo;
42 void DoSetSize(int x, int y,
43 int width, int height,
44 int sizeFlags );
45 void Evt_Size(wxSizeEvent& evt);
46 DECLARE_EVENT_TABLE()
50 //--------------------------------------
51 BEGIN_DECLARE_EVENT_TYPES()
52 DECLARE_EVENT_TYPE(wxEVT_COMBOBOXAUTOCOMPLETE_CHANGE, 7778)
53 DECLARE_EVENT_TYPE(wxEVT_COMBOBOXAUTOCOMPLETE_VALID, 7878)
54 END_DECLARE_EVENT_TYPES()
57 #ifndef EVT_COMBOBOXAUTOCOMPLETE_CHANGE
58 #define EVT_COMBOBOXAUTOCOMPLETE_CHANGE(id, fn) \
59 DECLARE_EVENT_TABLE_ENTRY( \
60 wxEVT_COMBOBOXAUTOCOMPLETE_CHANGE, id, wxID_ANY, \
61 (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
62 (wxObject *) NULL \
64 #endif
67 #ifndef EVT_COMBOBOXAUTOCOMPLETE_VALID
68 #define EVT_COMBOBOXAUTOCOMPLETE_VALID(id, fn) \
69 DECLARE_EVENT_TABLE_ENTRY( \
70 wxEVT_COMBOBOXAUTOCOMPLETE_VALID, id, wxID_ANY, \
71 (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
72 (wxObject *) NULL \
74 #endif
77 #endif //MYCONTROLS_H