wxToolBar problem
Posted: Mon Dec 29, 2008 6:03 am
В чем могут быть грабли? При создании тулбара последний растягивается на всю ширину окна. Но при изменении размера тулбар свой не меняет.
Вот код:
wxToolBar* CMainFrame::CreateToolBar()
{
wxToolBar* toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_NODIVIDER | wxTB_FLAT );
toolBar->SetToolBitmapSize( wxSize( 22, 22 ) );
toolBar->AddTool( wxID_NEW, wxT( "New" ), wxBitmap( wxImage( wxT( "document-new22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "New Scene" ) );
toolBar->AddTool( wxID_OPEN, wxT( "Open" ), wxBitmap( wxImage( wxT( "document-open22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Open Scene" ) );
toolBar->AddTool( wxID_SAVE, wxT( "Save" ), wxBitmap( wxImage( wxT( "document-save22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Save Scene" ) );
toolBar->AddTool( wxID_SAVEAS, wxT( "Save As..." ), wxBitmap( wxImage( wxT( "document-save-as22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Save Scene As" ) );
toolBar->AddSeparator();
toolBar->AddTool( wxID_EDIT_MOVE, wxT( "Move" ), wxBitmap( wxImage( wxT( "transform-move22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Select and Move" ) );
toolBar->AddTool( wxID_EDIT_ROTATE, wxT( "Rotate" ), wxBitmap( wxImage( wxT( "transform-rotate22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Select and Rotate" ) );
toolBar->AddTool( wxID_EDIT_SCALE, wxT( "Scale" ), wxBitmap( wxImage( wxT( "transform-scale22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Select and Scale" ) );
toolBar->AddSeparator();
toolBar->AddTool( wxID_ABOUT, wxT( "About..." ), wxBitmap( wxImage( wxT( "help-about22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Show about dialog" ) );
toolBar->Realize();
return toolBar;
}
Вот код:
wxToolBar* CMainFrame::CreateToolBar()
{
wxToolBar* toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_NODIVIDER | wxTB_FLAT );
toolBar->SetToolBitmapSize( wxSize( 22, 22 ) );
toolBar->AddTool( wxID_NEW, wxT( "New" ), wxBitmap( wxImage( wxT( "document-new22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "New Scene" ) );
toolBar->AddTool( wxID_OPEN, wxT( "Open" ), wxBitmap( wxImage( wxT( "document-open22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Open Scene" ) );
toolBar->AddTool( wxID_SAVE, wxT( "Save" ), wxBitmap( wxImage( wxT( "document-save22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Save Scene" ) );
toolBar->AddTool( wxID_SAVEAS, wxT( "Save As..." ), wxBitmap( wxImage( wxT( "document-save-as22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Save Scene As" ) );
toolBar->AddSeparator();
toolBar->AddTool( wxID_EDIT_MOVE, wxT( "Move" ), wxBitmap( wxImage( wxT( "transform-move22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Select and Move" ) );
toolBar->AddTool( wxID_EDIT_ROTATE, wxT( "Rotate" ), wxBitmap( wxImage( wxT( "transform-rotate22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Select and Rotate" ) );
toolBar->AddTool( wxID_EDIT_SCALE, wxT( "Scale" ), wxBitmap( wxImage( wxT( "transform-scale22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Select and Scale" ) );
toolBar->AddSeparator();
toolBar->AddTool( wxID_ABOUT, wxT( "About..." ), wxBitmap( wxImage( wxT( "help-about22.png" ), wxBITMAP_TYPE_PNG ) ), wxT( "Show about dialog" ) );
toolBar->Realize();
return toolBar;
}