Use already included XPM icon.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-30 16:17:48 +00:00
parent 160f1d38e6
commit c5cd3351af

View File

@@ -132,7 +132,7 @@ bool csApp::OnInit(void)
wxDEFAULT_FRAME_STYLE_NO_CLIP | wxHSCROLL | wxVSCROLL); wxDEFAULT_FRAME_STYLE_NO_CLIP | wxHSCROLL | wxVSCROLL);
// Give it an icon // Give it an icon
frame->SetIcon(wxICON(studio)); frame->SetIcon(wxIcon(studio_xpm));
// Make a menubar // Make a menubar
wxMenu *fileMenu = new wxMenu; wxMenu *fileMenu = new wxMenu;
@@ -228,94 +228,94 @@ int csApp::OnExit(void)
wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenuRet) wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenuRet)
{ {
//// Make a child frame //// Make a child frame
csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), wxID_ANY, _T("Child Frame"), csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), wxID_ANY, _T("Child Frame"),
wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE); wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE);
#ifdef __WXMSW__ #ifdef __WXMSW__
subframe->SetIcon(wxString(_T("chart"))); subframe->SetIcon(wxString(_T("chart")));
#endif #endif
#ifdef __X__ #ifdef __X__
subframe->SetIcon(wxIcon(_T("doc.xbm"))); subframe->SetIcon(wxIcon(_T("doc.xbm")));
#endif #endif
//// Make a menubar //// Make a menubar
wxMenu *fileMenu = new wxMenu; wxMenu *fileMenu = new wxMenu;
fileMenu->Append(wxID_NEW, _T("&New...\tCtrl+N")); fileMenu->Append(wxID_NEW, _T("&New...\tCtrl+N"));
fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O")); fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
fileMenu->Append(wxID_CLOSE, _T("&Close\tCtrl+W")); fileMenu->Append(wxID_CLOSE, _T("&Close\tCtrl+W"));
fileMenu->Append(wxID_SAVE, _T("&Save\tCtrl+S")); fileMenu->Append(wxID_SAVE, _T("&Save\tCtrl+S"));
fileMenu->Append(wxID_SAVEAS, _T("Save &As...\tF12")); fileMenu->Append(wxID_SAVEAS, _T("Save &As...\tF12"));
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append(wxID_PRINT, _T("&Print...\tCtrl+P")); fileMenu->Append(wxID_PRINT, _T("&Print...\tCtrl+P"));
fileMenu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); fileMenu->Append(wxID_PRINT_SETUP, _T("Print &Setup..."));
fileMenu->Append(wxID_PREVIEW, _T("Print Pre&view")); fileMenu->Append(wxID_PREVIEW, _T("Print Pre&view"));
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, _T("E&xit")); fileMenu->Append(wxID_EXIT, _T("E&xit"));
wxMenu* editMenu = new wxMenu; wxMenu* editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z")); editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z"));
editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y")); editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y"));
editMenu->AppendSeparator(); editMenu->AppendSeparator();
editMenu->Append(wxID_CUT, _T("Cu&t\tCtrl+X")); editMenu->Append(wxID_CUT, _T("Cu&t\tCtrl+X"));
editMenu->Append(wxID_COPY, _T("&Copy\tCtrl+C")); editMenu->Append(wxID_COPY, _T("&Copy\tCtrl+C"));
editMenu->Append(wxID_PASTE, _T("&Paste\tCtrl+V")); editMenu->Append(wxID_PASTE, _T("&Paste\tCtrl+V"));
editMenu->Append(wxID_DUPLICATE, _T("&Duplicate\tCtrl+D")); editMenu->Append(wxID_DUPLICATE, _T("&Duplicate\tCtrl+D"));
editMenu->AppendSeparator(); editMenu->AppendSeparator();
editMenu->Append(wxID_CLEAR, _T("Cle&ar\tDelete")); editMenu->Append(wxID_CLEAR, _T("Cle&ar\tDelete"));
editMenu->Append(ID_CS_SELECT_ALL, _T("Select A&ll\tCtrl+A")); editMenu->Append(ID_CS_SELECT_ALL, _T("Select A&ll\tCtrl+A"));
editMenu->AppendSeparator(); editMenu->AppendSeparator();
editMenu->Append(ID_CS_EDIT_PROPERTIES, _T("Edit P&roperties...")); editMenu->Append(ID_CS_EDIT_PROPERTIES, _T("Edit P&roperties..."));
*editMenuRet = editMenu; *editMenuRet = editMenu;
m_docManager->FileHistoryUseMenu(fileMenu); m_docManager->FileHistoryUseMenu(fileMenu);
m_docManager->FileHistoryAddFilesToMenu(fileMenu); m_docManager->FileHistoryAddFilesToMenu(fileMenu);
doc->GetCommandProcessor()->SetEditMenu(editMenu); doc->GetCommandProcessor()->SetEditMenu(editMenu);
wxMenu *viewMenu = new wxMenu; wxMenu *viewMenu = new wxMenu;
viewMenu->Append(ID_CS_SETTINGS, _T("&Settings...")); viewMenu->Append(ID_CS_SETTINGS, _T("&Settings..."));
wxMenu *helpMenu = new wxMenu; wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_HELP, _T("&Help Contents\tF1")); helpMenu->Append(wxID_HELP, _T("&Help Contents\tF1"));
helpMenu->Append(ID_CS_ABOUT, _T("&About")); helpMenu->Append(ID_CS_ABOUT, _T("&About"));
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, _T("&File")); menuBar->Append(fileMenu, _T("&File"));
menuBar->Append(editMenu, _T("&Edit")); menuBar->Append(editMenu, _T("&Edit"));
menuBar->Append(viewMenu, _T("&View")); menuBar->Append(viewMenu, _T("&View"));
menuBar->Append(helpMenu, _T("&Help")); menuBar->Append(helpMenu, _T("&Help"));
//// Associate the menu bar with the frame //// Associate the menu bar with the frame
subframe->SetMenuBar(menuBar); subframe->SetMenuBar(menuBar);
return subframe; return subframe;
} }
// Creates a canvas. Called by OnInit as a child of the main window // Creates a canvas. Called by OnInit as a child of the main window
csCanvas *csApp::CreateCanvas(wxView *view, wxMDIChildFrame *parent) csCanvas *csApp::CreateCanvas(wxView *view, wxMDIChildFrame *parent)
{ {
int width, height; int width, height;
parent->GetClientSize(&width, &height); parent->GetClientSize(&width, &height);
// Non-retained canvas // Non-retained canvas
csCanvas *canvas = new csCanvas((csDiagramView*) view, parent, 1000, wxPoint(0, 0), wxSize(width, height), wxSUNKEN_BORDER); csCanvas *canvas = new csCanvas((csDiagramView*) view, parent, 1000, wxPoint(0, 0), wxSize(width, height), wxSUNKEN_BORDER);
wxColour bgColour(_T("WHITE")); wxColour bgColour(_T("WHITE"));
canvas->SetBackgroundColour(bgColour); canvas->SetBackgroundColour(bgColour);
wxCursor cursor(wxCURSOR_HAND); wxCursor cursor(wxCURSOR_HAND);
canvas->SetCursor(cursor); canvas->SetCursor(cursor);
// Give it scrollbars // Give it scrollbars
canvas->SetScrollbars(20, 20, 100, 100); canvas->SetScrollbars(20, 20, 100, 100);
return canvas; return canvas;
} }
void csApp::InitToolBar(wxToolBar* toolBar) void csApp::InitToolBar(wxToolBar* toolBar)