Page 1 of 1

How to Place a wxStaticBitmap into a wxStatusBar

Posted: Tue Aug 28, 2018 8:08 pm
by ColleenKobe
I am looking at the sample program that came with wxWidgets called statbar (see below). Part of the executable of statbar shows a wxStatusBar bar containing a checkbox, a bitmap, and text.
statbar.cpp
Original wxWidgets Sample file statbar.cpp
(30.58 KiB) Downloaded 15 times
My question is, how do the checkbox, bitmap, and text get loaded into the fields of the status box? What procedure calls do that?

I read the wxStatusBar Class Reference page http://docs.wxwidgets.org/3.0/classwx_status_bar.html, looking for a procedure or method called "LoadObject" or LoadBitmap" or something. Fail. I don't know what text I should be looking for.

Thanks!

Colleen
wxStatusBar_Shot.jpg
How do they get there?
wxStatusBar_Shot.jpg (29.01 KiB) Viewed 320 times

Re: How to Place a wxStaticBitmap into a wxStatusBar

Posted: Tue Aug 28, 2018 8:32 pm
by PB
Check the statbar sample. In particular look for "m_statbmp" there.

Basically, as is said in the remark in the docs you linked, you create the controls as children of the status bar and need to position them by yourself in the size event handler.

Re: How to Place a wxStaticBitmap into a wxStatusBar

Posted: Tue Aug 28, 2018 8:42 pm
by catalin
ColleenKobe wrote:I am looking at the sample program that came with wxWidgets called statbar (see below)
statbar.cpp
Please don't add unnecessary attachments.
If you are able to look at it, everybody else should be able to do it as well. If you want to make it easier for them share a link to the same file in a github repository for example.
ColleenKobe wrote:how do the checkbox, bitmap, and text get loaded into the fields of the status box?
They are not loaded, they are created as children of the statusbar. You have the source, it's all there, just take the time to read it.