本文整理汇总了C++中MyFrame类的典型用法代码示例。如果您正苦于以下问题:C++ MyFrame类的具体用法?C++ MyFrame怎么用?C++ MyFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MyFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: MyFrame
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame(L"发票凑整", wxPoint(-1, -1), wxSize(-1, -1));
frame->SetMinSize(wxSize(640, 480));
frame->Show(true);
return true;
}
开发者ID:sagaxu,项目名称:xcalc,代码行数:7,代码来源:main.cpp
示例2: MyFrame
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;
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:26,代码来源:printing.cpp
示例3: MyFrame
bool MyApp::OnInit()
{
if ( !wxApp::OnInit() ) return false;
MyFrame *frame = new MyFrame(_T("coLinux Console"));
frame->Show(true);
return true;
}
开发者ID:matt81093,项目名称:Original-Colinux,代码行数:7,代码来源:main.cpp
示例4: wxBitmap
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;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:60,代码来源:dragimag.cpp
示例5: MyFrame
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;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:32,代码来源:nativdlg.cpp
示例6: printf
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;
}
开发者ID:ifwe,项目名称:wxpy,代码行数:27,代码来源:wxtest.cpp
示例7: MyFrame
// `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;
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:26,代码来源:penguin.cpp
示例8: wxInitAllImageHandlers
bool BasicApplication::OnInit(){
wxInitAllImageHandlers();
MyFrame *frame = new MyFrame(_T("Basic Frame"), 50, 50, 1024, 768);
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
开发者ID:sentinelweb,项目名称:masters,代码行数:7,代码来源:window.cpp
示例9: MyFrame
// `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;
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:36,代码来源:nettest.cpp
示例10: MyFrame
// '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;
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:26,代码来源:display.cpp
示例11: OnInit
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;
}
开发者ID:jimzshi,项目名称:game,代码行数:7,代码来源:main.cpp
示例12: MyFrame
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame("Hello World", wxPoint(50, 50), wxSize(450, 340));
frame->Show(true);
return true;
}
开发者ID:cknolla,项目名称:wxWidgetSandbox,代码行数:7,代码来源:main.cpp
示例13: wxSimpleHelpProvider
// '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
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:31,代码来源:accesstest.cpp
示例14: MyFrame
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( NULL, -1, wxT("Minimal"), wxPoint(20,20), wxSize(500,340) );
frame->Show( TRUE );
return TRUE;
}
开发者ID:Dovedanhan,项目名称:wxPython-In-Action,代码行数:7,代码来源:minimal.cpp
示例15: MyFrame
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( _T("Hello World"), wxPoint(50,50), wxSize(450,340) );
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
开发者ID:wjlroe,项目名称:experiments,代码行数:7,代码来源:wxwidgets.cpp
示例16: sprintf_s
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;
}
开发者ID:gfordyce,项目名称:stan,代码行数:29,代码来源:wx_app.cpp
示例17: MyFrame
bool MyApp::OnInit()
{
MyFrame * frame = new MyFrame(wxT("APPLICATION"));
frame->Show();
return true;;
}
开发者ID:robinskumar73,项目名称:tarun_zimmerman-,代码行数:7,代码来源:Main.cpp
示例18: MyFrame
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( _("Hello World"), wxPoint(50, 50), wxSize(500, 500) );
frame->Show(true);
SetTopWindow(frame);
return true;
}
开发者ID:danzeeeman,项目名称:robocon_summer_project_2013,代码行数:7,代码来源:main.cpp
示例19: MyFrame
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
}
开发者ID:spider69,项目名称:wxWidgetProjects,代码行数:8,代码来源:MyApp.cpp
示例20: MyFrame
// '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;
}
开发者ID:MarkMa1990,项目名称:wxwidgets,代码行数:9,代码来源:ce_wx_tcp_server.cpp
注:本文中的MyFrame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论