// 'Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
	wxInitAllImageHandlers();
	wxBitmap splashbitmap;
  	if (splashbitmap.LoadFile("/opt/extras.ubuntu.com/azpazeta/media/splash.png", wxBITMAP_TYPE_PNG))
  	{
      	wxSplashScreen* splash = new wxSplashScreen(splashbitmap,
          wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
          6000, NULL, -1, wxDefaultPosition, wxSize(400,400),
          wxSIMPLE_BORDER|wxSTAY_ON_TOP);
  	}
  	wxYield();
	//ChrTaskBarIcon* icon = new ChrTaskBarIcon(); 
    // call the base class initialization method, currently it only parses a
    // few common command-line options but it could be do more in the future
    if ( !wxApp::OnInit() )
        return false;
	SetAppName(wxT("Azpazeta"));
	SetVendorName(wxT("Adrian Arroyo Calle para Divel"));
        if(wxApp::argc>=2){
	fachada=1;
        wxString archivo=wxApp::argv[1].mb_str();
        //int* newsavedlg=new SaveDialog::Cargar(wxString archivo);
        SaveDialog* newsavedlg=new SaveDialog();
        newsavedlg->Cargar(archivo);
	newsavedlg->Destroy();
	MyFrame *frame = new MyFrame("Azpazeta");
	frame->Show(true);
	frame->Load();
	frame->Paint();
	//if(city==4){MyFrame::Stage4();}
	
        
        }else{	MyFrame *frame = new MyFrame("Azpazeta");
	frame->Show(true);
	frame->OnJugar();
	frame->Paint();}
        
        
    // create the main application window

    // and show it (the frames, unlike simple controls, are not shown when
    // created initially)
    
	
	

    // success: wxApp::OnRun() will be called which will enter the main message
    // loop and the application will run. If we returned false here, the
    // application would exit immediately.
    return true;
}
bool MyApp::OnInit(void)
{
    MyFrame *frame = new MyFrame(1, (wxFrame *) NULL, wxT("wxMultiCellSizer Sample"), wxPoint(50, 50), wxDefaultSize); //, wxSize(600, 500));

    frame->Show(true);

    SetTopWindow(frame);
    frame = new MyFrame(2, (wxFrame *) NULL, wxT("wxMultiCellCanvas Sample"), wxPoint(100, 100), wxSize(600, 500));

    frame->Show(true);

    SetTopWindow(frame);
    return true;
}
Exemple #3
0
bool MyApp::OnInit()
{
	MyFrame *frame = new MyFrame(L"发票凑整", wxPoint(-1, -1), wxSize(-1, -1));
	frame->SetMinSize(wxSize(640, 480));
	frame->Show(true);
	return true;
}
Exemple #4
0
bool MyApp::OnInit()
{
	if ( !wxApp::OnInit() ) return false;
	MyFrame *frame = new MyFrame(_T("coLinux Console"));
	frame->Show(true);
	return true;
}
Exemple #5
0
// '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:
    // wxHelpProvider::Set(new wxHelpControllerHelpProvider(m_helpController)).
    // JAWS does not seem to be getting the help text from
    // the wxAccessible object.
    wxHelpProvider::Set(new wxSimpleHelpProvider());

    // create the main application window
    MyFrame *frame = new MyFrame(wxT("AccessTest wxWidgets App"),
                                 wxPoint(50, 50), wxSize(450, 340));

    // and show it (the frames, unlike simple controls, are not shown when
    // created initially)
    frame->Show(true);

    // success: wxApp::OnRun() will be called which will enter the main message
    // loop and the application will run. If we returned false here, the
    // application would exit immediately.
    return true;
#else
    wxMessageBox( wxT("This sample has to be compiled with wxUSE_ACCESSIBILITY"), wxT("Building error"), wxOK);
    return false;
