Author Topic: wxSmith isues  (Read 1204 times)

Offline gtafan

  • Multiple posting newcomer
  • *
  • Posts: 54
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: 10567
    • 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

  • Multiple posting newcomer
  • *
  • Posts: 54
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

  • Lives here!
  • ****
  • Posts: 1678
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

  • Multiple posting newcomer
  • *
  • Posts: 54
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

  • Lives here!
  • ****
  • Posts: 1678
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: 10567
    • 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

  • Multiple posting newcomer
  • *
  • Posts: 54
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

  • Multiple posting newcomer
  • *
  • Posts: 54
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

  • Lives here!
  • ****
  • Posts: 1678
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

  • Multiple posting newcomer
  • *
  • Posts: 54
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: [Select]
||=== 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

  • Multiple posting newcomer
  • *
  • Posts: 54
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: 10567
    • 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: 10567
    • 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

  • Multiple posting newcomer
  • *
  • Posts: 54
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.

Offline gtafan

  • Multiple posting newcomer
  • *
  • Posts: 54
Re: wxSmith isues
« Reply #15 on: February 06, 2018, 02:48:13 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.
Sorry, but having no idea what you are meaning with that wx's precompiled header.
Deleting that ifdef section could be really a solution, as in the frame wersion from the last pic there is no ifdef section and it compiles. Really donīt see any use of that ifdef section.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6085
    • My Best Post
Re: wxSmith isues
« Reply #16 on: February 06, 2018, 02:49:39 pm »
Patches welcome...
Unfortunatelly have not found patches, that solve the problem with at least 1 of the missing widgets.

"Patches welcome..." Implies you creating and submitting patches.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gtafan

  • Multiple posting newcomer
  • *
  • Posts: 54
Re: wxSmith isues
« Reply #17 on: February 06, 2018, 03:06:44 pm »
Patches welcome...
Unfortunatelly have not found patches, that solve the problem with at least 1 of the missing widgets.

"Patches welcome..." Implies you creating and submitting patches.

Tim S.
Do I look like somebody creating and submitting patches?
Unfortunatelly it looks lie wxSmith is dead, as with a portable version of firefox I was finaly able to enter the sf.net page and for wxSmith the last update is 2013-05-03.
« Last Edit: February 06, 2018, 03:20:40 pm by gtafan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10567
    • Travis build status
Re: wxSmith isues
« Reply #18 on: February 06, 2018, 06:52:12 pm »
Dead is a bit strong word.
I'm not sure what you've looked at, but this is the latest commit for wxSmith:
Code: [Select]
commit b657ec13bec8e967e6fec997b52b4d56d9b4cf7b
Author: T Petrov <tpetrov@codeblocks.org>
Date:   Tue Aug 15 21:52:38 2017 +0000

    * wxSmith: Add wxSpinCtrl alignment styles

    > http://forums.codeblocks.org/index.php/topic,22082.msg150338.html#msg150338

    git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@11154 2a5c6006-c6dd-42ca-98ab-0921f2732cef
