ppulistdlg: Improvement appearance, close the dialog with [Esc]

This commit is contained in:
n7800 2024-07-18 09:24:51 +05:00 committed by Maxim Ganetsky
parent 82d3fdbe13
commit 6078ca4e45
2 changed files with 80 additions and 37 deletions

View File

@ -6,10 +6,12 @@ object PPUListDialog: TPPUListDialog
Caption = 'PPUListDialog' Caption = 'PPUListDialog'
ClientHeight = 531 ClientHeight = 531
ClientWidth = 740 ClientWidth = 740
KeyPreview = True
OnClose = FormClose OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
Position = poScreenCenter OnKeyDown = FormKeyDown
Position = poWorkAreaCenter
LCLVersion = '3.99.0.0' LCLVersion = '3.99.0.0'
object ButtonPanel1: TButtonPanel object ButtonPanel1: TButtonPanel
Left = 6 Left = 6
@ -56,54 +58,59 @@ object PPUListDialog: TPPUListDialog
Height = 209 Height = 209
Top = 6 Top = 6
Width = 724 Width = 724
Align = alTop Align = alClient
AutoFillColumns = True AutoFillColumns = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
ColCount = 6 ColCount = 6
Columns = < Columns = <
item item
SizePriority = 10 SizePriority = 1
Title.Caption = 'Unit' Title.Caption = 'Unit'
Width = 120 Width = 120
end end
item item
SizePriority = 10 SizePriority = 0
Title.Caption = 'Size of .ppu file' Title.Caption = 'Size of .ppu file'
Width = 120 Width = 130
end end
item item
SizePriority = 10 SizePriority = 0
Title.Caption = 'Size of .o file' Title.Caption = 'Size of .o file'
Width = 120 Width = 130
end end
item item
SizePriority = 5 SizePriority = 0
Title.Caption = 'Uses' Title.Caption = 'Uses'
Width = 120 Width = 100
end end
item item
SizePriority = 5 SizePriority = 0
Title.Caption = 'Used by' Title.Caption = 'Used by'
Width = 120 Width = 100
end end
item item
Title.Caption = 'Package' Title.Caption = 'Package'
Width = 120 Width = 119
end> end>
DefaultColWidth = 150 DefaultColWidth = 150
FixedCols = 0 FixedCols = 0
FixedRows = 2 FixedRows = 2
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goColSizing, goThumbTracking, goColSpanning, goDblClickAutoSize, goSmoothScroll] FocusRectVisible = False
MouseWheelOption = mwGrid
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goThumbTracking, goDblClickAutoSize, goSmoothScroll, goTruncCellHints, goCellEllipsis, goRowHighlight]
ParentShowHint = False
RowCount = 2
ShowHint = True
TabOrder = 0 TabOrder = 0
OnMouseDown = UnitsStringGridMouseDown OnMouseDown = UnitsStringGridMouseDown
OnSelectCell = UnitsStringGridSelectCell OnSelectCell = UnitsStringGridSelectCell
ColWidths = ( ColWidths = (
120 120
120 120
120 119
120 119
120 119
120 119
) )
end end
object Splitter1: TSplitter object Splitter1: TSplitter
@ -112,15 +119,15 @@ object PPUListDialog: TPPUListDialog
Height = 5 Height = 5
Top = 221 Top = 221
Width = 736 Width = 736
Align = alTop Align = alBottom
ResizeAnchor = akTop ResizeAnchor = akBottom
end end
object UnitGroupBox: TGroupBox object UnitGroupBox: TGroupBox
Left = 6 Left = 6
Height = 179 Height = 179
Top = 232 Top = 232
Width = 724 Width = 724
Align = alClient Align = alBottom
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'UnitGroupBox' Caption = 'UnitGroupBox'
ClientHeight = 149 ClientHeight = 149
@ -170,18 +177,24 @@ object PPUListDialog: TPPUListDialog
Width = 716 Width = 716
Align = alClient Align = alClient
AutoFillColumns = True AutoFillColumns = True
BorderSpacing.Around = 6
ColCount = 1 ColCount = 1
Columns = < Columns = <
item item
Title.Caption = 'Unit' Title.Caption = 'Unit'
Width = 712 Width = 704
end> end>
FixedCols = 0 FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goThumbTracking, goSmoothScroll] FocusRectVisible = False
MouseWheelOption = mwGrid
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goThumbTracking, goSmoothScroll, goTruncCellHints, goCellEllipsis, goRowHighlight]
ParentShowHint = False
RowCount = 1
ShowHint = True
TabOrder = 0 TabOrder = 0
OnMouseDown = UnitStringGridMouseDown OnMouseDown = UnitStringGridMouseDown
ColWidths = ( ColWidths = (
712 704
) )
end end
end end
@ -196,18 +209,24 @@ object PPUListDialog: TPPUListDialog
Width = 716 Width = 716
Align = alClient Align = alClient
AutoFillColumns = True AutoFillColumns = True
BorderSpacing.Around = 6
ColCount = 1 ColCount = 1
Columns = < Columns = <
item item
Title.Caption = 'Unit' Title.Caption = 'Unit'
Width = 712 Width = 704
end> end>
FixedCols = 0 FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goThumbTracking, goSmoothScroll] FocusRectVisible = False
MouseWheelOption = mwGrid
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goThumbTracking, goSmoothScroll, goTruncCellHints, goCellEllipsis, goRowHighlight]
ParentShowHint = False
RowCount = 1
ShowHint = True
TabOrder = 0 TabOrder = 0
OnMouseDown = UnitStringGridMouseDown OnMouseDown = UnitStringGridMouseDown
ColWidths = ( ColWidths = (
712 704
) )
end end
end end
@ -222,18 +241,24 @@ object PPUListDialog: TPPUListDialog
Width = 716 Width = 716
Align = alClient Align = alClient
AutoFillColumns = True AutoFillColumns = True
BorderSpacing.Around = 6
ColCount = 1 ColCount = 1
Columns = < Columns = <
item item
Title.Caption = 'Unit' Title.Caption = 'Unit'
Width = 712 Width = 704
end> end>
FixedCols = 0 FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goSmoothScroll] FocusRectVisible = False
MouseWheelOption = mwGrid
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goThumbTracking, goSmoothScroll, goTruncCellHints, goCellEllipsis, goRowHighlight]
ParentShowHint = False
RowCount = 1
ShowHint = True
TabOrder = 0 TabOrder = 0
OnMouseDown = UnitStringGridMouseDown OnMouseDown = UnitStringGridMouseDown
ColWidths = ( ColWidths = (
712 704
) )
end end
end end
@ -248,27 +273,34 @@ object PPUListDialog: TPPUListDialog
Width = 716 Width = 716
Align = alClient Align = alClient
AutoFillColumns = True AutoFillColumns = True
BorderSpacing.Around = 6
ColCount = 3 ColCount = 3
Columns = < Columns = <
item item
Title.Caption = 'Type' Title.Caption = 'Type'
Width = 231 Width = 235
end end
item item
Title.Caption = 'File' Title.Caption = 'File'
Width = 230 Width = 235
end end
item item
SizePriority = 0
Title.Caption = 'Flags' Title.Caption = 'Flags'
Width = 230 Width = 160
end> end>
FixedCols = 0 FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goColSizing, goThumbTracking, goColSpanning, goSmoothScroll] FocusRectVisible = False
MouseWheelOption = mwGrid
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goThumbTracking, goSmoothScroll, goTruncCellHints, goCellEllipsis, goRowHighlight]
ParentShowHint = False
RowCount = 1
ShowHint = True
TabOrder = 0 TabOrder = 0
ColWidths = ( ColWidths = (
231 235
230 235
230 234
) )
end end
end end

