Main Board > Nomads

change caption using titlebars

(1/3) > >>

Thomas Bock:
I encounter issues when changing the window caption while using titlebars.
As a fonted text with =px_titlebar_caption$ cannot be changed afterwards, I tried many different attribute settings with a multiline control. So far I could not find a satisfying solution. A multiline control always becomes visible if the user clicks and drags into it. The window cannot be moved, if the user clicks on the multiline control.
What is the best practice to change the window caption using titlebars?

Jane Raymond:
Thomas,
Changing the caption of a panel is the same with or without a title bar:
PRINT 'CAPTION'("New Title"),

Thomas Bock:
Yes, that still changes the window title, but it is not visible any more using titlebars.
I just did a quick test with PxPlus V14:
Button 1 does: print 'caption'(dte(0:"%Hz%mz%sz")),
Button 2 does: multi_line read 0,_$;msgbox _$, px_titlebar_caption$

While the window title is technically changed, the associated variable px_titlebar_caption$ remains the unchanged. That requires own logic for the visibility of the title change.
Is this the intended behavior?

Jane Raymond:
Thomas,
The title on the titlebar is displayed using a fonted text control called PX_TITLEBAR_CAPTION. You can change the panel title using:
PRINT 'CAPTION'(dte(0:"%Hz%mz%sz")),


Do not use a multi-line. We have an internal variable called PX_TITLEBAR_CAPTION$ that we manipulate when the title bar is changed with the PRINT 'CAPTION'() mnemonic.


The concept is that your old code which would have changed the window caption with a PRINT 'CAPTION'() still works with a title bar.

Thomas Bock:
Thank you Jane. Now it works.
I didn't notice to name the control "px_titlebar_caption". I only aasigned that variable as an expression.

Navigation

[0] Message Index

[#] Next page

Go to full version