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..............
wxBitmapButton with text Topic is solved
-
- Knows some wx things
- Posts: 29
- Joined: Wed May 09, 2007 1:01 am
- Location: Manila,Philippines
- Contact:
wxBitmapButton with text
What important in a problem is not the solution but the lessons you learned in finding the solution.
There is no control for this. You have to make your own!
see these threads
http://forums.wxwidgets.org/viewtopic.php?t=5172
http://forums.wxwidgets.org/viewtopic.php?t=13137
see these threads
http://forums.wxwidgets.org/viewtopic.php?t=5172
http://forums.wxwidgets.org/viewtopic.php?t=13137
-
- I live to help wx-kind
- Posts: 196
- Joined: Tue Dec 07, 2004 8:54 pm
- Location: Essen, Germany
Draw your text on a bitmap using wxMemoryDC. In the controls sample you will find a complete code. It looks like
Edit: Use wxDC::DrawBitmap to draw your own bitmap on the wxMemoryDC's bitmap.
Code: Select all
wxBitmap bitmap( 100, 100 );
wxMemoryDC dc;
dc.SelectObject( bitmap );
dc.SetBackground(*wxGREEN);
dc.SetPen(*wxRED_PEN);
dc.Clear();
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));
-
- Part Of The Furniture
- Posts: 1511
- Joined: Sun Jun 19, 2005 11:37 am
- Location: Singapore
- Contact:
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
Joel
See the Vista UX guidelines: http://msdn.microsoft.com/library/defau ... e/home.asp
Joel