Ignore:
Timestamp:
May 9, 2020, 4:02:07 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved HighDPI branch. Imported new changes from trunk branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Locale.pas

    r178 r210  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ScreenTools, Messg, ButtonA, Registry, fgl, Directories, DrawDlg, UDpiControls;
     8  UDpiControls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     9  ScreenTools, Messg, ButtonA, Registry, fgl, Directories, DrawDlg, ButtonC;
    1010
    1111type
     
    2727
    2828  TLocaleDlg = class(TDrawDlg)
     29    ButtonFullscreen: TButtonC;
    2930    List: TDpiListBox;
    3031    OKBtn: TButtonA;
    3132    CancelBtn: TButtonA;
     33    procedure ButtonFullscreenClick(Sender: TObject);
    3234    procedure CancelBtnClick(Sender: TObject);
    3335    procedure FormCreate(Sender: TObject);
     
    101103  OkBtn.Graphic := GrExt[HGrSystem].Data;
    102104  CancelBtn.Graphic := GrExt[HGrSystem].Data;
     105
     106  ButtonFullscreen.Graphic := GrExt[HGrSystem].Data;
     107  if FullScreen then ButtonFullscreen.ButtonIndex := 3
     108    else ButtonFullscreen.ButtonIndex := 2;
    103109end;
    104110
    105111procedure TLocaleDlg.CancelBtnClick(Sender: TObject);
    106112begin
    107   ModalResult := mrOk;
     113  ModalResult := mrCancel;
     114end;
     115
     116procedure TLocaleDlg.ButtonFullscreenClick(Sender: TObject);
     117begin
     118  FullScreen := not FullScreen;
     119  ButtonFullscreen.ButtonIndex := ButtonFullscreen.ButtonIndex xor 1;
    108120end;
    109121
     
    114126
    115127procedure TLocaleDlg.FormPaint(Sender: TObject);
     128var
     129  S: string;
    116130begin
    117131  PaintBackground(self, 3, 3, ClientWidth - 6, ClientHeight - 6);
     
    124138  BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture);
    125139  BtnFrame(Canvas, CancelBtn.BoundsRect, MainTexture);
     140
     141  RFrame(Canvas, ButtonFullscreen.Left - 1, ButtonFullscreen.Top - 1,
     142    ButtonFullscreen.Left + 12, ButtonFullscreen.Top + 12, MainTexture.clBevelShade,
     143    MainTexture.clBevelLight);
     144
     145  s := Phrases.Lookup('SETTINGS', 0);
     146  LoweredTextOut(Canvas, -2, MainTexture, ButtonFullscreen.Left + 32,
     147    ButtonFullscreen.Top - 4, s);
    126148end;
    127149
     
    138160begin
    139161  LocaleCode := Languages[List.ItemIndex].ShortName;
    140   ModalResult := mrCancel;
     162  ModalResult := mrOk;
    141163end;
    142164
Note: See TracChangeset for help on using the changeset viewer.