Recent

Author Topic: It must be my Dumb Day - Why No button icons??  (Read 5956 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1269
It must be my Dumb Day - Why No button icons??
« on: July 25, 2019, 08:01:11 pm »
Per dialog example wiki page...
https://wiki.freepascal.org/Dialog_Examples

Action buttons should be showing an icon image.
I copied the code off the page exactly.

I have added all kinds of uses trying to find what makes the icons show up on the buttons.


Code: Pascal  [Select][+][-]
  1. uses
  2.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
  3.   Buttons, StdCtrls,LCLType, ComCtrls, ExtCtrls;
  4.  
  5. procedure TForm1.Button3Click(Sender: TObject);
  6. var
  7.   Reply, BoxStyle: Integer;
  8. begin
  9.   BoxStyle := MB_ICONQUESTION + MB_YESNO;
  10.   Reply := Application.MessageBox('Press either button', 'MessageBoxDemo', BoxStyle);
  11.   if Reply = IDYES then Application.MessageBox('Yes       ', 'Reply',MB_ICONINFORMATION)
  12.     else Application.MessageBox('No         ', 'Reply', MB_ICONHAND);
  13. end;

I GET NO icons. Now what am I missing this time??
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #1 on: July 25, 2019, 08:04:04 pm »
FYI... just in case someone wonders.

I have been using Application.MessageBox for the past two years not caring about the icon buttons.

But, today, I thought, why not... lets just see if like them or not.

That's why I haven't tried for so long.
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

Handoko

  • Hero Member
  • *****
  • Posts: 5515
  • My goal: build my own game engine using Lazarus
Re: It must be my Dumb Day - Why No button icons??
« Reply #2 on: July 25, 2019, 08:37:28 pm »
As far as I know, we are not allowed to customize the button's image. The images are handled by the OS/theme/widgetset. On my system, the no button always is an 'x' mark and the yes button always is a correct sign.

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #3 on: July 25, 2019, 08:43:52 pm »
I am not talking about customizing... I get NO buttons at all, not even the ones shown on the wiki page.
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #4 on: July 25, 2019, 08:46:40 pm »
NO icons show on my message boxes at all... never have


I am talking about the actions buttons "Yes & No" (and all others)
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: It must be my Dumb Day - Why No button icons??
« Reply #5 on: July 25, 2019, 09:30:31 pm »
It's widgetset-dependent but most actual (and past) WS will not show icons in buttons. It's been considered "tacky" and "demodé" (by non-Delphi programers) since quite a long time ago :D

I never notice unless they are there (as they are e.g. in the TButtonPanel) but I've made a small test; attached is the result.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #6 on: July 25, 2019, 09:54:27 pm »
Are you saying Windows blocks them??

Then i don't understand.

In the LAZ examples = testall

Is a sample of Dialogs (menu) and they all show the icons fine.
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

Handoko

  • Hero Member
  • *****
  • Posts: 5515
  • My goal: build my own game engine using Lazarus
Re: It must be my Dumb Day - Why No button icons??
« Reply #7 on: July 25, 2019, 09:56:15 pm »
On my Ubuntu Mate GTK2 system, many of the buttons have an icon. But not for ignore, retry and abort.

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #8 on: July 25, 2019, 10:01:55 pm »
This is what I get for that "testall" demo in the LAZ examples folder.

Nothing is done different then what I did as far as uses or settings

This is on Win10
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

Handoko

  • Hero Member
  • *****
  • Posts: 5515
  • My goal: build my own game engine using Lazarus
Re: It must be my Dumb Day - Why No button icons??
« Reply #9 on: July 25, 2019, 10:06:18 pm »
I never tried "testall" demo. But I know you can use TBitButton and set the TBitButton.Kind to a predefined icon.

I'm going to sleep now. I'll try testall tomorrow.

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: It must be my Dumb Day - Why No button icons??
« Reply #10 on: July 25, 2019, 10:07:43 pm »
You did not look at all settings of that demo project. Open the "project options" > "Application":  You will see that the checkmark at "Use manifest source (and enable themes") is not set. Default, however, and therefore probably the setting of your own program, is that this checkbox is checked. When you remove this checkmark for you program you will have the icons in the message dialogs. But simultaneously you will also have the ancient look and feel of Windows 95.

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: It must be my Dumb Day - Why No button icons??
« Reply #11 on: July 25, 2019, 10:30:35 pm »
It's widgetset-dependent but most actual (and past) WS will not show icons in buttons. It's been considered "tacky" and "demodé" (by non-Delphi programers) since quite a long time ago :D
Just for completeness: When there is a TApplicationProperties component on the form you can select whether TBitButtons and TSpeedButtons are always visible, always hidden or follow the system standard (property "ShowButtonGlyphs"). Similarly there is a property "ShowMenuGlyhs" for the icons assigned to menu items.

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: It must be my Dumb Day - Why No button icons??
« Reply #12 on: July 25, 2019, 11:27:52 pm »
It's widgetset-dependent but most actual (and past) WS will not show icons in buttons. It's been considered "tacky" and "demodé" (by non-Delphi programers) since quite a long time ago :D
Just for completeness: When there is a TApplicationProperties component on the form you can select whether TBitButtons and TSpeedButtons are always visible, always hidden or follow the system standard (property "ShowButtonGlyphs"). Similarly there is a property "ShowMenuGlyhs" for the icons assigned to menu items.

To complete even more, note that it doesn't affect "standard" dialogs functions MessageBox, MessageDlg, ShowMessage, etc. Just tested it. :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #13 on: July 25, 2019, 11:45:39 pm »
You did not look at all settings of that demo project. Open the "project options" > "Application":  You will see that the checkmark at "Use manifest source (and enable themes") is not set. Default, however, and therefore probably the setting of your own program, is that this checkbox is checked. When you remove this checkmark for you program you will have the icons in the message dialogs. But simultaneously you will also have the ancient look and feel of Windows 95.

I unchecked it... still no icons
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: It must be my Dumb Day - Why No button icons??
« Reply #14 on: July 25, 2019, 11:55:14 pm »
I unchecked it... still no icons

You unchecked and ... rebuilt the program? Because t doesn't look as if it were theme-less ...
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018