PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: James Zukowski on March 10, 2022, 09:04:51 AM

Title: Picture in TitleBar
Post by: James Zukowski on March 10, 2022, 09:04:51 AM
We've got a TitleBar doing pretty much what we want: multi_lines in different positions, etc. But we have a picture that we want centered left/right in the bar, and it's not happening. It doesn't move relative to the left edge. Are we missing something?
Thanks!
Title: Re: Picture in TitleBar
Post by: Jane Raymond on March 10, 2022, 03:32:15 PM
To get an image centered in the toolbar, I did two things:
1. For the image, I defined the Image Format to be Centered (preserve aspect ratio)
2. I set Panel Sizing to Resizable/Custom, and set the image control have Stretch sizing.
Title: Re: Picture in TitleBar
Post by: James Zukowski on March 11, 2022, 04:37:48 PM
I hope we're talking about the same thing: I'm referring to a Custom TitleBar; you mentioned ToolBar. We had started trying to use an embedded panel, but stretching did all directions, not just horizontally, which is what we want.

I've tried setting the PX_TITLEBARHDR_TEXT element to the picture we want, stretched it to the margins, and set it to "Centered (preserve aspect ratio)", but it doesn't seem to want to be repositioned.

We're currently using PxPlus 2018 (v15.10) with WindX on Linux.
Title: Re: Picture in TitleBar
Post by: Jane Raymond on March 11, 2022, 06:28:36 PM
Sorry, I did mean titlebar, not toolbar.
How is the panel sizing set? And how is the resizing for the image set?
Title: Re: Picture in TitleBar
Post by: Jane Raymond on March 14, 2022, 09:16:55 AM
Attached is an exported library text file titlebar.txt that you can import to a new library.
It contains a titlebar with a centered image.
Title: Re: Picture in TitleBar
Post by: James Zukowski on March 16, 2022, 10:53:54 AM
THANK YOU for that sample. I stopped trying to get ours to work, and just ported the controls we needed into yours, and all is well.
Not sure what the problem was, but too much else going on to try and figure it out now.