Ignore:
Timestamp:
May 21, 2020, 6:42:45 PM (4 years ago)
Author:
chronos
Message:
  • Added: TDpiPopupMenu and TDpiMenuItem support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Start.pas

    r212 r244  
    6161
    6262  TStartDlg = class(TDrawDlg)
    63     PopupMenu1: TPopupMenu;
     63    PopupMenu1: TDpiPopupMenu;
    6464    StartBtn: TButtonA;
    6565    Down1Btn: TButtonC;
     
    12991299  if PlayerPopupIndex < 0 then
    13001300  begin // change default AI
    1301     BrainDefault := Brains[TMenuItem(Sender).Tag];
     1301    BrainDefault := Brains[TDpiMenuItem(Sender).Tag];
    13021302    SmartInvalidate(xDefault, yDefault, xDefault + 64, yDefault + 64);
    13031303  end
     
    13061306    if Assigned(PlayersBrain[PlayerPopupIndex]) then
    13071307      PlayersBrain[PlayerPopupIndex].Flags := PlayersBrain[PlayerPopupIndex].Flags and not fUsed;
    1308     if TMenuItem(Sender).Tag = -1 then begin
     1308    if TDpiMenuItem(Sender).Tag = -1 then begin
    13091309      PlayersBrain[PlayerPopupIndex] := nil;
    13101310      PlayerSlots[PlayerPopupIndex].DiffUpBtn.Visible := False;
     
    13161316      MultiControl := MultiControl and not (1 shl PlayerPopupIndex);
    13171317    end else begin
    1318       PlayersBrain[PlayerPopupIndex] := Brains[TMenuItem(Sender).Tag];
     1318      PlayersBrain[PlayerPopupIndex] := Brains[TDpiMenuItem(Sender).Tag];
    13191319      PlayerSlots[PlayerPopupIndex].DiffUpBtn.Visible := PlayersBrain[PlayerPopupIndex].Kind in [btTerm, btRandom, btAI];
    13201320      PlayerSlots[PlayerPopupIndex].DiffDownBtn.Visible := PlayersBrain[PlayerPopupIndex].Kind in [btTerm, btRandom, btAI];
     
    13601360var
    13611361  J: Integer;
    1362   MenuItem: TMenuItem;
    1363 begin
    1364   MenuItem := TMenuItem.Create(PopupMenu1);
     1362  MenuItem: TDpiMenuItem;
     1363begin
     1364  MenuItem := TDpiMenuItem.Create(PopupMenu1);
    13651365  if not Assigned(Brain) then MenuItem.Caption := Phrases.Lookup('NOMOD')
    13661366    else MenuItem.Caption := Brain.Name;
     
    13811381  I: Integer;
    13821382  FixedLines: integer;
    1383   MenuItem: TMenuItem;
     1383  MenuItem: TDpiMenuItem;
    13841384  AIBrains: TBrains;
    13851385begin
     
    14111411      end;
    14121412    if PlayerPopupIndex > 0 then begin
    1413       MenuItem := TMenuItem.Create(PopupMenu1);
     1413      MenuItem := TDpiMenuItem.Create(PopupMenu1);
    14141414      MenuItem.Caption := '-';
    14151415      PopupMenu1.Items.Add(MenuItem);
Note: See TracChangeset for help on using the changeset viewer.