Changeset 340


Ignore:
Timestamp:
Apr 2, 2021, 9:09:49 PM (4 years ago)
Author:
chronos
Message:
  • Added: Support for F11 full screen switch key in Start dialog.
  • Fixed: Allow F1 and F11 key in Start dialog even if listbox is focused.
  • Modified: Code cleanup.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Back.pas

    r220 r340  
    7575  end else begin
    7676    WindowState := wsNormal;
     77    WindowState := wsFullScreen;
     78    WindowState := wsNormal;
    7779    BoundsRect := Bounds(StartDlg.Left - 8, StartDlg.Top - 8,
    7880      StartDlg.Width + 16, StartDlg.Height + 16);
  • trunk/LocalPlayer/Diagram.pas

    r135 r340  
    355355      end;
    356356    Popup.Popup(Left + ToggleBtn.Left, Top + ToggleBtn.Top + ToggleBtn.Height);
    357   end
     357  end;
    358358end;
    359359
     
    370370  else if (Key = VK_F8) and (Kind = dkShip) then // my other key
    371371  else
    372     inherited
     372    inherited;
    373373end;
    374374
  • trunk/LocalPlayer/Enhance.pas

    r330 r340  
    4848  EnhanceDlg: TEnhanceDlg;
    4949
     50
    5051implementation
    5152
    5253uses
    53   Help;
     54  Help, UKeyBindings;
    5455
    5556{$R *.lfm}
     
    231232        Sprite(offscreen, HGrTerrain, x, 64 - yyt, xxt * 2, yyt * 2,
    232233          1 + 2 * (xxt * 2 + 1), 1 + yyt + 12 * (yyt * 3 + 1));
    233       inc(x, xxt * 2 + 6)
     234      inc(x, xxt * 2 + 6);
    234235    end;
    235236  end;
     
    302303procedure TEnhanceDlg.CloseBtnClick(Sender: TObject);
    303304begin
    304   Close
     305  Close;
    305306end;
    306307
     
    317318begin
    318319  Page := TComponent(Sender).Tag;
    319   SmartUpdateContent
     320  SmartUpdateContent;
    320321end;
    321322
     
    337338          move(MyData.EnhancementJobs[Page, stage + 1],
    338339            MyData.EnhancementJobs[Page, stage], 4 - stage);
    339         MyData.EnhancementJobs[Page, 4] := jNone
     340        MyData.EnhancementJobs[Page, 4] := jNone;
    340341      end
    341342      else
     
    364365    begin
    365366      MyData.EnhancementJobs[Page, stage] := jRoad;
    366       inc(stage)
     367      inc(stage);
    367368    end;
    368369    if (NewJob = jFarm) and not(jIrr in Done) then
    369370    begin
    370371      MyData.EnhancementJobs[Page, stage] := jIrr;
    371       inc(stage)
    372     end;
    373     MyData.EnhancementJobs[Page, stage] := NewJob
    374   end;
    375   SmartUpdateContent
     372      inc(stage);
     373    end;
     374    MyData.EnhancementJobs[Page, stage] := NewJob;
     375  end;
     376  SmartUpdateContent;
    376377end;
    377378
    378379procedure TEnhanceDlg.FormKeyDown(Sender: TObject; var Key: Word;
    379380  Shift: TShiftState);
    380 begin
    381   if Key = VK_F1 then
     381var
     382  ShortCut: TShortCut;
     383begin
     384  ShortCut := KeyToShortCut(Key, Shift);
     385  if BHelp.Test(ShortCut) then
    382386    HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkText,
    383387      HelpDlg.TextIndex('MACRO'))
  • trunk/LocalPlayer/Nego.pas

    r313 r340  
    681681procedure TNegoDlg.CloseBtnClick(Sender: TObject);
    682682begin
    683   Close
     683  Close;
    684684end;
    685685
     
    690690  begin
    691691    if OkBtn.Visible then
    692       OkBtnClick(nil)
     692      OkBtnClick(nil);
    693693  end
    694694  else
    695     inherited
     695    inherited;
    696696end;
    697697
  • trunk/LocalPlayer/Select.pas

    r328 r340  
    66uses
    77  Protocol, ClientTools, Term, ScreenTools, IsoEngine, PVSB, BaseWin,
    8 
    98  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    109  ExtCtrls, ButtonB, ButtonBase, Menus, Types;
     
    8584  ListDlg: TListDlg;
    8685  ModalSelectDlg: TModalSelectDlg;
     86
    8787
    8888implementation
  • trunk/Packages/CevoComponents/BaseWin.pas

    r317 r340  
    8787end;
    8888
    89 
    9089constructor TBufferedDrawDlg.Create(AOwner: TComponent);
    9190begin
     
    112111procedure TBufferedDrawDlg.FormClose(Sender: TObject; var Action: TCloseAction);
    113112begin
    114   if FWindowMode = wmPersistent then
    115   begin
     113  if FWindowMode = wmPersistent then begin
    116114    UserLeft := Left;
    117     UserTop := Top
     115    UserTop := Top;
    118116  end;
    119117  if OffscreenUser = self then
     
    131129  Shift: TShiftState);
    132130begin
    133   if Key = VK_ESCAPE then
    134   begin
     131  if Key = VK_ESCAPE then begin
    135132    if fsModal in FormState then
    136       ModalResult := mrCancel
    137   end
    138   else if Key = VK_RETURN then
    139   begin
     133      ModalResult := mrCancel;
     134  end else
     135  if Key = VK_RETURN then begin
    140136    if fsModal in FormState then
    141       ModalResult := mrOK
    142   end
    143   else if Key = VK_F1 then begin
     137      ModalResult := mrOK;
     138  end else
     139  if Key = VK_F1 then begin
    144140    if Assigned(ShowNewContentProc) then
    145141      ShowNewContentProc(FWindowMode or wmPersistent, HelpContext);
    146   end else if FWindowMode = wmPersistent then begin
     142  end else
     143  if FWindowMode = wmPersistent then begin
    147144    if Assigned(MainFormKeyDown) then
    148145      MainFormKeyDown(Sender, Key, Shift);
  • trunk/Start.lfm

    r290 r340  
    196196    ItemHeight = 0
    197197    OnClick = ListClick
     198    OnKeyDown = FormKeyDown
    198199    ParentFont = False
    199200    ScrollWidth = 266
  • trunk/Start.pas

    r339 r340  
    143143
    144144uses
    145   Global, Directories, Direct, ScreenTools, Inp, Back, Settings;
     145  Global, Directories, Direct, ScreenTools, Inp, Back, Settings, UKeyBindings;
    146146
    147147{$R *.lfm}
     
    17421742procedure TStartDlg.FormKeyDown(Sender: TObject; var Key: Word;
    17431743  Shift: TShiftState);
    1744 begin
    1745   if KeyToShortCut(Key, Shift) = VK_F1 then
     1744var
     1745  ShortCut: TShortCut;
     1746begin
     1747  ShortCut := KeyToShortCut(Key, Shift);
     1748  if BFullScreen.Test(ShortCut) then begin
     1749    FullScreen := not FullScreen;
     1750    UpdateInterface;
     1751    Background.UpdateInterface;
     1752  end else
     1753  if BHelp.Test(ShortCut) then
    17461754    DirectHelp(cStartHelp);
    17471755end;
Note: See TracChangeset for help on using the changeset viewer.