Author Topic: wxSmith isues  (Read 46185 times)

Offline gtafan

  • Almost regular
  • **
  • Posts: 126
wxSmith isues
« on: January 30, 2018, 01:39:47 pm »
I am using CodeBlocks and wxSmith for writing GUI applications and it worcks fine for me in most cases, but there are still some smaller problems with wxSmith like wrong sizing of windows with only 1 child. An other isue is that some widgets can´t be added using wxSmith like for example wxSimplebook and wxSpinCtrlDouble. I know that the mising widgets can be added manually, but first it´s huge pain in the as and second it makes editing the code complicated.
Have to mention, that I am stil on CodeBlocks 16.1, so my wxSmith version is the one included in official 16.1 release.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: wxSmith isues
« Reply #1 on: January 30, 2018, 07:08:05 pm »
Adding widgets to wxsmith shouldn't be too hard.
For the others you need to post simple examples with steps to reproduce the problems.
Saying "wrong sizing of windows with only 1 child" is not a good way to report a problem...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gtafan

  • Almost regular
  • **
  • Posts: 126
Re: wxSmith isues
« Reply #2 on: February 01, 2018, 01:05:21 pm »
Adding widgets to wxsmith shouldn't be too hard.
For the others you need to post simple examples with steps to reproduce the problems.
Saying "wrong sizing of windows with only 1 child" is not a good way to report a problem...
OK, first I am starting a new wxSmith framebased project which looks like this:



Than I am adding some widget like a button here:



as can be seen on the pic size and position for the button are completly ignored and after compilation it´s not looking beter:



Just to show it´s not problem with the button, the same thing with textCtrl here:



« Last Edit: February 01, 2018, 04:08:04 pm by gtafan »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: wxSmith isues
« Reply #3 on: February 01, 2018, 02:08:14 pm »
can't see anything on this small images...

but this is probably something wxWidgets related, not wxSmith. Wrong styles or flags...
are you using sizers?

there is something wrong...
« Last Edit: February 01, 2018, 02:11:24 pm by BlueHazzard »

Offline gtafan

  • Almost regular
  • **
  • Posts: 126
Re: wxSmith isues
« Reply #4 on: February 01, 2018, 03:46:29 pm »
can't see anything on this small images...

but this is probably something wxWidgets related, not wxSmith. Wrong styles or flags...
are you using sizers?

there is something wrong...
Have fixed the sizes of images.
Not using sizers.
« Last Edit: February 01, 2018, 04:08:48 pm by gtafan »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: wxSmith isues
« Reply #5 on: February 01, 2018, 05:30:40 pm »
Thank you.
This is for sure a wxWidgets issue. The code generated works fine, but is not the right code you want to... I am no wxWidgets expert, i tried a bit to look at the examples but did not find any obvious... What version of wxWidgets do you use?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: wxSmith isues
« Reply #6 on: February 01, 2018, 08:43:44 pm »
I don't think you would have great success using wxWidgets without sizers.
wxSmith is made around the idea of sizers, so even if there is support for the sizerless ui it is rarely tested or fixed/improved.

To find what is going on you need to manually make a sample code that works and then compare it with the auto generated from wxSmith to see where the difference is.
Then we could probably see if wxSmith could be made to generate such code.
But please consider the sizer idea - users of your application will be thanking you for this also.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gtafan

  • Almost regular
  • **
  • Posts: 126
Re: wxSmith isues
« Reply #7 on: February 03, 2018, 01:26:32 pm »
Thank you.
This is for sure a wxWidgets issue. The code generated works fine, but is not the right code you want to... I am no wxWidgets expert, i tried a bit to look at the examples but did not find any obvious... What version of wxWidgets do you use?
My fault, never noticed this problem with wxDev, so thought it's wxSmith problem.

Offline gtafan

  • Almost regular
  • **
  • Posts: 126
Re: wxSmith isues
« Reply #8 on: February 03, 2018, 01:35:23 pm »
I don't think you would have great success using wxWidgets without sizers.
wxSmith is made around the idea of sizers, so even if there is support for the sizerless ui it is rarely tested or fixed/improved.

To find what is going on you need to manually make a sample code that works and then compare it with the auto generated from wxSmith to see where the difference is.
Then we could probably see if wxSmith could be made to generate such code.
But please consider the sizer idea - users of your application will be thanking you for this also.
I am familiar with sizer idea, since Java is my prefered programing language. Unfortunately the sizers are not as powerfull as their conterparts in Java, for example FlowSizer and CardSizer are completly mising. Also it's not always posible to place widbets exactly where you want with sizers.
An other thing is that GridBagSizer is not working, which seems to be wxWidget bugg.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: wxSmith isues
« Reply #9 on: February 04, 2018, 12:11:53 pm »
Quote
An other thing is that GridBagSizer is not working, which seems to be wxWidget bug
i doubt that... Can you describe more? I still don't know what wxWidgets version you are using

Offline gtafan

  • Almost regular
  • **
  • Posts: 126
Re: wxSmith isues
« Reply #10 on: February 05, 2018, 04:14:29 pm »
Quote
An other thing is that GridBagSizer is not working, which seems to be wxWidget bug
i doubt that... Can you describe more? I still don't know what wxWidgets version you are using
Sorry, my wxWidget version is 3.0.2, which was the latest stable version at least about a month ago.
The problem with GridBagSizer only apear when using additional custom panel. So I am starting a new wxSmith framebased project and adding a new panel to the project, then adding a GridBagSizer with some widgets to that panel:



In prewiv window it worcks fine:



but when compiling geting an error mesage:



Here all error mesages:

Code
||=== Build: Release in test (compiler: GNU GCC Compiler) ===|
NewPanel.h|24|error: 'wxGridBagSizer' does not name a type|
NewPanel.cpp||In constructor 'NewPanel::NewPanel(wxWindow*, wxWindowID, const wxPoint&, const wxSize&)':|
NewPanel.cpp|29|error: 'GridBagSizer1' was not declared in this scope|
NewPanel.cpp|29|error: expected type-specifier before 'wxGridBagSizer'|
NewPanel.cpp|31|error: 'wxGBPosition' was not declared in this scope|
NewPanel.cpp|31|error: 'wxDefaultSpan' was not declared in this scope|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

It looks like mising include, but it´s not the case:



Without the panel, just using the frame there is no problem:


Offline gtafan

  • Almost regular
  • **
  • Posts: 126
Re: wxSmith isues
« Reply #11 on: February 05, 2018, 04:17:36 pm »
Adding widgets to wxsmith shouldn't be too hard.
Would be cool to have the mising widgets in wxSmith. Also wxStyledTextCtrl is mising in wxSmith.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: wxSmith isues
« Reply #12 on: February 05, 2018, 05:52:24 pm »
Patches welcome...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: wxSmith isues
« Reply #13 on: February 05, 2018, 05:53:45 pm »
About the mis-compilation - is the gbsize.h part of the wx's precompiled header or not?
What happens if you extract it from the ifdef section.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gtafan

  • Almost regular
  • **
  • Posts: 126
Re: wxSmith isues
« Reply #14 on: February 06, 2018, 02:44:21 pm »
Patches welcome...
Unfortunatelly have not found patches, that solve the problem with at least 1 of the missing widgets.