#endif // wxUSE_ACCESSIBILITY
}
bool MyApp::OnInit()
{
    if ( !wxApp::OnInit() )
        return false;

#if wxUSE_LIBPNG
    wxImage::AddHandler(new wxPNGHandler);
#endif
#if wxUSE_LIBJPEG
    wxImage::AddHandler(new wxJPEGHandler);
#endif
#if wxUSE_GIF
    wxImage::AddHandler(new wxGIFHandler);
#endif

    MyFrame *frame = new MyFrame(_("Printing test"),
        wxDefaultPosition, wxSize(640, 480));

    // Show it
    frame->Show(true);

    // success: wxApp::OnRun() will be called which will enter the main message
    // loop and the application will run. If we returned false here, the
    // application would exit immediately.
    return true;
}
bool MyApp::OnInit()
{
    MyFrame *frame = new MyFrame( NULL, -1, wxT("Minimal"), wxPoint(20,20), wxSize(500,340) );
    frame->Show( TRUE );
    
    return TRUE;
}
Exemple #8
0
bool MyApp::OnInit()
{
    wxString title;
    int size = 0;

    wxStockGDI& s = wxStockGDI::instance();
    const wxFont* f1 = s.GetFont(wxStockGDI::FONT_NORMAL);

    const wxFont* f2 = wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL);
    const wxFont* f3 = wxNORMAL_FONT;

    printf("%p %p %p\n", f1, f2, f3);

    size = wxNORMAL_FONT->GetPointSize();
    title.Printf(_T("Hello, World! %d"), size);

    MyFrame *frame = new MyFrame(title, wxPoint(50,50), wxSize(450,340) );
    frame->Show(TRUE);
    SetTopWindow(frame);

    FILE* fp = fopen("c:\\output.txt", "w");
    wxLog::SetActiveTarget(new wxLogStderr(fp));
    wxLogMessage(wxT("test log message"));
    wxLogError(wxT("this is an error"));

    return TRUE;
}
Exemple #9
0
bool BasicApplication::OnInit(){
	wxInitAllImageHandlers();
	MyFrame *frame = new MyFrame(_T("Basic Frame"), 50, 50, 1024, 768);
	frame->Show(TRUE);
	SetTopWindow(frame);
	return TRUE;
}
bool MyApp::OnInit()
{
    MyFrame * frame = new MyFrame(wxT("APPLICATION"));
    frame->Show();

    return true;;
}
Exemple #11
0
bool MyApp::OnInit()
{
    MyFrame *frame = new MyFrame( _T("Hello World"), wxPoint(50,50), wxSize(450,340) );
    frame->Show(TRUE);
    SetTopWindow(frame);
    return TRUE;
}
Exemple #12
0
bool MyApp::OnInit()
{
	MyFrame *frame = new MyFrame("Hello World", wxPoint(50, 50), wxSize(450, 340));
	frame->Show(true);

	return true;
}
// 'Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
    if ( !wxApp::OnInit() )
        return false;

#ifdef __WXMSW__
    if ( argc == 2 && !wxStricmp(argv[1],  wxT("/dx")) )
    {
        wxSystemOptions::SetOption(wxT("msw.display.directdraw"), 1);
    }
