Author Topic: WXSmith - Resizing Dialogs and Frames  (Read 9920 times)

Offline DaveJ61

  • Single posting newcomer
  • *
  • Posts: 3
WXSmith - Resizing Dialogs and Frames
« on: January 10, 2013, 07:40:39 am »
Am I being dense or what?
I am using both Windows 7 x64 and Debian versions of Code::Blocks on diffierent machines and I am having an issue with WXSmith with dialogs or frames. Sorry I can't remember what the versions of Code::Blocks or WXSmith are as I am at work at the moment, however, they are the latest stable releases.
I have trawled various forums, including this one and have been through numerous tutorials but I cannot get my head around how to resize a dialog or frame when in the design stage, so that I can add more controls or make the dialog or frame the size that I want, etc. In my searches, I did come across this small explanation but it is not quite pertain to my issue...

http://mbertens.home.xs4all.nl/wxSizers/wxSizers.pdf

If I make sure the wxDialog is selected, and then I go to resize it by using any of the handles, it snaps back into place. I have made sure that the wxBorderResize is checked, although I believe that this is only applicable during runtime.

The default program uses sizers and I think this is compounding my understanding but I have read about these and fiddled around with dummy projects as well but I am missing something here that is as plain as the nose on my face, I am sure.

I would be obliged if someone could enlighten me and put me out of my misery.
« Last Edit: January 10, 2013, 07:42:21 am by DaveJ61 »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: WXSmith - Resizing Dialogs and Frames
« Reply #1 on: January 10, 2013, 09:29:44 am »
At design time the dialog is computed with the layout as it would be shown initially to the user. To test your resizing features, either you compile the app and run it , or use the preview functionality of wxSmith.

The design window itself cannot by resized, by design. Thats what the preview is for (same as in may other IDE's, btw)...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline DaveJ61

  • Single posting newcomer
  • *
  • Posts: 3
Re: WXSmith - Resizing Dialogs and Frames
« Reply #2 on: January 10, 2013, 03:43:11 pm »
Hmmm, Ok. So what you are saying is that at design stage, what you see is not necessarily what you get. It does not mention this in the tutorials as far as I can see. I have to keep clicking the preview button to see what the end product would look like depending on what sizers, panels, controls and other properties I have set.
I still don't really understand why the design has to be this way as it seems to me it is making life for the design of the presentation more complicated.
Contrary to what you said concerning previewing the output, I have used C++ Builder and Lazarus and these both employ a WYSIWYG approach to the design window.
Maybe it would help if I knew what the differences were between Code::Blocks/WXSmith and the programs I mentioned above. Otherwise, I think I am going to stick to console apps.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: WXSmith - Resizing Dialogs and Frames
« Reply #3 on: January 10, 2013, 04:47:41 pm »
Hmmm, Ok. So what you are saying is that at design stage, what you see is not necessarily what you get.
NO! What you see is what you get by default. If you design a resizable dialog, the design might change if you resize it. This you can only test in the preview, or with the compiled application.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline DaveJ61

  • Single posting newcomer
  • *
  • Posts: 3
Re: WXSmith - Resizing Dialogs and Frames
« Reply #4 on: January 11, 2013, 05:29:06 am »
I think I understand what is going on here now.

C++ Builder and Lazarus go about their business in a completely different way to WXSmith. With those, you can resize the dialog or frame to suit your needs, insert more controls and lock them, etc and resize to fit again if needs be.

With WXSmith, you need to use sizers with either horizontal or vertical orientation properties set to be able to add new controls or to just create a space. This increases the size of the dialog in whatever direction you have set the sizers orientation.

The bottom line is that I was trying to ask why I couldn't make some space by resizing the dialog (at design) to drop more controls on to it, like I can do with C++ Builder or Lazarus. Now I know.
Thanks for you help.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: WXSmith - Resizing Dialogs and Frames
« Reply #5 on: January 11, 2013, 03:57:56 pm »
With WXSmith, you need to use sizers with either horizontal or vertical orientation properties set to be able to add new controls or to just create a space. This increases the size of the dialog in whatever direction you have set the sizers orientation.
Not only with wx(SMith/Widgets), but with many other UI toolsets, including QT and Java for example. Its basically a more modern UI design paradigm. Absolute positioning of controls is supported by wxWidgets in principle (and wxSmith, too, if you tweak it), but not recommended at all. You should make yourself familiar wit the sizer concept as it is state-of-the-art and way more flexible.

Search wxWidgets docs / WiKi / forums about resources on the concept and you'll see what I mean.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