From: Cyril on
Hello all,
I have a problem using wxStaticBitmap::SetBitmap, with C++, under Win XP
and WxWidgets 2.8.
These are samples of the code :

in the dialog constructor :
serviceStatusBitmap = new wxStaticBitmap(this, SERVICE_STATUS_BITMAP_ID,
wxNullBitmap);

in the do_layout() function (called from the constructor) :

wxBoxSizer* controlSizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticBoxSizer* serviceControlSizer = new
wxStaticBoxSizer(serviceControlSizer_staticbox, wxHORIZONTAL);
serviceControlSizer->Add(serviceStatusBitmap, 1,
wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
controlSizer->Add(serviceControlSizer, 1, wxEXPAND, 0);

regularly, I check the state of a Windows Service, so I do that :
serviceStatusBitmap->SetBitmap(*which); // which is a preloaded bitmap
selected according to the service status
serviceStatusBitmap->Update();

This code make a strange display : the old bitmap is displayed at the
right place (that is : centered), but the new one is displayed at 0,0.
I can make the old bitmap disappear adding this line :
serviceStatusBitmap->SetBitmap(wxNullBitmap);
before the last code snippet.

What's the matter ?

ps : I have a similar problem with a wxAnimateCtrl which is displayed
against the left side instead of being centered.

Thanks.

--
Cyril Delmas - D�veloppeur d'applications

Compagnie G�n�rale d'Imagerie Num�rique
55, route Jean Briaud
33693 M�rignac Cedex
France

T�l : +33 5 57 89 03 00 (standard)
T�l : +33 5 57 89 03 05 (direct)

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org