1. added code to dyntbar to allow bitmap loading from windows resources
2. modified fl_demo sample to use bitmaps in windows resource to allow run-from-anywhere behaviour under windows. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -145,6 +145,26 @@ void wxDynamicToolBar::AddTool( int toolIndex,
|
||||
|
||||
AddTool( toolIndex, pBtn );
|
||||
}
|
||||
void wxDynamicToolBar::AddTool( int toolIndex, wxBitmap labelBmp,
|
||||
const wxString& labelText, bool alignTextRight,
|
||||
bool isFlat )
|
||||
{
|
||||
wxNewBitmapButton* pBtn =
|
||||
|
||||
new wxNewBitmapButton( labelBmp,
|
||||
labelText,
|
||||
( alignTextRight )
|
||||
? NB_ALIGN_TEXT_RIGHT
|
||||
: NB_ALIGN_TEXT_BOTTOM,
|
||||
isFlat
|
||||
);
|
||||
|
||||
pBtn->Create( this, toolIndex );
|
||||
|
||||
pBtn->Reshape();
|
||||
|
||||
AddTool( toolIndex, pBtn );
|
||||
}
|
||||
|
||||
|
||||
wxToolBarTool*
|
||||
|
@@ -120,6 +120,9 @@ public:
|
||||
int imageFileType = wxBITMAP_TYPE_BMP,
|
||||
const wxString& labelText = "", bool alignTextRight = FALSE,
|
||||
bool isFlat = TRUE );
|
||||
virtual void AddTool( int toolIndex, wxBitmap labelBmp,
|
||||
const wxString& labelText = "", bool alignTextRight = FALSE,
|
||||
bool isFlat = TRUE );
|
||||
|
||||
// method from wxToolBarBase (for compatibility), only
|
||||
// first two arguments are valid
|
||||
|
Reference in New Issue
Block a user