mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
UPD: File types colors options page - use KASColorBoxButton
This commit is contained in:
parent
0197ad2a7a
commit
8daa08de29
3 changed files with 16 additions and 75 deletions
|
|
@ -96,20 +96,18 @@ inherited frmOptionsFileTypesColors: TfrmOptionsFileTypesColors
|
|||
BorderSpacing.Bottom = 8
|
||||
TabOrder = 2
|
||||
end
|
||||
object cbCategoryColor: TColorBox
|
||||
object cbCategoryColor: TKASColorBoxButton
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = btnCategoryColor
|
||||
AnchorSideRight.Control = edtCategoryAttr
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = btnApplyCategory
|
||||
Left = 170
|
||||
Height = 22
|
||||
Top = 252
|
||||
Width = 527
|
||||
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
|
||||
Height = 25
|
||||
Top = 249
|
||||
Width = 561
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 12
|
||||
ItemHeight = 16
|
||||
TabOrder = 5
|
||||
BorderSpacing.Bottom = 12
|
||||
end
|
||||
object btnAddCategory: TBitBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
|
|
@ -124,7 +122,7 @@ inherited frmOptionsFileTypesColors: TfrmOptionsFileTypesColors
|
|||
BorderSpacing.Right = 6
|
||||
Caption = 'A&dd'
|
||||
OnClick = btnAddCategoryClick
|
||||
TabOrder = 7
|
||||
TabOrder = 6
|
||||
end
|
||||
object btnDeleteCategory: TBitBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
|
|
@ -139,24 +137,7 @@ inherited frmOptionsFileTypesColors: TfrmOptionsFileTypesColors
|
|||
BorderSpacing.Right = 6
|
||||
Caption = 'D&elete'
|
||||
OnClick = btnDeleteCategoryClick
|
||||
TabOrder = 8
|
||||
end
|
||||
object btnCategoryColor: TButton
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = cbCategoryColor
|
||||
AnchorSideRight.Control = edtCategoryAttr
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = cbCategoryColor
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 703
|
||||
Height = 22
|
||||
Top = 252
|
||||
Width = 28
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = '>>'
|
||||
OnClick = btnCategoryColorClick
|
||||
TabOrder = 6
|
||||
TabOrder = 7
|
||||
end
|
||||
object lbCategories: TListBox
|
||||
AnchorSideTop.Control = gbFileTypesColors
|
||||
|
|
@ -194,7 +175,7 @@ inherited frmOptionsFileTypesColors: TfrmOptionsFileTypesColors
|
|||
BorderSpacing.Bottom = 8
|
||||
Caption = 'A&pply'
|
||||
OnClick = btnApplyCategoryClick
|
||||
TabOrder = 9
|
||||
TabOrder = 8
|
||||
end
|
||||
object edtCategoryAttr: TEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
|
|
@ -265,31 +246,4 @@ inherited frmOptionsFileTypesColors: TfrmOptionsFileTypesColors
|
|||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
object optColorDialog: TColorDialog[1]
|
||||
Color = clBlack
|
||||
CustomColors.Strings = (
|
||||
'ColorA=000000'
|
||||
'ColorB=000080'
|
||||
'ColorC=008000'
|
||||
'ColorD=008080'
|
||||
'ColorE=800000'
|
||||
'ColorF=800080'
|
||||
'ColorG=808000'
|
||||
'ColorH=808080'
|
||||
'ColorI=C0C0C0'
|
||||
'ColorJ=0000FF'
|
||||
'ColorK=00FF00'
|
||||
'ColorL=00FFFF'
|
||||
'ColorM=FF0000'
|
||||
'ColorN=FF00FF'
|
||||
'ColorO=FFFF00'
|
||||
'ColorP=FFFFFF'
|
||||
'ColorQ=C0DCC0'
|
||||
'ColorR=F0CAA6'
|
||||
'ColorS=F0FBFF'
|
||||
'ColorT=A4A0A0'
|
||||
)
|
||||
left = 184
|
||||
top = 288
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
{"hash":52377562,"name":"tfrmoptionsfiletypescolors.lblcategoryattr.caption","sourcebytes":[67,97,116,101,103,111,114,121,32,97,38,116,116,114,105,98,117,116,101,115,58],"value":"Category a&ttributes:"},
|
||||
{"hash":277668,"name":"tfrmoptionsfiletypescolors.btnaddcategory.caption","sourcebytes":[65,38,100,100],"value":"A&dd"},
|
||||
{"hash":114044133,"name":"tfrmoptionsfiletypescolors.btndeletecategory.caption","sourcebytes":[68,38,101,108,101,116,101],"value":"D&elete"},
|
||||
{"hash":1054,"name":"tfrmoptionsfiletypescolors.btncategorycolor.caption","sourcebytes":[62,62],"value":">>"},
|
||||
{"hash":71137081,"name":"tfrmoptionsfiletypescolors.btnapplycategory.caption","sourcebytes":[65,38,112,112,108,121],"value":"A&pply"},
|
||||
{"hash":47236478,"name":"tfrmoptionsfiletypescolors.btnsearchtemplate.hint","sourcebytes":[84,101,109,112,108,97,116,101,46,46,46],"value":"Template..."}
|
||||
]}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
-------------------------------------------------------------------------
|
||||
File types colors options page
|
||||
|
||||
Copyright (C) 2006-2022 Alexander Koblov (alexx2000@mail.ru)
|
||||
Copyright (C) 2006-2023 Alexander Koblov (alexx2000@mail.ru)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -27,7 +27,7 @@ unit fOptionsFileTypesColors;
|
|||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Controls, StdCtrls, ColorBox, Dialogs, Buttons,
|
||||
Classes, SysUtils, Controls, StdCtrls, KASComboBox, Dialogs, Buttons,
|
||||
LMessages, fOptionsFrame;
|
||||
|
||||
type
|
||||
|
|
@ -35,13 +35,11 @@ type
|
|||
{ TfrmOptionsFileTypesColors }
|
||||
|
||||
TfrmOptionsFileTypesColors = class(TOptionsEditor)
|
||||
optColorDialog: TColorDialog;
|
||||
btnAddCategory: TBitBtn;
|
||||
btnApplyCategory: TBitBtn;
|
||||
btnDeleteCategory: TBitBtn;
|
||||
btnCategoryColor: TButton;
|
||||
btnSearchTemplate: TBitBtn;
|
||||
cbCategoryColor: TColorBox;
|
||||
cbCategoryColor: TKASColorBoxButton;
|
||||
edtCategoryAttr: TEdit;
|
||||
edtCategoryMask: TEdit;
|
||||
edtCategoryName: TEdit;
|
||||
|
|
@ -57,7 +55,6 @@ type
|
|||
procedure btnAddCategoryClick(Sender: TObject);
|
||||
procedure btnApplyCategoryClick(Sender: TObject);
|
||||
procedure btnDeleteCategoryClick(Sender: TObject);
|
||||
procedure btnCategoryColorClick(Sender: TObject);
|
||||
procedure lbCategoriesDragDrop(Sender, {%H-}Source: TObject; {%H-}X, Y: Integer);
|
||||
procedure lbCategoriesDragOver(Sender, Source: TObject; {%H-}X, {%H-}Y: Integer;
|
||||
{%H-}State: TDragState; var Accept: Boolean);
|
||||
|
|
@ -97,7 +94,7 @@ begin
|
|||
|
||||
edtCategoryName.Text := MaskItem.sName;
|
||||
edtCategoryMask.Text := MaskItem.sExt;
|
||||
SetColorInColorBox(cbCategoryColor, MaskItem.cColor);
|
||||
cbCategoryColor.Selected := MaskItem.cColor;
|
||||
bEnabled:= (MaskItem.sExt = '') or (MaskItem.sExt[1] <> '>');
|
||||
edtCategoryMask.Enabled:= bEnabled;
|
||||
edtCategoryAttr.Enabled:= bEnabled;
|
||||
|
|
@ -108,7 +105,7 @@ begin
|
|||
edtCategoryName.Text := '';
|
||||
edtCategoryMask.Text := '';
|
||||
edtCategoryAttr.Text := '';
|
||||
cbCategoryColor.ItemIndex := -1;
|
||||
cbCategoryColor.Selected := gColors.FilePanel^.ForeColor;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -139,7 +136,6 @@ begin
|
|||
edtCategoryMask.Enabled := True;
|
||||
edtCategoryAttr.Enabled := True;
|
||||
cbCategoryColor.Enabled := True;
|
||||
btnCategoryColor.Enabled := True;
|
||||
btnDeleteCategory.Enabled := True;
|
||||
btnApplyCategory.Enabled := True;
|
||||
end;
|
||||
|
|
@ -149,7 +145,7 @@ begin
|
|||
edtCategoryName.Text := rsOptionsEditorFileNewFileTypes;
|
||||
edtCategoryMask.Text := '*';
|
||||
edtCategoryAttr.Text := '';
|
||||
cbCategoryColor.ItemIndex := -1;
|
||||
cbCategoryColor.Selected := gColors.FilePanel^.ForeColor;
|
||||
|
||||
MaskItem.sName:= edtCategoryName.Text;
|
||||
MaskItem.sExt:= edtCategoryMask.Text;
|
||||
|
|
@ -194,13 +190,6 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmOptionsFileTypesColors.btnCategoryColorClick(Sender: TObject);
|
||||
begin
|
||||
optColorDialog.Color:= cbCategoryColor.Selected;
|
||||
if optColorDialog.Execute then
|
||||
SetColorInColorBox(cbCategoryColor, optColorDialog.Color);
|
||||
end;
|
||||
|
||||
procedure TfrmOptionsFileTypesColors.lbCategoriesDragDrop(Sender,
|
||||
Source: TObject; X, Y: Integer);
|
||||
var
|
||||
|
|
@ -304,7 +293,6 @@ begin
|
|||
edtCategoryMask.Enabled := False;
|
||||
edtCategoryAttr.Enabled := False;
|
||||
cbCategoryColor.Enabled := False;
|
||||
btnCategoryColor.Enabled := False;
|
||||
btnDeleteCategory.Enabled := False;
|
||||
btnApplyCategory.Enabled := False;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue