本文整理汇总了C++中MainFrame类的典型用法代码示例。如果您正苦于以下问题:C++ MainFrame类的具体用法?C++ MainFrame怎么用?C++ MainFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MainFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MainFrame
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;
}
示例2: OnDropFiles
bool DnDFile::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
{
MainFrame * frame = (MainFrame *)parent;
frame->ChangeFile(filenames[0]);
return true;
}
示例3: Run
int App::Run(LPCTSTR /*lpstrCmdLine*/, int nCmdShow)
{
if (!ParseCommandLine())
return 0;
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
MainFrame wndMain;
if (!m_cszFilename.IsEmpty())
wndMain.OpenFileAtStart(m_cszFilename);
if (wndMain.CreateEx() == nullptr)
{
ATLTRACE(_T("Main window creation failed!\n"));
return 0;
}
wndMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例4: WXUNUSED
// Overrides
bool PowerTabTuningView::OnCreate(wxDocument* doc, long flags)
{
//------Last Checked------//
// - Dec 30, 2004
WXUNUSED(flags);
MainFrame* mainFrame = GetMainFrame();
wxCHECK(mainFrame != NULL, false);
m_frame = mainFrame->CreateChildFrame(doc, this);
wxCHECK(m_frame != NULL, false);
m_window = CreateViewWindow();
wxCHECK(m_window != NULL, false);
#ifdef __X__
// X seems to require a forced resize
int x, y;
m_frame->GetSize(&x, &y);
m_frame->SetSize(-1, -1, x, y);
#endif
m_frame->Show(true);
Activate(true);
return (true);
}
示例5: WXUNUSED
// Overrides
bool PowerTabView::OnCreate(wxDocument *doc, long flags)
{
//------Last Checked------//
// - Jan 27, 2005
WXUNUSED(flags);
MainFrame* mainFrame = GetMainFrame();
wxCHECK(mainFrame != NULL, false);
m_frame = mainFrame->CreateChildFrame(doc, this);
wxCHECK(m_frame != NULL, false);
m_frame->SetTitle(wxT("PowerTabView"));
m_canvas = CreateCanvas(this, m_frame);
wxCHECK(m_canvas != NULL, false);
#ifdef __X__
// X seems to require a forced resize
int x, y;
m_frame->GetSize(&x, &y);
m_frame->SetSize(-1, -1, x, y);
#endif
m_frame->Show(true);
Activate(true);
return (true);
}
示例6: MainFrame
bool MyApp::OnInit()
{
MainFrame *frame = new MainFrame(NULL);
frame->SetIcon(wxICON(datcom)); // To Set App Icon
frame->Show();
return true;
}
示例7: WinMain
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int nCmdShow)
#endif
{
CPaintManagerUI::SetInstance(hInstance);
#if defined(WIN32) && !defined(UNDER_CE)
HRESULT Hr = ::CoInitialize(NULL);
#else
HRESULT Hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif
if( FAILED(Hr) ) return 0;
MainFrame* pFrame = new MainFrame();
if( pFrame == NULL ) return 0;
#if defined(WIN32) && !defined(UNDER_CE)
pFrame->Create(NULL, _T("Çý¶¯Ð¶ÔسÌÐò"), UI_WNDSTYLE_FRAME, WS_EX_STATICEDGE | WS_EX_APPWINDOW, 0, 0, 600, 800);
#else
pFrame->Create(NULL, _T("Çý¶¯Ð¶ÔسÌÐò"), UI_WNDSTYLE_FRAME, WS_EX_TOPMOST, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
#endif
pFrame->CenterWindow();
::ShowWindow(*pFrame, SW_SHOW);
CPaintManagerUI::MessageLoop();
return 0;
}
示例8: SetVendorName
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;
}
示例9: MainFrame
bool YmgyrchApp::OnInit()
{
MainFrame *frame = new MainFrame(0);
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
示例10: Enable3dControls
BOOL WindowsApp::InitInstance()
{
// Standard initialization
#if _MFC_VER < 0x0700
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
#endif
// Change the registry key under which our settings are stored.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
// Qt initialization
QMfcApp::instance(this);
MainFrame* pFrame = new MainFrame;
m_pMainWnd = pFrame;
// create and load the frame with its resources
pFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
return true;
}
示例11: MainFrame
/**
* @return bool
*/
bool MainApp::OnInit()
{
MainFrame* mainFrame = new MainFrame(_T("EGF Editor"));
mainFrame->Show();
return true;
}
示例12: xsProperty
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;
}
示例13: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainFrame w;
w.show();
return a.exec();
}
示例14: WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE,
LPSTR lpCmdLine, int nShowCmd)
{
kMainAccel = NULL;
InitCommonControls();
kInstance = hInstance;
MainFrame::Register();
MainFrame *frame = new MainFrame(lpCmdLine);
frame->Create("DKC2 Editor", 128, 128, 512, 512, NULL);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
//if (!kMainAccel || !TranslateAccelerator(frame->GetHWND(), kMainAccel, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
//}
}
delete frame;
_CrtDumpMemoryLeaks();
return msg.wParam;
}
示例15: wxInitAllImageHandlers
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;
};