#endif // __WXMSW__

    // create the main application window
    MyFrame *frame = new MyFrame(_("Display wxWidgets Sample"),
                                 wxDefaultPosition, wxDefaultSize);

    // and show it (the frames, unlike simple controls, are not shown when
    // created initially)
    frame->Show();

    // success: wxApp::OnRun() will be called which will enter the main message
    // loop and the application will run. If we returned false here, the
    // application would exit immediately.
    return true;
}
Exemple #14
0
bool MyApp::OnInit()
{
    char path1[100];
    char path2[100];

    // path to data
    sprintf_s(path1, 100, ".");
    if (argc > 1) {
        wxString s(argv[1]);
        strncpy_s( path1, 100, (const char*)s.mb_str(wxConvUTF8), 100 );
        std::cout << "OnInit: data path is " << path1 << std::endl;
    }

    // Specifying a file to load at the command line is optional
    // and is otherwise done through File->Load in the UI
    sprintf_s(path2, 100, "NO FILE");
    if (argc > 2) {
        wxString s(argv[2]);
        strncpy_s( path2, 100, (const char*)s.mb_str(wxConvUTF8), 100 );
        std::cout << "OnInit: default path is " << path2 << std::endl;
    }

    MyFrame *frame = new MyFrame( _T("Stick'em Up"), wxPoint(50,50), wxSize(640,480),
                                  std::string(path1), std::string(path2) );
    frame->Show(TRUE);
    SetTopWindow(frame);

    return TRUE;
} 
Exemple #15
0
bool MyApp::OnInit()
{
#if wxUSE_LIBPNG
    wxImage::AddHandler( new wxPNGHandler );
#endif

    wxImage image;
    if (image.LoadFile(_T("backgrnd.png"), wxBITMAP_TYPE_PNG))
    {
        m_background = wxBitmap(image);
    }

    MyFrame *frame = new MyFrame();

    wxString rootName(_T("shape0"));

    int i;
    for (i = 1; i < 4; i++)
    {
        wxString filename;
        filename.Printf(wxT("%s%d.png"), (const wxChar*)rootName, i);
    /* For some reason under wxX11, the 2nd LoadFile in this loop fails, with
       a BadMatch inside CreateFromImage (inside ConvertToBitmap). This happens even if you copy
       the first file over the second file. */
        if (image.LoadFile(filename, wxBITMAP_TYPE_PNG))
        {
            DragShape* newShape = new DragShape(wxBitmap(image));
            newShape->SetPosition(wxPoint(i*50, i*50));

            if (i == 2)
                newShape->SetDragMethod(SHAPE_DRAG_TEXT);
            else if (i == 3)
                newShape->SetDragMethod(SHAPE_DRAG_ICON);
            else
                newShape->SetDragMethod(SHAPE_DRAG_BITMAP);
            frame->GetCanvas()->GetDisplayList().Append(newShape);
        }
    }

#if 0
    // Under Motif or GTK, this demonstrates that
    // wxScreenDC only gets the root window content.
    // We need to be able to copy the overall content
    // for full-screen dragging to work.
    int w, h;
    wxDisplaySize(& w, & h);
    wxBitmap bitmap(w, h);

    wxScreenDC dc;
    wxMemoryDC memDC;
    memDC.SelectObject(bitmap);
    memDC.Blit(0, 0, w, h, & dc, 0, 0);
    memDC.SelectObject(wxNullBitmap);
    m_background = bitmap;
#endif

    frame->Show( true );

    return true;
}
// `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("Dial-up wxWidgets demo"),
                                 wxPoint(50, 50), wxSize(450, 340));

    // Show it
    frame->Show(true);

    // Init dial up manager
    m_dial = wxDialUpManager::Create();

    if ( !m_dial->IsOk() )
    {
        wxLogError(wxT("The sample can't run on this system."));

#if wxUSE_LOG
        wxLog::GetActiveTarget()->Flush();
#endif // wxUSE_LOG

        // do it here, OnExit() won't be called
        delete m_dial;

        return false;
    }

#if wxUSE_STATUSBAR
    frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? wxT("LAN") : wxT("No LAN"), 2);
#endif // wxUSE_STATUSBAR

    return true;
}
Exemple #17
0
 virtual bool OnInit(){
 	g_logger.config.stream_type = 3;
 	g_logger.reset();
     MyFrame *frame = new MyFrame(wxT("ZKS Sudoku Beta"), wxDefaultPosition, wxDefaultSize);
     frame->Show(true);
     return true;
 }
