+ const wxSize& size, long style)
+ : wxFrame(frame, wxID_ANY, title, pos, size, style)
+{
+ SetIcon(wxIcon(sample_xpm));
+
+ // Make the "File" menu
+ wxMenu *fileMenu = new wxMenu;
+ fileMenu->Append(wxID_OPEN, wxT("&Open..."));
+ fileMenu->AppendSeparator();
+ fileMenu->Append(wxID_EXIT, wxT("E&xit\tALT-X"));
+ // Make the "Help" menu
+ wxMenu *helpMenu = new wxMenu;
+ helpMenu->Append(wxID_HELP, wxT("&About..."));
+
+ wxMenuBar *menuBar = new wxMenuBar;
+ menuBar->Append(fileMenu, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
+ SetMenuBar(menuBar);
+
+ m_canvas = new TestGLCanvas(this, wxID_ANY, wxDefaultPosition,
+ wxSize(300, 300), wxSUNKEN_BORDER);
+}
+
+// File|Open... command
+void MyFrame::OnMenuFileOpen( wxCommandEvent& WXUNUSED(event) )
+{
+ wxString filename = wxFileSelector(wxT("Choose DXF Model"), wxT(""), wxT(""), wxT(""),
+#if wxUSE_ZLIB
+ wxT("DXF Drawing (*.dxf;*.dxf.gz)|*.dxf;*.dxf.gz|All files (*.*)|*.*"),
+#else
+ wxT("DXF Drawing (*.dxf)|*.dxf)|All files (*.*)|*.*"),
+#endif
+ wxOPEN);
+ if (!filename.IsEmpty())
+ {
+ m_canvas->LoadDXF(filename);
+ m_canvas->Refresh(false);
+ }
+}
+
+// File|Exit command
+void MyFrame::OnMenuFileExit( wxCommandEvent& WXUNUSED(event) )