Author Topic: 1st widget placed on a form occupies the whole form.  (Read 4138 times)

dcbdbis

  • Guest
1st widget placed on a form occupies the whole form.
« on: June 30, 2013, 05:12:38 am »
Good evening,

Just installed Code::Blocks. I am a veteran C++ programmer moving from C++ Builder series from Embarcadero to Code::Blocks. I can tell you I like the look and feel very much for a RAD environment. I need to to allow cross-compilation. I am using forms not dialogs, and wxSmith.

I am using build 12.11.

Here is my issue: When I place my first object on the form, the object occupies the entire form's space until I place another object on the form, then the original object goes back to the original size that I expected in the first place. Very weird.

The workaround for me is to place a "custom" widget on the form, until I get two more objects on the form, then everything stays in the location and size I specified at design time. It's annoying, but not insurmountable.


I did some searches in the forum but came up empty handed.


Does anyone know how to fix this?


Thanks!


Dave

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: 1st widget placed on a form occupies the whole form.
« Reply #1 on: June 30, 2013, 06:53:12 am »
It sounds like you might be unfamiliar with the wxWidgets concept of sizerswxSmith tutorials from the wiki might also help.

Does that address your issue?

dcbdbis

  • Guest
Re: 1st widget placed on a form occupies the whole form.
« Reply #2 on: June 30, 2013, 08:27:55 am »
Thank you for the reply.....But I think I need to clarify...

And yes I did read your references which I had already been through. But I went through them again to make sure I didn't miss anything obvious. I guess best stated, the sizer is not behaving as the documentation states it should.

When I place the first object on the form, the object (in this case a push-button) it goes to full form size. The next thing I do is size it by the sizing handles provided. As soon as I let go of the mouse button after sizing it what I want, the control then jumps back to full form size.

I only regain control of the objects size and position, when two or more objects are placed on the form. When the second object lands on the form...in that instant then magically both objects then revert to their normal sizes and locations I put them in the first place.

I've done some utilitarian coding tonight for myself to get comfy with wxWidgets and Code::Blocks.... This weirdness only happens when I create a new form, and place one lone control on it. Add a second control, and everything jumps back to the way it should be.

Tonight, I fought through the usage if wxString vs the AnsiString of Embarcaderos. I got bit by the Ascii/UTF-8 thing......and finally came to the magic to make it all work by wrapping by strings literals with wxT("String");
There was certainaly some culture shock there.....Other than needing to memorize different objects and their member functions and properties.....I think I may be ready to get going with it. I really like how the debugger works, breakpoints, evaluation of a variable under the cursor....It's a nice package.

I also got the live F1 context sensitive help working too. Overall, it my setup now seems ready for production.

Remember, I am using Forms, NOT Dialogs.... It seems the mis-behavior is limited to Forms, not dialogs.

Thank you for your assistance!


Sincerely and respectfully,


Dave


Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: 1st widget placed on a form occupies the whole form.
« Reply #3 on: July 03, 2013, 03:29:53 pm »
Possibly this is a wxSmith bug... although someone else would have to look into it; I do not use wxSmith very much.

Tonight, I fought through the usage if wxString vs the AnsiString of Embarcaderos. I got bit by the Ascii/UTF-8 thing......and finally came to the magic to make it all work by wrapping by strings literals with wxT("String");
:D Then you will like the design of the unstable wxWidgets 2.9.x, wxString was rewritten to work without wrapping string literals.