bool MyApp::OnInit()
{
    MyFrame *frame = new MyFrame( _("Hello World"), wxPoint(50, 50),  wxSize(500, 500) );
    frame->Show(true);
    SetTopWindow(frame);
    return true;
}
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit(void)
{
    // Create the main frame window
    MyFrame *frame = new MyFrame(NULL, _("wxWidgets 2.0 wxFrameLayout demo"), 50, 50, 650, 540);

    // Give it an icon
#ifdef __WINDOWS__
    frame->SetIcon(wxIcon(wxT("mondrian")));
#endif
#ifdef __X__
    frame->SetIcon(wxIcon(wxT("aiai.xbm")));
#endif

    // Make a menubar
    wxMenu *file_menu = new wxMenu;
    wxMenu *active_menu = new wxMenu;

    file_menu->Append( ID_LOAD,  _("&Load layouts")  );
    file_menu->Append( ID_STORE, _("&Store layouts") );
    file_menu->AppendSeparator();

    file_menu->Append( ID_AUTOSAVE, _("&Auto Save Layouts"), _("save layouts on exit"), wxITEM_CHECK );
    file_menu->AppendSeparator();

    file_menu->Append(MINIMAL_ABOUT, _("A&bout !"));
    file_menu->Append(MINIMAL_QUIT, _("E&xit\tTab"));

    //active_menu->Append( ID_SETTINGS, _("&Settings...\tCtrl") );
    //active_menu->AppendSeparator();

    active_menu->Append( ID_REMOVE,    _("&Remove Active") );
    active_menu->Append( ID_REMOVEALL, _("Remove &All") );
    active_menu->Append( ID_RECREATE,  _("Re&create") );
    active_menu->AppendSeparator();

    active_menu->Append( ID_FIRST,  _("Activate f&irst layout \tF1"), _("activate it"), wxITEM_CHECK );
    active_menu->Append( ID_SECOND, _("Activate &second layout\tF2"), _("activate it"),  wxITEM_CHECK );
    active_menu->Append( ID_THIRD,  _("Activate &third layout\tF3"), _("activate it"),   wxITEM_CHECK );

    wxMenuBar *menu_bar = new wxMenuBar;

    menu_bar->Append(file_menu,   _("&File"));
    menu_bar->Append(active_menu, _("Active &Layout"));

#if wxUSE_STATUSBAR
    frame->CreateStatusBar(3);
#endif // wxUSE_STATUSBAR

    frame->SetMenuBar(menu_bar);

    frame->SyncMenuBarItems();

    // Show the frame
    frame->Show(true);

    SetTopWindow(frame);

    return true;
}
Exemple #20
0
HoeEditor::BaseEditor * Hoe2DEditApp::CreateEditor()
{
    MyFrame* frame = new MyFrame();
    SetTopWindow(frame);
    frame->Show();

    return frame;
}
// 'Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
if ( !wxApp::OnInit() )
return false;
MyFrame *frame = new MyFrame("wxWidgets TCP Server");
frame->Show(true);
return true;
}
Exemple #22
0
bool MyApp::OnInit()
{
    auto title = wxString::Format("Hello %s (pid %lu)", wxVERSION_STRING,
                                  wxGetProcessId());
    MyFrame* frame = new MyFrame(title, wxPoint(50, 50), wxSize(450, 340));
    frame->Show(true);
    return true;
}
Exemple #23
0
bool MiniWxApp::OnInit() {
	wxString title;
	title.Printf(wxT("Onega’s mini wxWidgets application pid:%d "), getpid());
	MyFrame *frame = new MyFrame( title, wxDefaultPosition, wxDefaultSize);
	frame->Show(true);
	SetTopWindow (frame);
	return true;
}
Exemple #24
0
bool MyApp::OnInit()
{
	//MyFrame *frame = new MyFrame("Hello World", wxPoint(50, 50), wxSize(450, 340));
	MyFrame *frame = new MyFrame("Hello World", wxDefaultPosition, wxDefaultSize);
	frame->Show(true);
	SetTopWindow(frame);
	return true;
}
Exemple #25
0
bool MyApp::OnInit() {
	MyFrame* frame = new MyFrame(wxT("Min wxWidgets app"));
	frame->Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnQuit));
	frame->Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnAbout));
	
	frame->Show(true);
	return true; // event handling loop starts after
}
bool MyApp::OnInit()
{
    // Create and display the main frame window.
    MyFrame *frame = new MyFrame((wxFrame *) NULL, wxT("Validator Test"),
                                 50, 50, 300, 250);
    frame->Show(true);
    SetTopWindow(frame);
    return true;
}
Exemple #27
0
// The `main program' equivalent, creating the windows and returning the
// main frame
bool MyApp::OnInit()
{
  // Create the main frame window
  MyFrame* frame = new MyFrame(NULL, _T("Tree Test"), wxDefaultPosition, wxSize(400, 550));

#if wxUSE_STATUSBAR
  // Give it a status line
  frame->CreateStatusBar(2);
#endif // wxUSE_STATUSBAR

  // Give it an icon
#ifdef __WINDOWS__
  wxIcon icon(_T("tree_icn"));
  frame->SetIcon(icon);
#endif

  // Make a menubar
  wxMenu *file_menu = new wxMenu;
  file_menu->Append(TEST_LEFT_RIGHT, _T("&Left to right"),                _T("Redraw left to right"));
  file_menu->Append(TEST_TOP_BOTTOM, _T("&Top to bottom"),                _T("Redraw top to bottom"));
  file_menu->AppendSeparator();
  file_menu->Append(TEST_QUIT, _T("E&xit"),                _T("Quit program"));

  wxMenu *help_menu = new wxMenu;
  help_menu->Append(TEST_ABOUT, _T("&About"),              _T("About Tree Test"));

  wxMenuBar* menu_bar = new wxMenuBar;

  menu_bar->Append(file_menu, _T("&File"));
  menu_bar->Append(help_menu, _T("&Help"));

  // Associate the menu bar with the frame
  frame->SetMenuBar(menu_bar);

  MyCanvas *canvas = new MyCanvas(frame);

  // Give it scrollbars: the virtual canvas is 20 * 50 = 1000 pixels in each direction
  canvas->SetScrollbars(20, 20, 50, 50);
  frame->canvas = canvas;

  myTree = new wxTreeLayoutStored();

  wxClientDC dc(canvas);
  wxFont font(10, wxROMAN, wxNORMAL, wxBOLD);
  dc.SetFont(font);
  TreeTest(*myTree, dc);

  frame->Show(true);

#if wxUSE_STATUSBAR
  frame->SetStatusText(_T("Hello, tree!"));
#endif // wxUSE_STATUSBAR

  // Return the main frame window
  return true;
}
bool MyApp::OnInit(void)
{
    if ( !wxApp::OnInit() )
        return false;

    wxInitAllImageHandlers();


    // init global objects
    // -------------------

    g_printData = new wxPrintData;

    // You could set an initial paper size here
#if 0
    g_printData->SetPaperId(wxPAPER_LETTER); // for Americans
    g_printData->SetPaperId(wxPAPER_A4);    // for everyone else
#endif

    g_pageSetupData = new wxPageSetupDialogData;

    // copy over initial paper size from print record
    (*g_pageSetupData) = *g_printData;

    // Set some initial page margins in mm.
    g_pageSetupData->SetMarginTopLeft(wxPoint(15, 15));
    g_pageSetupData->SetMarginBottomRight(wxPoint(15, 15));


    // init local GUI objects
    // ----------------------

#if 0
    wxImage image( wxT("test.jpg") );
    image.SetAlpha();
    int i,j;
    for (i = 0; i < image.GetWidth(); i++)
       for (j = 0; j < image.GetHeight(); j++)
          image.SetAlpha( i, j, 50 );
    m_bitmap = image;
#endif
    m_angle = 30;
    m_testFont.Create(10, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);


    // Create the main frame window
    // ----------------------------

    MyFrame* frame = new MyFrame((wxFrame *) NULL, wxT("wxWidgets Printing Demo"),
                                 wxPoint(0, 0), wxSize(400, 400));

    frame->Centre(wxBOTH);
    frame->Show();

    return true;
}
Exemple #29
-1
bool MyApp::OnInit(void)
{
  // Create the main frame window
  MyFrame   *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250));

