Recent

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

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #15 on: July 26, 2019, 12:04:52 am »
I unchecked it... still no icons

You unchecked and ... rebuilt the program? Because t doesn't look as if it were theme-less ...

Yes, checking-unchecking doesn't make it look Win95 on this Win10 pc... it did on my Win7 when I had it.
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 #16 on: July 26, 2019, 12:11:05 am »
Ah... made a discovery.

It doesn't work after buttons are already placed on the form.

BUT...

If I add a new button, uncheck the manifest then all the buttons look like Win 95.... and the icons display.

Bug for the manifest option??


Anyways.... I don't want to use the Win95 look.... so the icons don't work unless the Manifest is off?
« Last Edit: July 26, 2019, 12:15:55 am by pixelink »
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

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: It must be my Dumb Day - Why No button icons??
« Reply #17 on: July 26, 2019, 12:16:13 am »
Strange: the TestAll demo has the "Use manifest source" checkbox checked, but still I get the Win95 look on Win10. Only after I uncheck, save, check and save a second time, the Win10 theme does appear.

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #18 on: July 26, 2019, 12:24:46 am »
Strange: the TestAll demo has the "Use manifest source" checkbox checked, but still I get the Win95 look on Win10. Only after I uncheck, save, check and save a second time, the Win10 theme does appear.

Did you see my post previous to yours?
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

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: It must be my Dumb Day - Why No button icons??
« Reply #19 on: July 26, 2019, 01:02:24 am »
Anyways.... I don't want to use the Win95 look.... so the icons don't work unless the Manifest is off?
In unit Dialogs there is a function "DefaultPromptDialog" which is a pure LCL form and works without the dialogs of the operating system:

Code: Pascal  [Select][+][-]
  1. function DefaultPromptDialog(const DialogCaption,
  2.   DialogMessage: String;
  3.   DialogType: longint; Buttons: PLongint;
  4.   ButtonCount, DefaultIndex, EscapeResult: Longint;
  5.   UseDefaultPos: boolean;
  6.   X, Y: Longint): Longint;// widgetset independent implementation, see PromptDialogFunction

Unfortunately it is poorly documented. This is what I found out playing with it:
  • DialogCaption: the caption of the form
  • DialogMessage: the text displayed inside the dialog
  • DialogType: a constant declared in unit LCLType which determines the icon displayed inside the dialog. Use these values: idDialogWarning, idDialogError, idDialogInfo, idDialogConfirm, (idDialogShield - not working on Windows).
  • Buttons: pointer to an array of longint values defining the buttons added; every button will have its default icon. Possible values are declared in unit LCLType as idButtonXXX where XXX can be replaced by OK, Cancel, Help, Yes, No, Close, Abort, Retry, Ignore, All, YesToAll, NoToAll, Open, Save, Shield. It seems that the latter three are not working, at least not on windows
  • ButtonCount: count of elements used in the array to which Buttons points
  • DefaultIndex: array index of the button which is pressed with ENTER
  • EscapeIndex: array index of the button which is pressed with ESC
  • UseDefaultPos: place dialog in center or at position given by the following X,Y parameters
  • Result: the idButtonXXX value of the clicked button (but: not all buttons close the form).
Example, ready to try:
Code: Pascal  [Select][+][-]
  1. uses
  2.   LCLType;
  3.  
  4. procedure TForm1.Button1Click(Sender: TObject);
  5. var
  6.   btns: array[0..2] of LongInt = (idButtonOK, idButtonCancel, idButtonHelp);
  7.   res: LongInt;
  8. begin
  9.   res := DefaultPromptDialog('This is the caption','This is the message of this dialog', idDialogInfo, @btns, 3, 0, 1, true, 0, 0);
  10.   Caption := 'Dialog result is ' + IntToStr(res);
  11. end;  

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: It must be my Dumb Day - Why No button icons??
« Reply #20 on: July 26, 2019, 01:10:13 am »
Bug for the manifest option??
Hmmm... Maybe the IDE did not notice that something was changed with the resources. As usual, it is always a good idea to do a "Run" > "Build", or even "Run"  > "Clean up and Build" after changing anything related to the resources such as the manifest.

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: It must be my Dumb Day - Why No button icons??
« Reply #21 on: July 26, 2019, 02:34:00 am »
Okay thanks everyone for the info
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

dsiders

  • Hero Member
  • *****
  • Posts: 1525
Re: It must be my Dumb Day - Why No button icons??
« Reply #22 on: November 23, 2021, 01:45:28 am »
Anyways.... I don't want to use the Win95 look.... so the icons don't work unless the Manifest is off?
In unit Dialogs there is a function "DefaultPromptDialog" which is a pure LCL form and works without the dialogs of the operating system:

Code: Pascal  [Select][+][-]
  1. function DefaultPromptDialog(const DialogCaption,
  2.   DialogMessage: String;
  3.   DialogType: longint; Buttons: PLongint;
  4.   ButtonCount, DefaultIndex, EscapeResult: Longint;
  5.   UseDefaultPos: boolean;
  6.   X, Y: Longint): Longint;// widgetset independent implementation, see PromptDialogFunction

Unfortunately it is poorly documented. This is what I found out playing with it:
  • DialogCaption: the caption of the form
  • DialogMessage: the text displayed inside the dialog
  • DialogType: a constant declared in unit LCLType which determines the icon displayed inside the dialog. Use these values: idDialogWarning, idDialogError, idDialogInfo, idDialogConfirm, (idDialogShield - not working on Windows).
  • Buttons: pointer to an array of longint values defining the buttons added; every button will have its default icon. Possible values are declared in unit LCLType as idButtonXXX where XXX can be replaced by OK, Cancel, Help, Yes, No, Close, Abort, Retry, Ignore, All, YesToAll, NoToAll, Open, Save, Shield. It seems that the latter three are not working, at least not on windows
  • ButtonCount: count of elements used in the array to which Buttons points
  • DefaultIndex: array index of the button which is pressed with ENTER
  • EscapeIndex: array index of the button which is pressed with ESC
  • UseDefaultPos: place dialog in center or at position given by the following X,Y parameters
  • Result: the idButtonXXX value of the clicked button (but: not all buttons close the form).
Example, ready to try:
Code: Pascal  [Select][+][-]
  1. uses
  2.   LCLType;
  3.  
  4. procedure TForm1.Button1Click(Sender: TObject);
  5. var
  6.   btns: array[0..2] of LongInt = (idButtonOK, idButtonCancel, idButtonHelp);
  7.   res: LongInt;
  8. begin
  9.   res := DefaultPromptDialog('This is the caption','This is the message of this dialog', idDialogInfo, @btns, 3, 0, 1, true, 0, 0);
  10.   Caption := 'Dialog result is ' + IntToStr(res);
  11. end;  

This content has been included in the help topic found in CHM and HTML help files.

 

TinyPortal © 2005-2018