View File

@ -33,7 +33,7 @@ uses
Classes, SysUtils, contnrs, math, AVL_Tree, Classes, SysUtils, contnrs, math, AVL_Tree,
// LCL // LCL
FileUtil, Forms, Controls, Dialogs, ButtonPanel, Grids, StdCtrls, FileUtil, Forms, Controls, Dialogs, ButtonPanel, Grids, StdCtrls,
ExtCtrls, ComCtrls, ExtCtrls, ComCtrls, LCLType,
// LazUtils // LazUtils
AvgLvlTree, LazUTF8, AvgLvlTree, LazUTF8,
// BuildIntf // BuildIntf
@ -121,6 +121,7 @@ type
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction); procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure LinkedFilesTreeViewDblClick(Sender: TObject); procedure LinkedFilesTreeViewDblClick(Sender: TObject);
procedure UnitsStringGridMouseDown(Sender: TObject; {%H-}Button: TMouseButton; procedure UnitsStringGridMouseDown(Sender: TObject; {%H-}Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
@ -319,6 +320,16 @@ begin
FreeAndNil(FDlgLinkedFiles); FreeAndNil(FDlgLinkedFiles);
end; end;
procedure TPPUListDialog.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = VK_ESCAPE) and (Shift = []) then
begin
Close;
Key := 0;
end;
end;
procedure TPPUListDialog.LinkedFilesTreeViewDblClick(Sender: TObject); procedure TPPUListDialog.LinkedFilesTreeViewDblClick(Sender: TObject);
var var
Node: TTreeNode; Node: TTreeNode;