本文整理汇总了C++中MyFrame::GetToolbar方法的典型用法代码示例。如果您正苦于以下问题:C++ MyFrame::GetToolbar方法的具体用法?C++ MyFrame::GetToolbar怎么用?C++ MyFrame::GetToolbar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyFrame
的用法示例。
在下文中一共展示了MyFrame::GetToolbar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInit
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit()
{
hardSettings.OnStart();
cgSettings.SetDefaults(); // <-- quick hack (solves wrong constructor order):
//if (!wxApp::OnInit()) return false;
// questo per caricare salvare PNG...
wxImage::AddHandler(new wxPNGHandler);
wxImage::AddHandler(new wxJPEGHandler);
// Create the main frame window
MyFrame *frame = new MyFrame(NULL, wxT("QuteMol"),
// wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE //wxRESIZE_BORDER
#ifdef __DARWIN__
wxDefaultPosition, wxDefaultSize,wxDEFAULT_FRAME_STYLE| wxRESIZE_BORDER
#else
wxDefaultPosition, wxDefaultSize,wxRESIZE_BORDER
#endif
);
/* Make a menubar */
/*
// ...or, maybe NOT
wxMenu *fileMenu = new wxMenu;
fileMenu->Append(wxID_EXIT, wxT("E&xit"));
fileMenu->Append(wxID_ABOUT, wxT("A&bout"));
fileMenu->Append(wxID_OPEN, wxT("O&pen"));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, wxT("&File"));
frame->SetMenuBar(menuBar);
*/
frame->SetCanvas(
new TestGLCanvas(
frame, wxID_ANY, wxPoint(0,0), wxSize( winx, winy ), wxNO_BORDER //wxSUNKEN_BORDER
)
);
// onle TestGLCanvas to process idles...
wxIdleEvent::SetMode(wxIDLE_PROCESS_SPECIFIED);
frame->SetExtraStyle(wxWS_EX_PROCESS_IDLE );
MyTab::frame2redraw=frame->GetCanvas();
frame->SetToolbar(
new MyToolbar(
frame, wxID_ANY, wxPoint(winx,0), wxDefaultSize,
// wxNO_BORDER //wxSUNKEN_BORDER
wxDEFAULT_FRAME_STYLE
|
// wxNO_FULL_REPAINT_ON_RESIZE |
wxCLIP_CHILDREN |
wxTAB_TRAVERSAL
)
);
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(frame->GetCanvas(), 1, wxGROW|wxSHAPED);
sizer->Add(frame->GetToolbar(), 0, wxGROW);
frame->SetSizer(sizer);
int tbsize=frame->GetToolbar()->GetBestFittingSize().x;
frame->GetToolbar()->SetSize(tbsize,winy);
frame->GetToolbar()->Layout();
//frame->SetMinSize(wxSize(tbsize+200,200));
frame->SetClientSize(wxSize(winx+tbsize,winy));
static const wxCmdLineEntryDesc cmdLineDesc[] =
{
{
wxCMD_LINE_PARAM,_T(""),_T(""),_T("filename.pdb:(molecule to be drawn)"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_OPTION,_T("a"),_T(""),_T("filename.art: optional Atom Render Table"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_SWITCH,_T("v"),_T(""),_T("don't start, show version name"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{ wxCMD_LINE_NONE }
};
wxCmdLineParser parser(cmdLineDesc, argc, argv);
parser.Parse();
InitQuteMol( NULL );
wxString artFilename;
if (parser.Found(_T("v"))>0) {
//.........这里部分代码省略.........