NIREP
|
00001 00002 // Name: QuickView2.h 00003 // Purpose: Allows a user to create a display. The user can change the 00004 // number of rows and columns, which will in turn modify the 00005 // grid that is being displayed. The grid that is being displayed 00006 // corresponds to the final grid with the different views. From 00007 // there the user can go through each location in the grid and choose 00008 // the view they want displayed. When a user chooses a view, then the 00009 // possible inputs to the grid are displayed. The possible inputs 00010 // are: load in files that the user wants or a creation of evaluator 00011 // commands. There is an advanced area that the user can make changes 00012 // to the RDL that is being created. When the user is ready, they click 00013 // on Show to bring up the newly created display. 00014 // Author: Jeffrey Hawley 00015 // Modified by: 00016 // Created: 12/08/2010 12:03:56 00017 // RCS-ID: 00018 // Copyright: 00019 // Licence: 00021 00022 #ifndef _QUICKVIEW2_H_ 00023 #define _QUICKVIEW2_H_ 00024 00025 00030 00031 #include "wx/frame.h" 00032 #include "wx/grid.h" 00033 #include "wx/tokenzr.h" 00034 #include "wx/richtext/richtextctrl.h" 00035 #include "wx/notebook.h" 00036 #include "DisplayDescription.h" 00037 #include "ResourceDescriptionList/ResourceDescriptionList.h" 00038 00039 #include "NIREPDisplay.h" 00040 00041 #include <vector> 00042 #include <queue> 00043 #include <map> 00045 00051 class wxGrid; 00052 class EzGrid; 00053 class Interface; 00054 00059 00060 00061 #define SYMBOL_QUICKVIEW2_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxFULL_REPAINT_ON_RESIZE 00062 #define SYMBOL_QUICKVIEW2_TITLE _("QuickView2") 00063 #define SYMBOL_QUICKVIEW2_IDNAME ID_QUICKVIEW2 00064 #define SYMBOL_QUICKVIEW2_SIZE wxSize(400, 600) 00065 #define SYMBOL_QUICKVIEW2_POSITION wxDefaultPosition 00066 00067 00068 00073 class QuickView2: public wxFrame 00074 { 00075 DECLARE_CLASS( QuickView2 ) 00076 DECLARE_EVENT_TABLE() 00077 00078 public: 00080 QuickView2(); 00081 QuickView2( wxWindow* parent, wxWindowID id = SYMBOL_QUICKVIEW2_IDNAME, const wxString& caption = SYMBOL_QUICKVIEW2_TITLE, const wxPoint& pos = SYMBOL_QUICKVIEW2_POSITION, const wxSize& size = SYMBOL_QUICKVIEW2_SIZE, long style = SYMBOL_QUICKVIEW2_STYLE ); 00082 00083 bool Create( wxWindow* parent, wxWindowID id = SYMBOL_QUICKVIEW2_IDNAME, const wxString& caption = SYMBOL_QUICKVIEW2_TITLE, const wxPoint& pos = SYMBOL_QUICKVIEW2_POSITION, const wxSize& size = SYMBOL_QUICKVIEW2_SIZE, long style = SYMBOL_QUICKVIEW2_STYLE ); 00084 00086 ~QuickView2(); 00087 00089 void Init(); 00090 00092 void CreateControls(); 00093 00095 00097 void OnRowTextUpdated( wxCommandEvent& event ); 00098 00100 void OnColTextUpdated( wxCommandEvent& event ); 00101 00103 void OnWidgetCommandCellChanged( wxGridEvent& event ); 00104 00106 void OnCombobox5Selected( wxCommandEvent& event ); 00107 00109 void OnEvaluatorCommandCellChanged( wxGridEvent& event ); 00110 00112 void OnAdvancedClick( wxCommandEvent& event ); 00113 00115 void OnAddEvaluatorCommandClick( wxCommandEvent& event ); 00116 00118 void OnAddWidgetCommandClick( wxCommandEvent& event ); 00119 00121 void OnShowClick( wxCommandEvent& event ); 00122 00124 void OnCancelClick( wxCommandEvent& event ); 00125 00127 void OnDatatypeSelected( wxCommandEvent& event ); 00128 00130 void OnFormatSelected( wxCommandEvent& event ); 00131 00133 void OnBrowseClick( wxCommandEvent& event ); 00134 00136 void OnBrowse2Click( wxCommandEvent& event ); 00137 00139 void OnBrowse3Click( wxCommandEvent& event ); 00140 00142 void OnNotebookPageChanged( wxNotebookEvent& event ); 00143 00145 void OnGenerateClick( wxCommandEvent& event ); 00146 00148 void OnAddCoordinateClick( wxCommandEvent& event ); 00149 00151 void OnDeleteCoordinateClick( wxCommandEvent& event ); 00152 00154 void OnCoordinateGridChange( wxGridEvent& event ); 00155 00157 void OnUpdateDMID( wxCommandEvent& event ); 00158 00160 void OnUpdateVariables( wxCommandEvent& event ); 00161 00163 void OnListRdlSelected( wxCommandEvent& event ); 00164 00166 void OnAddRDL( wxCommandEvent& event ); 00167 00169 void OnDeleteRDL( wxCommandEvent& event ); 00170 00172 wxBitmap GetBitmapResource( const wxString& name ); 00173 00175 wxIcon GetIconResource( const wxString& name ); 00177 00179 static bool ShowToolTips(); 00180 private: 00181 enum{ 00182 ID_QUICKVIEW2 = 10100, 00183 ID_SCROLLEDWINDOW7, 00184 ID_ROW, 00185 ID_COL, 00186 ID_WIDGET_COMMAND, 00187 ID_COMBOBOX5, 00188 ID_EVALUATOR_COMMAND, 00189 ID_ADVANCED, 00190 ID_SCROLLEDWINDOW6, 00191 ID_COMBOBOX32, 00192 ID_TEXTCTRL112, 00193 ID_TEXTCTRL132, 00194 ID_COMBOBOX42, 00195 ID_SCROLLEDWINDOW32, 00196 ID_TEXTCTRL162, 00197 ID_TEXTCTRL172, 00198 ID_TEXTCTRL182, 00199 ID_TEXTCTRL2, 00200 ID_TEXTCTRL12, 00201 ID_ADD_COORDINATE, 00202 ID_DELETE_COORDINATE, 00203 ID_COMBOBOX6, 00204 ID_TITLE, 00205 ID_TEXTCTRL23, 00206 ID_ADD_EVALUATOR_COMMAND, 00207 ID_ADD_WIDGET_COMMAND, 00208 ID_SHOW, 00209 ID_STATIC_WIDGET_INPUTS, 00210 ID_STATIC_INPUTS_EC, 00211 ID_DATATYPE, 00212 ID_STATIC_FORMAT_TEXT, 00213 ID_FORMAT, 00214 ID_STATIC_FILEFORMAT1_TEXT, 00215 ID_FILENAME_PATTERN, 00216 ID_BROWSE, 00217 ID_STATIC_FILEFORMAT2_TEXT, 00218 ID_FILENAME_PATTERN2, 00219 ID_BROWSE2, 00220 ID_STATIC_FILEFORMAT3_TEXT, 00221 ID_FILENAME_PATTERN3, 00222 ID_BROWSE3, 00223 ID_VARIABLE_GRID, 00224 ID_COORDINATE_GRID, 00225 ID_REMOVE_DUPLICATES, 00226 ID_STATIC_DEFAULT_NAMESPACE_TEXT, 00227 ID_NAMESPACE, 00228 ID_STATIC_TRANSFORMATION_UNITS_TEXT, 00229 ID_TRANSFORMATION_UNITS, 00230 ID_STATIC_LABEL_TEXT, 00231 ID_LABEL, 00232 ID_NOTEBOOK, 00233 ID_DEFAULT_DMID, 00234 ID_DEFAULT_DMID_TEXT, 00235 ID_ADVANCED_DMID, 00236 ID_ADVANCED_DMID_TEXT, 00237 ID_TEXT, 00238 ID_STATIC_DATATYPE, 00239 ID_LIST_RDL, 00240 ID_ADD_RDL, 00241 ID_DELETE_RDL 00242 }; 00244 wxTextCtrl* m_row; 00245 wxTextCtrl* m_col; 00246 EzGrid* m_widgetGrid; 00247 EzGrid* m_evaluatorCommandGrid; 00248 wxComboBox* m_format; 00249 wxFlexGridSizer* m_itemFlexGridSizer3; 00250 00251 wxComboBox* m_datatype; 00252 wxTextCtrl* m_filenamePattern; 00253 wxTextCtrl* m_filenamePattern2; 00254 wxTextCtrl* m_filenamePattern3; 00255 wxGrid* m_variableGrid; 00256 wxGrid* m_coordinateGrid; 00257 wxTextCtrl* m_namespace; 00258 wxComboBox* m_transformationUnits; 00259 00260 Interface *m_parent; 00261 00262 int m_appendEvaluatorID; 00263 wxPoint m_widgetCommandLocation; 00264 00265 bool show; 00266 bool addRDL; 00267 bool deleteDD; 00268 00269 00270 //I might do things where I append commands 00271 //to the lists so that users can reuse old 00272 //commands 00273 std::vector<wxString> m_widgetList; 00274 std::vector<wxString> m_evaluatorList; 00275 std::vector<wxString> m_rdl; 00276 00277 DisplayDescription *m_displayDescription; 00278 00279 std::map<wxString,wxString> m_widgetCommand; 00280 00281 00282 std::queue<ResourceDescription *> ExpandRD(const wxString &pattern); 00283 00284 00285 void ChangeEvaluatorGrid(const wxString& evalCommand, const wxString& commaSeperatedInput = wxString(), const wxString& evalID= wxString(), const wxString& csID= wxString(), const wxString& extension= wxString()); 00286 00287 void DisplayDMID(); 00288 void Tokenize(const wxString& str, 00289 std::vector<wxString>& tokens, 00290 const wxString& delimiters = wxT(" ")); 00291 00292 00293 }; 00294 00295 #endif 00296 // _QUICKVIEW2_H_