UPD: Some interface elements

This commit is contained in:
Alexander Koblov 2007-10-12 20:12:27 +00:00
commit 5201a60f3b
14 changed files with 1065 additions and 1139 deletions

View file

@ -19,7 +19,7 @@ inherited frmFileOp: TfrmFileOp
ShowInTaskBar = stAlways
object lblFileName: TLabel
Height = 13
Width = 59
Width = 68
Caption = 'lblFileName'
Font.Color = clBlack
Font.Height = 13
@ -29,9 +29,9 @@ inherited frmFileOp: TfrmFileOp
ParentColor = False
end
object lblEstimated: TLabel
Height = 14
Height = 13
Top = 96
Width = 58
Width = 67
Caption = 'lblEstimated'
ParentColor = False
end
@ -56,7 +56,7 @@ inherited frmFileOp: TfrmFileOp
end
object btnCancel: TBitBtn
Left = 160
Height = 25
Height = 32
Top = 96
Width = 89
BorderSpacing.InnerBorder = 2

View file

@ -1,7 +1,7 @@
inherited frmFindDlg: TfrmFindDlg
Left = -84
Left = 129
Height = 476
Top = 176
Top = 54
Width = 659
HorzScrollBar.Page = 658
VertScrollBar.Page = 475
@ -43,21 +43,21 @@ inherited frmFindDlg: TfrmFindDlg
TabOrder = 0
object tsStandard: TTabSheet
Caption = 'Standard'
ClientHeight = 270
ClientWidth = 556
ClientHeight = 266
ClientWidth = 560
object lblFindPathStart: TLabel
Left = 8
Height = 14
Height = 13
Top = 50
Width = 30
Width = 38
Caption = 'FileDir'
ParentColor = False
end
object lblFindFileMask: TLabel
Left = 8
Height = 14
Height = 13
Top = 4
Width = 41
Width = 52
Caption = 'FileMask'
ParentColor = False
end
@ -68,7 +68,6 @@ inherited frmFindDlg: TfrmFindDlg
Width = 362
Anchors = [akTop, akLeft, akRight]
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13
MaxLength = 0
ParentCtl3D = False
TabOrder = 0
@ -81,16 +80,16 @@ inherited frmFindDlg: TfrmFindDlg
Width = 418
Anchors = [akTop, akLeft, akRight]
Caption = 'Find Data'
ClientHeight = 127
ClientHeight = 128
ClientWidth = 414
Enabled = False
ParentCtl3D = False
TabOrder = 1
object cbCaseSens: TCheckBox
Left = 18
Height = 13
Height = 20
Top = 97
Width = 88
Width = 109
Caption = 'Case sensitive'
TabOrder = 0
end
@ -98,23 +97,23 @@ inherited frmFindDlg: TfrmFindDlg
Left = 16
Height = 24
Top = 9
Width = 266
Width = 262
Anchors = [akTop, akLeft, akRight]
TabOrder = 1
end
object cbNoThisText: TCheckBox
Left = 154
Height = 13
Height = 20
Top = 97
Width = 177
Width = 214
Caption = 'Find files NOT containing the text'
TabOrder = 2
end
object cbReplaceText: TCheckBox
Left = 16
Height = 13
Height = 20
Top = 41
Width = 80
Width = 96
Caption = 'Replace text'
OnChange = cbReplaceTextChange
TabOrder = 4
@ -130,9 +129,9 @@ inherited frmFindDlg: TfrmFindDlg
end
object cbFindInFile: TCheckBox
Left = 12
Height = 13
Height = 20
Top = 98
Width = 67
Width = 86
Caption = 'Find in file'
OnClick = cbFindInFileClick
TabOrder = 2
@ -150,8 +149,8 @@ inherited frmFindDlg: TfrmFindDlg
end
object tsAdvanced: TTabSheet
Caption = 'Advanced'
ClientHeight = 270
ClientWidth = 556
ClientHeight = 296
ClientWidth = 564
ImageIndex = 1
object deDateFrom: TDateEdit
Left = 4
@ -256,7 +255,6 @@ inherited frmFindDlg: TfrmFindDlg
Width = 110
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
Enabled = False
ItemHeight = 13
ItemIndex = 2
Items.Strings = (
'Minute(s)'
@ -320,7 +318,6 @@ inherited frmFindDlg: TfrmFindDlg
Width = 72
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
Enabled = False
ItemHeight = 13
ItemIndex = 1
Items.Strings = (
'Byte'
@ -374,8 +371,8 @@ inherited frmFindDlg: TfrmFindDlg
Height = 165
Top = 41
Width = 270
ClientHeight = 147
ClientWidth = 266
ClientHeight = 165
ClientWidth = 270
Enabled = False
TabOrder = 16
object lblInfo: TLabel
@ -438,22 +435,28 @@ inherited frmFindDlg: TfrmFindDlg
end
end
object btnClose: TButton
AnchorSideTop.Control = btnStart
AnchorSideTop.Side = asrBottom
Left = 572
Height = 25
Top = 71
Height = 32
Top = 77
Width = 75
Anchors = [akTop, akRight]
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 4
Caption = '&Close'
OnClick = btnCloseClick
TabOrder = 3
end
object btnStop: TButton
AnchorSideTop.Control = btnClose
AnchorSideTop.Side = asrBottom
Left = 572
Height = 25
Top = 103
Height = 32
Top = 115
Width = 75
Anchors = [akTop, akRight]
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 4
Cancel = True
Caption = 'Cancel'
@ -463,7 +466,7 @@ inherited frmFindDlg: TfrmFindDlg
end
object btnStart: TButton
Left = 572
Height = 25
Height = 32
Top = 39
Width = 75
Anchors = [akTop, akRight]
@ -498,7 +501,7 @@ inherited frmFindDlg: TfrmFindDlg
Left = 8
Height = 13
Top = 30
Width = 44
Width = 54
Caption = 'lblStatus'
Font.Color = clBlack
Font.Height = 13
@ -511,7 +514,7 @@ inherited frmFindDlg: TfrmFindDlg
Left = 8
Height = 13
Top = 12
Width = 49
Width = 58
Caption = 'lblCurrent'
Font.Color = clBlack
Font.Height = 13
@ -522,7 +525,7 @@ inherited frmFindDlg: TfrmFindDlg
end
end
object lsFoundedFiles: TListBox
Height = 76
Height = 68
Top = 54
Width = 659
Align = alClient
@ -530,18 +533,19 @@ inherited frmFindDlg: TfrmFindDlg
OnDblClick = lsFoundedFilesDblClick
PopupMenu = PopupMenuFind
TabOrder = 1
TopIndex = -1
end
object Panel4: TPanel
Height = 50
Top = 130
Height = 58
Top = 122
Width = 659
Align = alBottom
ClientHeight = 50
ClientHeight = 58
ClientWidth = 659
TabOrder = 2
object btnView: TButton
Left = 24
Height = 25
Height = 32
Top = 14
Width = 104
BorderSpacing.InnerBorder = 4
@ -551,7 +555,7 @@ inherited frmFindDlg: TfrmFindDlg
end
object btnNewSearch: TButton
Left = 152
Height = 25
Height = 32
Top = 14
Width = 104
BorderSpacing.InnerBorder = 4
@ -561,7 +565,7 @@ inherited frmFindDlg: TfrmFindDlg
end
object btnGoToPath: TButton
Left = 398
Height = 25
Height = 32
Top = 14
Width = 104
Anchors = [akTop, akRight]
@ -572,7 +576,7 @@ inherited frmFindDlg: TfrmFindDlg
end
object btnWorkWithFound: TButton
Left = 526
Height = 25
Height = 32
Top = 14
Width = 104
Anchors = [akTop, akRight]

View file

@ -1,30 +1,30 @@
inherited frmCompareFiles: TfrmCompareFiles
Left = 13
Height = 540
Top = 153
Left = 24
Height = 530
Top = 255
Width = 783
HorzScrollBar.Page = 782
HorzScrollBar.Range = 365
VertScrollBar.Page = 539
VertScrollBar.Page = 529
VertScrollBar.Range = 52
ActiveControl = edtFileNameLeft
Caption = 'Compare files'
ClientHeight = 540
ClientHeight = 530
ClientWidth = 783
Position = poScreenCenter
object Splitter1: TSplitter
Left = 361
Height = 479
Top = 41
Height = 462
Top = 48
Width = 5
end
object pnlLeft: TPanel
Height = 479
Top = 41
Height = 462
Top = 48
Width = 361
Align = alLeft
BevelOuter = bvNone
ClientHeight = 479
ClientHeight = 462
ClientWidth = 361
FullRepaint = False
TabOrder = 0
@ -48,7 +48,7 @@ inherited frmCompareFiles: TfrmCompareFiles
end
end
object lstLeft: TSynEdit
Height = 454
Height = 437
Top = 25
Width = 361
Align = alClient
@ -60,10 +60,12 @@ inherited frmCompareFiles: TfrmCompareFiles
ParentCtl3D = False
TabOrder = 1
BookMarkOptions.Xoffset = -18
BookMarkOptions.OnChange = nil
Gutter.DigitCount = 2
Gutter.LeftOffset = 0
Gutter.Visible = False
Gutter.Width = 15
Gutter.OnChange = nil
Gutter.CodeFoldingWidth = 14
Keystrokes = <
item
@ -387,18 +389,19 @@ inherited frmCompareFiles: TfrmCompareFiles
ShortCut = 24642
end>
ReadOnly = True
SelectedColor.OnChange = nil
OnSpecialLineColors = lstLeftSpecialLineColors
OnStatusChange = lstLeftStatusChange
end
end
object pnlRight: TPanel
Left = 366
Height = 479
Top = 41
Height = 462
Top = 48
Width = 417
Align = alClient
BevelOuter = bvNone
ClientHeight = 479
ClientHeight = 462
ClientWidth = 417
FullRepaint = False
TabOrder = 1
@ -422,7 +425,7 @@ inherited frmCompareFiles: TfrmCompareFiles
end
end
object lstRight: TSynEdit
Height = 454
Height = 437
Top = 25
Width = 417
Align = alClient
@ -434,7 +437,9 @@ inherited frmCompareFiles: TfrmCompareFiles
ParentCtl3D = False
TabOrder = 1
BookMarkOptions.Xoffset = -18
BookMarkOptions.OnChange = nil
Gutter.Visible = False
Gutter.OnChange = nil
Gutter.CodeFoldingWidth = 14
Keystrokes = <
item
@ -758,13 +763,14 @@ inherited frmCompareFiles: TfrmCompareFiles
ShortCut = 24642
end>
ReadOnly = True
SelectedColor.OnChange = nil
OnSpecialLineColors = lstRightSpecialLineColors
OnStatusChange = lstRightStatusChange
end
end
object pnlStatusBar: TStatusBar
Height = 20
Top = 520
Top = 510
Width = 783
Panels = <
item
@ -773,17 +779,17 @@ inherited frmCompareFiles: TfrmCompareFiles
end>
end
object pnlButtons: TPanel
Height = 41
Height = 48
Width = 783
Align = alTop
BevelOuter = bvNone
ClientHeight = 41
ClientHeight = 48
ClientWidth = 783
FullRepaint = False
TabOrder = 2
object btnCompare: TButton
Left = 5
Height = 23
Height = 32
Top = 8
Width = 96
BorderSpacing.InnerBorder = 4
@ -793,7 +799,7 @@ inherited frmCompareFiles: TfrmCompareFiles
end
object btnNextDiff: TButton
Left = 120
Height = 23
Height = 32
Top = 8
Width = 122
BorderSpacing.InnerBorder = 4
@ -802,7 +808,7 @@ inherited frmCompareFiles: TfrmCompareFiles
end
object btnPrevDiff: TButton
Left = 256
Height = 23
Height = 32
Top = 8
Width = 147
BorderSpacing.InnerBorder = 4
@ -811,16 +817,16 @@ inherited frmCompareFiles: TfrmCompareFiles
end
object chbBinMode: TCheckBox
Left = 424
Height = 13
Height = 20
Top = 8
Width = 78
Width = 97
AllowGrayed = True
Caption = 'Binary mode'
TabOrder = 3
end
object btnClose: TButton
Left = 648
Height = 23
Height = 32
Top = 8
Width = 50
BorderSpacing.InnerBorder = 4
@ -830,9 +836,9 @@ inherited frmCompareFiles: TfrmCompareFiles
end
object chbKeepScrolling: TCheckBox
Left = 528
Height = 13
Height = 20
Top = 8
Width = 86
Width = 107
AllowGrayed = True
Caption = 'Keep scrolling'
TabOrder = 5

View file

@ -263,7 +263,10 @@ end;
procedure TfrmEditSearch.CreateDialog(AOwner: TForm);
begin
SetInitialBounds(367, 203, 332, 167);
SetInitialBounds(367, 203, 332, 170);
BorderStyle := bsDialog;
Position := poMainFormCenter;
lblSearchFor:= TLabel.Create(AOwner);
lblSearchFor.Parent:=AOwner;
@ -304,6 +307,7 @@ begin
btnOK.Parent:=AOwner;
btnOK.Left:=170;
btnOK.Top:=136;
btnOK.Height := 32;
btnOK.Caption:='OK'; // TODO: change this
btnOK.OnClick:=@btnOKClick;
@ -311,6 +315,7 @@ begin
btnCancel.Parent:=AOwner;
btnCancel.Top:=136;
btnCancel.Left:=249;
btnCancel.Height := 32;
btnCancel.Cancel:=True;
btnCancel.ModalResult:=mrCancel;
btnCancel.Caption:='Cancel'; // TODO: change this
@ -393,8 +398,11 @@ end;
procedure TfrmEditSearchReplace.CreateDialog(AOwner: TForm);
begin
inherited CreateDialog(AOwner); // create search dialog
Height:=Height+30;
BorderStyle := bsDialog;
Position := poMainFormCenter;
Height:=Height+40;
gbSearchOptions.Top:=gbSearchOptions.Top+30;
rgSearchDirection.Top:=rgSearchDirection.Top+30;
lblReplaceWith:= TLabel.Create(AOwner);
@ -406,7 +414,9 @@ begin
cbReplaceText.SetBounds(112, 35, 208, 24 );
btnOK.Top:=btnOK.Top+30;
btnOK.Height := 32;
btnCancel.Top:=btnCancel.Top+30;
btnCancel.Height := 32;
Caption:=cEditSearchReplace;
lblReplaceWith.Caption:=cEditSearchReplaceWith;

View file

@ -1,54 +1,56 @@
object frmHardLink: TfrmHardLink
inherited frmHardLink: TfrmHardLink
Left = 292
Height = 156
Top = 224
Width = 417
HorzScrollBar.Page = 416
HorzScrollBar.Range = 411
VertScrollBar.Page = 155
VertScrollBar.Range = 145
ActiveControl = edtNew
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'frmHardLink'
ClientHeight = 148
ClientHeight = 156
ClientWidth = 417
KeyPreview = True
OnKeyPress = frmHardLinkKeyPress
PixelsPerInch = 96
Position = poMainFormCenter
TextHeight = 16
HorzScrollBar.Page = 416
HorzScrollBar.Range = 411
VertScrollBar.Page = 147
VertScrollBar.Range = 145
Left = 292
Height = 148
Top = 224
Width = 417
object lblNew: TLabel
Caption = 'lblNew'
Color = clNone
ParentColor = False
Left = 8
Height = 14
Height = 13
Top = 64
Width = 32
Width = 39
Caption = 'lblNew'
ParentColor = False
end
object lblDst: TLabel
Caption = 'lblDst'
Color = clNone
ParentColor = False
Left = 8
Height = 14
Height = 13
Top = 8
Width = 27
Width = 32
Caption = 'lblDst'
ParentColor = False
end
object edtNew: TEdit
TabOrder = 1
Left = 8
Height = 24
Top = 88
Width = 401
TabOrder = 1
end
object edtDst: TEdit
TabOrder = 3
Left = 8
Height = 24
Top = 32
Width = 401
TabOrder = 3
end
object btnOK: TBitBtn
Left = 248
Height = 32
Top = 120
Width = 75
BorderSpacing.InnerBorder = 2
Caption = '&OK'
Default = True
@ -57,21 +59,17 @@ object frmHardLink: TfrmHardLink
NumGlyphs = 0
OnClick = btnOKClick
TabOrder = 0
Left = 248
Height = 23
Top = 120
Width = 75
end
object btnCancel: TBitBtn
Left = 336
Height = 32
Top = 120
Width = 75
BorderSpacing.InnerBorder = 2
Caption = 'Cancel'
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
TabOrder = 2
Left = 336
Height = 23
Top = 120
Width = 75
end
end

View file

@ -1,68 +1,75 @@
object frmHotDir: TfrmHotDir
ActiveControl = lsHotDir
Caption = 'frmHotDir'
ClientHeight = 423
ClientWidth = 411
Color = clBackground
TextHeight = 16
HorzScrollBar.Page = 412
HorzScrollBar.Range = 403
VertScrollBar.Page = 424
VertScrollBar.Range = 417
Left = 277
Height = 423
Top = 211
Width = 411
object lsHotDir: TListBox
TabOrder = 0
TopIndex = -1
Left = 8
Height = 409
Top = 8
Width = 305
end
object btnOK: TBitBtn
Kind = bkOK
ModalResult = 1
OnClick = btnOKClick
ModalResult = 1
Caption = '&OK'
TabOrder = 1
OnClick = btnOKClick
Left = 328
Height = 25
Top = 8
Width = 75
end
object btnCancel: TBitBtn
Kind = bkCancel
ModalResult = 2
ModalResult = 2
Caption = 'Cancel'
TabOrder = 2
Left = 328
Height = 25
Top = 128
Width = 75
end
object btnADD: TBitBtn
OnClick = btnADDClick
Caption = 'Add'
TabOrder = 3
OnClick = btnADDClick
Left = 328
Height = 25
Top = 48
Width = 75
end
object btnDelete: TBitBtn
OnClick = btnDeleteClick
Caption = 'Delete'
TabOrder = 4
OnClick = btnDeleteClick
Left = 328
Height = 25
Top = 88
Width = 75
end
end
inherited frmHotDir: TfrmHotDir
Left = 277
Height = 423
Top = 87
Width = 411
HorzScrollBar.Page = 410
HorzScrollBar.Range = 403
VertScrollBar.Page = 422
VertScrollBar.Range = 417
ActiveControl = lsHotDir
Caption = 'frmHotDir'
ClientHeight = 423
ClientWidth = 411
Position = poMainFormCenter
object lsHotDir: TListBox
Left = 8
Height = 409
Top = 8
Width = 305
TabOrder = 0
TopIndex = -1
end
object btnOK: TBitBtn
Left = 328
Height = 32
Top = 8
Width = 75
Caption = '&OK'
Kind = bkOK
ModalResult = 1
NumGlyphs = 0
OnClick = btnOKClick
TabOrder = 1
end
object btnCancel: TBitBtn
AnchorSideTop.Control = btnDelete
AnchorSideTop.Side = asrBottom
Left = 328
Height = 32
Top = 128
Width = 75
BorderSpacing.Top = 8
Caption = 'Cancel'
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
TabOrder = 2
end
object btnADD: TBitBtn
AnchorSideTop.Control = btnOK
AnchorSideTop.Side = asrBottom
Left = 328
Height = 32
Top = 48
Width = 75
BorderSpacing.Top = 8
Caption = 'Add'
NumGlyphs = 0
OnClick = btnADDClick
TabOrder = 3
end
object btnDelete: TBitBtn
AnchorSideTop.Control = btnADD
AnchorSideTop.Side = asrBottom
Left = 328
Height = 32
Top = 88
Width = 75
BorderSpacing.Top = 8
Caption = 'Delete'
NumGlyphs = 0
OnClick = btnDeleteClick
TabOrder = 4
end
end

View file

@ -1,140 +1,148 @@
object frmLinker: TfrmLinker
Left = 301
Height = 362
Top = 135
Width = 315
HorzScrollBar.Page = 314
HorzScrollBar.Range = 289
VertScrollBar.Page = 361
VertScrollBar.Range = 331
ActiveControl = edSave
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'Linker'
ClientHeight = 347
ClientHeight = 362
ClientWidth = 315
PixelsPerInch = 96
HorzScrollBar.Page = 314
HorzScrollBar.Range = 289
VertScrollBar.Page = 346
VertScrollBar.Range = 331
Left = 513
Height = 347
Top = 252
Width = 315
Position = poMainFormCenter
object prbrWork: TProgressBar
Height = 19
Top = 343
Width = 315
Align = alBottom
Max = 100
TabOrder = 0
Height = 19
Top = 328
Width = 315
end
object gbSaveTo: TGroupBox
Height = 76
Top = 256
Width = 217
Caption = 'Save to...'
ClientHeight = 47
ClientHeight = 59
ClientWidth = 213
ParentCtl3D = False
TabOrder = 1
Height = 65
Top = 256
Width = 217
object lblFileName: TLabel
Caption = 'lblFileName'
Color = clNone
ParentColor = False
Left = 6
Height = 14
Height = 13
Top = 1
Width = 54
Width = 67
Caption = 'lblFileName'
ParentColor = False
end
object edSave: TEdit
TabOrder = 0
Left = 6
Height = 24
Top = 17
Top = 20
Width = 168
TabOrder = 0
end
object btnSave: TButton
BorderSpacing.InnerBorder = 2
Left = 182
Height = 25
Top = 20
Width = 25
BorderSpacing.InnerBorder = 4
Caption = '...'
OnClick = btnSaveClick
TabOrder = 1
Left = 182
Height = 25
Top = 17
Width = 25
end
end
object grbxControl: TGroupBox
Caption = 'Item'
ClientHeight = 231
ClientWidth = 84
ParentCtl3D = False
TabOrder = 2
Left = 224
Height = 249
Width = 88
Caption = 'Item'
ClientHeight = 249
ClientWidth = 88
ParentCtl3D = False
TabOrder = 2
object spbtnUp: TButton
BorderSpacing.InnerBorder = 2
Left = 6
Height = 32
Hint = 'Up'
Top = 1
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'Up'
OnClick = spbtnUpClick
ParentShowHint = False
TabOrder = 0
Left = 6
Height = 23
Hint = 'Up'
Top = 1
Width = 75
end
object spbtnDown: TButton
BorderSpacing.InnerBorder = 2
AnchorSideTop.Control = spbtnUp
AnchorSideTop.Side = asrBottom
Left = 6
Height = 32
Hint = 'Down'
Top = 39
Width = 75
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 4
Caption = 'Down'
OnClick = spbtnDownClick
ParentShowHint = False
TabOrder = 1
Left = 6
Height = 23
Hint = 'Down'
Top = 33
Width = 75
end
object spbtnDel: TButton
BorderSpacing.InnerBorder = 2
AnchorSideTop.Control = spbtnDown
AnchorSideTop.Side = asrBottom
Left = 6
Height = 32
Hint = 'Delete'
Top = 77
Width = 75
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 4
Caption = 'Delete'
OnClick = spbtnDelClick
ParentShowHint = False
TabOrder = 2
Left = 6
Height = 23
Hint = 'Delete'
Top = 65
Width = 75
end
end
object btnOK: TButton
BorderSpacing.InnerBorder = 2
Left = 227
Height = 32
Top = 262
Width = 88
BorderSpacing.InnerBorder = 4
Caption = 'OK'
OnClick = btnOKClick
TabOrder = 3
Left = 227
Height = 25
Top = 262
Width = 88
end
object btnExit: TButton
BorderSpacing.InnerBorder = 2
AnchorSideTop.Control = btnOK
AnchorSideTop.Side = asrBottom
Left = 227
Height = 32
Top = 300
Width = 88
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 4
Caption = 'Exit'
ModalResult = 2
TabOrder = 4
Left = 224
Height = 25
Top = 296
Width = 88
end
object lstFile: TListBox
TabOrder = 5
Height = 248
Top = 8
Width = 212
TabOrder = 5
TopIndex = -1
end
object dlgSaveAll: TSaveDialog
Title = 'Ñîõðàíèòü ôàéë êàê'
Filter = 'All files|*.*'
FilterIndex = 0
Title = 'Ñîõðàíèòü ôàéë êàê'
left = 160
top = 240
end

View file

@ -1,14 +1,14 @@
inherited frmMain: TfrmMain
Left = 261
Left = 329
Height = 336
Top = 81
Top = 286
Width = 540
HorzScrollBar.Page = 539
VertScrollBar.Page = 315
VertScrollBar.Page = 309
VertScrollBar.Range = 79
ActiveControl = pnlNotebooks
Caption = 'Double Commander'
ClientHeight = 316
ClientHeight = 310
ClientWidth = 540
Font.Color = clBlack
Font.Height = 13
@ -79,35 +79,35 @@ inherited frmMain: TfrmMain
end
end
object pnlNotebooks: TPanel
Height = 240
Height = 234
Top = 49
Width = 540
Align = alClient
ClientHeight = 240
ClientHeight = 234
ClientWidth = 540
FullRepaint = False
TabOrder = 1
TabStop = True
object MainSplitter: TSplitter
Left = 171
Height = 200
Height = 194
Top = 1
Width = 4
ResizeStyle = rsLine
end
object pnlLeft: TPanel
Left = 1
Height = 200
Height = 194
Top = 1
Width = 170
Align = alLeft
BevelOuter = bvNone
Caption = 'pnlLeft'
ClientHeight = 200
ClientHeight = 194
ClientWidth = 170
TabOrder = 0
object nbLeft: TNotebook
Height = 176
Height = 170
Hint = 'Left'
Top = 24
Width = 170
@ -175,17 +175,17 @@ inherited frmMain: TfrmMain
end
object pnlRight: TPanel
Left = 175
Height = 200
Height = 194
Top = 1
Width = 364
Align = alClient
BevelOuter = bvNone
Caption = 'pnlRight'
ClientHeight = 200
ClientHeight = 194
ClientWidth = 364
TabOrder = 1
object nbRight: TNotebook
Height = 176
Height = 170
Hint = 'Right'
Top = 24
Width = 364
@ -254,7 +254,7 @@ inherited frmMain: TfrmMain
object pnlCommand: TPanel
Left = 1
Height = 38
Top = 201
Top = 195
Width = 538
Align = alBottom
Anchors = [akLeft, akRight]
@ -266,9 +266,9 @@ inherited frmMain: TfrmMain
TabOrder = 2
object lblCommandPath: TLabel
Left = 1
Height = 14
Height = 13
Top = 8
Width = 23
Width = 26
Alignment = taRightJustify
Caption = 'Path'
ParentColor = False
@ -281,7 +281,6 @@ inherited frmMain: TfrmMain
Width = 688
TabStop = False
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13
MaxLength = 0
OnKeyDown = edtCommandKeyDown
OnKeyUp = edtCommandKeyUp
@ -302,7 +301,7 @@ inherited frmMain: TfrmMain
end
object pnlKeys: TPanel
Height = 27
Top = 289
Top = 283
Width = 540
Align = alBottom
Anchors = [akLeft, akRight]

View file

@ -1,7 +1,7 @@
inherited frmMultiRename: TfrmMultiRename
Left = 278
Left = 79
Height = 354
Top = 176
Top = 233
Width = 608
HorzScrollBar.Page = 607
HorzScrollBar.Range = 603
@ -9,29 +9,31 @@ inherited frmMultiRename: TfrmMultiRename
VertScrollBar.Range = 345
ActiveControl = edName
Caption = 'MultiRename'
ClientHeight = 354
ClientWidth = 608
Position = poMainFormCenter
object gbMaska: TGroupBox
Height = 105
Top = 208
Width = 176
Caption = 'Mask'
ClientHeight = 88
ClientWidth = 172
ParentCtl3D = False
TabOrder = 0
object lbName: TLabel
Left = 6
Height = 14
Width = 47
Height = 13
Width = 58
Caption = 'File Name'
Color = clNone
ParentColor = False
end
object lbExt: TLabel
Left = 6
Height = 14
Height = 13
Top = 41
Width = 48
Width = 55
Caption = 'Extension'
Color = clNone
ParentColor = False
end
object edName: TEdit
@ -56,6 +58,7 @@ inherited frmMultiRename: TfrmMultiRename
Height = 19
Top = 17
Width = 16
BorderSpacing.InnerBorder = 4
Caption = '...'
OnClick = btnNameMenuClick
TabOrder = 1
@ -65,6 +68,7 @@ inherited frmMultiRename: TfrmMultiRename
Height = 20
Top = 57
Width = 16
BorderSpacing.InnerBorder = 4
Caption = '...'
OnClick = btnExtMenuClick
TabOrder = 3
@ -76,23 +80,23 @@ inherited frmMultiRename: TfrmMultiRename
Top = 208
Width = 137
Caption = 'Find && Replace'
ClientHeight = 88
ClientWidth = 133
ParentCtl3D = False
TabOrder = 1
object lbFind: TLabel
Left = 6
Height = 14
Width = 33
Height = 13
Width = 35
Caption = 'Find...'
Color = clNone
ParentColor = False
end
object lbReplace: TLabel
Left = 6
Height = 14
Height = 13
Top = 41
Width = 51
Width = 56
Caption = 'Replace...'
Color = clNone
ParentColor = False
end
object edFind: TEdit
@ -118,6 +122,8 @@ inherited frmMultiRename: TfrmMultiRename
Top = 208
Width = 137
Caption = 'File Name Style'
ClientHeight = 32
ClientWidth = 133
ParentCtl3D = False
TabOrder = 2
object cmbxFont: TComboBox
@ -126,7 +132,6 @@ inherited frmMultiRename: TfrmMultiRename
Top = 1
Width = 120
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 18
ItemIndex = 0
Items.Strings = (
'no change'
@ -148,33 +153,32 @@ inherited frmMultiRename: TfrmMultiRename
Top = 208
Width = 137
Caption = 'Counter'
ClientHeight = 88
ClientWidth = 133
ParentCtl3D = False
TabOrder = 3
object lbStNb: TLabel
Left = 6
Height = 14
Height = 13
Top = 1
Width = 65
Width = 73
Caption = 'Start Number'
Color = clNone
ParentColor = False
end
object lbInterval: TLabel
Left = 6
Height = 14
Height = 13
Top = 57
Width = 39
Width = 42
Caption = 'Interval'
Color = clNone
ParentColor = False
end
object lbWidth: TLabel
Left = 6
Height = 14
Height = 13
Top = 28
Width = 29
Width = 32
Caption = 'Width'
Color = clNone
ParentColor = False
end
object edPoc: TEdit
@ -203,7 +207,6 @@ inherited frmMultiRename: TfrmMultiRename
Top = 25
Width = 50
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 18
ItemIndex = 0
Items.Strings = (
'01'
@ -227,18 +230,20 @@ inherited frmMultiRename: TfrmMultiRename
end
object btnOK: TButton
Left = 320
Height = 25
Height = 32
Top = 320
Width = 65
BorderSpacing.InnerBorder = 4
Caption = 'OK'
OnClick = btnOKClick
TabOrder = 4
end
object btnCancel: TButton
Left = 392
Height = 25
Height = 32
Top = 320
Width = 65
BorderSpacing.InnerBorder = 4
Caption = 'Cancel'
ModalResult = 2
TabOrder = 5
@ -249,6 +254,8 @@ inherited frmMultiRename: TfrmMultiRename
Top = 263
Width = 137
Caption = 'Log Result'
ClientHeight = 65
ClientWidth = 133
ParentCtl3D = False
TabOrder = 6
object edFile: TEdit
@ -260,9 +267,9 @@ inherited frmMultiRename: TfrmMultiRename
end
object cbLog: TCheckBox
Left = 8
Height = 13
Height = 20
Top = 40
Width = 38
Width = 48
AllowGrayed = True
Caption = 'Log'
OnClick = cbLogClick
@ -271,9 +278,10 @@ inherited frmMultiRename: TfrmMultiRename
end
object btnRestore: TButton
Left = 8
Height = 25
Height = 32
Top = 318
Width = 136
BorderSpacing.InnerBorder = 4
Caption = 'Restore All'
OnClick = btnRestoreClick
TabOrder = 7
@ -287,17 +295,17 @@ inherited frmMultiRename: TfrmMultiRename
item
AutoSize = True
Caption = 'Old File Name'
Width = 190
Width = 80
end
item
AutoSize = True
Caption = 'New File Name'
Width = 190
Width = 85
end
item
AutoSize = True
Caption = 'File Path'
Width = 190
Width = 49
end>
TabOrder = 8
ViewStyle = vsReport

File diff suppressed because it is too large Load diff

View file

@ -311,7 +311,7 @@ end;
procedure TfrmOptions.cbColorBoxChange(Sender: TObject);
begin
(Sender as TColorBox).Color := (Sender as TColorBox).Selection;
(Sender as TColorBox).Color := (Sender as TColorBox).Selected;
pbExample.Repaint;
end;
@ -338,7 +338,7 @@ end;
procedure TfrmOptions.cbTextColorChange(Sender: TObject);
begin
cbTextColor.Color := cbTextColor.Selection;
cbTextColor.Color := cbTextColor.Selected;
end;
procedure TfrmOptions.cbColorBoxDropDown(Sender: TObject);
@ -427,22 +427,22 @@ begin
lblViewerFont.Caption:= lngGetString(clngDlgOptViewerFont);
{ Colors }
cbTextColor.Selection := gForeColor;
cbTextColor.Selected := gForeColor;
cbTextColor.Color := gForeColor;
cbBackColor.Selection := gBackColor;
cbBackColor.Selected := gBackColor;
cbBackColor.Color := gBackColor;
cbBackColor2.Selection := gBackColor2;
cbBackColor2.Selected := gBackColor2;
cbBackColor2.Color := gBackColor2;
cbMarkColor.Selection := gMarkColor;
cbMarkColor.Selected := gMarkColor;
cbMarkColor.Color := gMarkColor;
cbCursorColor.Selection := gCursorColor;
cbCursorColor.Selected := gCursorColor;
cbCursorColor.Color := gCursorColor;
cbCursorText.Selection := gCursorText;
cbCursorText.Selected := gCursorText;
cbCursorText.Color := gCursorText;
cbShowIcons.Checked := gShowIcons;
@ -938,7 +938,7 @@ end;
procedure TfrmOptions.cbCategoryColorChange(Sender: TObject);
begin
(Sender as TColorBox).Color := (Sender as TColorBox).Selection;
(Sender as TColorBox).Color := (Sender as TColorBox).Selected;
end;
procedure TfrmOptions.lbCategoriesClick(Sender: TObject);
@ -953,7 +953,7 @@ begin
edtCategoryMask.Text := ColorFileMask^.sFileMask;
cbCategoryColor.Color := ColorFileMask^.clMaskColor;
cbCategoryColor.Selection := cbCategoryColor.Color;
cbCategoryColor.Selected := cbCategoryColor.Color;
end
else
begin
@ -964,7 +964,7 @@ begin
edtCategoryMask.Text := '';
cbCategoryColor.ItemIndex := -1;
cbCategoryColor.Color := clWindow;
cbCategoryColor.Selection := cbCategoryColor.Color;
cbCategoryColor.Selected := cbCategoryColor.Color;
end;
end;

View file

@ -1,91 +1,90 @@
object frmSplitter: TfrmSplitter
Left = 297
Height = 255
Top = 179
Width = 371
HorzScrollBar.Page = 370
HorzScrollBar.Range = 369
VertScrollBar.Page = 254
VertScrollBar.Range = 227
ActiveControl = edFileSource
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'Splitter'
ClientHeight = 244
ClientHeight = 255
ClientWidth = 371
PixelsPerInch = 96
TextHeight = 16
HorzScrollBar.Page = 370
HorzScrollBar.Range = 369
VertScrollBar.Page = 243
VertScrollBar.Range = 227
Left = 299
Height = 244
Top = 230
Width = 371
Position = poMainFormCenter
object prgbrDoIt: TProgressBar
Height = 27
Top = 224
Width = 369
Max = 100
TabOrder = 5
Height = 27
Top = 213
Width = 369
end
object grbxFile: TGroupBox
Height = 137
Width = 185
Caption = 'File name'
ClientHeight = 119
ClientHeight = 120
ClientWidth = 181
ParentCtl3D = False
TabOrder = 0
Height = 137
Width = 185
object lbFileSource: TLabel
Caption = 'File source'
Color = clNone
ParentColor = False
Left = 6
Height = 14
Height = 13
Top = 9
Width = 52
Width = 64
Caption = 'File source'
ParentColor = False
end
object lbDirTarget: TLabel
Caption = 'Directory target'
Color = clNone
ParentColor = False
Left = 6
Height = 14
Height = 13
Top = 65
Width = 78
Width = 87
Caption = 'Directory target'
ParentColor = False
end
object edFileSource: TEdit
ReadOnly = True
TabOrder = 0
Left = 6
Height = 23
Top = 33
Width = 144
ReadOnly = True
TabOrder = 0
end
object edDirTarget: TEdit
TabOrder = 1
Left = 6
Height = 23
Top = 89
Width = 144
TabOrder = 1
end
object btnFTChoice: TButton
BorderSpacing.InnerBorder = 2
Caption = '...'
OnClick = btnFTChoiceClick
TabOrder = 2
Left = 158
Height = 23
Top = 89
Width = 19
Caption = '...'
OnClick = btnFTChoiceClick
TabOrder = 2
end
end
object grbxSize: TGroupBox
Height = 73
Top = 144
Width = 185
Caption = 'File size'
ClientHeight = 47
ClientHeight = 56
ClientWidth = 181
ParentCtl3D = False
TabOrder = 1
Height = 65
Top = 144
Width = 185
object cmbxSize: TComboBox
Left = 6
Height = 23
Top = 12
Width = 168
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 18
ItemIndex = 0
Items.Strings = (
'1457664B - 3.5"'
@ -97,22 +96,22 @@ object frmSplitter: TfrmSplitter
ParentCtl3D = False
TabOrder = 0
Text = '1457664B - 3.5"'
Left = 6
Height = 21
Top = 9
Width = 168
end
end
object grbxWatch: TGroupBox
Caption = 'Watchtower'
ClientHeight = 159
ClientWidth = 173
ParentCtl3D = False
TabOrder = 2
Left = 192
Height = 177
Width = 177
Caption = 'Watchtower'
ClientHeight = 160
ClientWidth = 173
ParentCtl3D = False
TabOrder = 2
object memWatch: TMemo
Left = 6
Height = 138
Top = 9
Width = 161
Color = clBlack
Font.Color = clYellow
Font.Height = 11
@ -123,30 +122,24 @@ object frmSplitter: TfrmSplitter
TabOrder = 0
TabStop = False
WordWrap = False
Left = 6
Height = 138
Top = 9
Width = 161
end
end
object btnOK: TButton
BorderSpacing.InnerBorder = 2
Left = 192
Height = 32
Top = 185
Width = 75
Caption = 'OK'
OnClick = btnOKClick
TabOrder = 3
Left = 192
Height = 25
Top = 184
Width = 75
end
object btnCancel: TButton
BorderSpacing.InnerBorder = 2
Left = 288
Height = 32
Top = 185
Width = 75
Caption = 'Exit'
ModalResult = 2
TabOrder = 4
Left = 288
Height = 25
Top = 184
Width = 75
end
end

View file

@ -1,51 +1,51 @@
object frmSymLink: TfrmSymLink
inherited frmSymLink: TfrmSymLink
Left = 291
Height = 136
Top = 233
Width = 362
HorzScrollBar.Page = 361
HorzScrollBar.Range = 344
VertScrollBar.Page = 135
VertScrollBar.Range = 128
ActiveControl = btnOK
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'frmSymLink'
ClientHeight = 138
ClientWidth = 355
ClientHeight = 136
ClientWidth = 362
KeyPreview = True
OnKeyPress = frmSymLinkKeyPress
PixelsPerInch = 96
Position = poScreenCenter
TextHeight = 16
HorzScrollBar.Page = 354
HorzScrollBar.Range = 344
HorzScrollBar.Visible = True
VertScrollBar.Page = 137
VertScrollBar.Range = 119
VertScrollBar.Visible = True
Left = 291
Height = 138
Top = 233
Width = 355
object lblNew: TLabel
Height = 13
Width = 39
Caption = 'lblNew'
Color = clNone
ParentColor = False
Height = 14
Width = 32
end
object lblDst: TLabel
Caption = 'lblDst'
Color = clNone
ParentColor = False
Height = 14
Height = 13
Top = 40
Width = 27
Width = 32
Caption = 'lblDst'
ParentColor = False
end
object edtNew: TEdit
TabOrder = 1
Height = 23
Top = 16
Width = 344
TabOrder = 1
end
object edtDst: TEdit
TabOrder = 3
Height = 23
Top = 64
Width = 344
TabOrder = 3
end
object btnOK: TBitBtn
Left = 176
Height = 32
Top = 96
Width = 88
BorderSpacing.InnerBorder = 2
Caption = '&OK'
Default = True
@ -54,21 +54,17 @@ object frmSymLink: TfrmSymLink
NumGlyphs = 0
OnClick = btnOKClick
TabOrder = 0
Left = 176
Height = 23
Top = 96
Width = 88
end
object btnCancel: TBitBtn
Left = 269
Height = 32
Top = 96
Width = 75
BorderSpacing.InnerBorder = 2
Caption = 'Cancel'
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
TabOrder = 2
Left = 269
Height = 23
Top = 96
Width = 75
end
end

View file

@ -1,259 +1,260 @@
{
Seksi Commander
----------------------------
Implementing of Showing messages with lokalization
Licence : GNU GPL v 2.0
Author : radek.cervinka@centrum.cz
contributors:
Koblov Alexander (Alexx2000@mail.ru)
}
unit uShowMsg;
{$MODE Delphi}{$H+}
interface
uses
Forms, Classes;
type
TMyMsgResult=(mmrOK, mmrNo, mmrYes, mmrCancel, mmrNone,
mmrAppend, mmrRewrite, mmrRewriteAll, mmrSkip, mmrSkipAll, mmrAll );
TMyMsgButton=(msmbOK, msmbNO, msmbYes, msmbCancel, msmbNone,
msmbAppend, msmbRewrite, msmbRewriteAll, msmbSkip, msmbSkipAll, msmbAll);
{ TDlgOpThread }
TDlgOpThread = class
private
procedure ShowInTheThread;
protected
FThread : TThread;
FMsg : String;
FButtons: array of TMyMsgButton;
FButDefault,
FButEscape : TMyMsgButton;
FDlgResult : TMyMsgResult;
public
constructor Create(Thread : TThread);
destructor Destroy;override;
function Show(const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton) : TMyMsgResult;
end;
function msgYesNo(const sMsg:String):Boolean;
function msgYesNoCancel(const sMsg:String):TMyMsgResult;
procedure msgOK(const sMsg:String);
function msgWarning(const sMsg:String):Boolean;
procedure msgError(const sMsg:String);
function MsgBox(const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton):TMyMsgResult;
function MsgBoxForThread(Thread : TThread;const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton):TMyMsgResult;
function MsgTest:TMyMsgResult;
procedure msgLoadLng;
implementation
uses
SysUtils, StdCtrls, Graphics, fMsg, uLng, Buttons, Controls;
const
cMsgName='Double Commander';
var
cLngButton:Array[TMyMsgButton] of String;
{ TDlgOpThread }
procedure TDlgOpThread.ShowInTheThread;
begin
FDlgResult := MsgBox(FMsg, FButtons, FButDefault, FButEscape);
end;
constructor TDlgOpThread.Create(Thread : TThread);
begin
FThread := Thread;
end;
destructor TDlgOpThread.Destroy;
begin
FButtons := nil;
inherited Destroy;
end;
function TDlgOpThread.Show(const sMsg: String;
const Buttons: array of TMyMsgButton; ButDefault,
ButEscape: TMyMsgButton) : TMyMsgResult;
var
I : Integer;
begin
FMsg := sMsg;
SetLength(FButtons, SizeOf(Buttons));
for I := Low(Buttons) to High(Buttons) do
FButtons[I] := Buttons[I];
FButDefault := ButDefault;
FButEscape := ButEscape;
FThread.Synchronize(FThread, ShowInTheThread);
Result := FDlgResult;
end;
{ This is workaround for autosize}
function MeasureText(Canvas:TCanvas; const sText:String):Integer;
var
xEnter:Integer;
x:Integer;
begin
xEnter:=Pos(#10, sText);
if xEnter>0 then
Result:=Canvas.TextWidth(Copy(sText,1, xEnter))
else
Result:=Canvas.TextWidth(sText);
end;
procedure SetMsgBoxParams(var frmMsg : TfrmMsg; const sMsg:String;
const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton);
var
iIndex:Integer;
begin
frmMsg.Position:=poScreenCenter;
frmMsg.BorderStyle := bsSingle;
frmMsg.BorderIcons := [biSystemMenu, biMinimize];
if (High(Buttons)+1)>=3 then
frmMsg.Width:=(cButtonWith+cButtonSpace)*3+cButtonSpace
else
frmMsg.Width:=(cButtonWith+cButtonSpace)*(High(Buttons)+1)+cButtonSpace;
frmMsg.Height:=(High(Buttons) div 3)*30+80;
frmMsg.Caption:=cMsgName;
with frmMsg.lblMsg do
begin
Caption:=sMsg;
Top:=15;
AutoSize:=True;
// Anchors:=[akTop];
Width:=MeasureText(frmMsg.Canvas, sMsg); // workaround
if Width>frmMsg.Width then
frmMsg.Width:=Width+2*cButtonSpace;
Left:=(frmMsg.Width-Width) div 2;
end;
for iIndex:=0 to High(Buttons) do
begin
With TButton.Create(frmMsg) do
begin
Caption:=cLngButton[Buttons[iIndex]];
Parent:=frmMsg;
Width:=cButtonWith;
Tag:=iIndex;
OnCLick:=frmMsg.ButtonClick;
if (High(Buttons)+1)>=3 then
Left:=(iIndex mod 3)*(cButtonWith+cButtonSpace)+(frmMsg.Width-(3*cButtonWith+2*cButtonSpace)) div 2
else
Left:=iIndex*(cButtonWith+cButtonSpace)+(frmMsg.Width-((High(Buttons)+1)*cButtonWith+High(Buttons)*cButtonSpace)) div 2;
Top:=(iIndex div 3)*(Height+5)+50;
if Buttons[iIndex]=ButDefault then
Default:=True;
if Buttons[iIndex]=ButEscape then
frmMsg.Escape:=iIndex;
{ if iIndex=0 then
SetFocus; }
end;
end;
end;
function MsgBox(const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton):TMyMsgResult;
var
frmMsg:TfrmMsg;
begin
frmMsg:=TfrmMsg.Create(Application);
try
SetMsgBoxParams(frmMsg, sMsg, Buttons, ButDefault, ButEscape);
frmMsg.ShowModal;
if (frmMsg.iSelected)=-1 then
Result:=mmrNone
else
Result:=TMyMsgResult(Buttons[frmMsg.iSelected]);
finally
frmMsg.Free;
end;
end;
function MsgBoxForThread(Thread: TThread; const sMsg: String;
const Buttons: array of TMyMsgButton; ButDefault,
ButEscape: TMyMsgButton): TMyMsgResult;
var
DlgOpThread : TDlgOpThread;
begin
Result := mmrNone;
try
DlgOpThread := TDlgOpThread.Create(Thread);
Result := DlgOpThread.Show(sMsg, Buttons, ButDefault, ButEscape);
finally
DlgOpThread.Free;
end;
end;
Function MsgTest:TMyMsgResult;
begin
Result:= MsgBox('test language of msg subsystem'#10'Second line',[msmbOK, msmbNO, msmbYes, msmbCancel, msmbNone,
msmbAppend, msmbRewrite, msmbRewriteAll],msmbOK, msmbNO);
end;
function msgYesNo(const sMsg:String):Boolean;
begin
Result:= MsgBox(sMsg,[msmbYes, msmbNo], msmbYes, msmbNo )= mmrYes;
end;
function msgYesNoCancel(const sMsg:String):TMyMsgResult;
begin
Result:= MsgBox(sMsg,[msmbYes, msmbNo, msmbCancel], msmbYes, msmbNo);
end;
procedure msgOK(const sMsg:String);
begin
MsgBox(sMsg,[msmbOK],msmbOK, msmbOK);
end;
procedure msgError(const sMsg:String);
begin
MsgBox(sMsg,[msmbOK],msmbOK, msmbOK);
end;
function msgWarning(const sMsg:String):Boolean;
begin
Raise Exception.Create('Not implemented yet!');
end;
procedure msgLoadLng;
var
i:TMyMsgButton;
s:String;
xPos:Integer;
begin
s:=lngGetString(clngDlgButtons);
for i:= Low(TMyMsgButton) to High(TMyMsgButton) do
begin
xPos:=Pos(';',s);
cLngButton[i]:=Copy(s,1,xPos-1);
Delete(s,1,xPos);
end;
end;
end.
{
Seksi Commander
----------------------------
Implementing of Showing messages with lokalization
Licence : GNU GPL v 2.0
Author : radek.cervinka@centrum.cz
contributors:
Koblov Alexander (Alexx2000@mail.ru)
}
unit uShowMsg;
{$MODE Delphi}{$H+}
interface
uses
Forms, Classes;
type
TMyMsgResult=(mmrOK, mmrNo, mmrYes, mmrCancel, mmrNone,
mmrAppend, mmrRewrite, mmrRewriteAll, mmrSkip, mmrSkipAll, mmrAll );
TMyMsgButton=(msmbOK, msmbNO, msmbYes, msmbCancel, msmbNone,
msmbAppend, msmbRewrite, msmbRewriteAll, msmbSkip, msmbSkipAll, msmbAll);
{ TDlgOpThread }
TDlgOpThread = class
private
procedure ShowInTheThread;
protected
FThread : TThread;
FMsg : String;
FButtons: array of TMyMsgButton;
FButDefault,
FButEscape : TMyMsgButton;
FDlgResult : TMyMsgResult;
public
constructor Create(Thread : TThread);
destructor Destroy;override;
function Show(const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton) : TMyMsgResult;
end;
function msgYesNo(const sMsg:String):Boolean;
function msgYesNoCancel(const sMsg:String):TMyMsgResult;
procedure msgOK(const sMsg:String);
function msgWarning(const sMsg:String):Boolean;
procedure msgError(const sMsg:String);
function MsgBox(const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton):TMyMsgResult;
function MsgBoxForThread(Thread : TThread;const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton):TMyMsgResult;
function MsgTest:TMyMsgResult;
procedure msgLoadLng;
implementation
uses
SysUtils, StdCtrls, Graphics, fMsg, uLng, Buttons, Controls;
const
cMsgName='Double Commander';
var
cLngButton:Array[TMyMsgButton] of String;
{ TDlgOpThread }
procedure TDlgOpThread.ShowInTheThread;
begin
FDlgResult := MsgBox(FMsg, FButtons, FButDefault, FButEscape);
end;
constructor TDlgOpThread.Create(Thread : TThread);
begin
FThread := Thread;
end;
destructor TDlgOpThread.Destroy;
begin
FButtons := nil;
inherited Destroy;
end;
function TDlgOpThread.Show(const sMsg: String;
const Buttons: array of TMyMsgButton; ButDefault,
ButEscape: TMyMsgButton) : TMyMsgResult;
var
I : Integer;
begin
FMsg := sMsg;
SetLength(FButtons, SizeOf(Buttons));
for I := Low(Buttons) to High(Buttons) do
FButtons[I] := Buttons[I];
FButDefault := ButDefault;
FButEscape := ButEscape;
FThread.Synchronize(FThread, ShowInTheThread);
Result := FDlgResult;
end;
{ This is workaround for autosize}
function MeasureText(Canvas:TCanvas; const sText:String):Integer;
var
xEnter:Integer;
x:Integer;
begin
xEnter:=Pos(#10, sText);
if xEnter>0 then
Result:=Canvas.TextWidth(Copy(sText,1, xEnter))
else
Result:=Canvas.TextWidth(sText);
end;
procedure SetMsgBoxParams(var frmMsg : TfrmMsg; const sMsg:String;
const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton);
var
iIndex:Integer;
begin
frmMsg.Position:=poScreenCenter;
frmMsg.BorderStyle := bsSingle;
frmMsg.BorderIcons := [biSystemMenu, biMinimize];
if (High(Buttons)+1)>=3 then
frmMsg.Width:=(cButtonWith+cButtonSpace)*3+cButtonSpace
else
frmMsg.Width:=(cButtonWith+cButtonSpace)*(High(Buttons)+1)+cButtonSpace;
frmMsg.Height:=(High(Buttons) div 3)*40+80;
frmMsg.Caption:=cMsgName;
with frmMsg.lblMsg do
begin
Caption:=sMsg;
Top:=15;
AutoSize:=True;
// Anchors:=[akTop];
Width:=MeasureText(frmMsg.Canvas, sMsg); // workaround
if Width>frmMsg.Width then
frmMsg.Width:=Width+2*cButtonSpace;
Left:=(frmMsg.Width-Width) div 2;
end;
for iIndex:=0 to High(Buttons) do
begin
With TButton.Create(frmMsg) do
begin
Caption:=cLngButton[Buttons[iIndex]];
Parent:=frmMsg;
Width:=cButtonWith;
Height := 32;
Tag:=iIndex;
OnCLick:=frmMsg.ButtonClick;
if (High(Buttons)+1)>=3 then
Left:=(iIndex mod 3)*(cButtonWith+cButtonSpace)+(frmMsg.Width-(3*cButtonWith+2*cButtonSpace)) div 2
else
Left:=iIndex*(cButtonWith+cButtonSpace)+(frmMsg.Width-((High(Buttons)+1)*cButtonWith+High(Buttons)*cButtonSpace)) div 2;
Top:=(iIndex div 3)*(Height+5)+50;
if Buttons[iIndex]=ButDefault then
Default:=True;
if Buttons[iIndex]=ButEscape then
frmMsg.Escape:=iIndex;
{ if iIndex=0 then
SetFocus; }
end;
end;
end;
function MsgBox(const sMsg:String; const Buttons: array of TMyMsgButton; ButDefault, ButEscape:TMyMsgButton):TMyMsgResult;
var
frmMsg:TfrmMsg;
begin
frmMsg:=TfrmMsg.Create(Application);
try
SetMsgBoxParams(frmMsg, sMsg, Buttons, ButDefault, ButEscape);
frmMsg.ShowModal;
if (frmMsg.iSelected)=-1 then
Result:=mmrNone
else
Result:=TMyMsgResult(Buttons[frmMsg.iSelected]);
finally
frmMsg.Free;
end;
end;
function MsgBoxForThread(Thread: TThread; const sMsg: String;
const Buttons: array of TMyMsgButton; ButDefault,
ButEscape: TMyMsgButton): TMyMsgResult;
var
DlgOpThread : TDlgOpThread;
begin
Result := mmrNone;
try
DlgOpThread := TDlgOpThread.Create(Thread);
Result := DlgOpThread.Show(sMsg, Buttons, ButDefault, ButEscape);
finally
DlgOpThread.Free;
end;
end;
Function MsgTest:TMyMsgResult;
begin
Result:= MsgBox('test language of msg subsystem'#10'Second line',[msmbOK, msmbNO, msmbYes, msmbCancel, msmbNone,
msmbAppend, msmbRewrite, msmbRewriteAll],msmbOK, msmbNO);
end;
function msgYesNo(const sMsg:String):Boolean;
begin
Result:= MsgBox(sMsg,[msmbYes, msmbNo], msmbYes, msmbNo )= mmrYes;
end;
function msgYesNoCancel(const sMsg:String):TMyMsgResult;
begin
Result:= MsgBox(sMsg,[msmbYes, msmbNo, msmbCancel], msmbYes, msmbNo);
end;
procedure msgOK(const sMsg:String);
begin
MsgBox(sMsg,[msmbOK],msmbOK, msmbOK);
end;
procedure msgError(const sMsg:String);
begin
MsgBox(sMsg,[msmbOK],msmbOK, msmbOK);
end;
function msgWarning(const sMsg:String):Boolean;
begin
Raise Exception.Create('Not implemented yet!');
end;
procedure msgLoadLng;
var
i:TMyMsgButton;
s:String;
xPos:Integer;
begin
s:=lngGetString(clngDlgButtons);
for i:= Low(TMyMsgButton) to High(TMyMsgButton) do
begin
xPos:=Pos(';',s);
cLngButton[i]:=Copy(s,1,xPos-1);
Delete(s,1,xPos);
end;
end;
end.