Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 08, 2016, 01:49:41 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: generic form designer  (Read 4034 times)

slowmaker

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 51
  • Reinventing the wheel can be fun!
    • View Profile
    • rambling-nerd
    • Read more about this member.
    • Donate to Member
generic form designer
« on: January 02, 2010, 11:33:02 PM »
Does anyone know if this exists? I've hopped around from one language to the other a lot (I'm sort of a perpetual beginner), and many of the compilers/interpreters I've ended up with did not have GUI designing tools. I end up either doing the run-it-and-adjust-the-numbers thing over and over, or I use the designer from another language and copy the numbers over.

Even when the language does have a designer, it often does not have the flexibility to spit out code the way I want it to, so I still end up picking out the numbers and plopping them into my code.

I've often wished for a form designer that just output the basic information of button locations, text, window dimensions, etc. without trying to write the code for me. I end up having to rewrite it anyway, so most of the generated code is just visual clutter.

So...any ideas?
WinXP Home SP3 - PSPad 4.5.4

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,412
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: generic form designer
« Reply #1 on: January 03, 2010, 12:44:54 AM »
you migth try one of the wxwidgets form designers, like:
http://wxformbuilder.org/

slowmaker

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 51
  • Reinventing the wheel can be fun!
    • View Profile
    • rambling-nerd
    • Read more about this member.
    • Donate to Member
Re: generic form designer
« Reply #2 on: January 03, 2010, 01:36:25 AM »
Thanks, I'll check it out.
WinXP Home SP3 - PSPad 4.5.4

mnemonic

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 177
    • View Profile
    • My website
    • Donate to Member
Re: generic form designer
« Reply #3 on: January 03, 2010, 02:19:35 AM »
you migth try one of the wxwidgets form designers, like:
http://wxformbuilder.org/

Agreed - this is a really good tool.  From experience, it doesn't produce too much "clutter", but you will need to refactor as it produces one big lump of code.

slowmaker

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 51
  • Reinventing the wheel can be fun!
    • View Profile
    • rambling-nerd
    • Read more about this member.
    • Donate to Member
Re: generic form designer
« Reply #4 on: January 03, 2010, 03:50:47 AM »
Whoooosh; been playing with wxformbuilder a bit, and that 'sizer' thing is a bit rough for an old pea-brain like me. I googled for how to just drag the controls around where I want them, didn't find it.

I found a thread where some poor soul had the temerity to mention this might be a good thing for some of us, and they ...  weren't very nice (basically said 'you're an idiot for wanting to do this, all application goals must be the same as ours, etc., etc.'). The thread mentions that absolute positioning is possible, so I'll keep looking.

I can definitely see the power inherent in having a framework that auto-adjusts your widgets, but since I won't actually be using the framework, I'll have to find something else if I can't figure how to use it in a drag-to-position and drag-to-size way. I suspect, though, that what I want doesn't exist (the generic aspect, I mean).

Man, remember NRE? Or the old MS Access form editor? Drop, size, select, align to this, center with that, bing bang boom. Sweet. I miss editors like that.

Don't get me wrong; I can see that if I ever move beyond 'toy' progs I would might need to look at putting in the effort to think in terms of things auto-adjusting, and I would probably be overjoyed to sacrifice a little drag-and-drop comfort in return for not having to manually write all that adjustment code later on. I'm sure I'll be glad to have snagged this prog when that time comes.

Oh, and I read some more in that thread I mentioned; they did lighten up on the second page and start giving the guy some attempts at helpfulness rather than the knee-jerk (emphasis on the jerk) nonsense that was on the first page.

WinXP Home SP3 - PSPad 4.5.4

mnemonic

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 177
    • View Profile
    • My website
    • Donate to Member
Re: generic form designer
« Reply #5 on: January 03, 2010, 04:25:30 AM »
I struggled a bit at first, but it gets easier.  Here's an example screen:

newroute.gifgeneric form designer

So, here's a hierarchy of how I lay things out (not sure of this is the proper way, but it works for me):

Project
-- Frame (if screen can co-exist with others) or a dialog (if a screen should take all focus away from its parent)
-----Panel
-------PanelSizer (vertical)
---------Horizontal sizer for each row

Once you've got them all into position, you just need to play with the proportion settings of each component on each sizer.  Once this is done, I copy the code, refactor and then tweak manually to line things up.

The code that comes out of wxFormBuilder is relatively clean.  I guess that anything that comes out of a "drag and drop" designer tends to be messy as it has to worry about the absolute positioning of each component (this might also cause all kinds of issues when expanding the window).

slowmaker

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 51
  • Reinventing the wheel can be fun!
    • View Profile
    • rambling-nerd
    • Read more about this member.
    • Donate to Member
Re: generic form designer
« Reply #6 on: January 03, 2010, 04:49:08 AM »
Thanks, mnemonic. That looks like a good approach, and it's a darn sight clearer that any of the so-called documentation I found so far. I'll make a note of it.

I guess that anything that comes out of a "drag and drop" designer tends to be messy as it has to worry about the absolute positioning of each component (this might also cause all kinds of issues when expanding the window).
Nope. The drag and drop designer's output tends to be very clean precisely because it doesn't 'worry' about the positioning at all; it just spits out the coords you left the component at, and that's that. My only problem with them is that they are usually for a different language, or the designer had different ideas about code layout than I do. It doesn't cause window-expanding issues for me because these simple little programs I do don't have resizing windows; the ones that do are generally single-component (like Notepad), which is a no-brainer to handle.

My ideal solution would actually be drag-and-drop, absolute positioning, with no code output at all; just a csv text file with the coordinates and properties of each component. Then anyone could script something to mash that data into whatever format they wanted.

Thanks again for all the help, guys.
WinXP Home SP3 - PSPad 4.5.4

Cyeb

  • Participant
  • Joined in 2009
  • *
  • Posts: 50
    • View Profile
    • Donate to Member
Re: generic form designer
« Reply #7 on: January 16, 2010, 09:01:23 PM »
What language is this for? :D  Didn't really look around the site.  I'm pretty sure you didn't mean any languages like Visual Basic, did you?  Otherwise somebody else would have posted it?  If a VB.net kind of thing is what you're looking for, why not try C#?

Edit:  No wait wait, I see now that it is for C++, XRC, and python.  SharpDevelop and Visual Studio are IDE's for C#, and they come with form designer type of things, which are very easy to use...Not sure how it compares to wsFormBuilder, but it's nearly as easy as Visual Basic.
« Last Edit: January 16, 2010, 09:08:30 PM by Cyeb »