Window layout question

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
andrewc
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Sep 01, 2014 11:47 am

Window layout question

Post by andrewc »

All,

I currently have a main window which looks like this:

p1.png

I would like to add a logo in the top right, thus:

p2.png

The idea is to occupy both unused toolbar space and unused notebook space. I'm guessing it's not possible to do this with sizers. I have tried creating the logo window as a child of the frame itself, but this seems to mess up everything else—the main panel is screwed up and everything is in the top left corner. And if I create the logo window as a child of the main panel, I cannot move it on top of the toolbar—tried positioning it on creation and using Raise, but to no avail.

Any ideas for an easy way to achieve this layout? By the way, I'm not too bothered if the logo covers the toolbar or notebook tabs if the user resizes the window too small.

Windows 7 / 10 only.

Thanks,
Andrew
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Window layout question

Post by doublemax »

I don't think this is possible with wxWidgets methods.

In any case you'd have to split the logo into an upper and lower part and draw them separately.
Use the source, Luke!
andrewc
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Sep 01, 2014 11:47 am

Re: Window layout question

Post by andrewc »

OK, thanks. Pity, it would have looked great. I'm not keen on trying to split it, as I can imagine it would be a nightmare keeping the bits together in all situations.

Andrew
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Window layout question

Post by doublemax »

andrewc wrote: Thu May 23, 2019 8:47 am OK, thanks. Pity, it would have looked great. I'm not keen on trying to split it, as I can imagine it would be a nightmare keeping the bits together in all situations.

Andrew
Yes, indeed. However as you'd have the right edge of the frame as reference, it wouldn't be too bad.

I do have a vague idea how this could be done (Windows only), but i'll need some time for an experiment. If i get something that works, i let you know. ( No promises :) )
Use the source, Luke!
User avatar
T-Rex
Moderator
Moderator
Posts: 1248
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Re: Window layout question

Post by T-Rex »

I think that it should be possible with wxAUI art classes:
https://docs.wxwidgets.org/3.0/classwx_ ... r_art.html
https://docs.wxwidgets.org/3.0/classwx_aui_tab_art.html

But anyway will take some time to implement.
andrewc
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Sep 01, 2014 11:47 am

Re: Window layout question

Post by andrewc »

Thanks doublemax, thanks T-Rex.
Post Reply