How to Place a wxStaticBitmap into a wxStatusBar

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
ColleenKobe
Experienced Solver
Experienced Solver
Posts: 88
Joined: Mon Aug 31, 2015 3:47 pm

How to Place a wxStaticBitmap into a wxStatusBar

Post by ColleenKobe » Tue Aug 28, 2018 8:08 pm

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 318 times

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2438
Joined: Sun Jan 03, 2010 5:45 pm

Re: How to Place a wxStaticBitmap into a wxStatusBar

Post by PB » Tue Aug 28, 2018 8:32 pm

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.

catalin
Moderator
Moderator
Posts: 1574
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: How to Place a wxStaticBitmap into a wxStatusBar

Post by catalin » Tue Aug 28, 2018 8:42 pm

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.

Post Reply