NIREP
|
00001 00002 // Name: QuickView2.cpp 00003 // Purpose: 00004 // Author: Jeffrey Hawley 00005 // Modified by: 00006 // Created: 12/08/2010 12:03:56 00007 // RCS-ID: 00008 // Copyright: 00009 // Licence: 00011 00012 // For compilers that support precompilation, includes "wx/wx.h". 00013 #include "wx/wxprec.h" 00014 00015 #ifdef __BORLANDC__ 00016 #pragma hdrstop 00017 #endif 00018 00019 #ifndef WX_PRECOMP 00020 #include "wx/wx.h" 00021 #endif 00022 00025 00026 #include "QuickView2.h" 00027 00028 #include "EzGrid.h" 00029 #include "GridCellChoiceRenderer.h" 00030 #include "FastComboEditor.h" 00031 00032 #include "NIREPDefinitions.h" 00033 00034 #include <iostream> 00035 00036 #include "Interface.h" 00037 00040 00041 00042 /* 00043 * QuickView2 type definition 00044 */ 00045 00046 IMPLEMENT_CLASS( QuickView2, wxFrame ) 00047 00048 00049 /* 00050 * QuickView2 event table definition 00051 */ 00052 00053 BEGIN_EVENT_TABLE( QuickView2, wxFrame ) 00054 00055 EVT_TEXT( ID_ROW, QuickView2::OnRowTextUpdated ) 00056 00057 EVT_TEXT( ID_COL, QuickView2::OnColTextUpdated ) 00058 00059 EVT_GRID_CMD_CELL_CHANGE( ID_WIDGET_COMMAND, QuickView2::OnWidgetCommandCellChanged ) 00060 00061 EVT_COMBOBOX( ID_COMBOBOX5, QuickView2::OnCombobox5Selected ) 00062 00063 EVT_COMBOBOX( ID_COMBOBOX6, QuickView2::OnCombobox5Selected ) 00064 00065 EVT_GRID_CMD_CELL_CHANGE( ID_EVALUATOR_COMMAND, QuickView2::OnEvaluatorCommandCellChanged ) 00066 00067 EVT_BUTTON( ID_ADVANCED, QuickView2::OnAdvancedClick ) 00068 00069 EVT_BUTTON( ID_ADD_EVALUATOR_COMMAND, QuickView2::OnAddEvaluatorCommandClick ) 00070 00071 EVT_BUTTON( ID_ADD_WIDGET_COMMAND, QuickView2::OnAddWidgetCommandClick ) 00072 00073 EVT_BUTTON( ID_SHOW, QuickView2::OnShowClick ) 00074 00075 EVT_BUTTON( wxID_CANCEL, QuickView2::OnCancelClick ) 00076 00077 EVT_COMBOBOX( ID_DATATYPE, QuickView2::OnDatatypeSelected ) 00078 00079 EVT_COMBOBOX( ID_FORMAT, QuickView2::OnFormatSelected ) 00080 00081 EVT_BUTTON( ID_BROWSE, QuickView2::OnBrowseClick ) 00082 00083 EVT_BUTTON( ID_BROWSE2, QuickView2::OnBrowse2Click ) 00084 00085 EVT_BUTTON( ID_BROWSE3, QuickView2::OnBrowse3Click ) 00086 00087 EVT_NOTEBOOK_PAGE_CHANGED( ID_NOTEBOOK, QuickView2::OnNotebookPageChanged ) 00088 00089 EVT_BUTTON( ID_ADD_COORDINATE, QuickView2::OnAddCoordinateClick ) 00090 00091 EVT_BUTTON( ID_DELETE_COORDINATE, QuickView2::OnDeleteCoordinateClick ) 00092 00093 EVT_GRID_CMD_CELL_CHANGE(ID_COORDINATE_GRID,QuickView2::OnCoordinateGridChange) 00094 00095 EVT_TEXT(ID_NAMESPACE, QuickView2::OnUpdateDMID) 00096 00097 EVT_TEXT(ID_LABEL, QuickView2::OnUpdateDMID) 00098 00099 EVT_TEXT(ID_FILENAME_PATTERN, QuickView2::OnUpdateVariables) 00100 00101 EVT_TEXT(ID_FILENAME_PATTERN2, QuickView2::OnUpdateVariables) 00102 00103 EVT_TEXT(ID_FILENAME_PATTERN3, QuickView2::OnUpdateVariables) 00104 00105 EVT_LISTBOX( ID_LIST_RDL, QuickView2::OnListRdlSelected ) 00106 00107 EVT_BUTTON( ID_ADD_RDL, QuickView2::OnAddRDL ) 00108 00109 EVT_BUTTON( ID_DELETE_RDL, QuickView2::OnDeleteRDL ) 00110 00111 00112 END_EVENT_TABLE() 00113 00114 00115 /* 00116 * QuickView2 constructors 00117 */ 00118 00119 QuickView2::QuickView2() 00120 { 00121 Init(); 00122 } 00123 00124 QuickView2::QuickView2( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) 00125 { 00126 00127 Init(); 00128 m_parent = dynamic_cast<Interface*>(parent); 00129 Create( parent, id, caption, pos, size, style ); 00130 } 00131 00132 00133 /* 00134 * QuickView2 creator 00135 */ 00136 00137 bool QuickView2::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) 00138 { 00140 wxFrame::Create( parent, id, caption, pos, size, style ); 00141 00142 CreateControls(); 00143 Centre(); 00145 return true; 00146 } 00147 00148 00149 /* 00150 * QuickView2 destructor 00151 */ 00152 00153 QuickView2::~QuickView2() 00154 { 00155 if(deleteDD) { 00156 delete m_displayDescription; 00157 } 00158 } 00159 00160 00161 /* 00162 * Member initialisation 00163 */ 00164 00165 void QuickView2::Init() 00166 { 00168 deleteDD = true; 00169 show = true; 00170 addRDL = false; 00171 m_parent = NULL; 00172 m_row = NULL; 00173 m_col = NULL; 00174 m_widgetGrid = NULL; 00175 m_evaluatorCommandGrid = NULL; 00176 m_format = NULL; 00177 m_namespace = NULL; 00178 m_transformationUnits = NULL; 00179 m_itemFlexGridSizer3 = NULL; 00180 m_datatype = NULL; 00181 m_filenamePattern = NULL; 00182 m_filenamePattern2 = NULL; 00183 m_filenamePattern3 = NULL; 00184 m_variableGrid = NULL; 00185 m_coordinateGrid = NULL; 00186 00187 m_displayDescription = new DisplayDescription(); 00188 00189 m_widgetList.push_back(wxT("Select Widget Command")); 00190 m_widgetList.push_back(wxT("---------NEW------------")); 00191 for(WidgetCmdList::iterator l = WidgetCmd.begin(); l != WidgetCmd.end(); l++) { 00192 m_widgetList.push_back(wxString(l->second.c_str(), wxConvUTF8)); 00193 } 00194 m_widgetList.push_back(wxT("--------GENERATED-------")); 00195 m_appendEvaluatorID = 0; 00196 m_widgetCommandLocation.x = -1; 00197 m_widgetCommandLocation.y = -1; 00198 //for(EvaluatorCmdList::iterator l = EvalCmd.begin(); l != EvalCmd.end(); l++) { 00199 // m_evaluatorList.push_back(l->second); 00200 //} 00201 //m_evaluatorList.push_back("<Open File>"); 00203 } 00204 00205 00206 /* 00207 * Control creation for QuickView2 00208 */ 00209 00210 void QuickView2::CreateControls() 00211 { 00213 QuickView2* itemFrame1 = this; 00214 00215 wxScrolledWindow* itemScrolledWindow2 = new wxScrolledWindow( itemFrame1, ID_SCROLLEDWINDOW7, wxDefaultPosition, wxSize(100, 100), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); 00216 itemScrolledWindow2->SetScrollbars(1, 1, 0, 0); 00217 m_itemFlexGridSizer3 = new wxFlexGridSizer(0, 1, 0, 0); 00218 m_itemFlexGridSizer3->AddGrowableRow(3); 00219 m_itemFlexGridSizer3->AddGrowableCol(0); 00220 itemScrolledWindow2->SetSizer(m_itemFlexGridSizer3); 00221 00222 wxStaticText* itemStaticText4 = new wxStaticText( itemScrolledWindow2, wxID_STATIC, _("Widgets"), wxDefaultPosition, wxDefaultSize, 0 ); 00223 itemStaticText4->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("Tahoma"))); 00224 m_itemFlexGridSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00225 wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); 00226 m_itemFlexGridSizer3->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00227 wxStaticText* itemStaticText6 = new wxStaticText( itemScrolledWindow2, wxID_STATIC, _("Row"), wxDefaultPosition, wxDefaultSize, 0 ); 00228 itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00229 00230 m_row = new wxTextCtrl( itemScrolledWindow2, ID_ROW, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00231 itemBoxSizer5->Add(m_row, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00232 00233 wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL); 00234 m_itemFlexGridSizer3->Add(itemBoxSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00235 wxStaticText* itemStaticText9 = new wxStaticText( itemScrolledWindow2, wxID_STATIC, _("Column"), wxDefaultPosition, wxDefaultSize, 0 ); 00236 itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00237 00238 m_col = new wxTextCtrl( itemScrolledWindow2, ID_COL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00239 itemBoxSizer8->Add(m_col, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00240 00241 m_widgetGrid = new EzGrid( itemScrolledWindow2, ID_WIDGET_COMMAND, wxDefaultPosition, wxSize(200, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); 00242 m_widgetGrid->SetDefaultColSize(150); 00243 m_widgetGrid->SetDefaultRowSize(25); 00244 m_widgetGrid->SetColLabelSize(25); 00245 m_widgetGrid->SetRowLabelSize(50); 00246 m_widgetGrid->CreateGrid(0, 0, wxGrid::wxGridSelectCells); 00247 m_itemFlexGridSizer3->Add(m_widgetGrid, 0, wxGROW|wxGROW|wxALL, 5); 00248 00249 wxStaticText* itemStaticText12 = new wxStaticText( itemScrolledWindow2, ID_STATIC_WIDGET_INPUTS, _("Widget Inputs"), wxDefaultPosition, wxDefaultSize, 0 ); 00250 m_itemFlexGridSizer3->Add(itemStaticText12, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00251 itemStaticText12->Show(false); 00252 00253 wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL); 00254 m_itemFlexGridSizer3->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00255 wxArrayString itemComboBox14Strings; 00256 wxComboBox* itemComboBox14 = new wxComboBox( itemScrolledWindow2, ID_COMBOBOX5, _("Select Evaluator Command"), wxDefaultPosition, wxDefaultSize, itemComboBox14Strings, wxCB_DROPDOWN ); 00257 itemComboBox14->SetStringSelection(_("Select Evaluator Command")); 00258 itemBoxSizer13->Add(itemComboBox14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00259 itemComboBox14->Show(false); 00260 00261 wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL); 00262 m_itemFlexGridSizer3->Add(itemBoxSizer16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00263 wxArrayString itemComboBox17Strings; 00264 wxComboBox* itemComboBox17 = new wxComboBox( itemScrolledWindow2, ID_COMBOBOX6, _("Select Evaluator Command"), wxDefaultPosition, wxDefaultSize, itemComboBox17Strings, wxCB_DROPDOWN ); 00265 itemComboBox17->SetStringSelection(_("Select Evaluator Command")); 00266 itemBoxSizer16->Add(itemComboBox17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00267 itemComboBox17->Show(false); 00268 00269 wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL); 00270 m_itemFlexGridSizer3->Add(itemBoxSizer19, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00271 wxStaticText* itemStaticText20 = new wxStaticText( itemScrolledWindow2, ID_TITLE, _("Title"), wxDefaultPosition, wxDefaultSize, 0 ); 00272 itemBoxSizer19->Add(itemStaticText20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00273 itemStaticText20->Show(false); 00274 00275 wxTextCtrl* itemTextCtrl21 = new wxTextCtrl( itemScrolledWindow2, ID_TEXTCTRL23, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00276 itemBoxSizer19->Add(itemTextCtrl21, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00277 itemTextCtrl21->Show(false); 00278 00279 wxStaticText* itemStaticText16 = new wxStaticText( itemScrolledWindow2, ID_STATIC_INPUTS_EC, _("Inputs for Evaluator Command"), wxDefaultPosition, wxDefaultSize, 0 ); 00280 m_itemFlexGridSizer3->Add(itemStaticText16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00281 itemStaticText16->Show(false); 00282 00283 m_evaluatorCommandGrid = new EzGrid( itemScrolledWindow2, ID_EVALUATOR_COMMAND, wxDefaultPosition, wxSize(200, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); 00284 m_evaluatorCommandGrid->SetDefaultColSize(150); 00285 m_evaluatorCommandGrid->SetDefaultRowSize(25); 00286 m_evaluatorCommandGrid->SetColLabelSize(25); 00287 m_evaluatorCommandGrid->SetRowLabelSize(50); 00288 m_evaluatorCommandGrid->CreateGrid(1, 3, wxGrid::wxGridSelectCells); 00289 00290 m_evaluatorCommandGrid->SetColLabelValue(0,wxT("Evaluator ID")); 00291 m_evaluatorCommandGrid->SetColLabelValue(1,wxT("")); 00292 m_evaluatorCommandGrid->SetColLabelValue(2,wxT("Evaluator Command")); 00293 m_evaluatorCommandGrid->SetColSize(1,25); 00294 00295 m_evaluatorCommandGrid->SetCellValue(wxT("="),0,1); 00296 m_evaluatorCommandGrid->SetReadOnly(0,1); 00297 m_evaluatorCommandGrid->SetReadOnly(0,2); 00298 m_itemFlexGridSizer3->Add(m_evaluatorCommandGrid, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5); 00299 m_evaluatorCommandGrid->Show(false); 00300 00301 wxButton* itemButton24 = new wxButton( itemScrolledWindow2, ID_ADD_EVALUATOR_COMMAND, _("Add Evaluator Command"), wxDefaultPosition, wxDefaultSize, 0 ); 00302 m_itemFlexGridSizer3->Add(itemButton24, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00303 itemButton24->Show(false); 00304 00305 wxButton* itemButton25 = new wxButton( itemScrolledWindow2, ID_ADD_WIDGET_COMMAND, _("Add Widget Command"), wxDefaultPosition, wxDefaultSize, 0 ); 00306 m_itemFlexGridSizer3->Add(itemButton25, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00307 itemButton25->Show(false); 00308 00309 wxButton* itemButton18 = new wxButton( itemScrolledWindow2, ID_ADVANCED, _("Advanced >>"), wxDefaultPosition, wxDefaultSize, 0 ); 00310 m_itemFlexGridSizer3->Add(itemButton18, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00311 00312 wxFlexGridSizer* itemBoxSizer64 = new wxFlexGridSizer(0, 2, 0, 0); 00313 itemBoxSizer64->AddGrowableCol(0); 00314 itemBoxSizer64->AddGrowableCol(1); 00315 itemBoxSizer64->AddGrowableRow(0); 00316 m_itemFlexGridSizer3->Add(itemBoxSizer64, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxGROW, 5); 00317 00318 wxArrayString itemListBox29Strings; 00319 wxListBox* itemListBox29 = new wxListBox( itemScrolledWindow2, ID_LIST_RDL, wxDefaultPosition, wxDefaultSize, itemListBox29Strings, wxLB_SINGLE|wxLB_NEEDED_SB ); 00320 itemBoxSizer64->Add(itemListBox29, 0, wxGROW|wxALL, 5); 00321 itemListBox29->Show(false); 00322 00323 wxRichTextCtrl* itemRichTextCtrl4 = new wxRichTextCtrl( itemScrolledWindow2, ID_TEXT, wxEmptyString, wxDefaultPosition, wxSize(100, 100), wxWANTS_CHARS ); 00324 itemBoxSizer64->Add(itemRichTextCtrl4, 0, wxGROW|wxGROW|wxALL, 5); 00325 itemRichTextCtrl4->Show(false); 00326 itemRichTextCtrl4->SetEditable(false); 00327 00328 wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); 00329 m_itemFlexGridSizer3->Add(itemBoxSizer4, 0, wxALIGN_LEFT|wxALL, 5); 00330 00331 wxStaticText* itemStaticText5 = new wxStaticText( itemScrolledWindow2, ID_STATIC_DATATYPE, _("Datatype"), wxDefaultPosition, wxDefaultSize, 0 ); 00332 itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00333 itemStaticText5->Show(false); 00334 00335 wxArrayString m_datatypeStrings; 00336 m_datatypeStrings.Add("Select Datatype"); 00337 for(DataTypeList::iterator temp = DataType.begin(); temp != DataType.end(); temp++) { 00338 m_datatypeStrings.Add(wxString(temp->second.c_str(), wxConvUTF8)); 00339 } 00340 m_datatype = new wxComboBox( itemScrolledWindow2, ID_DATATYPE, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_datatypeStrings, wxCB_DROPDOWN ); 00341 itemBoxSizer4->Add(m_datatype, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00342 m_datatype->Show(false); 00343 m_datatype->SetSelection(0,0); 00344 00345 wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL); 00346 m_itemFlexGridSizer3->Add(itemBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5); 00347 00348 wxStaticText* itemStaticText8 = new wxStaticText( itemScrolledWindow2, ID_STATIC_FORMAT_TEXT, _("Format"), wxDefaultPosition, wxDefaultSize, 0 ); 00349 itemStaticText8->Show(false); 00350 itemBoxSizer7->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00351 00352 wxArrayString itemComboBox9Strings; 00353 for(TransformFormatList::iterator temp = TransformFormat.begin(); temp != TransformFormat.end(); temp++) { 00354 itemComboBox9Strings.Add(wxString(temp->second.c_str(), wxConvUTF8)); 00355 } 00356 wxComboBox *format = new wxComboBox( itemScrolledWindow2, ID_FORMAT, wxEmptyString, wxDefaultPosition, wxDefaultSize, itemComboBox9Strings, wxCB_DROPDOWN ); 00357 format->Show(false); 00358 itemBoxSizer7->Add(format, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00359 00360 wxFlexGridSizer* itemFlexGridSizer10 = new wxFlexGridSizer(0, 3, 0, 0); 00361 itemFlexGridSizer10->AddGrowableCol(1); 00362 m_itemFlexGridSizer3->Add(itemFlexGridSizer10, 0, wxGROW|wxALL, 5); 00363 00364 wxStaticText* itemStaticText11 = new wxStaticText( itemScrolledWindow2, ID_STATIC_FILEFORMAT1_TEXT, _("Filename pattern 1"), wxDefaultPosition, wxDefaultSize, 0 ); 00365 itemFlexGridSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00366 itemStaticText11->Show(false); 00367 00368 m_filenamePattern = new wxTextCtrl( itemScrolledWindow2, ID_FILENAME_PATTERN, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00369 itemFlexGridSizer10->Add(m_filenamePattern, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5); 00370 m_filenamePattern->Show(false); 00371 00372 wxButton* itemButton13 = new wxButton( itemScrolledWindow2, ID_BROWSE, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); 00373 itemFlexGridSizer10->Add(itemButton13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00374 itemButton13->Show(false); 00375 00376 wxStaticText* itemStaticText14 = new wxStaticText( itemScrolledWindow2, ID_STATIC_FILEFORMAT2_TEXT, _("Filename pattern 2"), wxDefaultPosition, wxDefaultSize, 0 ); 00377 itemStaticText14->Show(false); 00378 itemFlexGridSizer10->Add(itemStaticText14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00379 00380 m_filenamePattern2 = new wxTextCtrl( itemScrolledWindow2, ID_FILENAME_PATTERN2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00381 m_filenamePattern2->Show(false); 00382 itemFlexGridSizer10->Add(m_filenamePattern2, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5); 00383 00384 wxButton* itemButton16 = new wxButton( itemScrolledWindow2, ID_BROWSE2, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); 00385 itemButton16->Show(false); 00386 itemFlexGridSizer10->Add(itemButton16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00387 00388 wxStaticText* itemStaticText17 = new wxStaticText( itemScrolledWindow2, ID_STATIC_FILEFORMAT3_TEXT, _("Filename pattern 3"), wxDefaultPosition, wxDefaultSize, 0 ); 00389 itemStaticText17->Show(false); 00390 itemFlexGridSizer10->Add(itemStaticText17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00391 00392 m_filenamePattern3 = new wxTextCtrl( itemScrolledWindow2, ID_FILENAME_PATTERN3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00393 m_filenamePattern3->Show(false); 00394 itemFlexGridSizer10->Add(m_filenamePattern3, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5); 00395 00396 wxButton* itemButton19 = new wxButton( itemScrolledWindow2, ID_BROWSE3, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); 00397 itemButton19->Show(false); 00398 itemFlexGridSizer10->Add(itemButton19, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00399 00400 wxFlexGridSizer* itemFlexGridSizer20 = new wxFlexGridSizer(0, 2, 0, 0); 00401 itemFlexGridSizer20->AddGrowableCol(0); 00402 m_itemFlexGridSizer3->Add(itemFlexGridSizer20, 0, wxGROW|wxALL, 5); 00403 00404 m_variableGrid = new wxGrid( itemScrolledWindow2, ID_VARIABLE_GRID, wxDefaultPosition, wxSize(200, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); 00405 m_variableGrid->SetDefaultColSize(150); 00406 m_variableGrid->SetDefaultRowSize(25); 00407 m_variableGrid->SetColLabelSize(25); 00408 m_variableGrid->SetRowLabelSize(50); 00409 m_variableGrid->CreateGrid(5, 2, wxGrid::wxGridSelectCells); 00410 itemFlexGridSizer20->Add(m_variableGrid, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00411 m_variableGrid->SetColLabelValue(0,wxT("Variable")); 00412 m_variableGrid->SetColLabelValue(1,wxT("Values")); 00413 m_variableGrid->Show(false); 00414 00415 wxFlexGridSizer* itemFlexGridSizer28 = new wxFlexGridSizer(0, 2, 0, 0); 00416 itemFlexGridSizer28->AddGrowableCol(1); 00417 m_itemFlexGridSizer3->Add(itemFlexGridSizer28, 0, wxGROW|wxALL, 5); 00418 00419 wxStaticText* itemStaticText29 = new wxStaticText( itemScrolledWindow2, ID_STATIC_DEFAULT_NAMESPACE_TEXT, _("Default namespace"), wxDefaultPosition, wxDefaultSize, 0 ); 00420 itemFlexGridSizer28->Add(itemStaticText29, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00421 itemStaticText29->Show(false); 00422 00423 m_namespace = new wxTextCtrl( itemScrolledWindow2, ID_NAMESPACE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00424 itemFlexGridSizer28->Add(m_namespace, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00425 m_namespace->Show(false); 00426 00427 wxFlexGridSizer* itemFlexGridSizer22 = new wxFlexGridSizer(0, 2, 0, 0); 00428 itemFlexGridSizer22->AddGrowableCol(0); 00429 m_itemFlexGridSizer3->Add(itemFlexGridSizer22, 0, wxGROW|wxALL, 5); 00430 00431 m_coordinateGrid = new wxGrid( itemScrolledWindow2, ID_COORDINATE_GRID, wxDefaultPosition, wxSize(200, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); 00432 m_coordinateGrid->SetDefaultColSize(150); 00433 m_coordinateGrid->SetDefaultRowSize(25); 00434 m_coordinateGrid->SetColLabelSize(25); 00435 m_coordinateGrid->SetRowLabelSize(150); 00436 m_coordinateGrid->CreateGrid(1, 2, wxGrid::wxGridSelectCells); 00437 itemFlexGridSizer22->Add(m_coordinateGrid, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00438 m_coordinateGrid->SetRowLabelValue(0,wxT("Coordinate System 0")); 00439 m_coordinateGrid->SetColLabelValue(0,wxT( "Associated Variable" )); 00440 m_coordinateGrid->SetColLabelValue(1,wxT("Namespace (optional)")); 00441 m_coordinateGrid->Show(false); 00442 00443 wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); 00444 m_itemFlexGridSizer3->Add(itemBoxSizer24, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00445 00446 wxButton* itemButton252 = new wxButton( itemScrolledWindow2, ID_ADD_COORDINATE, _("Add Coordinate"), wxDefaultPosition, wxDefaultSize, 0 ); 00447 itemBoxSizer24->Add(itemButton252, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00448 itemButton252->Show(false); 00449 00450 wxButton* itemButton262 = new wxButton( itemScrolledWindow2, ID_DELETE_COORDINATE, _("Delete Coordinate"), wxDefaultPosition, wxDefaultSize, 0 ); 00451 itemBoxSizer24->Add(itemButton262, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00452 itemButton262->Show(false); 00453 00454 wxCheckBox* itemCheckBox27 = new wxCheckBox( itemScrolledWindow2, ID_REMOVE_DUPLICATES, _("Remove Identity Maps"), wxDefaultPosition, wxDefaultSize, 0 ); 00455 itemCheckBox27->SetValue(true); 00456 itemCheckBox27->Show(false); 00457 m_itemFlexGridSizer3->Add(itemCheckBox27, 0, wxALIGN_LEFT|wxALL, 5); 00458 00459 00460 00461 00462 00463 wxBoxSizer* itemBoxSizer31 = new wxBoxSizer(wxHORIZONTAL); 00464 m_itemFlexGridSizer3->Add(itemBoxSizer31, 0, wxALIGN_LEFT|wxALL, 5); 00465 00466 wxStaticText* itemStaticText32 = new wxStaticText( itemScrolledWindow2, ID_STATIC_TRANSFORMATION_UNITS_TEXT, _("Transformation units"), wxDefaultPosition, wxDefaultSize, 0 ); 00467 itemStaticText32->Show(false); 00468 itemBoxSizer31->Add(itemStaticText32, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00469 00470 wxArrayString m_transformationUnitsStrings; 00471 for(TransformUnitsList::iterator temp = TransformUnits.begin(); temp != TransformUnits.end(); temp++) { 00472 m_transformationUnitsStrings.Add(wxString(temp->second.c_str(), wxConvUTF8)); 00473 } 00474 m_transformationUnits = new wxComboBox( itemScrolledWindow2, ID_TRANSFORMATION_UNITS, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_transformationUnitsStrings, wxCB_DROPDOWN ); 00475 m_transformationUnits->Show(false); 00476 itemBoxSizer31->Add(m_transformationUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00477 00478 wxFlexGridSizer* itemFlexGridSizer34 = new wxFlexGridSizer(0, 2, 0, 0); 00479 itemFlexGridSizer34->AddGrowableCol(1); 00480 m_itemFlexGridSizer3->Add(itemFlexGridSizer34, 0, wxGROW|wxALL, 5); 00481 00482 wxFlexGridSizer* itemFlexGridSizer37 = new wxFlexGridSizer(0, 2, 0, 0); 00483 itemFlexGridSizer37->AddGrowableCol(1); 00484 m_itemFlexGridSizer3->Add(itemFlexGridSizer37, 0, wxGROW|wxALL, 5); 00485 00486 wxStaticText* itemStaticText38 = new wxStaticText( itemScrolledWindow2, ID_STATIC_LABEL_TEXT, _("Label"), wxDefaultPosition, wxDefaultSize, 0 ); 00487 itemStaticText38->Show(false); 00488 itemFlexGridSizer37->Add(itemStaticText38, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00489 00490 wxTextCtrl* itemTextCtrl39 = new wxTextCtrl( itemScrolledWindow2, ID_LABEL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00491 itemTextCtrl39->Show(false); 00492 itemFlexGridSizer37->Add(itemTextCtrl39, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5); 00493 00494 wxNotebook* itemNotebook40 = new wxNotebook( itemScrolledWindow2, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT ); 00495 itemNotebook40->Show(false); 00496 00497 wxPanel* itemPanel41 = new wxPanel( itemNotebook40, ID_DEFAULT_DMID, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); 00498 wxFlexGridSizer* itemFlexGridSizer42 = new wxFlexGridSizer(0, 2, 0, 0); 00499 itemFlexGridSizer42->AddGrowableCol(1); 00500 itemPanel41->SetSizer(itemFlexGridSizer42); 00501 00502 wxStaticText* itemStaticText43 = new wxStaticText( itemPanel41, wxID_STATIC, _("DMID"), wxDefaultPosition, wxDefaultSize, 0 ); 00503 itemFlexGridSizer42->Add(itemStaticText43, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00504 00505 wxTextCtrl* itemTextCtrl44 = new wxTextCtrl( itemPanel41, ID_DEFAULT_DMID_TEXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00506 itemTextCtrl44->Enable(false); 00507 itemFlexGridSizer42->Add(itemTextCtrl44, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5); 00508 00509 itemNotebook40->AddPage(itemPanel41, _("Default DMID")); 00510 00511 wxPanel* itemPanel45 = new wxPanel( itemNotebook40, ID_ADVANCED_DMID, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); 00512 wxFlexGridSizer* itemFlexGridSizer46 = new wxFlexGridSizer(0, 2, 0, 0); 00513 itemFlexGridSizer46->AddGrowableCol(1); 00514 itemPanel45->SetSizer(itemFlexGridSizer46); 00515 00516 wxStaticText* itemStaticText47 = new wxStaticText( itemPanel45, wxID_STATIC, _("DMID"), wxDefaultPosition, wxDefaultSize, 0 ); 00517 itemFlexGridSizer46->Add(itemStaticText47, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00518 00519 wxTextCtrl* itemTextCtrl48 = new wxTextCtrl( itemPanel45, ID_ADVANCED_DMID_TEXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00520 itemFlexGridSizer46->Add(itemTextCtrl48, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5); 00521 00522 itemNotebook40->AddPage(itemPanel45, _("Edit DMID")); 00523 00524 m_itemFlexGridSizer3->Add(itemNotebook40, 0, wxGROW|wxALL, 5); 00525 00526 wxBoxSizer* itemBoxSizer63 = new wxBoxSizer(wxHORIZONTAL); 00527 m_itemFlexGridSizer3->Add(itemBoxSizer63, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00528 wxButton* itemButton64 = new wxButton( itemScrolledWindow2, ID_ADD_RDL, _("Add RDL Information"), wxDefaultPosition, wxDefaultSize, 0 ); 00529 itemBoxSizer63->Add(itemButton64, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00530 itemButton64->Show(false); 00531 00532 wxButton* itemButton65 = new wxButton( itemScrolledWindow2, ID_DELETE_RDL, _("Delete RDL Information"), wxDefaultPosition, wxDefaultSize, 0 ); 00533 itemBoxSizer63->Add(itemButton65, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00534 itemButton65->Show(false); 00535 00536 wxScrolledWindow* itemScrolledWindow33 = new wxScrolledWindow( itemScrolledWindow2, ID_SCROLLEDWINDOW32, wxDefaultPosition, wxSize(100, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); 00537 itemScrolledWindow33->Show(false); 00538 m_itemFlexGridSizer3->Add(itemScrolledWindow33, 0, wxGROW|wxGROW|wxALL|wxFIXED_MINSIZE, 5); 00539 itemScrolledWindow33->SetScrollbars(1, 1, 0, 0); 00540 wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxHORIZONTAL); 00541 itemScrolledWindow33->SetSizer(itemBoxSizer34); 00542 00543 wxBoxSizer* itemBoxSizer35 = new wxBoxSizer(wxVERTICAL); 00544 itemBoxSizer34->Add(itemBoxSizer35, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00545 wxStaticText* itemStaticText36 = new wxStaticText( itemScrolledWindow33, wxID_STATIC, _("coordinate 0 (source)"), wxDefaultPosition, wxDefaultSize, 0 ); 00546 itemBoxSizer35->Add(itemStaticText36, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00547 00548 wxTextCtrl* itemTextCtrl37 = new wxTextCtrl( itemScrolledWindow33, ID_TEXTCTRL162, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00549 itemBoxSizer35->Add(itemTextCtrl37, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00550 00551 wxStaticText* itemStaticText382 = new wxStaticText( itemScrolledWindow33, wxID_STATIC, _("namespace"), wxDefaultPosition, wxDefaultSize, 0 ); 00552 itemBoxSizer35->Add(itemStaticText382, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00553 00554 wxTextCtrl* itemTextCtrl392 = new wxTextCtrl( itemScrolledWindow33, ID_TEXTCTRL172, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00555 itemBoxSizer35->Add(itemTextCtrl392, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00556 00557 wxStaticText* itemStaticText40 = new wxStaticText( itemScrolledWindow33, wxID_STATIC, _("->"), wxDefaultPosition, wxDefaultSize, 0 ); 00558 itemStaticText40->SetForegroundColour(wxColour(255, 0, 0)); 00559 itemStaticText40->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("Tahoma"))); 00560 itemBoxSizer34->Add(itemStaticText40, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00561 00562 wxBoxSizer* itemBoxSizer41 = new wxBoxSizer(wxVERTICAL); 00563 itemBoxSizer34->Add(itemBoxSizer41, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00564 wxStaticText* itemStaticText42 = new wxStaticText( itemScrolledWindow33, wxID_STATIC, _("Algorithm Name"), wxDefaultPosition, wxDefaultSize, 0 ); 00565 itemBoxSizer41->Add(itemStaticText42, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00566 00567 wxTextCtrl* itemTextCtrl43 = new wxTextCtrl( itemScrolledWindow33, ID_TEXTCTRL182, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00568 itemBoxSizer41->Add(itemTextCtrl43, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00569 00570 wxStaticText* itemStaticText44 = new wxStaticText( itemScrolledWindow33, wxID_STATIC, _("->"), wxDefaultPosition, wxDefaultSize, 0 ); 00571 itemStaticText44->SetForegroundColour(wxColour(255, 0, 0)); 00572 itemStaticText44->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("Tahoma"))); 00573 itemBoxSizer34->Add(itemStaticText44, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00574 00575 wxBoxSizer* itemBoxSizer45 = new wxBoxSizer(wxVERTICAL); 00576 itemBoxSizer34->Add(itemBoxSizer45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00577 wxStaticText* itemStaticText46 = new wxStaticText( itemScrolledWindow33, wxID_STATIC, _("coordinate 1 (target)"), wxDefaultPosition, wxDefaultSize, 0 ); 00578 itemBoxSizer45->Add(itemStaticText46, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00579 00580 wxTextCtrl* itemTextCtrl47 = new wxTextCtrl( itemScrolledWindow33, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00581 itemBoxSizer45->Add(itemTextCtrl47, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00582 00583 wxStaticText* itemStaticText48 = new wxStaticText( itemScrolledWindow33, wxID_STATIC, _("namespace"), wxDefaultPosition, wxDefaultSize, 0 ); 00584 itemBoxSizer45->Add(itemStaticText48, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00585 00586 wxTextCtrl* itemTextCtrl49 = new wxTextCtrl( itemScrolledWindow33, ID_TEXTCTRL12, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); 00587 itemBoxSizer45->Add(itemTextCtrl49, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00588 00589 itemScrolledWindow33->FitInside(); 00590 wxBoxSizer* itemBoxSizer50 = new wxBoxSizer(wxHORIZONTAL); 00591 m_itemFlexGridSizer3->Add(itemBoxSizer50, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00592 wxButton* itemButton51 = new wxButton( itemScrolledWindow2, ID_ADD_COORDINATE, _("Add Coordinate System"), wxDefaultPosition, wxDefaultSize, 0 ); 00593 itemButton51->Show(false); 00594 itemBoxSizer50->Add(itemButton51, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00595 00596 wxButton* itemButton52 = new wxButton( itemScrolledWindow2, ID_DELETE_COORDINATE, _("Delete Coordinate System"), wxDefaultPosition, wxDefaultSize, 0 ); 00597 itemButton52->Show(false); 00598 itemBoxSizer50->Add(itemButton52, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00599 00600 wxBoxSizer* itemBoxSizer61 = new wxBoxSizer(wxHORIZONTAL); 00601 m_itemFlexGridSizer3->Add(itemBoxSizer61, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); 00602 wxButton* itemButton62 = new wxButton( itemScrolledWindow2, ID_SHOW, _("Show"), wxDefaultPosition, wxDefaultSize, 0 ); 00603 itemBoxSizer61->Add(itemButton62, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00604 00605 wxButton* itemButton63 = new wxButton( itemScrolledWindow2, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); 00606 itemBoxSizer61->Add(itemButton63, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00607 00608 itemScrolledWindow2->FitInside(); 00609 00610 m_col->SetValue(wxT("3")); 00611 m_row->SetValue(wxT("2")); 00612 00613 } 00614 00615 00616 /* 00617 * Should we show tooltips? 00618 */ 00619 00620 bool QuickView2::ShowToolTips() 00621 { 00622 return true; 00623 } 00624 00625 /* 00626 * Get bitmap resources 00627 */ 00628 00629 wxBitmap QuickView2::GetBitmapResource( const wxString& name ) 00630 { 00631 // Bitmap retrieval 00633 wxUnusedVar(name); 00634 return wxNullBitmap; 00636 } 00637 00638 /* 00639 * Get icon resources 00640 */ 00641 00642 wxIcon QuickView2::GetIconResource( const wxString& name ) 00643 { 00644 // Icon retrieval 00646 wxUnusedVar(name); 00647 return wxNullIcon; 00649 } 00650 00651 00652 /* 00653 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON13 00654 */ 00655 00656 void QuickView2::OnAdvancedClick( wxCommandEvent& event ) 00657 { 00658 this->FindWindow(ID_TEXT)->Show(show); 00659 this->FindWindow(ID_STATIC_DATATYPE)->Show(show); 00660 this->FindWindow(ID_DATATYPE)->Show(show); 00661 this->FindWindow(ID_STATIC_FILEFORMAT1_TEXT)->Show(show); 00662 this->FindWindow(ID_FILENAME_PATTERN)->Show(show); 00663 this->FindWindow(ID_BROWSE)->Show(show); 00664 00665 m_variableGrid->Show(show); 00666 m_coordinateGrid->Show(show); 00667 this->FindWindow(ID_ADD_COORDINATE)->Show(show); 00668 this->FindWindow(ID_DELETE_COORDINATE)->Show(show); 00669 this->FindWindow(ID_REMOVE_DUPLICATES)->Show(show); 00670 this->FindWindow(ID_STATIC_DEFAULT_NAMESPACE_TEXT)->Show(show); 00671 this->FindWindow(ID_NAMESPACE)->Show(show); 00672 this->FindWindow(ID_NOTEBOOK)->Show(show); 00673 this->FindWindow(ID_LIST_RDL)->Show(show); 00674 this->FindWindow(ID_ADD_RDL)->Show(show); 00675 this->FindWindow(ID_DELETE_RDL)->Show(show); 00676 00677 00678 show = !show; 00679 00680 if(show) { 00681 dynamic_cast<wxButton*>(this->FindWindow(ID_ADVANCED) )->SetLabel(wxT("Advanced >>")); 00682 00683 //just to make sure that everything is hidden 00684 this->FindWindow(ID_FORMAT)->Show(false); 00685 this->FindWindow(ID_STATIC_FORMAT_TEXT)->Show(false); 00686 this->FindWindow(ID_TRANSFORMATION_UNITS)->Show(false); 00687 this->FindWindow(ID_STATIC_TRANSFORMATION_UNITS_TEXT)->Show(false); 00688 00689 this->FindWindow(ID_STATIC_FILEFORMAT2_TEXT)->Show(false); 00690 this->FindWindow(ID_FILENAME_PATTERN2)->Show(false); 00691 this->FindWindow(ID_BROWSE2)->Show(false); 00692 00693 this->FindWindow(ID_STATIC_FILEFORMAT3_TEXT)->Show(false); 00694 this->FindWindow(ID_FILENAME_PATTERN3)->Show(false); 00695 this->FindWindow(ID_BROWSE3)->Show(false); 00696 00697 this->FindWindow(ID_STATIC_LABEL_TEXT)->Show(false); 00698 this->FindWindow(ID_LABEL)->Show(false); 00699 } else { 00700 dynamic_cast<wxButton*>(this->FindWindow(ID_ADVANCED) )->SetLabel("<< Advanced"); 00701 00702 dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->Clear(); 00703 FILE * tempfile = fopen("tempfile.txt", "w+"); 00704 m_displayDescription->GetRDL()->Save(tempfile); 00705 rewind(tempfile); 00706 int character; 00707 while( (character = fgetc(tempfile) ) != EOF ) { 00708 wxString temp; 00709 temp.Append(static_cast<char>(character) ); 00710 dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->AppendText(temp); 00711 } 00712 fclose(tempfile); 00713 } 00714 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 00715 } 00716 00717 00718 00719 00720 00721 00722 /* 00723 * wxEVT_GRID_CMD_CELL_CHANGED event handler for ID_GRID6 00724 */ 00725 00726 void QuickView2::OnWidgetCommandCellChanged( wxGridEvent& event ) 00727 { 00728 this->FindWindow(ID_STATIC_WIDGET_INPUTS)->Show(); 00729 this->FindWindow(ID_TITLE)->Show(); 00730 this->FindWindow(ID_TEXTCTRL23)->Show(); 00731 this->FindWindow(ID_ADD_WIDGET_COMMAND)->Show(); 00732 00733 this->FindWindow(ID_STATIC_INPUTS_EC)->Show(false); 00734 m_evaluatorCommandGrid->Show(false); 00735 this->FindWindow(ID_ADD_EVALUATOR_COMMAND)->Show(false); 00736 00737 //this->FindWindow(ID_ADVANCED)->Show(); 00738 00739 wxString widgetCommand = event.GetString(); 00740 m_widgetCommandLocation.x = event.GetRow(); 00741 m_widgetCommandLocation.y = event.GetCol(); 00742 std::pair<WidgetInputList::iterator, WidgetInputList::iterator> inputs = WidgetInput.equal_range(std::string(widgetCommand.mb_str())); 00743 int k=0; 00744 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Clear(); 00745 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Clear(); 00746 00747 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(wxT("Select Evaluator Command")); 00748 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(wxT("Select Evaluator Command")); 00749 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->SetStringSelection(_("Select Evaluator Command")); 00750 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->SetStringSelection(_("Select Evaluator Command")); 00751 00752 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(wxT("---------NEW------------")); 00753 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(wxT("---------NEW------------")); 00754 WidgetInputList::iterator i; 00755 for(i = inputs.first; i!= inputs.second; ++i, k++) { 00756 EvalOutputList::iterator output; 00757 for(output = EvalOutput.begin(); output != EvalOutput.end(); ++output) { 00758 if(i->second.compare(output->second) ==0 && output->first.compare(EvalCmd.find("SpatialData")->second) == 0 ) { 00759 if(k == 0) { 00760 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(wxT("<Open Spatial Data File>")); 00761 } 00762 else { 00763 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(wxT("<Open Spatial Data File>")); 00764 } 00765 } 00766 else if(i->second.compare(output->second) ==0 && output->first.compare(EvalCmd.find("Transformation")->second) == 0) { 00767 if(k == 0) { 00768 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(wxT("<Open Transformation File>")); 00769 } 00770 else { 00771 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(wxT("<Open Transformation File>")); 00772 } 00773 } 00774 else if(i->second.compare(output->second) ==0) { 00775 if(k == 0) { 00776 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(wxString(output->first.c_str(), wxConvUTF8)); 00777 } 00778 else { 00779 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(wxString(output->first.c_str(), wxConvUTF8)); 00780 } 00781 } 00782 } 00783 00784 } 00785 00786 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append("--------RDL DMID-------"); 00787 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append("--------RDL DMID-------"); 00788 00789 k = 0; 00790 for(i = inputs.first; i!= inputs.second; ++i, k++) { 00791 for(int j = 0; j < m_rdl.size(); j++) { 00792 EvalOutputList::iterator output; 00793 for(output = EvalOutput.begin(); output != EvalOutput.end(); ++output) { 00794 if(i->second.compare(output->second) ==0 ) { 00795 //need to first get the evaluator command 00796 wxString eC = m_rdl.at(j); 00797 eC = eC.BeforeFirst('('); 00798 00799 //then need to see if the command produces the right output 00800 if(eC.compare(output->first.c_str()) ==0 ) { 00801 if(k == 0) { 00802 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(m_rdl.at(j)); 00803 } else { 00804 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(m_rdl.at(j)); 00805 } 00806 } 00807 } 00808 } 00809 00810 } 00811 } 00812 00813 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append("--------GENERATED-------"); 00814 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append("--------GENERATED-------"); 00815 00816 00817 k = 0; 00818 for(i = inputs.first; i!= inputs.second; ++i, k++) { 00819 for(int j = 0; j < m_evaluatorList.size(); j++) { 00820 EvalOutputList::iterator output; 00821 for(output = EvalOutput.begin(); output != EvalOutput.end(); ++output) { 00822 if(i->second.compare(output->second) ==0 ) { 00823 //need to first get the evaluator command 00824 wxString eC = m_evaluatorList.at(j); 00825 eC = eC.Remove(0,eC.find_first_of(wxT("="))+1); 00826 eC = eC.Remove(eC.find_first_of(wxT("(")),eC.size() - eC.find_first_of(wxT("("))); 00827 00828 //then need to see if the command produces the right output 00829 if(eC.compare(wxString(output->first.c_str(), wxConvUTF8)) ==0 ) { 00830 if(k == 0) { 00831 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(m_evaluatorList.at(j)); 00832 } else { 00833 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(m_evaluatorList.at(j)); 00834 } 00835 } 00836 } 00837 } 00838 00839 } 00840 } 00841 00842 if( k == 0) { 00843 this->FindWindow(ID_COMBOBOX6)->Show(false); 00844 this->FindWindow(ID_COMBOBOX5)->Show(false); 00845 00846 this->FindWindow(ID_STATIC_WIDGET_INPUTS)->Show(false); 00847 this->FindWindow(ID_TITLE)->Show(false); 00848 this->FindWindow(ID_TEXTCTRL23)->Show(false); 00849 this->FindWindow(ID_ADD_WIDGET_COMMAND)->Show(false); 00850 //this->FindWindow(ID_ADVANCED)->Show(false); 00851 } 00852 else if(k >2) { 00853 this->FindWindow(ID_COMBOBOX6)->Show(true); 00854 00855 this->FindWindow(ID_COMBOBOX5)->Show(true); 00856 } 00857 else { 00858 this->FindWindow(ID_COMBOBOX6)->Show(false); 00859 00860 this->FindWindow(ID_COMBOBOX5)->Show(true); 00861 } 00862 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 00863 } 00864 00865 00866 /* 00867 * wxEVT_GRID_CMD_CELL_CHANGED event handler for ID_GRID7 00868 */ 00869 00870 void QuickView2::OnEvaluatorCommandCellChanged( wxGridEvent& event ) 00871 { 00872 if(event.GetString().compare("<Open File>") == 0) { 00873 wxFileDialog * filedialog = new wxFileDialog(this, wxT("Choose a file to use for data."), wxT(""), wxT("*"), "*", wxFD_OPEN|wxFD_FILE_MUST_EXIST, wxDefaultPosition, wxDefaultSize, wxT("Open")); 00874 if( filedialog->ShowModal() == wxID_CANCEL ){ delete filedialog; return;} 00875 00876 00877 wxArrayString tempTwo; 00878 filedialog->GetPaths(tempTwo); 00879 wxString tempThree; 00880 int count = 0; 00881 for(wxArrayString::iterator i = tempTwo.begin(); i != tempTwo.end(); i++) { 00882 tempThree.Append(i->c_str()); 00883 tempThree.Append(wxT(";")); 00884 count++; 00885 } 00886 wxString::iterator semiColonErase = tempThree.end(); 00887 semiColonErase--; 00888 tempThree.erase(semiColonErase,tempThree.end()); 00889 //m_browseText->SetValue(tempThree ); 00890 00891 00892 size_t dot = filedialog->GetFilename().find_last_of(wxT(".")); 00893 std::string extension(std::string(filedialog->GetFilename().mb_str()),dot); 00894 00895 if(count == 3) { 00896 //we have a disp transformation 00897 } 00898 else if(FileExtension.find(extension) != FileExtension.end() ) { 00899 std::pair<FileExtensionList::iterator, FileExtensionList::iterator> typesAndTransforms = FileExtension.equal_range(extension); 00900 if(FileExtension.find(extension)->second.compare(DataType["Transformation"])) { 00901 } 00902 else { 00903 } 00904 } 00905 else{ 00906 //not the right data type 00907 } 00908 00909 delete filedialog; 00910 } 00911 else if(event.GetString().compare("<Open Transformation File>") == 0) { 00912 wxFileDialog * filedialog = new wxFileDialog(this, wxT("Choose a file(s) to use for data. If multiple files then please choose 3 that correspond to one data."), wxT(""), wxT("*"), wxT("*"), wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_MULTIPLE, wxDefaultPosition, wxDefaultSize, wxT("Open")); 00913 if( filedialog->ShowModal() == wxID_CANCEL ){ delete filedialog; return;} 00914 00915 addRDL = true; 00916 wxArrayString tempTwo; 00917 filedialog->GetPaths(tempTwo); 00918 wxString tempThree; 00919 int count = 0; 00920 for(wxArrayString::iterator i = tempTwo.begin(); i != tempTwo.end(); i++) { 00921 tempThree.Append(i->c_str()); 00922 tempThree.Append(";"); 00923 count++; 00924 } 00925 tempThree = tempThree.RemoveLast(); 00926 00927 00928 size_t dot = filedialog->GetFilename().find_last_of("."); 00929 std::string extension = filedialog->GetFilename().After(wxT('.')).ToStdString(); 00930 if(count == 3) { 00931 //we have a disp transformation 00932 } 00933 else if(FileExtension.find(extension) != FileExtension.end() ) { 00934 std::pair<FileExtensionList::iterator, FileExtensionList::iterator> typesAndTransforms = FileExtension.equal_range(extension); 00935 wxString evalCommand; 00936 wxString nameSpace = filedialog->GetDirectory(); 00937 nameSpace.Remove(0,nameSpace.find_last_of('\\')+1); 00938 wxString csID; 00939 if(FileExtension.find(extension)->second.compare(DataType["Transformation"]) == 0) { 00940 evalCommand = EvalCmd["Transformation"]; 00941 } 00942 this->ChangeEvaluatorGrid(evalCommand,wxString(),filedialog->GetFilename().BeforeFirst('.'), csID, extension); 00943 } 00944 else{ 00945 //not the right data type 00946 } 00947 00948 delete filedialog; 00949 } 00950 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 00951 } 00952 00953 00954 /* 00955 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX5 00956 */ 00957 00958 void QuickView2::OnCombobox5Selected( wxCommandEvent& event ) 00959 { 00960 m_appendEvaluatorID = event.GetId(); 00961 if(event.GetString().compare("<Open Spatial Data File>")==0) { 00962 wxFileDialog * filedialog = new wxFileDialog(this, wxT("Choose a file to use for data."), wxT(""), wxT("*"), wxT("*"), wxFD_OPEN|wxFD_FILE_MUST_EXIST, wxDefaultPosition, wxDefaultSize, wxT("Open")); 00963 if( filedialog->ShowModal() == wxID_CANCEL ){ delete filedialog; return;} 00964 00965 addRDL = true; 00966 wxArrayString tempTwo; 00967 filedialog->GetPaths(tempTwo); 00968 wxString tempThree; 00969 int count = 0; 00970 for(wxArrayString::iterator i = tempTwo.begin(); i != tempTwo.end(); i++) { 00971 tempThree.Append(i->c_str()); 00972 tempThree.Append(";"); 00973 count++; 00974 } 00975 tempThree = tempThree.RemoveLast(); 00976 00977 00978 size_t dot = filedialog->GetFilename().find_last_of("."); 00979 std::string extension = filedialog->GetFilename().After(wxT('.')).ToStdString(); 00980 00981 if(extension.compare("obj") == 0) { 00982 int sel = m_datatype->FindString(DataType["Objectmap"]); 00983 m_datatype->SetSelection(sel); 00984 dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_LABEL))->SetValue("Objectmap"); 00985 } else { 00986 int sel = m_datatype->FindString(DataType["Image"]); 00987 m_datatype->SetSelection(sel); 00988 dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_LABEL))->SetValue("Image"); 00989 } 00990 m_filenamePattern->SetValue(filedialog->GetPath()); 00991 m_coordinateGrid->SetCellValue(filedialog->GetFilename().BeforeFirst('.'),0,0); 00992 m_namespace->SetValue(filedialog->GetDirectory().AfterLast('\\')); 00993 00994 00995 if(FileExtension.find(extension) != FileExtension.end() ) { 00996 wxString evalCommand; 00997 wxString nameSpace = filedialog->GetDirectory(); 00998 nameSpace.Remove(0,nameSpace.find_last_of('\\')+1); 00999 wxString csID; 01000 evalCommand = EvalCmd["SpatialData"]; 01001 csID = nameSpace; 01002 csID.Append("|"); 01003 csID.Append(filedialog->GetFilename().BeforeFirst('.')); 01004 this->ChangeEvaluatorGrid(evalCommand,wxString(),filedialog->GetFilename().BeforeFirst('.'), csID, extension); 01005 01006 } 01007 else{ 01008 //not the right data type 01009 } 01010 01011 01012 delete filedialog; 01013 01014 this->FindWindow(ID_STATIC_INPUTS_EC)->Show(); 01015 m_evaluatorCommandGrid->Show(); 01016 this->FindWindow(ID_ADD_EVALUATOR_COMMAND)->Show(); 01017 } else if(event.GetString().compare("<Open Transformation File>")==0) { 01018 wxFileDialog * filedialog = new wxFileDialog(this, wxT("Choose a file(s) to use for data. If multiple files then please choose 3 that correspond to one data."), wxT(""), wxT("*"), wxT("*"), wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_MULTIPLE, wxDefaultPosition, wxDefaultSize, wxT("Open")); 01019 if( filedialog->ShowModal() == wxID_CANCEL ){ delete filedialog; return;} 01020 01021 addRDL = true; 01022 wxArrayString tempTwo; 01023 filedialog->GetPaths(tempTwo); 01024 wxString tempThree; 01025 int count = 0; 01026 for(wxArrayString::iterator i = tempTwo.begin(); i != tempTwo.end(); i++) { 01027 tempThree.Append(i->c_str()); 01028 tempThree.Append(";"); 01029 count++; 01030 } 01031 tempThree = tempThree.RemoveLast(); 01032 01033 01034 size_t dot = filedialog->GetFilename().find_last_of("."); 01035 std::string extension = filedialog->GetFilename().After(wxT('.')).ToStdString(); 01036 if(count == 3) { 01037 //we have a disp transformation 01038 } 01039 else if(FileExtension.find(extension) != FileExtension.end() ) { 01040 std::pair<FileExtensionList::iterator, FileExtensionList::iterator> typesAndTransforms = FileExtension.equal_range(extension); 01041 wxString evalCommand; 01042 wxString nameSpace = filedialog->GetDirectory(); 01043 nameSpace.Remove(0,nameSpace.find_last_of('\\')+1); 01044 wxString csID; 01045 if(FileExtension.find(extension)->second.compare(DataType["Transformation"]) == 0) { 01046 evalCommand = EvalCmd["Transformation"]; 01047 } 01048 else { 01049 evalCommand = EvalCmd["SpatialData"]; 01050 csID = nameSpace; 01051 csID.Append("|"); 01052 csID.Append(filedialog->GetFilename().BeforeFirst('.')); 01053 } 01054 this->ChangeEvaluatorGrid(evalCommand,wxString(),filedialog->GetFilename().BeforeFirst('.'), csID, extension); 01055 } 01056 else{ 01057 //not the right data type 01058 } 01059 01060 delete filedialog; 01061 this->FindWindow(ID_STATIC_INPUTS_EC)->Show(); 01062 m_evaluatorCommandGrid->Show(); 01063 this->FindWindow(ID_ADD_EVALUATOR_COMMAND)->Show(); 01064 } else if(event.GetString().compare("Select Evaluator Command")!=0 && event.GetString().compare("--------GENERATED-------")!=0 && event.GetString().compare("---------NEW------------")!=0 && event.GetString().compare("--------RDL DMID-------") !=0 ){ 01065 addRDL = false; 01066 //not the cleanist just yet. Now that i'm appending generated evaluator commands 01067 //I need to see if its a generated evaluator command or one they want to create. 01068 wxString evaluatorCommand = event.GetString(); 01069 wxString ecID = evaluatorCommand.BeforeFirst('='); 01070 wxString commaSeperatedInput; 01071 if(ecID.compare(evaluatorCommand) != 0 ) { 01072 m_evaluatorCommandGrid->SetCellValue(ecID,0,0); 01073 evaluatorCommand = evaluatorCommand.AfterFirst('='); 01074 commaSeperatedInput = evaluatorCommand.AfterFirst('('); 01075 commaSeperatedInput = commaSeperatedInput.BeforeLast(')'); 01076 evaluatorCommand = evaluatorCommand.BeforeFirst('('); 01077 } 01078 else if(evaluatorCommand.BeforeFirst('(').compare(evaluatorCommand) != 0) { 01079 m_evaluatorCommandGrid->SetCellValue("",0,0); 01080 commaSeperatedInput = evaluatorCommand.AfterFirst('('); 01081 commaSeperatedInput = commaSeperatedInput.BeforeLast(')'); 01082 evaluatorCommand = evaluatorCommand.BeforeFirst('('); 01083 } 01084 else { 01085 m_evaluatorCommandGrid->SetCellValue(wxT(""),0,0); 01086 } 01087 m_evaluatorCommandGrid->SetCellValue(evaluatorCommand,0,2); 01088 01089 this->ChangeEvaluatorGrid(evaluatorCommand, commaSeperatedInput); 01090 01091 this->FindWindow(ID_STATIC_INPUTS_EC)->Show(); 01092 m_evaluatorCommandGrid->Show(); 01093 this->FindWindow(ID_ADD_EVALUATOR_COMMAND)->Show(); 01094 } 01095 else { 01096 this->FindWindow(ID_STATIC_INPUTS_EC)->Show(false); 01097 m_evaluatorCommandGrid->Show(false); 01098 this->FindWindow(ID_ADD_EVALUATOR_COMMAND)->Show(false); 01099 } 01100 01101 01102 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01103 } 01104 01105 void QuickView2::ChangeEvaluatorGrid(const wxString& evalCommand, const wxString& commaSeperatedInput, const wxString& evalID, const wxString& csID, const wxString& extension) 01106 { 01107 std::pair<EvaluatorInputList::iterator,EvaluatorInputList::iterator> ret = EvalInput.equal_range( std::string(evalCommand.mb_str()) ); 01108 int col = 3; 01109 wxStringTokenizer tk; 01110 if(!commaSeperatedInput.empty()) { 01111 tk.SetString(commaSeperatedInput,wxT(",")); 01112 } 01113 01114 for(EvaluatorInputList::iterator i = ret.first; i != ret.second; i++,col++) { 01115 if(col > m_evaluatorCommandGrid->GetNumberCols()-1 ) { 01116 m_evaluatorCommandGrid->AppendCols(); 01117 m_evaluatorCommandGrid->SetCellRenderer(0, col, new wxGridCellChoiceRenderer); 01118 m_evaluatorCommandGrid->SetCellEditor(0, col, new wxFastComboEditor()); 01119 } 01120 01121 m_evaluatorCommandGrid->SetCellValue(wxT(""),0,col); 01122 m_evaluatorCommandGrid->SetColLabelValue(col,wxString(i->second.c_str(), wxConvUTF8)); 01123 wxArrayString strChoices; 01124 01125 m_evaluatorCommandGrid->SetCellValue(wxT("Select Evaluator Input"),0,col); 01126 strChoices.Add(wxT("Select Evaluator Input")); 01127 wxString selection = wxT("Select Evaluator Input"); 01128 01129 if(!commaSeperatedInput.empty()) { 01130 wxString token = tk.GetNextToken(); 01131 strChoices.Add(token); 01132 m_evaluatorCommandGrid->SetCellValue(token,0,col); 01133 selection = token; 01134 } 01135 01136 for(int j = 0; j < m_evaluatorList.size(); j++) { 01137 EvalOutputList::iterator output; 01138 for(output = EvalOutput.begin(); output != EvalOutput.end(); ++output) { 01139 if(i->second.compare(output->second) ==0 && i->second.compare(EvalCmd.find("SpatialData")->second) != 0 && i->second.compare(EvalCmd.find("Transformation")->second) != 0) { 01140 //need to first get the evaluator command 01141 wxString eC = m_evaluatorList.at(j); 01142 eC = eC.Remove(0,eC.find_first_of(wxT("="))+1); 01143 eC = eC.Remove(eC.find_first_of(wxT("(")),eC.size() - eC.find_first_of(wxT("("))); 01144 01145 //then need to see if the command produces the right output 01146 if(eC.compare(wxString(output->first.c_str(), wxConvUTF8)) ==0 ) { 01147 strChoices.Add(m_evaluatorList.at(j)); 01148 } 01149 } 01150 } 01151 01152 } 01153 if(!evalID.IsEmpty()) { 01154 m_evaluatorCommandGrid->SetCellValue(0,0,evalID); 01155 } 01156 m_evaluatorCommandGrid->SetCellValue(0,2,evalCommand); 01157 01158 //Yeah, i'm hard coding but i'm trying to make the users life a little easier 01159 //by pre-populating some information so that user does not have to figure out 01160 //what to do. 01161 if(!csID.IsEmpty()){ 01162 if(col == 3) { 01163 strChoices.Add(csID); 01164 m_evaluatorCommandGrid->SetCellValue(csID,0,col); 01165 selection = csID; 01166 } 01167 } 01168 01169 if(!extension.IsEmpty()) { 01170 if(col == 4 && FileExtension.find(std::string(extension.mb_str()))->second.compare(DataType["Transformation"]) == 0) { 01171 } 01172 else if(col ==4 && FileExtension.find(std::string(extension.mb_str()))->second.compare(DataType["Objectmap"]) == 0) { 01173 strChoices.Add(wxT("Objectmap")); 01174 m_evaluatorCommandGrid->SetCellValue(wxT("Objectmap"),0,col); 01175 selection = wxT("Objectmap"); 01176 } 01177 else if(col == 4){ 01178 strChoices.Add(wxT("Image")); 01179 m_evaluatorCommandGrid->SetCellValue(wxT("Image"),0,col); 01180 selection = wxT("Image"); 01181 } 01182 } 01183 01184 01185 if(i->second.compare(InputType["Image"]) == 0 ) { 01186 strChoices.Add(wxT("<Open Spatial Data File>")); 01187 } else if(i->second.compare(InputType["Transformation"]) == 0) { 01188 strChoices.Add(wxT("<Open Transformation File>")); 01189 } 01190 //wxString *strChoicesPointer = new wxString[strChoices.size()]; 01191 wxFastComboEditor * fce = dynamic_cast<wxFastComboEditor *>(m_evaluatorCommandGrid->GetCellEditor(0, col)); 01192 fce->SetParameters(strChoices); 01193 fce->SetChoice(selection); 01194 //Need this decrement reference otherwise you will have memory leaks 01195 fce->DecRef(); 01196 } 01197 01198 if(m_evaluatorCommandGrid->GetNumberCols() > (col) ) { 01199 for(int i = m_evaluatorCommandGrid->GetNumberCols(); i > (col); i--) { 01200 m_evaluatorCommandGrid->DeleteCols(i-1); 01201 } 01202 } 01203 } 01204 01205 01206 /* 01207 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_ROW 01208 */ 01209 01210 void QuickView2::OnRowTextUpdated( wxCommandEvent& event ) 01211 { 01212 if(m_widgetGrid != NULL) { 01213 double row; 01214 m_row->GetValue().ToDouble(&row); 01215 01216 m_displayDescription->GetDisplayAttributes()->SetRowDimension(row); 01217 m_displayDescription->GetWidgetList()->Resize(); 01218 if(row > m_widgetGrid->GetNumberRows() ) { 01219 for(int i= m_widgetGrid->GetNumberRows(); i< row; i++) { 01220 m_widgetGrid->AppendRows(); 01221 for(int j=0; j< m_widgetGrid->GetNumberCols(); j++) { 01222 //m_widgetCommands->SetCellRenderer(i , j, new wxGridCellAutoWrapStringRenderer); 01223 //m_widgetCommands->SetCellEditor( i, j , new wxGridCellAutoWrapStringEditor); 01224 m_widgetGrid->SetCellRenderer(i, j, new wxGridCellChoiceRenderer); 01225 wxString *strChoices = new wxString[m_widgetList.size()]; 01226 for(unsigned int l = 0; l < m_widgetList.size(); l++) { 01227 strChoices[l] = m_widgetList.at(l); 01228 } 01229 m_widgetGrid->SetCellEditor(i, j, new wxFastComboEditor(m_widgetList.size(), strChoices, true)); 01230 m_widgetGrid->SetCellValue(m_widgetList.at(0),i, j); 01231 delete [] strChoices; 01232 } 01233 } 01234 } 01235 else { 01236 for(int i= m_widgetGrid->GetNumberRows(); i> row; i--) { 01237 m_widgetGrid->DeleteRows(m_widgetGrid->GetNumberRows() - 1); 01238 } 01239 } 01240 } 01241 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01242 } 01243 01244 01245 /* 01246 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_COL 01247 */ 01248 01249 void QuickView2::OnColTextUpdated( wxCommandEvent& event ) 01250 { 01251 if(m_widgetGrid != NULL) { 01252 double col = 0; 01253 m_col->GetValue().ToDouble(&col); 01254 m_displayDescription->GetDisplayAttributes()->SetColDimension(col); 01255 m_displayDescription->GetWidgetList()->Resize(); 01256 01257 //figure out if we need to add columns or delete columns 01258 if(col > m_widgetGrid->GetNumberCols() ) { 01259 for(int i= m_widgetGrid->GetNumberCols(); i< col; i++) { 01260 m_widgetGrid->AppendCols(); 01261 for(int j=0; j< m_widgetGrid->GetNumberRows(); j++) { 01262 //A nice feature that will wrap the text 01263 //m_widgetCommands->SetCellRenderer(j , i, new wxGridCellAutoWrapStringRenderer); 01264 //m_widgetCommands->SetCellEditor( j, i , new wxGridCellAutoWrapStringEditor); 01265 m_widgetGrid->SetCellRenderer(j, i, new wxGridCellChoiceRenderer); 01266 wxString *strChoices = new wxString[m_widgetList.size()]; 01267 for(unsigned int l = 0; l < m_widgetList.size(); l++) { 01268 strChoices[l] = m_widgetList.at(l); 01269 } 01270 m_widgetGrid->SetCellEditor(j, i, new wxFastComboEditor(m_widgetList.size(), strChoices, true)); 01271 m_widgetGrid->SetCellValue(m_widgetList.at(0),j, i); 01272 delete [] strChoices; 01273 } 01274 } 01275 } 01276 else { 01277 for(int i= m_widgetGrid->GetNumberCols(); i> col; i--) { 01278 m_widgetGrid->DeleteCols(m_widgetGrid->GetNumberCols() - 1); 01279 } 01280 } 01281 } 01282 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01283 } 01284 01285 /* 01286 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON13 01287 */ 01288 01289 void QuickView2::OnAddEvaluatorCommandClick( wxCommandEvent& event ) 01290 { 01291 01292 if(addRDL) { 01293 wxString filenamePattern = m_filenamePattern->GetValue(); 01294 std::queue<ResourceDescription *> queueOfResourceDescription; 01295 queueOfResourceDescription = ExpandRD(filenamePattern); 01296 01297 //ResourceDescriptionList *rdl = new ResourceDescriptionList(); 01298 m_displayDescription->GetRDL()->SetNameSpace(std::string(m_namespace->GetValue().mb_str())); 01299 01300 //Go through the queue that was created and move the data 01301 //over into the rdl 01302 int queueSize = queueOfResourceDescription.size(); 01303 for(int i=0; i< queueSize; i++) { 01304 std::string datatype = std::string(m_datatype->GetValue().mb_str()); 01305 if(datatype.compare(DataType.find("Image")->second) == 0 || datatype.compare(DataType.find("Objectmap")->second) == 0) { 01306 m_displayDescription->GetRDL()->AddDataDescrip(queueOfResourceDescription.front()->GetDMID(), queueOfResourceDescription.front()); 01307 dynamic_cast<wxListBox*>(this->FindWindow(ID_LIST_RDL) )->Append(queueOfResourceDescription.front()->GetDMID()); 01308 } 01309 else if(datatype.compare(DataType.find("Transformation")->second) == 0) { 01310 m_displayDescription->GetRDL()->AddTransformDescrip(queueOfResourceDescription.front()->GetDMID(), queueOfResourceDescription.front()); 01311 dynamic_cast<wxListBox*>(this->FindWindow(ID_LIST_RDL) )->Append(queueOfResourceDescription.front()->GetDMID()); 01312 } 01313 else { 01314 delete queueOfResourceDescription.front(); 01315 } 01316 queueOfResourceDescription.pop(); 01317 } 01318 } 01319 01320 this->FindWindow(ID_STATIC_INPUTS_EC)->Show(false); 01321 m_evaluatorCommandGrid->Show(false); 01322 this->FindWindow(ID_ADD_EVALUATOR_COMMAND)->Show(false); 01323 //this->FindWindow(ID_ADVANCED)->Show(false); 01324 01325 wxString command; 01326 command.Append(m_evaluatorCommandGrid->GetCellValue(0,0)); 01327 command.Append(m_evaluatorCommandGrid->GetCellValue(0,1)); 01328 command.Append(m_evaluatorCommandGrid->GetCellValue(0,2)); 01329 command.Append(wxT("(")); 01330 for(int i=3; i < m_evaluatorCommandGrid->GetNumberCols(); i++) { 01331 command.Append(m_evaluatorCommandGrid->GetCellValue(0,i)); 01332 command.Append(wxT(",")); 01333 } 01334 command.RemoveLast(); 01335 command.Append(wxT(")")); 01336 m_evaluatorList.push_back(command); 01337 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Append(command); 01338 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Append(command); 01339 01340 01341 wxComboBox *comboBox= dynamic_cast<wxComboBox*>(this->FindWindow(m_appendEvaluatorID)); 01342 if(comboBox != NULL) { 01343 int location = comboBox->FindString(command); 01344 comboBox->SetSelection(location); 01345 } 01346 01347 //need to create an rdl entry 01348 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01349 } 01350 01351 01352 /* 01353 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_WIDGET_COMMAND 01354 */ 01355 01356 void QuickView2::OnAddWidgetCommandClick( wxCommandEvent& event ) 01357 { 01358 this->FindWindow(ID_STATIC_INPUTS_EC)->Show(false); 01359 m_evaluatorCommandGrid->Show(false); 01360 this->FindWindow(ID_ADD_EVALUATOR_COMMAND)->Show(false); 01361 this->FindWindow(ID_COMBOBOX5)->Show(false); 01362 this->FindWindow(ID_COMBOBOX6)->Show(false); 01363 this->FindWindow(ID_TITLE)->Show(false); 01364 this->FindWindow(ID_STATIC_WIDGET_INPUTS)->Show(false); 01365 this->FindWindow(ID_ADD_WIDGET_COMMAND)->Show(false); 01366 this->FindWindow(ID_TEXTCTRL23)->Show(false); 01367 //this->FindWindow(ID_ADVANCED)->Show(false); 01368 01369 if(m_widgetCommandLocation.x != -1) { 01370 wxString command; 01371 wxString commandWithEvaluatorID; 01372 command = m_widgetGrid->GetCellValue(m_widgetCommandLocation.x,m_widgetCommandLocation.y); 01373 commandWithEvaluatorID = m_widgetGrid->GetCellValue(m_widgetCommandLocation.x,m_widgetCommandLocation.y); 01374 command.Append(wxT("(")); 01375 commandWithEvaluatorID.Append(wxT("(")); 01376 01377 command.Append(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->GetValue().AfterFirst('=')); 01378 commandWithEvaluatorID.Append(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->GetValue().BeforeFirst('=')); 01379 m_displayDescription->GetEvaluatorList()->SetEvaluatorTask(std::string(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->GetValue().BeforeFirst('=').mb_str()), std::string(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->GetValue().AfterFirst('=').mb_str())); 01380 if(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->GetValue().compare(wxT("Select Evaluator Command")) != 0) { 01381 command.Append(wxT(",")); 01382 commandWithEvaluatorID.Append(wxT(",")); 01383 command.Append(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->GetValue().AfterFirst('=')); 01384 commandWithEvaluatorID.Append(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->GetValue().BeforeFirst('=')); 01385 m_displayDescription->GetEvaluatorList()->SetEvaluatorTask(std::string(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->GetValue().BeforeFirst('=').mb_str()), std::string(dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->GetValue().AfterFirst('=').mb_str())); 01386 } 01387 command.Append(wxT(",")); 01388 command.Append(dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_TEXTCTRL23))->GetValue()); 01389 command.Append(wxT(")")); 01390 01391 commandWithEvaluatorID.Append(wxT(",")); 01392 commandWithEvaluatorID.Append(dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_TEXTCTRL23))->GetValue()); 01393 commandWithEvaluatorID.Append(wxT(")")); 01394 01395 this->m_widgetList.push_back(command); 01396 m_widgetCommand.insert(std::pair<wxString,wxString>(command,commandWithEvaluatorID)); 01397 01398 //m_displayDescription->GetWidgetList()->SetWidget(m_widgetCommandLocation.x,m_widgetCommandLocation.y,command.c_str()); 01399 wxFastComboEditor * fce = dynamic_cast<wxFastComboEditor *>(m_widgetGrid->GetCellEditor(m_widgetCommandLocation.x, m_widgetCommandLocation.y)); 01400 fce->AppendToCombo(command); 01401 fce->SetChoice(command); 01402 m_widgetGrid->SetCellValue(command,m_widgetCommandLocation.x, m_widgetCommandLocation.y); 01403 //Need this decrement reference otherwise you will have memory leaks 01404 fce->DecRef(); 01405 01406 for(int i=0; i< m_widgetGrid->GetNumberCols(); i++) { 01407 for(int j=0; j< m_widgetGrid->GetNumberRows();j++) { 01408 if(i!= m_widgetCommandLocation.y || j != m_widgetCommandLocation.x) { 01409 wxFastComboEditor * fceTwo = dynamic_cast<wxFastComboEditor *>(m_widgetGrid->GetCellEditor(j, i)); 01410 fceTwo->AppendToCombo(command); 01411 //Need this decrement reference otherwise you will have memory leaks 01412 fceTwo->DecRef(); 01413 } 01414 } 01415 } 01416 01417 } 01418 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01419 } 01420 01421 01422 /* 01423 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SHOW 01424 */ 01425 01426 void QuickView2::OnShowClick( wxCommandEvent& event ) 01427 { 01428 deleteDD = false; 01429 for(int i=0; i< m_widgetGrid->GetNumberCols(); i++) { 01430 for(int j=0; j< m_widgetGrid->GetNumberRows(); j++) { 01431 wxString tempTeo = m_widgetGrid->GetCellValue(j,i); 01432 if(m_widgetGrid->GetCellValue(j,i).compare("Select Widget Command") != 0 ) { 01433 if(m_widgetCommand.find(m_widgetGrid->GetCellValue(j,i)) != m_widgetCommand.end()) { 01434 m_displayDescription->GetWidgetList()->SetWidget(j,i,m_widgetCommand.find(m_widgetGrid->GetCellValue(j,i))->second.ToStdString()); 01435 } 01436 else { 01437 std::string blank = WidgetCmd.find("blankWidget")->second; 01438 blank.append("(blankWidget)"); 01439 m_displayDescription->GetWidgetList()->SetWidget(j,i,blank); 01440 } 01441 } 01442 else{ 01443 std::string blank = WidgetCmd.find("blankWidget")->second; 01444 blank.append("(blankWidget)"); 01445 m_displayDescription->GetWidgetList()->SetWidget(j,i,blank); 01446 } 01447 } 01448 } 01449 NIREPDisplay *temp = new NIREPDisplay(this->GetParent(),m_parent->GetEvaluator()); 01450 temp->SetDisplayDescription(m_displayDescription); 01451 temp->CreateNIREPDisplay(""); 01452 temp->Show(); 01453 this->Close(); 01454 } 01455 01456 01457 /* 01458 * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL 01459 */ 01460 01461 void QuickView2::OnCancelClick( wxCommandEvent& event ) 01462 { 01463 this->Close(); 01464 } 01465 01466 01467 /* 01468 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_DATATYPE 01469 */ 01470 01471 void QuickView2::OnDatatypeSelected( wxCommandEvent& event ) 01472 { 01473 if(m_datatype->GetValue().compare(wxString(DataType.find("Image")->second.c_str(), wxConvUTF8) ) == 0 || m_datatype->GetValue().compare(wxString(DataType.find("Objectmap")->second.c_str(), wxConvUTF8)) == 0) { 01474 this->FindWindow(ID_LABEL)->Show(true); 01475 this->FindWindow(ID_STATIC_LABEL_TEXT)->Show(true); 01476 01477 this->FindWindow(ID_STATIC_FORMAT_TEXT)->Show(false); 01478 this->FindWindow(ID_FORMAT)->Show(false); 01479 this->FindWindow(ID_REMOVE_DUPLICATES)->Show(false); 01480 this->FindWindow(ID_TRANSFORMATION_UNITS)->Show(false); 01481 this->FindWindow(ID_STATIC_TRANSFORMATION_UNITS_TEXT)->Show(false); 01482 } 01483 else if(m_datatype->GetValue().compare(wxString(DataType.find("Transformation")->second.c_str(), wxConvUTF8) ) == 0) { 01484 this->FindWindow(ID_STATIC_FORMAT_TEXT)->Show(true); 01485 this->FindWindow(ID_FORMAT)->Show(true); 01486 this->FindWindow(ID_REMOVE_DUPLICATES)->Show(true); 01487 this->FindWindow(ID_TRANSFORMATION_UNITS)->Show(true); 01488 this->FindWindow(ID_STATIC_TRANSFORMATION_UNITS_TEXT)->Show(true); 01489 01490 this->FindWindow(ID_LABEL)->Show(false); 01491 this->FindWindow(ID_STATIC_LABEL_TEXT)->Show(false); 01492 } 01493 else { 01494 this->FindWindow(ID_STATIC_FORMAT_TEXT)->Show(false); 01495 this->FindWindow(ID_FORMAT)->Show(false); 01496 this->FindWindow(ID_REMOVE_DUPLICATES)->Show(false); 01497 this->FindWindow(ID_TRANSFORMATION_UNITS)->Show(false); 01498 this->FindWindow(ID_STATIC_TRANSFORMATION_UNITS_TEXT)->Show(false); 01499 01500 this->FindWindow(ID_LABEL)->Show(false); 01501 this->FindWindow(ID_STATIC_LABEL_TEXT)->Show(false); 01502 } 01503 this->DisplayDMID(); 01504 01505 //Need to get the panel and do the layout of the panel 01506 //because the panel holds the sizer 01507 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01508 } 01509 01510 01511 /* 01512 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_FORMAT 01513 */ 01514 01515 void QuickView2::OnFormatSelected( wxCommandEvent& event ) 01516 { 01517 if(event.GetString().compare(wxString(TransformFormat.find("Displacement3")->second.c_str(), wxConvUTF8)) == 0) { 01518 this->FindWindow(ID_STATIC_FILEFORMAT2_TEXT)->Show(true); 01519 this->FindWindow(ID_STATIC_FILEFORMAT3_TEXT)->Show(true); 01520 this->FindWindow(ID_FILENAME_PATTERN2)->Show(true); 01521 this->FindWindow(ID_BROWSE2)->Show(true); 01522 this->FindWindow(ID_FILENAME_PATTERN3)->Show(true); 01523 this->FindWindow(ID_BROWSE3)->Show(true); 01524 } 01525 else { 01526 this->FindWindow(ID_STATIC_FILEFORMAT2_TEXT)->Show(false); 01527 this->FindWindow(ID_STATIC_FILEFORMAT3_TEXT)->Show(false); 01528 this->FindWindow(ID_FILENAME_PATTERN2)->Show(false); 01529 this->FindWindow(ID_BROWSE2)->Show(false); 01530 this->FindWindow(ID_FILENAME_PATTERN3)->Show(false); 01531 this->FindWindow(ID_BROWSE3)->Show(false); 01532 } 01533 this->DisplayDMID(); 01534 01535 //Need to get the panel and do the layout of the panel 01536 //because the panel holds the sizer 01537 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01538 m_variableGrid->Refresh(); 01539 m_coordinateGrid->Refresh(); 01540 01541 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 01542 } 01543 01544 01545 /* 01546 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSE 01547 */ 01548 01549 void QuickView2::OnBrowseClick( wxCommandEvent& event ) 01550 { 01551 wxFileDialog * filedialog = new wxFileDialog(this, wxT("Choose a file to use for the file pattern")); 01552 if( filedialog->ShowModal() == wxID_CANCEL ){ delete filedialog; return;} 01553 01554 m_filenamePattern->SetValue(filedialog->GetFilename() ); 01555 01556 delete filedialog; 01557 } 01558 01559 01560 /* 01561 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSE2 01562 */ 01563 01564 void QuickView2::OnBrowse2Click( wxCommandEvent& event ) 01565 { 01566 wxFileDialog * filedialog = new wxFileDialog(this, wxT("Choose a file to use for the file pattern")); 01567 if( filedialog->ShowModal() == wxID_CANCEL ){ delete filedialog; return;} 01568 01569 m_filenamePattern2->SetValue(filedialog->GetFilename() ); 01570 01571 delete filedialog; 01572 } 01573 01574 01575 /* 01576 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSE3 01577 */ 01578 01579 void QuickView2::OnBrowse3Click( wxCommandEvent& event ) 01580 { 01581 wxFileDialog * filedialog = new wxFileDialog(this, wxT("Choose a file to use for the file pattern")); 01582 if( filedialog->ShowModal() == wxID_CANCEL ){ delete filedialog; return;} 01583 01584 m_filenamePattern3->SetValue(filedialog->GetFilename() ); 01585 01586 delete filedialog; 01587 } 01588 01589 01590 /* 01591 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_GENERATE 01592 */ 01593 //void QuickView2::OnGenerateClick( wxCommandEvent& event ) 01594 //{ 01595 // wxString filenamePattern = m_filenamePattern->GetValue(); 01596 // std::queue<ResourceDescription *> queueOfResourceDescription; 01597 // queueOfResourceDescription = ExpandRD(filenamePattern); 01598 // 01599 // ResourceDescriptionList *rdl = new ResourceDescriptionList(); 01600 // rdl->SetNameSpace(m_namespace->GetValue().c_str()); 01601 // 01602 // //Go through the queue that was created and move the data 01603 // //over into the rdl 01604 // int queueSize = queueOfResourceDescription.size(); 01605 // for(int i=0; i< queueSize; i++) { 01606 // std::string datatype = m_datatype->GetValue().c_str(); 01607 // if(datatype.compare(DataType.find("Image")->second) == 0 || datatype.compare(DataType.find("Objectmap")->second) == 0) { 01608 // rdl->AddDataDescrip(queueOfResourceDescription.front()->GetDMID(), queueOfResourceDescription.front()); 01609 // } 01610 // else if(datatype.compare(DataType.find("Transformation")->second) == 0) { 01611 // rdl->AddTransformDescrip(queueOfResourceDescription.front()->GetDMID(), queueOfResourceDescription.front()); 01612 // } 01613 // else { 01614 // delete queueOfResourceDescription.front(); 01615 // } 01616 // queueOfResourceDescription.pop(); 01617 // } 01618 // 01619 // 01620 // delete rdl; 01621 //} 01622 01623 01624 //major re-change, now going to use ResourceDescription 01625 //The main logic of this is the following: 01626 //Go through m_variableGrid and get the variable 01627 //to be used and the values associated. 01628 //Then run through a while loop that will expand 01629 //a fifo queue with the subsition of variables 01630 //for values. 01631 //Example: 01632 // m_variableGrid holds: 01633 // a 01,02,03 01634 // b 01,02,03 01635 // 01636 // file name pattern: 01637 // na{a}_na{b}.warp 01638 // 01639 // Therefore this is what happens: 01640 // 1.) A blank ResourceDescription is created and put 01641 // into the queue along with the filename pattern 01642 // na{a}_na{b}.warp 01643 // 2.) run through the for loop 01644 // a.) first iteration of for loop 01645 // i.) Get the variable a and values 01,02,03 01646 // ii.) run through the while loop 01647 // A.) na{a}_na{b}.warp is popped off the queue 01648 // B.) na01_na{b}.warp 01649 // na02_na{b}.warp 01650 // na03_na{b}.warp 01651 // are all added to the queue 01652 // C.) na01_na{b}.warp is popped off the queue 01653 // D.) na01_na{b}.warp 01654 // is added to the queue and the while loop stops 01655 // b) next iteration of the for loop 01656 // i.) Get the variable b and values 01,02,03 01657 // ii.) run through the while loop 01658 // A.) na02_na{b}.warp is popped off the queue 01659 // B.) na02_na01.warp 01660 // na02_na02.warp 01661 // na02_na03.warp 01662 // are all added to the queue 01663 // C.) na03_na{b}.warp is popped off the queue 01664 // D.) na03_na01.warp 01665 // na03_na02.warp 01666 // na03_na03.warp 01667 // are all added to the queue 01668 // E.) na01_na{b}.warp is popped off the queue 01669 // F.) na01_na01.warp 01670 // na01_na02.warp 01671 // na01_na03.warp 01672 // are all added to the queue 01673 // G.) na02_na01.warp is popped off the queue 01674 // H.) na02_na01.warp 01675 // is added to the queue and the while loop stops 01676 std::queue<ResourceDescription *> QuickView2::ExpandRD(const wxString &pattern) 01677 { 01678 std::queue<ResourceDescription *> queueOfResourceDescription; 01679 ResourceDescription *resourceDescription = new ResourceDescription(std::string(m_namespace->GetValue().mb_str())); 01680 //resourceDescription->AddAlgorithm("0", std::string(m_algorithm->GetValue().c_str())); 01681 if(m_coordinateGrid->GetNumberCols() == 3) { 01682 for(unsigned int i=1; i<m_coordinateGrid->GetNumberRows(); i++) { 01683 std::string index; 01684 std::stringstream out; 01685 out << i-1; 01686 index = out.str(); 01687 resourceDescription->AddAlgorithm(index, std::string(m_coordinateGrid->GetCellValue(i,2).mb_str())); 01688 } 01689 } 01690 resourceDescription->SetDataType(std::string(m_datatype->GetValue().mb_str())); 01691 resourceDescription->SetDefaultNS(std::string(m_namespace->GetValue().mb_str())); 01692 resourceDescription->SetFormat(std::string(dynamic_cast<wxComboBox*>(this->FindWindow(ID_FORMAT))->GetValue().mb_str())); 01693 resourceDescription->SetTransformUnits(std::string(m_transformationUnits->GetValue().mb_str())); 01694 resourceDescription->SetLabel(std::string(dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_LABEL))->GetValue().mb_str())); 01695 01696 resourceDescription->AddFilename("0",std::string(pattern.mb_str())); 01697 resourceDescription->SetDMID(std::string(dynamic_cast<wxTextCtrl *>(this->FindWindow(ID_ADVANCED_DMID_TEXT))->GetValue().mb_str())); 01698 01699 queueOfResourceDescription.push(resourceDescription); 01700 01701 for(unsigned int i=0; i< m_variableGrid->GetNumberRows(); i++) { 01702 if( !m_variableGrid->GetCellValue(i,0).IsEmpty()) { 01703 //Create a temporary variable associated with the value 01704 //at m_variableGrid->GetCellValue(i,0), wrap 01705 //curly braces 01706 wxString variable = wxT("{"); 01707 variable.Append(m_variableGrid->GetCellValue(i,0)); 01708 variable.Append(wxT("}")); 01709 01710 //Create temporary vector called tokens that 01711 //stores values that are assocated with variable 01712 wxString commaSeperatedvalues = m_variableGrid->GetCellValue(i,1); 01713 std::vector<wxString> vectorOfValues; 01714 this->Tokenize(commaSeperatedvalues,vectorOfValues,wxT(",")); 01715 01716 01717 //figure out if m_variableGrid->GetCellValue(i,0) is associated with 01718 //m_coordinateGrid->GetCellValue(j,0) 01719 bool isCoordinate = false; 01720 int index = 0; 01721 for(unsigned int j=0; j<m_coordinateGrid->GetNumberRows(); j ++) { 01722 if(m_variableGrid->GetCellValue(i,0).compare(m_coordinateGrid->GetCellValue(j,0) ) == 0) { 01723 isCoordinate = true; 01724 index = j; 01725 } 01726 } 01727 01728 bool availableVariable= true; 01729 if(vectorOfValues.size()!= 0) { 01730 while(availableVariable) { 01731 if(queueOfResourceDescription.size() > 0) { 01732 ResourceDescription *tempResourceDescription = queueOfResourceDescription.front(); 01733 queueOfResourceDescription.pop(); 01734 01735 for(unsigned int i=0; i< vectorOfValues.size(); i++) { 01736 //need to make a copy of tempResourceDescription 01737 ResourceDescription *copyResourceDescription = new ResourceDescription(std::string(m_namespace->GetValue().mb_str())); 01738 copyResourceDescription->SetDataType(tempResourceDescription->GetDataType()); 01739 copyResourceDescription->SetDefaultNS(tempResourceDescription->GetDefaultNS()); 01740 copyResourceDescription->SetFormat(tempResourceDescription->GetFormat()); 01741 copyResourceDescription->SetLabel(tempResourceDescription->GetLabel()); 01742 copyResourceDescription->SetTransformUnits(tempResourceDescription->GetTransformUnits()); 01743 copyResourceDescription->AddAlgorithm("0",tempResourceDescription->GetAlgorithm("0")); 01744 const ResourceDescription::CSList *cslist = tempResourceDescription->GetCS(); 01745 if(cslist != NULL) { 01746 for(ResourceDescription::CSList::const_iterator temp = cslist->begin(); temp!= cslist->end(); temp++) { 01747 copyResourceDescription->AddCS(temp->second.index,temp->second); 01748 } 01749 } 01750 01751 //Get the items that need to be replaced 01752 wxString tempFile = wxString(tempResourceDescription->GetFilename("0", false).c_str(), wxConvUTF8); 01753 wxString tempDmidString = wxString(tempResourceDescription->GetDMID().c_str(), wxConvUTF8); 01754 wxString value = vectorOfValues.at(i); 01755 01756 01757 unsigned int dmidReplace = tempDmidString.Replace(variable,value); 01758 unsigned int fileReplace = tempFile.Replace(variable,value); 01759 01760 //Replace returns the number of items replaced, and so 01761 //if it is equal to zero, then nothing was replaced 01762 if(fileReplace == 0 && dmidReplace == 0 && availableVariable) { 01763 //Now we just need to push back the items that we popped off 01764 //the queues and get out of the while loop 01765 availableVariable = false; 01766 01767 //Make sure we update the copyResourceDescription with the up to date 01768 //DMID and filename 01769 copyResourceDescription->SetDMID(std::string(tempDmidString.mb_str())); 01770 copyResourceDescription->AddFilename("0", std::string(tempFile.mb_str())); 01771 queueOfResourceDescription.push(copyResourceDescription); 01772 } 01773 else if(dmidReplace != 0 && availableVariable && fileReplace == 0) { 01774 //Make sure we update the copyResourceDescription with the up to date 01775 //DMID and filename 01776 copyResourceDescription->SetDMID(std::string(tempDmidString.mb_str())); 01777 copyResourceDescription->AddFilename("0", std::string(tempFile.mb_str())); 01778 queueOfResourceDescription.push(copyResourceDescription); 01779 } 01780 else if(fileReplace != 0 && availableVariable) { 01781 copyResourceDescription->AddFilename("0", std::string(tempFile.mb_str())); 01782 bool push = true; 01783 if(isCoordinate) { 01784 01785 //Figure out if the current value creates an identity 01786 if(dynamic_cast<wxCheckBox*>(this->FindWindow(ID_REMOVE_DUPLICATES))->GetValue()) { 01787 if(index > 0) { 01788 std::string previousIndexString; 01789 std::stringstream outTwo; 01790 outTwo << index-1; 01791 previousIndexString = outTwo.str(); 01792 if(copyResourceDescription->GetCS(previousIndexString)->id.compare(std::string(value.mb_str())) == 0) { 01793 push = false; 01794 } 01795 outTwo.flush(); 01796 } 01797 } 01798 01799 //If the values are not an identity then create a new ResourceDescription::CoordinateSystem 01800 if(push) { 01801 ResourceDescription::CoordinateSystem cs; 01802 wxString indexString = wxString::Format(_T("%d"), index); 01803 cs.index = std::string(indexString.mb_str() ); 01804 cs.id = std::string(value.mb_str() ); 01805 if(!m_coordinateGrid->GetCellValue(index,1).IsEmpty() ) { 01806 cs.ns = std::string( m_coordinateGrid->GetCellValue(index,1).mb_str() ); 01807 } else { 01808 cs.ns = std::string( m_namespace->GetValue().mb_str() ); 01809 } 01810 copyResourceDescription->AddCS(cs.index, cs); 01811 } 01812 } 01813 01814 //If the values are not an identity then push onto the queue 01815 if(push) { 01816 copyResourceDescription->SetDMID(std::string(tempDmidString.mb_str())); 01817 queueOfResourceDescription.push(copyResourceDescription); 01818 } else { 01819 //make sure that we delete any copies that aren't being used 01820 //otherwise we will have memory leaks 01821 delete copyResourceDescription; 01822 } 01823 } 01824 else{ 01825 //make sure that we delete any copies that aren't being used 01826 //otherwise we will have memory leaks 01827 delete copyResourceDescription; 01828 } 01829 01830 } 01831 delete tempResourceDescription; 01832 } 01833 } 01834 } 01835 } 01836 } 01837 return queueOfResourceDescription; 01838 } 01839 01840 01841 //Found this code from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html 01842 //Had to modify a little bit 01843 void QuickView2::Tokenize(const wxString& str, 01844 std::vector<wxString>& tokens, 01845 const wxString& delimiters) 01846 { 01847 // Skip delimiters at beginning. 01848 wxString::size_type lastPos = str.find_first_not_of(delimiters, 0); 01849 // Find first "non-delimiter". 01850 //JAH added in this if statement 01851 wxString::size_type pos = wxString::npos; 01852 if(lastPos != wxString::npos) 01853 pos = str.find_first_of(delimiters, lastPos); 01854 01855 while (wxString::npos != pos || wxString::npos != lastPos) 01856 { 01857 // Found a token, add it to the vector. 01858 tokens.push_back(str.substr(lastPos, pos - lastPos)); 01859 // Skip delimiters. Note the "not_of" 01860 lastPos = str.find_first_not_of(delimiters, pos); 01861 // Find next "non-delimiter" 01862 //JAH added in this if statement 01863 if(lastPos != wxString::npos) 01864 pos = str.find_first_of(delimiters, lastPos); 01865 } 01866 } 01867 01868 01869 /* 01870 * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL 01871 */ 01872 01873 void QuickView2::OnAddCoordinateClick( wxCommandEvent& event ) 01874 { 01875 m_coordinateGrid->AppendRows(); 01876 wxString temp = wxT("Coordinate System "); 01877 temp.Append(wxString::Format (wxT("%i"), m_coordinateGrid->GetNumberRows()-1)); 01878 m_coordinateGrid->SetRowLabelValue(m_coordinateGrid->GetNumberRows()-1,temp); 01879 if(m_coordinateGrid->GetNumberRows()>1 && m_coordinateGrid->GetNumberCols() != 3) { 01880 m_coordinateGrid->AppendCols(); 01881 m_coordinateGrid->SetColLabelValue(2,wxT("Algorithm")); 01882 //m_coordinateGrid->SetCellValue("Please do not put an algorithm name here",0,2); 01883 m_coordinateGrid->SetReadOnly(0,2); 01884 } 01885 } 01886 01887 01888 /* 01889 * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL 01890 */ 01891 01892 void QuickView2::OnDeleteCoordinateClick( wxCommandEvent& event ) 01893 { 01894 m_coordinateGrid->DeleteRows(m_coordinateGrid->GetNumberRows()-1); 01895 if(m_coordinateGrid->GetNumberRows()<2 && m_coordinateGrid->GetNumberCols() == 3) { 01896 m_coordinateGrid->DeleteCols(2); 01897 } 01898 } 01899 01900 /* 01901 * wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK 01902 */ 01903 01904 void QuickView2::OnNotebookPageChanged( wxNotebookEvent& event ) 01905 { 01906 01907 int id = event.GetId(); 01908 int selection = event.GetSelection(); 01909 int previous = event.GetOldSelection(); 01910 const wxWindowList temp = this->GetChildren(); 01911 wxNotebook *tempTwo = dynamic_cast<wxNotebook*>( this->FindWindow(id) ); 01912 wxTextCtrl *tempThree = dynamic_cast<wxTextCtrl*>( tempTwo->GetCurrentPage()->FindWindow(ID_DEFAULT_DMID_TEXT) ); 01913 wxTextCtrl *tempFour = dynamic_cast<wxTextCtrl*>( tempTwo->GetCurrentPage()->FindWindow(ID_ADVANCED_DMID_TEXT) ); 01914 if(previous != -1) { 01915 wxTextCtrl *defaultText = dynamic_cast<wxTextCtrl*>( tempTwo->GetPage(previous) ); 01916 01917 //make sure that any changes that were made in the advanced get shown in the default 01918 if(defaultText != NULL && tempFour != NULL) { 01919 defaultText->Clear(); 01920 defaultText->SetValue(tempFour->GetValue()); 01921 } 01922 } 01923 } 01924 01925 void QuickView2::DisplayDMID() 01926 { 01927 wxString dmid; 01928 01929 //Figure out what evaluator command to use 01930 if(DataType.find("Image")->second.compare(std::string(m_datatype->GetValue().mb_str())) == 0 || DataType.find("Objectmap")->second.compare(std::string(m_datatype->GetValue().mb_str())) == 0) { 01931 dmid = wxString(EvalCmd.find("SpatialData")->second.c_str(), wxConvUTF8); 01932 } else if(DataType.find("Transformation")->second.compare(std::string(m_datatype->GetValue().mb_str())) == 0) { 01933 dmid = wxString(EvalCmd.find("Transformation")->second.c_str(), wxConvUTF8); 01934 } 01935 01936 01937 dmid.Append(wxT("(")); 01938 //need to check the m_coordinate second column values 01939 //if there is a value in the second column then we 01940 //want to use that 01941 //add the namespace 01942 if(m_coordinateGrid->GetNumberRows() > 0) { 01943 if(!m_coordinateGrid->GetCellValue(0,1).IsEmpty() ) { 01944 dmid.Append(m_coordinateGrid->GetCellValue(0,1)); 01945 } else { 01946 dmid.Append(m_namespace->GetValue()); 01947 } 01948 } else { 01949 dmid.Append(m_namespace->GetValue()); 01950 } 01951 dmid.Append(wxT("|")); 01952 if(m_coordinateGrid->GetNumberRows() > 0) { 01953 dmid.Append(m_coordinateGrid->GetCellValue(0,0)); 01954 } 01955 dmid.Append(wxT(",")); 01956 01957 01958 //Figure out which format we should use for DMID 01959 if(DataType.find("Image")->second.compare(m_datatype->GetValue()) == 0 || DataType.find("Objectmap")->second.compare(m_datatype->GetValue()) == 0) { 01960 dmid.Append( dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_LABEL))->GetValue() ); 01961 } else if(DataType.find("Transformation")->second.compare(m_datatype->GetValue()) == 0) { 01962 if(m_coordinateGrid->GetNumberRows() > 1) { 01963 if(!m_coordinateGrid->GetCellValue(1,1).IsEmpty() ) { 01964 dmid.Append(m_coordinateGrid->GetCellValue(1,1)); 01965 } else { 01966 dmid.Append(m_namespace->GetValue()); 01967 } 01968 } else { 01969 dmid.Append(m_namespace->GetValue()); 01970 } 01971 dmid.Append("|"); 01972 //dmid.Append("|{"); 01973 if(m_coordinateGrid->GetNumberRows() > 1) { 01974 dmid.Append(m_coordinateGrid->GetCellValue(1,0)); 01975 } 01976 //dmid.Append("},"); 01977 dmid.Append(","); 01978 if(m_coordinateGrid->GetNumberCols() == 3) { 01979 dmid.Append(m_coordinateGrid->GetCellValue(1,2)); 01980 } 01981 } 01982 dmid.Append(wxT(")")); 01983 01984 //Push the newly created DMID out to the text controls 01985 dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_DEFAULT_DMID_TEXT))->SetValue(dmid); 01986 dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_ADVANCED_DMID_TEXT))->SetValue(dmid); 01987 } 01988 01989 void QuickView2::OnCoordinateGridChange( wxGridEvent& event ) 01990 { 01991 this->DisplayDMID(); 01992 } 01993 01994 void QuickView2::OnUpdateDMID( wxCommandEvent& event ) 01995 { 01996 this->DisplayDMID(); 01997 } 01998 01999 void QuickView2::OnUpdateVariables( wxCommandEvent& event ) 02000 { 02001 //Figure out if a user put in a variable in the 02002 //filename pattern boxes. If the user did 02003 //then add the variable to m_variableGrid 02004 wxString pattern = event.GetString(); 02005 size_t first = pattern.find_first_of(wxT("{")); 02006 size_t second = pattern.find_first_of(wxT("}")); 02007 while(first != wxString::npos && second != wxString::npos) { 02008 wxString temp = pattern.substr(first+1, second - first-1); 02009 int i=0; 02010 bool insert = false; 02011 while(!insert) { 02012 if(m_variableGrid->GetNumberRows()-1 < i) { 02013 m_variableGrid->InsertRows(m_variableGrid->GetNumberRows()); 02014 } 02015 if(m_variableGrid->GetCellValue(i,0).compare(temp) == 0) { 02016 insert = true; 02017 } 02018 else if(m_variableGrid->GetCellValue(i,0).IsEmpty() ) { 02019 m_variableGrid->SetCellValue(temp, i, 0); 02020 insert = true; 02021 } 02022 i++; 02023 } 02024 first = pattern.find(wxT("{"),first+1); 02025 second = pattern.find(wxT("}"),second+1); 02026 } 02027 } 02028 02029 /* 02030 * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_LIST_RDL 02031 */ 02032 02033 void QuickView2::OnListRdlSelected( wxCommandEvent& event ) 02034 { 02035 int length = 0; 02036 for(int i=0; i< dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->GetNumberOfLines(); i++) { 02037 int sel = dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->GetLineText(i).Find(event.GetString()); 02038 if(sel != -1) { 02039 dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->SetSelection(length+sel, length+sel+event.GetString().size()); 02040 dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->ShowPosition(length+sel); 02041 return; 02042 } 02043 length += dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->GetLineLength(i); 02044 length ++; 02045 } 02046 02047 } 02048 02049 void QuickView2::OnAddRDL( wxCommandEvent& event ) 02050 { 02051 wxString filenamePattern = m_filenamePattern->GetValue(); 02052 std::queue<ResourceDescription *> queueOfResourceDescription; 02053 queueOfResourceDescription = ExpandRD(filenamePattern); 02054 02055 //ResourceDescriptionList *rdl = new ResourceDescriptionList(); 02056 m_displayDescription->GetRDL()->SetNameSpace(m_namespace->GetValue().ToStdString()); 02057 02058 //Go through the queue that was created and move the data 02059 //over into the rdl 02060 int queueSize = queueOfResourceDescription.size(); 02061 for(int i=0; i< queueSize; i++) { 02062 std::string datatype = m_datatype->GetValue().ToStdString(); 02063 if(datatype.compare(DataType.find("Image")->second) == 0 || datatype.compare(DataType.find("Objectmap")->second) == 0) { 02064 if(m_displayDescription->GetRDL()->AddDataDescrip(queueOfResourceDescription.front()->GetDMID(), queueOfResourceDescription.front())) { 02065 dynamic_cast<wxListBox*>(this->FindWindow(ID_LIST_RDL) )->Append(queueOfResourceDescription.front()->GetDMID()); 02066 02067 m_rdl.push_back(queueOfResourceDescription.front()->GetDMID()); 02068 02069 int loc = dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->FindString("--------RDL DMID-------"); 02070 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Insert(queueOfResourceDescription.front()->GetDMID(), loc+1); 02071 02072 loc = dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->FindString("--------RDL DMID-------"); 02073 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Insert(queueOfResourceDescription.front()->GetDMID(), loc+1); 02074 } 02075 } 02076 else if(datatype.compare(DataType.find("Transformation")->second) == 0) { 02077 if(m_displayDescription->GetRDL()->AddTransformDescrip(queueOfResourceDescription.front()->GetDMID(), queueOfResourceDescription.front())) { 02078 dynamic_cast<wxListBox*>(this->FindWindow(ID_LIST_RDL) )->Append(queueOfResourceDescription.front()->GetDMID()); 02079 02080 m_rdl.push_back(queueOfResourceDescription.front()->GetDMID()); 02081 02082 int loc = dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->FindString("--------RDL DMID-------"); 02083 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX5))->Insert(queueOfResourceDescription.front()->GetDMID(), loc+1); 02084 02085 loc = dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->FindString("--------RDL DMID-------"); 02086 dynamic_cast<wxComboBox*>(this->FindWindow(ID_COMBOBOX6))->Insert(queueOfResourceDescription.front()->GetDMID(), loc+1); 02087 } 02088 } 02089 else { 02090 delete queueOfResourceDescription.front(); 02091 } 02092 queueOfResourceDescription.pop(); 02093 } 02094 02095 02096 m_filenamePattern->Clear(); 02097 m_namespace->Clear(); 02098 m_filenamePattern2->Clear(); 02099 m_filenamePattern3->Clear(); 02100 m_transformationUnits->Clear(); 02101 dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_LABEL))->Clear(); 02102 02103 02104 for(int i=0; i< m_variableGrid->GetNumberCols(); i++) { 02105 for(int j=0; j<m_variableGrid->GetNumberRows(); j++) { 02106 m_variableGrid->SetCellValue("",j,i); 02107 } 02108 } 02109 for(int i=0; i< m_coordinateGrid->GetNumberCols(); i++) { 02110 for(int j=0; j<m_coordinateGrid->GetNumberRows(); j++) { 02111 m_coordinateGrid->SetCellValue("",j,i); 02112 } 02113 } 02114 dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_DEFAULT_DMID_TEXT))->Clear(); 02115 dynamic_cast<wxTextCtrl*>(this->FindWindow(ID_ADVANCED_DMID_TEXT))->Clear(); 02116 m_datatype->SetSelection(0); 02117 02118 this->FindWindow(ID_STATIC_FORMAT_TEXT)->Show(false); 02119 this->FindWindow(ID_FORMAT)->Show(false); 02120 this->FindWindow(ID_REMOVE_DUPLICATES)->Show(false); 02121 this->FindWindow(ID_TRANSFORMATION_UNITS)->Show(false); 02122 this->FindWindow(ID_STATIC_TRANSFORMATION_UNITS_TEXT)->Show(false); 02123 02124 this->FindWindow(ID_LABEL)->Show(false); 02125 this->FindWindow(ID_STATIC_LABEL_TEXT)->Show(false); 02126 this->FindWindow(ID_STATIC_FILEFORMAT2_TEXT)->Show(false); 02127 this->FindWindow(ID_STATIC_FILEFORMAT3_TEXT)->Show(false); 02128 this->FindWindow(ID_FILENAME_PATTERN2)->Show(false); 02129 this->FindWindow(ID_BROWSE2)->Show(false); 02130 this->FindWindow(ID_FILENAME_PATTERN3)->Show(false); 02131 this->FindWindow(ID_BROWSE3)->Show(false); 02132 02133 this->FindWindow(ID_SCROLLEDWINDOW7)->FitInside(); 02134 02135 dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->Clear(); 02136 FILE * tempfile = fopen("tempfile.txt", "w+"); 02137 m_displayDescription->GetRDL()->Save(tempfile); 02138 rewind(tempfile); 02139 int character; 02140 while( (character = fgetc(tempfile) ) != EOF ) { 02141 wxString temp; 02142 temp.Append(static_cast<char>(character) ); 02143 dynamic_cast<wxRichTextCtrl*>(this->FindWindow(ID_TEXT))->AppendText(temp); 02144 } 02145 fclose(tempfile); 02146 } 02147 02148 void QuickView2::OnDeleteRDL( wxCommandEvent& event ) 02149 { 02150 } 02151