Widgets look flat in wxFormbuilder, but not when compiled in IDE Topic is solved
Widgets look flat in wxFormbuilder, but not when compiled in IDE
Hello,
I've just switched from using wxSmith to wxFormbuilder and I am having one issue that I haven't been able to solve.
I've created a Frame window in wxFormbuilder with different panels, notebooks, text controls and other widgets and all the controls in the wxFormbuilder app look flat (strangely except for one wxNoteBook which has the tabs on the right side instead of the top). That they look flat is good because that is my intention. But when I compile the generated code in my IDE (I use CodeBlocks), then everything works like a charm except that all the controls now have a 3D look with raised borders. wxBORDER_RAISED or wxBORDER_SUNKEN is nowhere enabled. I tried to set the wxBORDER_NONE setting of every widget in wxFormbuilder, but that has no effect. I haven't found any other setting that influences the 3D look.
Today I compiled the same code in Linux, also with the same IDE (the linker settings are different there, don't know if that explains it), in Linux all the controls look like they should, flat as in wxFormbuilder.
Any idea where I should look for the cause?
I am using Windows10 (and Ubuntu) and wxWidgets 3.04 and gcc compiler
I've just switched from using wxSmith to wxFormbuilder and I am having one issue that I haven't been able to solve.
I've created a Frame window in wxFormbuilder with different panels, notebooks, text controls and other widgets and all the controls in the wxFormbuilder app look flat (strangely except for one wxNoteBook which has the tabs on the right side instead of the top). That they look flat is good because that is my intention. But when I compile the generated code in my IDE (I use CodeBlocks), then everything works like a charm except that all the controls now have a 3D look with raised borders. wxBORDER_RAISED or wxBORDER_SUNKEN is nowhere enabled. I tried to set the wxBORDER_NONE setting of every widget in wxFormbuilder, but that has no effect. I haven't found any other setting that influences the 3D look.
Today I compiled the same code in Linux, also with the same IDE (the linker settings are different there, don't know if that explains it), in Linux all the controls look like they should, flat as in wxFormbuilder.
Any idea where I should look for the cause?
I am using Windows10 (and Ubuntu) and wxWidgets 3.04 and gcc compiler
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Do the buttons in your compiled application appear the same as buttons in other Windows applications? wxWidgets uses the windows theme by default. I am not aware of any workaround except to use wxUniversal which draws its own controls.
If you are willing to make bitmaps for all of your buttons and their various states (that you are interested in) that would also be an option.
If you are willing to make bitmaps for all of your buttons and their various states (that you are interested in) that would also be an option.
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Windows can not be the cause. I am also running wxFormbuilder under windows and the widgets look correct there. And before this I was using wxSmith instead of wxFormbuilder and there too the widgets were flat without sunken or raised borders within the same OS.
I am not talking about the buttons, what I mean are the borders of a wxTreeCtrl, the tabs of a wxNotebook and its border, and other panels.
I am not talking about the buttons, what I mean are the borders of a wxTreeCtrl, the tabs of a wxNotebook and its border, and other panels.
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Can you provide MCVE for reproducing behaviour?
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Hi,
Also, some screenshots would have been great as well as a screenshot of the Windows Explorer (to see how it looks on your machine).
Thank you.
Also, some screenshots would have been great as well as a screenshot of the Windows Explorer (to see how it looks on your machine).
Thank you.
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Here are three screenshots, all of them are made in Windows10
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Hi,
So do you want the theme to look as if it is in the RAD tool?
Or you are just curious - why there is a difference?
Thank you.
So do you want the theme to look as if it is in the RAD tool?
Or you are just curious - why there is a difference?
Thank you.
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
It is supposed to look like either the left screenshot or the right screenshot, not like the middle screenshot.
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Hi,
What version of wxFB do you use?
Thank you.
What version of wxFB do you use?
Thank you.
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
I think this is a theme/manifest issue. This topic has come up a few times, but I my search skills are failing me and I can't find any forum links right now.
The easy way to solve this is to:
1) create an rc file containing at least the lineSee <WXROOT>\samples\sample.rc for a sample of what other items you might want to include in your rc file
2) use windres to compile the rc file
3) include the object file generated by windres in the linking stage of your program.
If you're using and IDE, it should automate steps 2 and 3 for you.
The easy way to solve this is to:
1) create an rc file containing at least the line
Code: Select all
#include "wx/msw/wx.rc"
2) use windres to compile the rc file
3) include the object file generated by windres in the linking stage of your program.
If you're using and IDE, it should automate steps 2 and 3 for you.
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
I am using wxFormbuilder version 3.9.0ONEEYEMAN wrote:Hi,
What version of wxFB do you use?
Thank you.
Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE
New Pagodi, your suggestion worked. I did not knew what a resource file was or how to include that line in my IDE but I found the instructions on the web.
I copied the sample.ico file from <WXROOT>\samples\sample.rc to my project directory where my main source files are
In my IDE (CodeBlocks in my case) I went to File -> New -> Empty File and named it icon.rc
I then added these lines of code to icon.rc:
MAINICON ICON "sample.ico"
#define wxUSE_NO_MANIFEST 0
#include "wx/msw/wx.rc"
Then I saved the files and compiled. The widgets look flat as they should, although the icon is not visible. I also tried the code from the sample.rc file but that did not work either. But my question, the reason for this topic was the non-flat widgets. And you helped me solve that.
I copied the sample.ico file from <WXROOT>\samples\sample.rc to my project directory where my main source files are
In my IDE (CodeBlocks in my case) I went to File -> New -> Empty File and named it icon.rc
I then added these lines of code to icon.rc:
MAINICON ICON "sample.ico"
#define wxUSE_NO_MANIFEST 0
#include "wx/msw/wx.rc"
Then I saved the files and compiled. The widgets look flat as they should, although the icon is not visible. I also tried the code from the sample.rc file but that did not work either. But my question, the reason for this topic was the non-flat widgets. And you helped me solve that.