Page 1 of 1
wxBitmapButton with text
Posted: Wed May 09, 2007 5:01 am
How could I load a text in the wxBitmapButton for i am having a problem on how to put a text value like "enter" or "submit" on top of the image in the button...
Thanks in advanced..............
Posted: Wed May 09, 2007 5:06 am
Posted: Wed May 09, 2007 5:08 am
Draw your text on a bitmap using wxMemoryDC. In the controls sample you will find a complete code. It looks like
Code: Select all
wxBitmap bitmap( 100, 100 );
dc.SelectObject( bitmap );
dc.DrawEllipse(5, 5, 90, 90);
dc.DrawText(_T("Bitmap"), 30, 40);
dc.SelectObject( wxNullBitmap );
(void)new wxBitmapButton(panel, ID_BITMAP_BTN, bitmap, wxPoint(100, 20));
Edit: Use wxDC::DrawBitmap to draw your own bitmap on the wxMemoryDC's bitmap.
Posted: Wed May 09, 2007 9:19 am
You should never be using Bitmap Buttons with labels, especially if they do not add meaning to the buttons.
See the Vista UX guidelines: http://msdn.microsoft.com/library/defau ... e/home.asp
Posted: Thu May 10, 2007 3:12 am
thanks to both of u.....thank so much.....