NIREP
|
00001 00002 // Name: windowdeletespatialdata.cpp 00003 // Purpose: 00004 // Author: 00005 // Modified by: 00006 // Created: 18/11/2009 15:44:46 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 "WindowDeleteSpatialData.h" 00027 00028 #include "DeleteSpatialDataAction.h" 00029 #include "Interface.h" 00032 00033 00038 IMPLEMENT_CLASS( WindowDeleteSpatialData, wxFrame ) 00039 00040 00041 00045 BEGIN_EVENT_TABLE( WindowDeleteSpatialData, wxFrame ) 00046 EVT_BUTTON(ID_BUTTON, WindowDeleteSpatialData::OkButton) 00047 EVT_BUTTON(ID_BUTTON1, WindowDeleteSpatialData::CancelButton) 00050 00051 END_EVENT_TABLE() 00052 00053 00058 WindowDeleteSpatialData::WindowDeleteSpatialData() 00059 { 00060 Init(); 00061 } 00062 00063 WindowDeleteSpatialData::WindowDeleteSpatialData( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) 00064 { 00065 interfaceParent = (Interface *)parent; 00066 Init(); 00067 Create( parent, id, caption, pos, size, style ); 00068 } 00069 00070 00075 bool WindowDeleteSpatialData::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) 00076 { 00078 wxFrame::Create( parent, id, caption, pos, size, style ); 00079 00080 CreateControls(); 00081 Centre(); 00083 return true; 00084 } 00085 00086 00091 WindowDeleteSpatialData::~WindowDeleteSpatialData() 00092 { 00095 } 00096 00097 00102 void WindowDeleteSpatialData::Init() 00103 { 00104 00107 } 00108 00109 00114 void WindowDeleteSpatialData::CreateControls() 00115 { 00117 WindowDeleteSpatialData* itemFrame1 = this; 00118 00119 wxPanel* itemPanel2 = new wxPanel( itemFrame1, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); 00120 00121 wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); 00122 itemPanel2->SetSizer(itemBoxSizer3); 00123 00124 wxStaticText* itemStaticText4 = new wxStaticText( itemPanel2, wxID_STATIC, _("Do you really want to delete this spatial data?"), wxDefaultPosition, wxDefaultSize, 0 ); 00125 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00126 00127 wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); 00128 itemBoxSizer3->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00129 00130 wxButton* itemButton6 = new wxButton( itemPanel2, ID_BUTTON, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 ); 00131 itemBoxSizer5->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00132 00133 wxButton* itemButton7 = new wxButton( itemPanel2, ID_BUTTON1, _("No"), wxDefaultPosition, wxDefaultSize, 0 ); 00134 itemBoxSizer5->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00135 00137 } 00138 00139 00144 bool WindowDeleteSpatialData::ShowToolTips() 00145 { 00146 return true; 00147 } 00148 00153 wxBitmap WindowDeleteSpatialData::GetBitmapResource( const wxString& name ) 00154 { 00155 // Bitmap retrieval 00157 wxUnusedVar(name); 00158 return wxNullBitmap; 00160 } 00161 00166 wxIcon WindowDeleteSpatialData::GetIconResource( const wxString& name ) 00167 { 00168 // Icon retrieval 00170 wxUnusedVar(name); 00171 return wxNullIcon; 00173 } 00174 00175 void WindowDeleteSpatialData::OkButton(wxCommandEvent &event) 00176 { 00177 interfaceParent->DeleteSpatialData(row,col); 00178 this->Close(); 00179 } 00180 00181 void WindowDeleteSpatialData::CancelButton(wxCommandEvent &event) 00182 { 00183 this->Close(); 00184 } 00185 00186 void WindowDeleteSpatialData::SetRowCol(int r, int c) 00187 { 00188 row=r; 00189 col=c; 00190 }