Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: geronet on July 24, 2006, 09:56:41 pm

Title: Own wxSpinCtrl integrated in wxSmith
Post by: geronet on July 24, 2006, 09:56:41 pm
Hello,

i have created some dialogs with wxSmith (it's really good) and on them are really many wxSpinCtrl, but i need them do display floating point numbers in the form "123,5". I could write a custom class, derived from wxSpinCtrl which overwrites the text- and spinfunctions, but how could i integrate them into the dialogs without too much work?

Always inserting and connecting the "Custom" widget would be a bit nasty, i hope someone has a better way how to handle this ;)

Greetings, Stefan (German)

PS: Code::Blocks is fantastic, easy and effective to use!
Title: Re: Own wxSpinCtrl integrated in wxSmith
Post by: Pecan on July 25, 2006, 03:53:27 am
Hello,

i have created some dialogs with wxSmith (it's really good) and on them are really many wxSpinCtrl, but i need them do display floating point numbers in the form "123,5". I could write a custom class, derived from wxSpinCtrl which overwrites the text- and spinfunctions, but how could i integrate them into the dialogs without too much work?

Always inserting and connecting the "Custom" widget would be a bit nasty, i hope someone has a better way how to handle this ;)

Greetings, Stefan (German)

PS: Code::Blocks is fantastic, easy and effective to use!

wxCode or wxCommunity has code for floating point spin controls.
Google wxCode and wxCommunity.
Title: Re: Own wxSpinCtrl integrated in wxSmith
Post by: takeshi miya on July 25, 2006, 05:11:16 am
wxCode or wxCommunity has code for floating point spin controls.
Google wxCode and wxCommunity.

He didn't asked for that. :P

Answering the question,
Always inserting and connecting the "Custom" widget would be a bit nasty, i hope someone has a better way how to handle this ;)
Unfortunately, using "Custom" widgets is currently the only way. (Well, or recompiling wxSmith to include support to the custom controls :P).

That is one of my biggest requests for wxSmith.
There are a lot of ways to handle custom controls, it's not an easy topic, and I couldn't figure (neither byo I think) the best way to handle them. Some ideas are perhaps, for defining custom controls: XML, XRC, scripting, plugins for wxSmith, etc.

Ideally, the customs control (for example, a wxScintilla control, or some control made by yourself) could have most properties (events, looks, properties, C++ & XRC code generation, etc) defined in an XML file. So this would be a bit like the current "custom" control; but letting the user select the properties of the control, like Font, Size, Name, ACustomProperty, etc.
Of course, the drawing of the control when RAD editing will not be WYSIWYG, that would requiere something like "plugins" for wxSmith, which could be difficult to make and requieres compilation, etc.

But the first step is more important, WYSIWYG editing is not as important as letting the user create a custom control with all it's own properties, events and code generation all in a single XML file. :)
Some squirrel scripting can be used if necessary too.