Discussion:
XRC and Variable Expansion
'AliKet' via wx-users
2014-09-09 10:14:22 UTC
Permalink
Hello,

Here is the full statement from the xrc sample:
[[[
VARIABLE EXPANSION ISN'T IMPLEMENTED CURRENTLY. You can use variable
expansion in your XRC files. The steps to do this are:

(1)Enclose a variable inside a dollarsign and round brackets, like this:
dollarsign(version).

(2) Set the XmlResource flags to allow expansion of variables.

(3)Before you use that XML resource, inform the XmlResourceHandler what you
want that variable's value to be, via
wxResourceHandler::Get()->SetVariable( "version", "2.4.0")

Now, at runtime, the variable will be automatically replace by its value
before the control is constructed.

The number in the version at the bottom of this dialog is an example of
this expansion in action.

This is very handy for things like replacing the text in a wxStaticText,
since it is a much simpler way to make a wxStaticText be a proper size: by
creating it the proper size. This is in contrast to the alternative way of
having using some static non-variable value in your XRC, having XRC
construct it, then your application having code to change the text of it,
then your app getting its best size, then setting the statictext's size,
then laying out the dialog's sizer again, and other work.
]]]

As noted above : VARIABLE EXPANSION ISN'T IMPLEMENTED CURRENTLY !! (
understood )
My question is : When this feature will be implemented ?
BTW: I can't find a class named wxResourceHandler ?
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-09-09 14:07:05 UTC
Permalink
On Tue, 9 Sep 2014 03:14:22 -0700 (PDT) 'AliKet' via wx-users wrote:

Avwu> Here is the full statement from the xrc sample:
Avwu> [[[
Avwu> VARIABLE EXPANSION ISN'T IMPLEMENTED CURRENTLY. You can use variable
Avwu> expansion in your XRC files. The steps to do this are:
...
Avwu> ]]]
Avwu>
Avwu> As noted above : VARIABLE EXPANSION ISN'T IMPLEMENTED CURRENTLY !! (
Avwu> understood )
Avwu> My question is : When this feature will be implemented ?

Considering that this comment was added 12 years ago (I admit I have no
idea why was this checked in without any code implementing this feature,
but it's a bit too late now...), I wouldn't expect it to be implemented any
time soon. Of course, if somebody submits a patch doing it, it could always
be added...

Avwu> BTW: I can't find a class named wxResourceHandler ?

It is called wxXmlResourceHandler.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
'AliKet' via wx-users
2014-09-09 14:30:42 UTC
Permalink
Hey Vadim ! and thank you so much for your replay.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...