Author Topic: I see differences in GUI Buttons, compiled with PellesC, compared to LCC  (Read 242 times)

Ad_Rienks

  • Newbie
  • *
  • Posts: 38
    • View Profile
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.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1431
    • View Profile
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.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1431
    • View Profile
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='*'\"")


Ad_Rienks

  • Newbie
  • *
  • Posts: 38
    • View Profile
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?

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1431
    • View Profile
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.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1431
    • View Profile
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>

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1431
    • View Profile
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.

Ad_Rienks

  • Newbie
  • *
  • Posts: 38
    • View Profile
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 ...

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1431
    • View Profile
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.