本文整理汇总了C++中MainFrame::Show方法的典型用法代码示例。如果您正苦于以下问题:C++ MainFrame::Show方法的具体用法?C++ MainFrame::Show怎么用?C++ MainFrame::Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainFrame
的用法示例。
在下文中一共展示了MainFrame::Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInit
bool YmgyrchApp::OnInit()
{
MainFrame *frame = new MainFrame(0);
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
示例2: main
// int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) {
int main() {
try {
DesignerApplication app;
MainFrame frame;
frame.Create(L"wcl Designer", WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS, CW_USEDEFAULT, CW_USEDEFAULT, 400, 300, NULL, NULL);
frame.Show(SW_NORMAL);
return app.Run();
} catch (const wcl::Exception &e) {
MessageBoxA(NULL, e.what(), "Designer - Windows Exception", MB_OK|MB_ICONERROR);
return 1;
} catch (const std::exception &e) {
MessageBoxA(NULL, e.what(), "Designer - C++ Exception", MB_OK|MB_ICONERROR);
return 2;
} catch (...) {
MessageBoxA(NULL, "Unknown fatal error", "Designer - C++ Exception", MB_OK|MB_ICONERROR);
return 3;
}
}
示例3: parser
bool sQ1App::OnInit()
{
sq1::InitVariables();
// open CAN channel:
if (!sq1::OpenCAN())
return false;
sq1::DriveReset();
sq1::DriveInit();
wxInitAllImageHandlers();
int width = 285;
int height = 540;
MainFrame *pFrame = new MainFrame(wxT("sQ1 Control Panel"), width, height);
wxCmdLineParser parser(argc, argv);
OnInitCmdLine(parser);
parser.Parse();
OnCmdLineParsed(parser);
pFrame->Show(true);
SetTopWindow(pFrame);
Connect( wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(sQ1App::OnIdle) );
return true;
};
示例4: OnInit
/**
* @return bool
*/
bool MainApp::OnInit()
{
MainFrame* mainFrame = new MainFrame(_T("EGF Editor"));
mainFrame->Show();
return true;
}
示例5: OnInit
bool App::OnInit() {
SetAppName(u8"flutterrust");
SetAppDisplayName(u8"flutterrust");
const wxFileName exeFileName{wxStandardPaths::Get().GetExecutablePath()};
const std::string exePath = exeFileName.GetPath().ToStdString();
try {
Creature::loadTypes(exePath + static_cast<char>(wxFileName::GetPathSeparator()) +
u8"CreatureTable.txt");
mainFrame = new MainFrame{exePath};
} catch (const std::exception& e) {
wxMessageDialog dialog{nullptr, u8"Exception caught. Terminating.\n",
u8"Fatal error", wxICON_ERROR | wxOK};
dialog.SetExtendedMessage(std::string{typeid(e).name()} + ": \"" + e.what() + '"');
dialog.ShowModal();
return false; // Exit the application immediately.
} catch (...) {
wxMessageDialog(nullptr, u8"Unknown exception caught. Terminating.",
u8"Fatal error", wxICON_ERROR | wxOK)
.ShowModal();
return false;
}
mainFrame->Show(true);
SetTopWindow(mainFrame);
return true; // Continue processing.
}
示例6: OnInit
bool App::OnInit()
{
SetAppName(u8"TrackHack");
SetAppDisplayName(u8"TrackHack");
wxFileName localFileName = wxFileConfig::GetLocalFile("track_hack.ini",
wxCONFIG_USE_SUBDIR);
if (!localFileName.FileExists() && // Does the user-specific configuration file exist?
!localFileName.DirExists()) // If not, does the directory where it would have
// been not exist either?
{
// Create that directory.
bool success = wxFileName::Mkdir(localFileName.GetPath(), wxS_DIR_DEFAULT,
wxPATH_MKDIR_FULL);
if (!success) { // Assert success in creating it; otherwise terminate.
::wxLogFatalError("Failed to create local configuration directory: "
"%s\n\nTerminating.", localFileName.GetPath());
}
}
wxConfigBase::Set(new wxFileConfig{u8"TrackHack", wxEmptyString, u8"track_hack.ini",
u8"track_hack.ini", wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE |
wxCONFIG_USE_SUBDIR});
// No wxInitAllImageHandlers() as for now, only the BMP/DIB file format is supported.
mainFrame = new MainFrame(wxDefaultPosition, wxSize(640, 720));
mainFrame->Show(true);
SetTopWindow(mainFrame);
return true;
}
示例7: OnInit
bool SettingsSampleApp::OnInit()
{
// load application settings if the configuration file exists, otherwise default
// values are used
// initialize serializer
m_XmlIO.SetSerializerOwner(wxT("StaticSettingsSampleApp"));
m_XmlIO.SetSerializerRootName(wxT("settings"));
m_XmlIO.SetSerializerVersion(wxT("1.0.0"));
// tell the serializer's root node it should serialize static 'Settings' class instance as a
// standard property (the 'Settings' class instance is not created at the runtime, only its
// properties are serialized).
m_XmlIO.GetRootItem()->AddProperty(new xsProperty(&m_Settings, wxT("serializablestatic"), wxT("app_settings")));
if( wxFileExists(wxT("settings.xml")) )
{ // load settings from configuration file
m_XmlIO.DeserializeFromXml(wxT("settings.xml"));
}
// create and show main application frame
MainFrame *frame = new MainFrame(NULL);
SetTopWindow(frame);
frame->Show();
return true;
}
示例8: OnInit
bool PRIMEServer::OnInit()
{
#ifdef _DEBUG
Utilities::SetStdOutToNewConsole();
#endif
PRIME::Reply a;
m_frame = new MainFrame( (wxFrame *)NULL , -1, wxString::FromUTF8("FLOW Server") );
m_frame->SetIcon(wxICON(FLOW));
m_frame->Show( true );
a.set_type(PRIME::Reply_ReplyType_SPEED_TEST);
int size = a.ByteSize();
m_frame->log(wxString::Format("Size %d", size));
wxString str;
str.Format("%d",wxThread::GetCPUCount());
m_frame->log(str);
//printf("\nValue %d\n", a.type());
if(wxSocketBase::Initialize()){
wxString t;
t = wxString::Format("%d",a.type());
wxString s(wxT("Socket Base Initialized\n"+t));
m_frame->log(s);
} else {
//m_frame->C3OOutputText->AppendText(wxT("Socket Base NOT Initialized... Exiting!\n"));
}
return true;
}
示例9: OnInit
bool CustomDataSampleApp::OnInit()
{
// load application settings if the configuration file exists, otherwise create new
// settings class object with default values
// initialize serializer
m_XmlIO.SetSerializerOwner(wxT("CustomDataSampleApp"));
m_XmlIO.SetSerializerRootName(wxT("settings"));
m_XmlIO.SetSerializerVersion(wxT("1.0.0"));
// register new property I/O handler 'xsColourDataPropIO' for data type with name 'colourdata'
XS_REGISTER_IO_HANDLER(wxT("colourdata"), xsColourDataPropIO);
// create serialized settings class object manualy with default values
m_pSettings = new Settings();
// insert settings class object into serializer as its root node
m_XmlIO.SetRootItem(m_pSettings);
if( wxFileExists(wxT("settings.xml")) )
{ // load settings from configuration file
m_XmlIO.DeserializeFromXml(wxT("settings.xml"));
}
// create and show main application frame
MainFrame *frame = new MainFrame(NULL);
SetTopWindow(frame);
frame->Show();
return true;
}
示例10: OnInit
bool App::OnInit()
{
bool ok = wxApp::OnInit();
if (ok)
{
wxLocaleHelper::Init(&m_locale, STE_APPNAME, m_cmdLine.m_lang);
::wxInitAllImageHandlers();
// Fill in the application information fields before creating wxConfig.
SetVendorName(wxT("wxWidgets"));
SetAppName(APP_NAME_SHORT);
#if (wxVERSION_NUMBER >= 2900)
SetAppDisplayName(APP_NAME_DISPLAY);
#endif
// Create a document manager
wxDocManager* docManager = CreateDocManager();
// create the main frame window
MainFrame* frame = new MainFrame();
ok = frame->Create(docManager, GetAppDisplayName());
if (ok)
{
frame->Show();
OpenDocuments(docManager);
}
else
{
delete frame;
}
}
return ok;
}
示例11: OnInit
bool MyApp::OnInit()
{
#ifdef __LINUX__
setlocale (LC_ALL,"POSIX");
#endif
register_all_file_formats();
#if GILVIEWER_USE_GDAL
OGRRegisterAll();
#endif // GILVIEWER_USE_GDAL
try
{
if ( InitFrame() )
m_mainFrameDock->Show();
else
exit(0);
}
catch( std::exception &e )
{
wxString message;
message << wxString(e.what(), *wxConvCurrent);
wxMessageBox( message );
}
catch( ... )
{
wxMessageBox( _("Unhandled exception ...") );
}
return true;
}
示例12: OnInit
bool TimeApp::OnInit(){
MainFrame* m = new MainFrame(NULL);
m->Show(true);
return true;
}
示例13: OnInit
bool MyApp::OnInit()
{
MainFrame *frame = new MainFrame(NULL);
frame->SetIcon(wxICON(datcom)); // To Set App Icon
frame->Show();
return true;
}
示例14: OnInit
// `Main program' equivalent, creating windows and returning main app frame
bool wxOsgApp::OnInit()
{
if (argc<2)
{
std::cout << wxString(argv[0]).mb_str() <<": requires filename argument." << std::endl;
return false;
}
int width = 800;
int height = 600;
// Create the main frame window
MainFrame *frame = new MainFrame(NULL, wxT("wxWidgets OSG Sample"),
wxDefaultPosition, wxSize(width, height));
// create osg canvas
// - initialize
int *attributes = new int[7];
attributes[0] = int(WX_GL_DOUBLEBUFFER);
attributes[1] = WX_GL_RGBA;
attributes[2] = WX_GL_DEPTH_SIZE;
attributes[3] = 8;
attributes[4] = WX_GL_STENCIL_SIZE;
attributes[5] = 8;
attributes[6] = 0;
OSGCanvas *canvas = new OSGCanvas(frame, wxID_ANY, wxDefaultPosition,
wxSize(width, height), wxSUNKEN_BORDER, wxT("osgviewerWX"), attributes);
GraphicsWindowWX* gw = new GraphicsWindowWX(canvas);
canvas->SetGraphicsWindow(gw);
osgViewer::Viewer *viewer = new osgViewer::Viewer;
viewer->getCamera()->setGraphicsContext(gw);
viewer->getCamera()->setViewport(0,0,width,height);
viewer->addEventHandler(new osgViewer::StatsHandler);
viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
// load the scene.
wxString fname(argv[1]);
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(std::string(fname.mb_str()));
if (!loadedModel)
{
std::cout << argv[0] <<": No data loaded." << std::endl;
return false;
}
viewer->setSceneData(loadedModel.get());
viewer->setCameraManipulator(new osgGA::TrackballManipulator);
frame->SetViewer(viewer);
/* Show the frame */
frame->Show(true);
return true;
}
示例15: OnInit
bool MyApp::OnInit()
{
frame = new MainFrame( NULL, wxID_ANY, _T("MP Processor"));//_T("Hello World"), wxPoint(50,50), wxSize(450,340) );
frame->setApp(this);
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}