// RCS-ID: $Id$
// Copyright: (c) 1998 Julian Smart
// (c) 2008 Vadim Zeitlin
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
if ( !wxApp::OnInit() )
return false;
+ ::wxInitAllImageHandlers();
+
SetAppName("DocView Sample");
//// Create a document manager
#if defined( __WXMAC__ ) && wxOSX_USE_CARBON
wxFileName::MacRegisterDefaultTypeAndCreator("txt" , 'TEXT' , 'WXMA');
#endif
+ // Create a template relating image documents to their views
+ new wxDocTemplate(docManager, "Image", "*.png;*.jpg", "", "png;jpg",
+ "Image Doc", "Image View",
+ CLASSINFO(ImageDocument), CLASSINFO(ImageView));
}
// create the main frame window
{
m_canvas = new MyCanvas(NULL, frame);
m_menuEdit = CreateDrawingEditMenu();
+ docManager->CreateNewDocument();
}
CreateMenuBarForFrame(frame, menuFile, m_menuEdit);
frame->SetIcon(wxICON(doc));
- frame->Centre(wxBOTH);
- frame->Show(true);
+ frame->Centre();
+ frame->Show();
SetTopWindow(frame);
return true;
menu->Append(wxID_CLOSE);
menu->Append(wxID_SAVE);
menu->Append(wxID_SAVEAS);
+ menu->Append(wxID_REVERT, _("Re&vert..."));
if ( supportsPrinting )
{
frame->SetMenuBar(menubar);
}
-wxFrame *MyApp::CreateChildFrame(wxDocument *doc, wxView *view, bool isCanvas)
+wxFrame *MyApp::CreateChildFrame(wxView *view, bool isCanvas)
{
// create a child frame of appropriate class for the current mode
wxFrame *subframe;
+ wxDocument *doc = view->GetDocument();
#if wxUSE_MDI_ARCHITECTURE
if ( GetMode() == Mode_MDI )
{
wxSize(300, 300)
);
- subframe->Centre(wxBOTH);
+ subframe->Centre();
}
wxMenu *menuFile = new wxMenu;