BCX Basic Forum

BCX Basic ( You must log in, if you want to download files that were uploaded by members of this forum. ) => Compiler Related Discussions => Topic started by: Ad_Rienks on August 20, 2022, 03:29:56 PM

Title: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: Ad_Rienks on August 20, 2022, 03:29:56 PM
See attached screenprints. The same code produces quite some different-looking buttons. The buttons built with LCC look better to me, like real buttons. The Pelles ones are more sunken, like input boxes.

How come? I use the recommended batch file set-up from the Bed editor.
Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: MrBcx on August 20, 2022, 04:38:27 PM
I tried a few things but nothing changes ... in my tests, GUI elements produced by Pelles and Mingw
look identical while GUI elements produced by Lcc-Win32 and MSVC++ look identical.  Initially, I
thought because Lcc-Win32 hasn't been updated since 2016, its outdated headers and libs were to blame. 
That theory went out the window when I saw that MSVC++ 2022 with my DPIawareness.res produced
visuals that basically match Lcc-Win32's.

Maybe someone else can put their finger on it.
Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: MrBcx on August 20, 2022, 05:05:42 PM
I sorted it out ... the difference has to do with enabling Windows visual styles.

If you add the following to your Lccwin32 GUI app ( or MSVC++) , you will enable visual styles
and get the sunken look.  Apparently, Mingw and Pelles do this automatically.


! #pragma comment(linker,"\"/manifestdependency:type='win32' \
! name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
! processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: Ad_Rienks on August 20, 2022, 05:11:10 PM
I see that the buttons in your Bed dialogs also have the "sunken" look. Which compiler did you use? Is that your favourite look? It's not mine!

LCC may be outdated, but I prefer the look of the buttons it produces. Could it be that not using DPIAwareness is causing it?
Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: MrBcx on August 20, 2022, 05:29:00 PM
Which compiler did you use?

I use MSVC to build Scilexer.dll and I use Pelles C to compile Bed.exe

I prefer the newer visual style but it's not that important to me.

Could it be that not using DPIAwareness is causing it?

Removing DPIAwareness.res from the Pelles still results in the sunken style.
Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: MrBcx on August 20, 2022, 05:48:49 PM
Ad,

Just to be extra clear about ALL this, my DPIAwareness.res is simply an embedded manifest file that contains, among other things, the following that tell Windows which version of common controls to use, and by extension, visual styles.

 <assemblyIdentity
               type="win32"
               name="Microsoft.Windows.Common-Controls"
               version="6.0.0.0"
               processorArchitecture="*"
               publicKeyToken="6595b64144ccf1df"
               language="*" />
    </dependentAssembly>
Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: MrBcx on August 21, 2022, 10:59:43 AM
Ad,

One more update here ...

I discovered the 6 build batch files in BED's MSVC folder shared a common typo.   Those batch files define a variable of DPIAWARE but invoke using a non-existent variable of DPIFILE.  Changing DPIFILE to DPIAWARE in those 6 batch files now produces the expected visual style. 

The bottom line: 

Regardless of compiler used, if you want the old visual style, do not link DPIAwareness.res.
Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: Ad_Rienks on August 21, 2022, 02:20:51 PM
MrBcx,

Realizing that I kept holding on to "old visual styles", I think it is time to embrace "the new style". Keep on growing; there were times when I was fond of the Windows 3.0 GUI ... Haha, those were the days ...
Title: Re: I see differences in GUI Buttons, compiled with PellesC, compared to LCC
Post by: MrBcx on August 21, 2022, 04:57:27 PM
MrBcx,

Realizing that I kept holding on to "old visual styles", I think it is time to embrace "the new style". Keep on growing; there were times when I was fond of the Windows 3.0 GUI ... Haha, those were the days ...

Hi Ad,

I've decided to make the Build Interface more flexible.  See screenshot.

The default build with all four compilers will NOT include a DPI manifest file.  If anyone wants one
linked in, simply set the CheckBox and BED will link one automatically.  Alternatively, we can leave the
CheckBox unchecked and include our own customized manifest file, if we desire.

I've also made it a bit easier when picking a color Theme, and a couple other small improvements.

I'll announce when the new version can be downloaded.