How to draw a image in wxStatusBar? Topic is solved
How to draw a image in wxStatusBar?
How to draw a image in wxStatusBar?
-
- wxWorld Domination!
- Posts: 1471
- Joined: Tue Nov 14, 2006 7:58 am
- Location: Saint-Petersburg, Russia
Hi,
another way - use wxStaticBitmap inside status bar. Anything like this:
another way - use wxStaticBitmap inside status bar. Anything like this:
Code: Select all
// in the frame ctor
m_bitmap_status = 0;
...
wxStatusBar *sbar = CreateStatusBar(3, wxST_SIZEGRIP);
int widths[] = {-1, 200, 220};
sbar->SetStatusWidths(3, widths);
m_bitmap_status = new wxStaticBitmap(sbar, -1, wxBITMAP(IDC_BMP_ERROR));
...
// OnSize event handler
{
wxStatusBar* sbar = GetStatusBar();
if( sbar && m_bitmap_status )
{
wxRect r;
sbar->GetFieldRect(2, r);
m_bitmap_status->Move(r.x+r.width, r.y+(r.height-16)/2);
}
ev.Skip();
}
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10