mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-20 21:08:24 +08:00
call OnInit() from all samples to allow using standard command line options with all of them (patch 1623971)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -163,6 +163,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
// Note: JAWS for Windows will only speak the context-sensitive
|
||||
// help if you use this help provider:
|
||||
|
||||
@@ -90,6 +90,9 @@ END_EVENT_TABLE()
|
||||
// Initialise this in OnInit, not statically
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
|
||||
MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("Animation Demo"),
|
||||
|
||||
@@ -96,6 +96,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("wxArtProvider sample"),
|
||||
wxPoint(50, 50), wxSize(450, 340));
|
||||
|
||||
@@ -548,6 +548,9 @@ END_EVENT_TABLE()
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
wxFrame* frame = new MyFrame(NULL,
|
||||
wxID_ANY,
|
||||
wxT("wxAUI Sample Application"),
|
||||
|
||||
@@ -266,6 +266,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("Calendar wxWidgets sample")
|
||||
#ifndef __WXWINCE__
|
||||
|
||||
@@ -182,6 +182,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create and show the main application window
|
||||
MyFrame *frame = new MyFrame(_T("Caret wxWidgets sample"),
|
||||
wxPoint(50, 50), wxSize(450, 340));
|
||||
|
||||
@@ -151,6 +151,9 @@ IMPLEMENT_APP(CheckListBoxApp)
|
||||
// init our app: create windows
|
||||
bool CheckListBoxApp::OnInit(void)
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
CheckListBoxFrame *pFrame = new CheckListBoxFrame
|
||||
(
|
||||
NULL,
|
||||
|
||||
@@ -126,6 +126,9 @@ IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create and show the main frame
|
||||
MyFrame* frame = new MyFrame;
|
||||
|
||||
|
||||
@@ -154,6 +154,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("wxComboCtrl and wxOwnerDrawnComboBox Sample"));
|
||||
|
||||
|
||||
@@ -85,6 +85,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// we're using wxConfig's "create-on-demand" feature: it will create the
|
||||
// config object when it's used for the first time. It has a number of
|
||||
// advantages compared with explicitly creating our wxConfig:
|
||||
|
||||
@@ -365,6 +365,9 @@ IMPLEMENT_APP (MyApp)
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
MyFrame *frame = new MyFrame(NULL, wxT("wxDataViewCtrl feature test"), 10, 10, 800, 340);
|
||||
frame->Show(true);
|
||||
|
||||
|
||||
@@ -635,6 +635,9 @@ void CheckSupportForAllDataTypes(wxDb *pDb)
|
||||
|
||||
bool DatabaseDemoApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
DbConnectInf = NULL;
|
||||
Contact = NULL;
|
||||
|
||||
|
||||
@@ -238,6 +238,9 @@ MyCanvas *myCanvas = (MyCanvas *) NULL;
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
wxInitAllImageHandlers();
|
||||
#endif
|
||||
|
||||
@@ -150,6 +150,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("Dial-up wxWidgets demo"),
|
||||
wxPoint(50, 50), wxSize(450, 340));
|
||||
|
||||
@@ -167,6 +167,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
if ( argc == 2 && !wxStricmp(argv[1], _T("/dx")) )
|
||||
{
|
||||
|
||||
@@ -883,6 +883,9 @@ END_EVENT_TABLE()
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool DnDApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP || wxUSE_CLIPBOARD
|
||||
// switch on trace messages
|
||||
#if wxUSE_LOG
|
||||
|
||||
@@ -55,6 +55,9 @@ MyApp::MyApp(void)
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
//// Find out if we're:
|
||||
//// multiple window: multiple windows, each view in a separate frame
|
||||
//// single window: one view (within the main frame) and one document at a time, as in Windows Write.
|
||||
|
||||
@@ -368,6 +368,9 @@ MyApp::MyApp()
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if wxUSE_LIBPNG
|
||||
wxImage::AddHandler( new wxPNGHandler );
|
||||
#endif
|
||||
|
||||
@@ -353,6 +353,9 @@ bool MyApp::LoadImages()
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("Drawing sample"),
|
||||
wxPoint(50, 50), wxSize(550, 340));
|
||||
|
||||
@@ -66,6 +66,9 @@ IMPLEMENT_APP (MyApp)
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWidgets App"), 50, 50, 450, 340);
|
||||
|
||||
|
||||
@@ -117,6 +117,9 @@ IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
MyFrame *frame = new MyFrame;
|
||||
|
||||
frame->Show(true);
|
||||
|
||||
@@ -200,6 +200,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("Event wxWidgets Sample"),
|
||||
wxPoint(50, 50), wxSize(600, 340));
|
||||
|
||||
@@ -238,6 +238,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame();
|
||||
|
||||
|
||||
@@ -386,6 +386,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("Exec wxWidgets sample"),
|
||||
wxDefaultPosition, wxSize(500, 140));
|
||||
|
||||
@@ -234,6 +234,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(wxT("Font wxWidgets demo"),
|
||||
wxPoint(50, 50), wxSize(600, 400));
|
||||
|
||||
@@ -287,6 +287,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create a simple help provider to make SetHelpText() do something.
|
||||
// Note that this must be set before any SetHelpText() calls are made.
|
||||
#if USE_SIMPLE_HELP_PROVIDER
|
||||
|
||||
@@ -85,6 +85,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// we use a PNG image in our HTML page
|
||||
wxImage::AddHandler(new wxPNGHandler);
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
wxInitAllImageHandlers();
|
||||
#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
|
||||
wxFileSystem::AddHandler(new wxZipFSHandler);
|
||||
|
||||
@@ -53,6 +53,9 @@ IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#ifdef __WXMOTIF__
|
||||
delete wxLog::SetActiveTarget(new wxLogStderr); // So dialog boxes aren't used
|
||||
#endif
|
||||
|
||||
@@ -125,6 +125,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("wxWebKit Sample"));
|
||||
|
||||
|
||||
@@ -128,6 +128,9 @@ IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if wxUSE_LIBPNG
|
||||
wxImage::AddHandler(new wxPNGHandler);
|
||||
#endif
|
||||
|
||||
@@ -154,6 +154,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if wxUSE_SYSTEM_OPTIONS
|
||||
wxSystemOptions::SetOption(wxT("no-maskblt"), 1);
|
||||
#endif
|
||||
|
||||
@@ -155,6 +155,9 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"),
|
||||
wxDefaultPosition, wxSize(640, 480));
|
||||
|
||||
@@ -156,6 +156,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame( _("wxHtmlWindow testing application"),
|
||||
wxDefaultPosition, wxSize(640, 480) );
|
||||
|
||||
@@ -97,6 +97,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if wxUSE_LIBPNG
|
||||
wxImage::AddHandler(new wxPNGHandler);
|
||||
#endif
|
||||
|
||||
@@ -1168,6 +1168,9 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
wxInitAllImageHandlers();
|
||||
|
||||
wxFrame *frame = new MyFrame();
|
||||
|
||||
@@ -166,6 +166,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
long lng = -1;
|
||||
|
||||
if ( argc == 2 )
|
||||
|
||||
@@ -76,6 +76,9 @@ END_EVENT_TABLE()
|
||||
// main frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
m_frame = new MyFrame(NULL, _T("Client"));
|
||||
m_frame->Show(true);
|
||||
|
||||
@@ -66,6 +66,9 @@ END_EVENT_TABLE()
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
m_frame = new MyFrame(NULL, _T("Server"));
|
||||
m_frame->Show(true);
|
||||
|
||||
@@ -43,6 +43,9 @@ int nButtons = 0;
|
||||
// Initialise this in OnInit, not statically
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
wxJoystick stick(wxJOYSTICK1);
|
||||
if (!stick.IsOk())
|
||||
{
|
||||
|
||||
@@ -240,6 +240,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(_T("Keyboard wxWidgets App"),
|
||||
wxPoint(50, 50), wxSize(450, 340));
|
||||
|
||||
@@ -41,6 +41,9 @@ IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame;
|
||||
|
||||
|
||||
@@ -322,6 +322,9 @@ END_EVENT_TABLE()
|
||||
|
||||
bool LboxTestApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
wxFrame *frame = new LboxTestFrame(_T("wxListBox sample"));
|
||||
frame->Show();
|
||||
|
||||
|
||||
@@ -153,6 +153,9 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData)
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(wxT("wxListCtrl Test"));
|
||||
|
||||
|
||||
@@ -112,6 +112,9 @@ END_EVENT_TABLE()
|
||||
// Initialise this in OnInit, not statically
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
|
||||
frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("MDI Demo"),
|
||||
|
||||
@@ -409,6 +409,9 @@ IMPLEMENT_APP(wxMediaPlayerApp)
|
||||
// ----------------------------------------------------------------------------
|
||||
bool wxMediaPlayerApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// SetAppName() lets wxConfig and others know where to write
|
||||
SetAppName(wxT("wxMediaPlayer"));
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL);
|
||||
|
||||
|
||||
@@ -344,6 +344,9 @@ IMPLEMENT_APP(MyApp)
|
||||
// main frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame* frame = new MyFrame;
|
||||
|
||||
|
||||
@@ -232,6 +232,9 @@ BOOL CTheApp::OnIdle(LONG WXUNUSED(lCount))
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
#if !START_WITH_MFC_WINDOW
|
||||
// as we're not inside wxWidgets main loop, the default logic doesn't work
|
||||
// in our case and we need to do this explicitly
|
||||
|
||||
@@ -57,6 +57,9 @@ wxButton *button = (wxButton*) NULL;
|
||||
// main frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
return false;
|
||||
|
||||
// Create the main frame window
|
||||
main_frame = new MyMainFrame((wxFrame *) NULL, wxID_ANY, _T("wxFrame sample"),
|
||||
wxPoint(100, 100), wxSize(300, 200));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user