NIREP

C:/Programs/source/NIREP/DisplayManager/ViewDisplayDescription.h

00001 
00002 // Name:        ViewDisplayDescription.h
00003 // Purpose:     Allows a user to view a display description, edit the display
00004 //              description and create a display description.
00005 // Author:      Jeffrey Hawley
00006 // Modified by: 
00007 // Created:     02/08/2010 16:53:38
00008 // RCS-ID:      
00009 // Copyright:   
00010 // Licence:     
00012 
00013 #ifndef _VIEWDISPLAYDESCRIPTION_H_
00014 #define _VIEWDISPLAYDESCRIPTION_H_
00015 
00016 
00021 #include "wx/frame.h"
00022 #include "wx/statline.h"
00023 #include "wx/grid.h"
00024 
00025 #include "NIREPDefinitions.h"
00026 #include "IntelliTextCtrl.h"
00027 
00028 #include <map>
00029 
00038 #define SYMBOL_ViewDisplayDescription_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
00039 #define SYMBOL_ViewDisplayDescription_TITLE _("ViewDisplayDescription")
00040 #define SYMBOL_ViewDisplayDescription_IDNAME ID_VIEWDISPLAYDESCRIPTION
00041 #define SYMBOL_ViewDisplayDescription_SIZE wxSize(500, 775)
00042 #define SYMBOL_ViewDisplayDescription_POSITION wxDefaultPosition
00043 
00044 
00049 class ViewDisplayDescription: public wxFrame
00050 {    
00051     DECLARE_CLASS( ViewDisplayDescription )
00052     DECLARE_EVENT_TABLE()
00053 
00054 public:
00056     ViewDisplayDescription();
00057     ViewDisplayDescription( wxWindow* parent, wxWindowID id = SYMBOL_ViewDisplayDescription_IDNAME, const wxString& caption = SYMBOL_ViewDisplayDescription_TITLE, const wxPoint& pos = SYMBOL_ViewDisplayDescription_POSITION, const wxSize& size = SYMBOL_ViewDisplayDescription_SIZE, long style = SYMBOL_ViewDisplayDescription_STYLE );
00058 
00059     bool Create( wxWindow* parent, wxWindowID id = SYMBOL_ViewDisplayDescription_IDNAME, const wxString& caption = SYMBOL_ViewDisplayDescription_TITLE, const wxPoint& pos = SYMBOL_ViewDisplayDescription_POSITION, const wxSize& size = SYMBOL_ViewDisplayDescription_SIZE, long style = SYMBOL_ViewDisplayDescription_STYLE );
00060 
00062     ~ViewDisplayDescription();
00063 
00065     void Init();
00066 
00068     void CreateControls();
00069 
00071     void OnWidgetCommandsCellChange( wxGridEvent& event );
00072 
00074     wxBitmap GetBitmapResource( const wxString& name );
00075 
00077     wxIcon GetIconResource( const wxString& name );
00078 
00080     static bool ShowToolTips();
00081 
00083     void OnAddRdlClick( wxCommandEvent& event );
00084 
00086     void OnRemoveRdlClick( wxCommandEvent& event );
00087 
00089     void OnSaveClick( wxCommandEvent& event );
00090 
00092     void OnCancelClick( wxCommandEvent& event );
00093 
00095     void OnRowTextUpdated( wxCommandEvent& event );
00096 
00098     void OnColumnTextUpdated( wxCommandEvent& event );
00099 
00101     void OnMenuNewClick( wxCommandEvent& event );
00102 
00104     void OnMenuOpenClick( wxCommandEvent& event );
00105 
00107     void OnMenuSaveClick( wxCommandEvent& event );
00108 
00110     void OnExitClick( wxCommandEvent& event );
00111 
00113     void OnWidgetCommandsCellRightClick( wxGridEvent& event );
00114 
00115     void OnRightClickSelect(wxCommandEvent& event);
00116 private:
00117   wxListBox* m_rdlList;
00118   IntelliTextCtrl* m_variableList;
00119   IntelliTextCtrl* m_evaluatorList;
00120   IntelliTextCtrl* m_displayAttributesList;
00121   wxGrid* m_widgetCommands;
00122   wxTextCtrl* m_row;
00123   wxTextCtrl* m_col;
00124 
00125   struct LocationAndText {
00126     wxString text;
00127     int col;
00128     int row;
00129   };
00130 
00131   std::map<int,LocationAndText> m_clickToText;
00132 
00133   void Save();
00134   void ClearAll();
00135   void SetDefaults();
00136 
00137   enum{
00138     ID_VIEWDISPLAYDESCRIPTION =10000,
00139     ID_SCROLLEDWINDOW2,
00140     ID_RDL_LIST,
00141     ID_ADD_RDL,
00142     ID_REMOVE_RDL,
00143     ID_MENUITEM4,
00144     ID_INTELLITEXTCTRL1,
00145     ID_COMBOBOX,
00146     ID_ROW,
00147     ID_COLUMN,
00148     ID_WIDGET_COMMANDS,
00149     ID_TEXTCTRL12,
00150     ID_SAVE,
00151     ID_MENU_NEW,
00152     ID_MENU_OPEN,
00153     ID_MENU_SAVE
00154   };
00155 
00156 };
00157 
00158 
00159 #endif
00160     // _VIEWDISPLAYDESCRIPTION_H_
 All Classes Functions Variables Typedefs Enumerations Enumerator