Free Positioning

This forum is reserved for everything you want to talk about. It could be about programming, opinions, open source programs, development in general, or just cool stuff to share!
Post Reply
StevenJMUK
In need of some credit
In need of some credit
Posts: 9
Joined: Sat Jun 03, 2006 9:17 pm

Free Positioning

Post by StevenJMUK »

Does anyone know of a GUI Editor for wxWidgets that allows free positioning of Controls (Like in VB)? I've been playing with wxFormBuilder, but it does not seem to allow it.
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

The whole idea behind wxWidgets is that you can code your app to be cross platform. If you program absolute positions, then you will get in trouble, even on one platform with different themes.

Having said that, I think there is a form designer in wxDev-Cpp that allows absolute positioning. Have you tried that ?

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

wx is not VB.
I was used to code in MFC, and also the sizers were some kind
of silly and unneeded to me, so I thought I don't need them,
I could program without for years...

But actually, once you think about sizing etc. you get to the
point, where you see the big advantage which sizers offer,
and, that a "Handmade" form really can't compete with it.
It takes some time to get used to it, but I think its worth it.
StevenJMUK
In need of some credit
In need of some credit
Posts: 9
Joined: Sat Jun 03, 2006 9:17 pm

Post by StevenJMUK »

It's not just VB though. Every GUI editor I've used allows for absolute positioning. The whole .NET windows forms thing uses absolute positioning, although there are sizer type controls as well.

I suddenly find myself in an unfamiliar land, frustrated that I can't put things where I want them.

I started looking at WxWidgets because I have grown tired of using proprietary tools and the risk factor they represent. e.g. The company I work for has lots of VB6 code, which is a disaster now that Microsoft has discontinued the language. I think the combination of C++ and WxWidgets is the perfect non-proprietary match.

Does anyone have some links to explain the evils of absolute positioning?
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

I don't think I'm a geek, but the first argument for me would be localization:
When you translate your app, all strings do not have the same display size. Then, if you have absolute positionning, you may cut words, and the application does not look so nice.

Of course, 99% of applications are available in English, only. But I really think that for localized apps, the UI is very important. You don't let the user believe the translation is only a matter of strings.
jhurtado
Experienced Solver
Experienced Solver
Posts: 53
Joined: Wed Mar 16, 2005 1:40 pm

Post by jhurtado »

If you have fixed positions and you increase the default font size then your UI won't be displayed correctly (I had this problem with Delphi).

See wxFormBuilder tutorial, there is a small example of sizer philosophy.
User avatar
tierra
Site Admin
Site Admin
Posts: 1355
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Post by tierra »

The second evil is that it encourages non-flexible window and dialog design where users aren't free to resize windows when they should be able to and there's no good reason why they can't forcing them to use scrolled windows more often slowing down productivity.
buildere
Super wx Problem Solver
Super wx Problem Solver
Posts: 358
Joined: Thu Oct 28, 2004 3:45 pm
Location: Costa Rica

Post by buildere »

StevenJMUK wrote:It's not just VB though. Every GUI editor I've used allows for absolute positioning. The whole .NET windows forms thing uses absolute positioning, although there are sizer type controls as well.

I suddenly find myself in an unfamiliar land, frustrated that I can't put things where I want them.

I started looking at WxWidgets because I have grown tired of using proprietary tools and the risk factor they represent. e.g. The company I work for has lots of VB6 code, which is a disaster now that Microsoft has discontinued the language. I think the combination of C++ and WxWidgets is the perfect non-proprietary match.

Does anyone have some links to explain the evils of absolute positioning?
I don't want you to encourage to keep using absolute positioning but as someone mentioned, wx-devcpp lets you design like that. At least that's a good start if you feel uncomfortable. Once you familiarize with wxWidgets you can start learning sizers (wich wx-devcpp also lets use use).
StevenJMUK
In need of some credit
In need of some credit
Posts: 9
Joined: Sat Jun 03, 2006 9:17 pm

Aha

Post by StevenJMUK »

I think I'm figuring it out now. It requires some planning and top down thinking to get the layout you want.

>Then, if you have absolute positionning, you may cut words, and the >application does not look so nice.

Tell me about it. My company's main product is available in German and the words are always enormous and mess up our layouts. I'd be interested to see how wxWidgets deals with varying word lengths in buttons etc.
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

Our application is available in English, French and Spanish, and all the dialog boxes are resized automatically using sizers.

When you design your layout, sizers are positionning controls with relative positions (all in a vertical/horizontal layout, in a grid,... left/center/right aligned...).
Once the window is created in the app, all the controls have their size/position set so as to respect the sizers constraints and to be fully visible. Then, the top level container (dialog box, frame, panel, ...) is resized, then displayed.

If you wish to have an idea of all this can be used, I suggest you to play a bit with a resource designer (such as wxDesigner, or DialogBlocks) and design resizable dialogs. By resizing the dialog, you can imagine how localized strings would impact the controls positions.
PhoenixPl
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Wed Feb 15, 2006 9:26 am

Post by PhoenixPl »

If you want to be able to freely position your controls you can use:

wxDevCpp - http://wxdsgn.sourceforge.net/(I was using it but it seams to crash very often)

Code::Blocks - http://www.codeblocks.org/ (it has a lot of good futures and has support for diffrenet compilers - use nightly builds)

VisualWx - http://visualwx.altervista.org/ (good support for controls, but doesn't have class browser, code completion)
lowjoel
Part Of The Furniture
Part Of The Furniture
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel »

In our case, it does seem that alphas are actually more stable than releases... lol :oops: I don't have time for nightly builds, but I do put up pretty regular ones (no worse than once a fortnight). Check http://joelsplace.sg/projects/
Post Reply