Skip to content

Commit

Permalink
fix darkmode for finddialog
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Mar 26, 2021
1 parent ca6cfa8 commit 931b7a6
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 55 deletions.
97 changes: 50 additions & 47 deletions Cheat Engine/frmfinddialogunit.lfm
Original file line number Diff line number Diff line change
@@ -1,72 +1,39 @@
object frmFindDialog: TfrmFindDialog
Left = 1016
Height = 127
Height = 148
Top = 149
Width = 234
Width = 337
AutoSize = True
Caption = 'Find'
ClientHeight = 127
ClientWidth = 234
ClientHeight = 148
ClientWidth = 337
Position = poOwnerFormCenter
LCLVersion = '1.6.4.0'
LCLVersion = '2.0.6.0'
object edtText: TEdit
AnchorSideLeft.Control = Label1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblDescription
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnFind
Left = 30
Left = 29
Height = 23
Top = 21
Width = 200
Width = 224
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 3
BorderSpacing.Top = 3
BorderSpacing.Right = 6
Constraints.MinWidth = 200
TabOrder = 0
end
object rgUpDown: TRadioGroup
AnchorSideLeft.Control = edtText
AnchorSideTop.Control = btnFind
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnFind
AnchorSideRight.Side = asrBottom
Left = 161
Height = 58
Top = 49
Width = 67
Anchors = [akTop, akRight]
AutoFill = True
AutoSize = True
BorderSpacing.Left = 4
BorderSpacing.Top = 3
BorderSpacing.Right = 3
Caption = 'Direction'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 38
ClientWidth = 63
ItemIndex = 1
Items.Strings = (
'Up'
'Down'
)
TabOrder = 3
end
object Label1: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = edtText
AnchorSideTop.Side = asrCenter
Left = 5
Height = 15
Top = 25
Width = 22
Width = 21
BorderSpacing.Left = 5
Caption = 'Text'
ParentColor = False
Expand All @@ -75,7 +42,7 @@ object frmFindDialog: TfrmFindDialog
AnchorSideTop.Control = edtText
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 156
Left = 259
Height = 25
Top = 21
Width = 75
Expand All @@ -102,11 +69,11 @@ object frmFindDialog: TfrmFindDialog
TabOrder = 2
end
object Button1: TButton
AnchorSideTop.Control = rgUpDown
AnchorSideTop.Control = gbDirection
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnFind
AnchorSideRight.Side = asrBottom
Left = 156
Left = 259
Height = 25
Top = 115
Width = 75
Expand All @@ -118,17 +85,53 @@ object frmFindDialog: TfrmFindDialog
Caption = 'Cancel'
Constraints.MinWidth = 75
ModalResult = 2
TabOrder = 4
TabOrder = 3
end
object lblDescription: TLabel
AnchorSideLeft.Control = edtText
AnchorSideTop.Control = Owner
Left = 30
Left = 29
Height = 15
Top = 3
Width = 123
Width = 124
BorderSpacing.Top = 3
Caption = 'Enter the text to search:'
ParentColor = False
end
object gbDirection: TGroupBox
AnchorSideTop.Control = btnFind
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnFind
AnchorSideRight.Side = asrBottom
Left = 264
Height = 58
Top = 49
Width = 67
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 3
BorderSpacing.Right = 3
Caption = 'Direction'
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 38
ClientWidth = 63
TabOrder = 4
object rbDirectionUp: TRadioButton
Left = 0
Height = 19
Top = 0
Width = 51
Caption = 'Up'
TabOrder = 0
end
object rbDirectionDown: TRadioButton
Left = 0
Height = 19
Top = 19
Width = 51
Caption = 'Down'
TabOrder = 1
end
end
end
18 changes: 10 additions & 8 deletions Cheat Engine/frmfinddialogunit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ TfrmFindDialog = class(TForm)
Button1: TButton;
cbCaseSensitive: TCheckBox;
edtText: TEdit;
gbDirection: TGroupBox;
Label1: TLabel;
lblDescription: TLabel;
rgUpDown: TRadioGroup;
rbDirectionUp: TRadioButton;
rbDirectionDown: TRadioButton;
private
{ private declarations }
function getFindText: string;
Expand Down Expand Up @@ -71,12 +73,12 @@ procedure TfrmFindDialog.setDescription(s: string);

function TfrmFindDialog.getShowDirection: boolean;
begin
result:=rgUpDown.Visible;
result:=gbDirection.Visible;
end;

procedure TfrmFindDialog.setShowDirection(s: boolean);
begin
rgUpDown.visible:=s;
gbDirection.visible:=s;
end;

function TfrmFindDialog.getShowCaseSensitive: boolean;
Expand All @@ -101,18 +103,18 @@ procedure TfrmFindDialog.setCaseSensitive(s: boolean);

function TfrmFindDialog.getDirection: TFindDirection;
begin
if rgUpDown.itemindex=1 then
result:=fdDown
if rbDirectionUp.checked then
result:=fdUp
else
result:=fdUp;
result:=fdDown;
end;

procedure TfrmFindDialog.setDirection(d: TFindDirection);
begin
if d=fdDown then
rgUpDown.itemindex:=1
rbDirectionDown.Checked:=true
else
rgUpDown.itemindex:=0;
rbDirectionUp.checked:=true;
end;

function TfrmFindDialog.getFindText: string;
Expand Down

0 comments on commit 931b7a6

Please sign in to comment.