Einzelnen Beitrag anzeigen

lxo

Registriert seit: 30. Nov 2017
260 Beiträge
 
Delphi 12 Athens
 
#84

AW: Delphi 12 ist offiziell da!!!

  Alt 9. Nov 2023, 11:25
Fehler gefunden: Bei Verwendung von CreateMessageDialog werden keine Icons mehr angezeigt.
In der VCL.Dialogs ist die Prüfung offenbar falsch

Delphi 11
function GetMsgIconResourceName: String;
begin
Result := '';
case DlgType of
mtWarning,
mtConfirmation:
Result := 'MSG_WARNING';
mtError:
Result := 'MSG_ERROR';
mtInformation:
Result := 'MSG_INFO';
end;
end;

Delphi 12
function GetMsgIconResourceName: String;
begin
Result := '';
case MsgDlgIcons[DlgType] of
TMsgDlgIcon.mdiWarning:

Result := 'MSG_WARNING';
TMsgDlgIcon.mdiError:
Result := 'MSG_ERROR';
TMsgDlgIcon.mdiInformation:
Result := 'MSG_INFO';
end;
end;
Das ist kein Fehler sondern eine Berichtigung von dem was bei Delphi 11.3 probiert wurde.
Siehe ab Post #149
https://www.delphipraxis.net/212558-...hon-da-15.html

Das Icon bei Confirmation wurde dort fälschlicherweise auf das Warnungssymbol geändert.
Da Windows in deren Leitlinien sagt, dass man bei Confirmation kein Logo mehr anzeigt. Weil das blaue Fragezeichen Hilfe und keine Frage signalisieren soll.
Das blaue Ausrufezeichen bei Information wird für MessageDlg auch nicht mehr empfohlen.

Siehe ...
Englisch
https://learn.microsoft.com/en-us/wi...ormation-icons
https://learn.microsoft.com/en-us/wi...ion-mark-icons
Deutsch
https://learn.microsoft.com/de-de/wi...ormation-icons
https://learn.microsoft.com/de-de/wi...ion-mark-icons


Damit werden die Leitlinien von Microsoft mit Delphi 12.0 eingehalten.

Es gibt jetzt aber eine globale Variable in Vcl.Dialogs die man nach belieben anpassen kann.

Delphi-Quellcode:
begin
  // Somit hat man das gleiche Verhalten wie in 11.3
  MsgDlgIcons[mtInformation] := mdiInformation;
  MsgDlgIcons[mtConfirmation] := mdiWarning;

  // Somit hat man das gleiche Verhalten wie in 11.2
  MsgDlgIcons[mtInformation] := mdiInformation;
  MsgDlgIcons[mtConfirmation] := mdiInformation;
end;

Geändert von lxo ( 9. Nov 2023 um 11:40 Uhr)
  Mit Zitat antworten Zitat