Changeset 408 for trunk


Ignore:
Timestamp:
Nov 3, 2021, 5:31:17 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Use correct text color and background in settings form key bindings edit boxes.
  • Fixed: Always use initial back background for windows so they less flicker during first draw. This was more visible on Linux systems with white system theme.
  • Modified: Code cleanup.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Inp.pas

    r352 r408  
    55
    66uses
    7   ScreenTools, Messg,
    8   LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, DrawDlg,
    9   ButtonA, StdCtrls;
     7  ScreenTools, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
     8  DrawDlg, ButtonA, StdCtrls;
    109
    1110type
     
    3837  TitleHeight := Height;
    3938  InitButtons;
    40   Center := true;
     39  Center := True;
    4140end;
    4241
     
    6463    ModalResult := mrCancel
    6564  else
    66     ModalResult := mrOK
     65    ModalResult := mrOK;
    6766end;
    6867
     
    7271  begin
    7372    Key := #0;
    74     ModalResult := mrOK
     73    ModalResult := mrOK;
    7574  end
    7675  else if Key = #27 then
    7776  begin
    7877    Key := #0;
    79     ModalResult := mrCancel
    80   end
     78    ModalResult := mrCancel;
     79  end;
    8180end;
    8281
     
    9392procedure TInputDlg.FormClose(Sender: TObject; var Action: TCloseAction);
    9493begin
    95   Center := true
     94  Center := True;
    9695end;
    9796
    9897procedure TInputDlg.CenterToRect(Rect: TRect);
    9998begin
    100   Center := false;
     99  Center := False;
    101100  Left := Rect.Left + (Rect.Right - Rect.Left - Width) div 2;
    102101  Top := Rect.Top + (Rect.Bottom - Rect.Top - Height) div 2;
  • trunk/Packages/CevoComponents/BaseWin.pas

    r352 r408  
    1414  TBufferedDrawDlg = class(TDrawDlg)
    1515  public
    16     UserLeft, UserTop: integer;
     16    UserLeft: Integer;
     17    UserTop: Integer;
    1718    constructor Create(AOwner: TComponent); override;
    1819    destructor Destroy; override;
     
    2122    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    2223    procedure FormDeactivate(Sender: TObject);
    23     procedure SmartUpdateContent(ImmUpdate: boolean = false);
     24    procedure SmartUpdateContent(ImmUpdate: Boolean = false);
    2425    procedure StayOnTop_Workaround;
    2526  protected
    26     FWindowMode, ModalFrameIndent: integer;
     27    FWindowMode: Integer;
     28    ModalFrameIndent: Integer;
    2729    HelpContext: string;
    28     procedure ShowNewContent(NewMode: integer; forceclose: boolean = false);
    29     procedure MarkUsedOffscreen(xMax, yMax: integer);
     30    procedure ShowNewContent(NewMode: Integer; ForceClose: Boolean = False);
     31    procedure MarkUsedOffscreen(xMax, yMax: Integer);
    3032    procedure OffscreenPaint; virtual;
    3133    procedure VPaint; virtual;
    3234  public
    33     UsedOffscreenWidth, UsedOffscreenHeight: integer;
     35    UsedOffscreenWidth: Integer;
     36    UsedOffscreenHeight: Integer;
    3437    Offscreen: TBitmap;
    3538    OffscreenUser: TForm;
     
    5356    procedure InitWindowRegion;
    5457    procedure VPaint; override;
    55     procedure FillOffscreen(Left, Top, Width, Height: integer);
     58    procedure FillOffscreen(Left, Top, Width, Height: Integer);
    5659  end;
    5760
     
    155158procedure TBufferedDrawDlg.OffscreenPaint;
    156159begin
    157   if (OffscreenUser <> nil) and (OffscreenUser <> self) then
     160  if (OffscreenUser <> nil) and (OffscreenUser <> Self) then
    158161    OffscreenUser.Update; // complete working with old owner to prevent rebound
    159   OffscreenUser := self;
     162  OffscreenUser := Self;
    160163end;
    161164
     
    165168end;
    166169
    167 procedure TBufferedDrawDlg.ShowNewContent(NewMode: integer;
    168   forceclose: boolean);
    169 begin
    170   if Visible then
    171   begin
    172     assert((NewMode = wmModal) or (FWindowMode <> wmModal));
     170procedure TBufferedDrawDlg.ShowNewContent(NewMode: Integer;
     171  ForceClose: Boolean);
     172begin
     173  if Visible then begin
     174    Assert((NewMode = wmModal) or (FWindowMode <> wmModal));
    173175    // don't make modal window non-modal
    174176    if (NewMode = wmModal) and (forceclose or (FWindowMode <> wmModal)) then
     
    194196        OnShow(nil);
    195197      Invalidate;
    196       BringToFront
    197     end
     198      BringToFront;
     199    end;
    198200  end
    199201  else
     
    205207      ShowModal
    206208    else
    207       Show
    208   end
    209 end;
    210 
    211 procedure TBufferedDrawDlg.SmartUpdateContent(ImmUpdate: boolean);
    212 begin
    213   if Visible then
    214   begin
     209      Show;
     210  end;
     211end;
     212
     213procedure TBufferedDrawDlg.SmartUpdateContent(ImmUpdate: Boolean);
     214begin
     215  if Visible then begin
    215216    OffscreenPaint;
    216217    SmartInvalidate;
     
    220221end;
    221222
    222 procedure TBufferedDrawDlg.MarkUsedOffscreen(xMax, yMax: integer);
     223procedure TBufferedDrawDlg.MarkUsedOffscreen(xMax, yMax: Integer);
    223224begin
    224225  if xMax > UsedOffscreenWidth then
     
    256257  CaptionLeft := 0;
    257258  CaptionRight := $FFFF;
    258   WideBottom := false;
    259   FullCaption := true;
    260   TexOverride := false;
    261   ModalIndication := true;
     259  WideBottom := False;
     260  FullCaption := True;
     261  TexOverride := False;
     262  ModalIndication := True;
    262263  Canvas.Brush.Style := bsClear;
    263264  InnerWidth := Width - 2 * SideFrame;
     
    284285      DeleteObject(r1);
    285286    end;
    286   InvalidateRgn(Handle, r0, false);
     287  InvalidateRgn(Handle, r0, False);
    287288  DeleteObject(r0);
    288289end;
     
    348349  // RFrame(Canvas,SideFrame-2,TitleHeight-2,ClientWidth-SideFrame+1,
    349350  // InnerBottom+1,MainTexture.ColorBevelShade,MainTexture.ColorBevelLight);
    350   if FullCaption then
    351   begin
     351  if FullCaption then begin
    352352    if (FWindowMode <> wmModal) or not ModalIndication then
    353353    begin
     
    479479    // DeleteObject(r1);
    480480  end;
    481   SetWindowRgn(Handle, r0, false);
     481  SetWindowRgn(Handle, r0, False);
    482482  // DeleteObject(r0); // causes crash with Windows 95
    483483end;
    484484
    485 procedure TFramedDlg.FillOffscreen(Left, Top, Width, Height: integer);
     485procedure TFramedDlg.FillOffscreen(Left, Top, Width, Height: Integer);
    486486begin
    487487  Fill(Offscreen.Canvas, Left, Top, Width, Height,
     
    493493begin
    494494  if Offscreen <> nil then
    495     exit;
     495    Exit;
    496496  Offscreen := TBitmap.Create;
    497497  Offscreen.PixelFormat := pf24bit;
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r395 r408  
    4646    MessgText: string;
    4747  protected
    48     Lines, TopSpace: integer;
     48    Lines: Integer;
     49    TopSpace: Integer;
    4950    procedure SplitText(preview: boolean);
    5051    procedure CorrectHeight;
     
    7172begin
    7273  inherited;
     74  Color := clBlack;
    7375  TitleHeight := 0;
    7476  MoveActive := False;
  • trunk/Settings.pas

    r386 r408  
    3737    procedure FormPaint(Sender: TObject);
    3838    procedure FormShow(Sender: TObject);
    39     procedure ListKeyBindingsSelectionChange(Sender: TObject; User: boolean);
     39    procedure ListKeyBindingsSelectionChange(Sender: TObject; User: Boolean);
    4040    procedure ButtonOkClick(Sender: TObject);
    4141    procedure Up2BtnClick(Sender: TObject);
     
    166166  Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    167167    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
     168  EditFrame(Canvas, EditShortCutPrimary.BoundsRect, MainTexture);
     169  EditFrame(Canvas, EditShortCutSecondary.BoundsRect, MainTexture);
    168170  EditFrame(Canvas, ListLanguages.BoundsRect, MainTexture);
    169171  BtnFrame(Canvas, ButtonOk.BoundsRect, MainTexture);
     
    196198  LoadData;
    197199  LocalKeyBindings.LoadToStrings(ListKeyBindings.Items);
     200  EditShortCutPrimary.Font.Color := MainTexture.ColorMark;
     201  EditShortCutSecondary.Font.Color := MainTexture.ColorMark;
    198202end;
    199203
    200204procedure TSettingsDlg.ListKeyBindingsSelectionChange(Sender: TObject;
    201   User: boolean);
     205  User: Boolean);
    202206begin
    203207  if Assigned(CurrentKeyBinding) then begin
Note: See TracChangeset for help on using the changeset viewer.