Hi
1) Is it possible to extend wx controls, say, in order to give them additional properties?
2) Is it possible to use a Designer to set the values of these new wx control properties (the ones added) at design time? If so, which designer has this capability?
Thanks
Steven
Extending wx controls
Re: Extending wx controls
That depends on what you want to change, on the control itself and eventually even on the platform. If a control is implemented with a native control (which is always the aim in wxWidgets), extending its functionality may be hard or even impossible.1) Is it possible to extend wx controls, say, in order to give them additional properties?
For generic controls (that are implemented without an underlying native control) like wxGrid or wxDataViewControl, the chances are much better.
Not that i know if.2) Is it possible to use a Designer to set the values of these new wx control properties (the ones added) at design time? If so, which designer has this capability?
Can you give an example of what you have in mind?
Use the source, Luke!
Re: Extending wx controls
Thanks for the reply.
1) Lets consider the case where the control is implemented as a native control. In this case, I'm guessing that the wx control would be a wrapper for the native control. If so, it should be possible to extend the wrapper control (but obviously not the underlying native control, which is anyway unnecessary).
In case it is not possible to extend the wrapper (for some reason), one can, at the app level, create a custom control which wraps the wx control and give it additional custom properties. This would serve the requirement.
2) More difficult is the Designer. I'd love the designer to be able to set these custom properties on the control. (This kind of functionality is available for the WPF designer and also the Windows forms designer, where one can set custom properties at design time.)
An example would be as follows (I'm using pseudo-code):
_Some_ of these custom properties should be settable at custom time in the Designer. If this not possible, is there a workaround?
Thanks
Steven
1) Lets consider the case where the control is implemented as a native control. In this case, I'm guessing that the wx control would be a wrapper for the native control. If so, it should be possible to extend the wrapper control (but obviously not the underlying native control, which is anyway unnecessary).
In case it is not possible to extend the wrapper (for some reason), one can, at the app level, create a custom control which wraps the wx control and give it additional custom properties. This would serve the requirement.
2) More difficult is the Designer. I'd love the designer to be able to set these custom properties on the control. (This kind of functionality is available for the WPF designer and also the Windows forms designer, where one can set custom properties at design time.)
An example would be as follows (I'm using pseudo-code):
Code: Select all
control myTextBox : wxTextBox
{
private wxTextBox wtb; // the wrapped TextBox
// custom properties
private String s1;
private String s2;
private int i1;
...
myTextBox(wxTextBox w) // ctor
{
wtb = w;
}
}
Thanks
Steven
Re: Extending wx controls
I don't use and GUI designer myself, so i don't know if any of them supports this. I also can't think of a workaround.If this not possible, is there a workaround?
Use the source, Luke!
Re: Extending wx controls
Hi,
Can you give an example of what you are trying to do? Maybe it is already been done and you can just use it straight ahead.
In terms of the GUI designer: there are many different RAD tools that is designed specifically to work with wxWidgets. Usually people/companies select one tool and stick with it in order to do the development.
If this property is not implemented and you need it in the RAD tool - you best bet would be to create a poll asking if such a tool/workaround exists.
Thank you.
Can you give an example of what you are trying to do? Maybe it is already been done and you can just use it straight ahead.
In terms of the GUI designer: there are many different RAD tools that is designed specifically to work with wxWidgets. Usually people/companies select one tool and stick with it in order to do the development.
If this property is not implemented and you need it in the RAD tool - you best bet would be to create a poll asking if such a tool/workaround exists.
Thank you.