本文整理汇总了C++中MyFrame::Centre方法的典型用法代码示例。如果您正苦于以下问题:C++ MyFrame::Centre方法的具体用法?C++ MyFrame::Centre怎么用?C++ MyFrame::Centre使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyFrame
的用法示例。
在下文中一共展示了MyFrame::Centre方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInit
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;
}
示例2: OnInit
//.........这里部分代码省略.........
file_menu->Append(wxID_ANY,_T("&Entry dialogs"),entry_menu);
#endif // wxUSE_TEXTDLG || wxUSE_NUMBERDLG
#if wxUSE_FILEDLG
wxMenu *filedlg_menu = new wxMenu;
filedlg_menu->Append(DIALOGS_FILE_OPEN, _T("&Open file\tCtrl-O"));
filedlg_menu->Append(DIALOGS_FILE_OPEN2, _T("&Second open file\tCtrl-2"));
filedlg_menu->Append(DIALOGS_FILES_OPEN, _T("Open &files\tCtrl-Q"));
filedlg_menu->Append(DIALOGS_FILE_SAVE, _T("Sa&ve file\tCtrl-S"));
#if USE_FILEDLG_GENERIC
filedlg_menu->AppendSeparator();
filedlg_menu->Append(DIALOGS_FILE_OPEN_GENERIC, _T("&Open file (generic)"));
filedlg_menu->Append(DIALOGS_FILES_OPEN_GENERIC, _T("Open &files (generic)"));
filedlg_menu->Append(DIALOGS_FILE_SAVE_GENERIC, _T("Sa&ve file (generic)"));
#endif // USE_FILEDLG_GENERIC
file_menu->Append(wxID_ANY,_T("&File operations"),filedlg_menu);
#endif // wxUSE_FILEDLG
#if wxUSE_DIRDLG
wxMenu *dir_menu = new wxMenu;
dir_menu->Append(DIALOGS_DIR_CHOOSE, _T("&Choose a directory\tCtrl-D"));
dir_menu->Append(DIALOGS_DIRNEW_CHOOSE, _T("Choose a directory (with \"Ne&w\" button)\tShift-Ctrl-D"));
file_menu->Append(wxID_ANY,_T("&Directory operations"),dir_menu);
#if USE_DIRDLG_GENERIC
dir_menu->AppendSeparator();
dir_menu->Append(DIALOGS_GENERIC_DIR_CHOOSE, _T("&Choose a directory (generic)"));
#endif // USE_DIRDLG_GENERIC
#endif // wxUSE_DIRDLG
#if wxUSE_STARTUP_TIPS || wxUSE_PROGRESSDLG || wxUSE_BUSYINFO || wxUSE_LOG_DIALOG
wxMenu *info_menu = new wxMenu;
#if wxUSE_STARTUP_TIPS
info_menu->Append(DIALOGS_TIP, _T("&Tip of the day\tCtrl-T"));
#endif // wxUSE_STARTUP_TIPS
#if wxUSE_PROGRESSDLG
info_menu->Append(DIALOGS_PROGRESS, _T("Pro&gress dialog\tCtrl-G"));
#endif // wxUSE_PROGRESSDLG
#if wxUSE_BUSYINFO
info_menu->Append(DIALOGS_BUSYINFO, _T("&Busy info dialog\tCtrl-B"));
#endif // wxUSE_BUSYINFO
#if wxUSE_LOG_DIALOG
info_menu->Append(DIALOGS_LOG_DIALOG, _T("&Log dialog\tCtrl-L"));
#endif // wxUSE_LOG_DIALOG
file_menu->Append(wxID_ANY,_T("&Informative dialogs"),info_menu);
#endif // wxUSE_STARTUP_TIPS || wxUSE_PROGRESSDLG || wxUSE_BUSYINFO || wxUSE_LOG_DIALOG
#if wxUSE_FINDREPLDLG
wxMenu *find_menu = new wxMenu;
find_menu->AppendCheckItem(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"));
find_menu->AppendCheckItem(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"));
file_menu->Append(wxID_ANY,_T("&Searching"),find_menu);
#endif // wxUSE_FINDREPLDLG
#if USE_MODAL_PRESENTATION
wxMenu *modal_menu = new wxMenu;
modal_menu->Append(DIALOGS_MODAL, _T("Mo&dal dialog\tCtrl-W"));
modal_menu->AppendCheckItem(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"));
file_menu->Append(wxID_ANY,_T("&Modal/Modeless"),modal_menu);
#endif // USE_MODAL_PRESENTATION
file_menu->Append(DIALOGS_PROPERTY_SHEET, _T("&Property Sheet Dialog\tCtrl-P"));
file_menu->Append(DIALOGS_REQUEST, _T("&Request user attention\tCtrl-R"));
file_menu->AppendSeparator();
file_menu->Append(wxID_EXIT, _T("E&xit\tAlt-X"));
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, _T("&File"));
frame->SetMenuBar(menu_bar);
myCanvas = new MyCanvas(frame);
myCanvas->SetBackgroundColour(*wxWHITE);
frame->Centre(wxBOTH);
// Show the frame
frame->Show(true);
SetTopWindow(frame);
return true;
}