NIREP
|
00001 00002 // Name: IntelliTextCtrl.h 00003 // Purpose: To help users create a display description by allowing the user 00004 // to right click and a pop up appears with suggestions. Currently 00005 // works for whatever text is passed into SetRightClickText. 00006 // Author: Jeffrey Hawley 00007 // Modified by: 00008 // Created: 04/08/2010 10:28:02 00009 // RCS-ID: 00010 // Copyright: 00011 // Licence: 00013 00014 #ifndef _INTELLITEXTCTRL_H_ 00015 #define _INTELLITEXTCTRL_H_ 00016 00017 00018 00019 00020 #include "vector" 00021 #include "map" 00026 #define ID_TEXTCTRL9 10104 00027 #define SYMBOL_INTELLITEXTCTRL_STYLE wxTE_MULTILINE 00028 #define SYMBOL_INTELLITEXTCTRL_IDNAME ID_TEXTCTRL9 00029 #define SYMBOL_INTELLITEXTCTRL_SIZE wxSize(-1, 200) 00030 #define SYMBOL_INTELLITEXTCTRL_POSITION wxDefaultPosition 00031 00032 00037 class IntelliTextCtrl: public wxTextCtrl 00038 { 00039 DECLARE_DYNAMIC_CLASS( IntelliTextCtrl ) 00040 DECLARE_EVENT_TABLE() 00041 00042 public: 00044 IntelliTextCtrl(); 00045 IntelliTextCtrl(wxWindow* parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator); 00046 00048 bool Create(wxWindow* parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator); 00049 00051 ~IntelliTextCtrl(); 00052 00054 void Init(); 00055 00057 void CreateControls(); 00058 00059 00061 void OnRightDown( wxMouseEvent& event ); 00062 00064 void OnChar( wxKeyEvent& event ); 00065 00066 void SetRightClickText(std::vector<wxString> &text){m_rightClickText = text;}; 00067 00068 void OnRightClickSelect(wxCommandEvent& event); 00069 private: 00070 std::vector<wxString> m_rightClickText; 00071 std::map<int,wxString> m_clickToText; 00072 00073 }; 00074 00075 #endif 00076 // _INTELLITEXTCTRL_H_