(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

  • Multiple posting newcomer
  • *
  • Posts: 54
Re: wxSmith isues
« Reply #19 on: February 07, 2018, 01:27:54 pm »
Dead is a bit strong word.
I'm not sure what you've looked at, but this is the latest commit for wxSmith:
Code: [Select]
commit b657ec13bec8e967e6fec997b52b4d56d9b4cf7b
Author: T Petrov <tpetrov@codeblocks.org>
Date:   Tue Aug 15 21:52:38 2017 +0000

    * wxSmith: Add wxSpinCtrl alignment styles

    > http://forums.codeblocks.org/index.php/topic,22082.msg150338.html#msg150338

    git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@11154 2a5c6006-c6dd-42ca-98ab-0921f2732cef
I was looking here: https://sourceforge.net/projects/wxsmithaddons/

Deleting that ifdef section solved the problem with GridBagSizer.
« Last Edit: February 07, 2018, 01:29:52 pm by gtafan »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1678
Re: wxSmith isues
« Reply #20 on: February 08, 2018, 09:42:30 pm »
I wanted to try to implement your controls, and i found out, that there is a implementation for this controls in wxSmith. They are simply not compiled and up to date ( the source is from 2000~2003?)
https://sourceforge.net/p/codeblocks/code/HEAD/tree/trunk/src/plugins/contrib/wxSmithSTC/
They are not in the default codeblocks.workspace

Anyway, the rich text component compiles fine with wx2.8 and wx3.0
The wxStyledTextCtrl does not work, because it is made for <wx2.8
I think it would not be difficult to port it to wx3.0 but i would not port it to wx2.8. I think we should begin to abandon wx2.8.

Any thoughts on this? Why is this component not shipped by default?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10567
    • Travis build status
Re: wxSmith isues
« Reply #21 on: February 09, 2018, 01:44:29 am »
Use blame to find out if it is mentioned. And yes, don't bother to provide support for wxSTC on wx2.8, just 3.0 is enough.
(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

  • Multiple posting newcomer
  • *
  • Posts: 54
Re: wxSmith isues
« Reply #22 on: February 09, 2018, 01:35:05 pm »
I wanted to try to implement your controls, and i found out, that there is a implementation for this controls in wxSmith. They are simply not compiled and up to date ( the source is from 2000~2003?)
https://sourceforge.net/p/codeblocks/code/HEAD/tree/trunk/src/plugins/contrib/wxSmithSTC/
They are not in the default codeblocks.workspace

Anyway, the rich text component compiles fine with wx2.8 and wx3.0
The wxStyledTextCtrl does not work, because it is made for <wx2.8
I think it would not be difficult to port it to wx3.0 but i would not port it to wx2.8. I think we should begin to abandon wx2.8.

Any thoughts on this? Why is this component not shipped by default?
But what about wxSpinCtrlDouble? This component would be very usefull for me since I want to manipulate float values.

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1678
Re: wxSmith isues
« Reply #23 on: February 09, 2018, 11:42:18 pm »
I created a pull request for the wxSmithSTC component.

https://github.com/obfuscated/codeblocks_sf/pull/9

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1678
Re: wxSmith isues
« Reply #24 on: February 10, 2018, 12:51:39 am »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10567
    • Travis build status
Re: wxSmith isues
« Reply #25 on: February 10, 2018, 02:42:50 am »
Pull requests are not acceptable. Please post patches on sf.net.
Unfortunately I cannot disable them, so you don't waste your time creating them.
(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 BlueHazzard

  • Lives here!
  • ****
  • Posts: 1678
Re: wxSmith isues
« Reply #26 on: February 10, 2018, 11:56:20 am »
The patch includes binary data (images). As far as i can tell SVN patch does not support binary data. Can i summit patches created with "git format-patch" ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10567
    • Travis build status
Re: wxSmith isues
« Reply #27 on: February 10, 2018, 12:34:55 pm »
Yes, you can submit such patches. I'm not using svn, so I could apply them.
Just make sure to review the changes and remove everything that is not needed or required...
(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 BlueHazzard

  • Lives here!
  • ****
  • Posts: 1678
Re: wxSmith isues
« Reply #28 on: February 10, 2018, 01:44:42 pm »
The project files are pretty old, so if i save them all backslashes get replaced to slashes. This makes the patches quite large...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10567
    • Travis build status
Re: wxSmith isues
« Reply #29 on: February 10, 2018, 02:52:23 pm »
So what?
(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 BlueHazzard

  • Lives here!
  • ****
  • Posts: 1678

Offline gtafan

  • Multiple posting newcomer
  • *
  • Posts: 54
Re: wxSmith isues
« Reply #31 on: February 13, 2018, 01:57:04 pm »
Here we are:
https://sourceforge.net/p/codeblocks/tickets/616/
https://sourceforge.net/p/codeblocks/tickets/617/
Cool thanks. But how to instal such patch? And does the patch worck only with the latest CodeBlocks version?
Also that simpleBook would be a nice to have widget.
« Last Edit: February 13, 2018, 03:27:18 pm by gtafan »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1678
Re: wxSmith isues
« Reply #32 on: February 13, 2018, 05:00:04 pm »
You have to compile codeblocks by yourself to get the latest features, or wait for a nightly build. At the moment only wxSpinCtrlDouble  is in trunk (https://sourceforge.net/p/codeblocks/code/HEAD/tree/ ), for the StyledTextCtrl you have to wait until a developer has reviewed the code and pushed to trunk.

How to compile codeblocks from source: http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Windows
But be aware, this is a old guide and you have to use the wx30 workspace and fix al paths and settings accordingly. I have lost my wiki password, and i don't get any answer from the admin so i can not fix the wiki entries...

Offline gtafan

  • Multiple posting newcomer
  • *
  • Posts: 54
Re: wxSmith isues
« Reply #33 on: February 14, 2018, 01:10:27 pm »
You have to compile codeblocks by yourself to get the latest features, or wait for a nightly build. At the moment only wxSpinCtrlDouble  is in trunk (https://sourceforge.net/p/codeblocks/code/HEAD/tree/ ), for the StyledTextCtrl you have to wait until a developer has reviewed the code and pushed to trunk.

How to compile codeblocks from source: http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Windows
But be aware, this is a old guide and you have to use the wx30 workspace and fix al paths and settings accordingly. I have lost my wiki password, and i don't get any answer from the admin so i can not fix the wiki entries...
So itīs much complicated, that I thought. I thought, that I have just to replace wxSmith stuff.
I personally not really interested in StyledTextCtrl, but since it was avaible in wxDev see no reason why it shouldnīt be suported in wxSmith. Also could you post the request for wxSimplebook there? The widget is also not a priority for me personally, but itīs the only mising book widget.

Offline gtafan

  • Multiple posting newcomer
  • *
  • Posts: 54
Re: wxSmith isues
« Reply #34 on: February 16, 2018, 12:47:04 pm »
Also would be nice to have a posibility to start a clean framebased wxSmith project, without menu and status bars.