Show how to handle files on command line in docview sample.
This is not totally obvious, so show how to do it, including the Mac-specific MacNewFile() overriding part. Closes #16816. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#define _WX_SAMPLES_DOCVIEW_DOCVIEW_H_
|
||||
|
||||
#include "wx/docview.h"
|
||||
#include "wx/vector.h"
|
||||
|
||||
class MyCanvas;
|
||||
|
||||
@@ -39,6 +40,8 @@ public:
|
||||
virtual void OnInitCmdLine(wxCmdLineParser& parser) wxOVERRIDE;
|
||||
virtual bool OnCmdLineParsed(wxCmdLineParser& parser) wxOVERRIDE;
|
||||
|
||||
virtual void MacNewFile() wxOVERRIDE;
|
||||
|
||||
// our specific methods
|
||||
Mode GetMode() const { return m_mode; }
|
||||
wxFrame *CreateChildFrame(wxView *view, bool isCanvas);
|
||||
@@ -68,6 +71,8 @@ private:
|
||||
// application object itself
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
|
||||
// contains the file names given on the command line, possibly empty
|
||||
wxVector<wxString> m_filesFromCmdLine;
|
||||
|
||||
// the currently used mode
|
||||
Mode m_mode;
|
||||
|
Reference in New Issue
Block a user