#if wxUSE_STATUSBAR
  // Give it a status line
  frame->CreateStatusBar(2);
#endif // wxUSE_STATUSBAR

  // Make a menubar
  wxMenu *file_menu = new wxMenu;

  file_menu->Append(RESOURCE_TEST1, _T("&Dialog box test"),                _T("Test dialog box resource"));
  file_menu->Append(RESOURCE_QUIT, _T("E&xit"),                _T("Quit program"));

  wxMenuBar *menu_bar = new wxMenuBar;

  menu_bar->Append(file_menu, _T("&File"));

  // Associate the menu bar with the frame
  frame->SetMenuBar(menu_bar);

  // Make a panel
  frame->panel = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 400), 0, _T("MyMainFrame"));
  frame->Show(true);

  // Return the main frame window
  SetTopWindow(frame);

  return true;
}
Exemple #30
-2
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit()
{
    // Create the main frame window
    MyFrame *frame = new MyFrame(NULL, wxT("wxWidgets OpenGL Penguin Sample"),
        wxDefaultPosition, wxDefaultSize);

    /* Make a menubar */
    wxMenu *fileMenu = new wxMenu;

    fileMenu->Append(wxID_EXIT, wxT("E&xit"));
    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append(fileMenu, wxT("&File"));
    frame->SetMenuBar(menuBar);

    frame->SetCanvas( new TestGLCanvas(frame, wxID_ANY, wxDefaultPosition,
        wxSize(200, 200), wxSUNKEN_BORDER) );

    /* Load file wiht mesh data */
    frame->GetCanvas()->LoadLWO( wxT("penguin.lwo") );

    /* Show the frame */
    frame->Show(true);

    return true;
}