ADD: Example in color configuration

This commit is contained in:
Alexander Koblov 2007-06-10 14:47:40 +00:00
commit 4d84910542
7 changed files with 142 additions and 170 deletions

View file

@ -1,5 +1,5 @@
#!/bin/bash
lazpath=/at/lazarus
lazpath=/root/Prog/lazarus
fpc doublecmd.lpr -S2cdgi -OG3 -g -gl -vewnhi -l -Ficomponents/KASToolBar/ -Ficomponents/KASToolBar/lib/i386-linux/ -Ficomponents/viewer/ -Fu$lazpath/components/jpeg/lib/i386-linux/ -Fucomponents/KASToolBar/lib/i386-linux/ -Fu$lazpath/components/synedit/units/i386-linux/ -Fu$lazpath/lcl/units/i386-linux/ -Fu$lazpath/lcl/units/i386-linux/gtk/ -Fucomponents/viewer/lib/i386-linux/ -Fu$lazpath/packager/units/i386-linux/ -Fu. -odoublecmd -dLCL -dLCLgtk
fpc doublecmd.lpr -S2cdgi -OG3 -g -gl -vewnhi -l -Ficomponents/KASToolBar/ -Ficomponents/KASToolBar/lib/i386-linux/ -Ficomponents/viewer/ -Fu$lazpath/components/jpeg/lib/i386-linux/ -Fucomponents/KASToolBar/lib/i386-linux/ -Fu$lazpath/components/synedit/units/i386-linux/ -Fu$lazpath/lcl/units/i386-linux/ -Fu$lazpath/lcl/units/i386-linux/gtk2/ -Fucomponents/viewer/lib/i386-linux/ -Fu$lazpath/packager/units/i386-linux/ -Fu. -odoublecmd -dLCL -dLCLgtk2

View file

@ -2,4 +2,6 @@
23.05.2007 Измения интерфейс, добавив TreeView с иконками
Добавил возможность установки цвета текста и фона в файловой панели
26.05.2007 Добавил диалог настроек архиваторных плагинов в окно настроек
09.06.2007 Добавил более детальную настройку цветов в файловой панели
09.06.2007 Добавил более детальную настройку цветов в файловой панели
10.06.2007 Добавил пример, который показывает как цвета будут смотреться,
в файловых панелях

View file

@ -56,7 +56,7 @@ uses
uPixMapManager, uVFS,
KASComp, fbtnchangedlg, fconfigtoolbar, uWCXprototypes, uDCUtils, fPackDlg,
fLngForm, dmDialogs, fViewer, fOptions, fCopyDlg, fMoveDlg, fFindDlg,
fSymLink, fMultiRename, fSplitter, fDlgCustomColors;
fSymLink, fMultiRename, fSplitter;
{$IFDEF WIN32}
{$R XP.res}

View file

@ -1,93 +0,0 @@
object DlgCustomColors: TDlgCustomColors
Tag = 1
Left = 287
Height = 271
Top = 146
Width = 375
HelpContext = 640
HorzScrollBar.Page = 374
VertScrollBar.Page = 270
ActiveControl = lbTypesList
BorderStyle = bsDialog
Caption = 'Define colors by file type'
ClientHeight = 271
ClientWidth = 375
Font.Height = -11
Position = poScreenCenter
object lblCaption: TLabel
Tag = 2
Left = 4
Height = 13
Top = 4
Width = 357
AutoSize = False
Caption = '&File types (sort by drag&&drop, edit with <spacebar>):'
Color = clNone
FocusControl = lbTypesList
ParentColor = False
end
object lbTypesList: TListBox
Left = 4
Height = 244
Top = 20
Width = 273
IntegralHeight = True
ItemHeight = 16
Style = lbOwnerDrawFixed
TabOrder = 0
end
object btnAdd: TButton
Tag = 3
Left = 284
Height = 32
Top = 24
Width = 80
BorderSpacing.InnerBorder = 4
Caption = '&Add...'
TabOrder = 1
end
object btnDelete: TButton
Tag = 4
Left = 284
Height = 32
Top = 104
Width = 80
BorderSpacing.InnerBorder = 4
Caption = '&Delete'
TabOrder = 3
end
object btnOK: TButton
Tag = 4001
Left = 284
Height = 32
Top = 144
Width = 80
BorderSpacing.InnerBorder = 4
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 4
end
object btnCancel: TButton
Tag = 4002
Left = 284
Height = 32
Top = 184
Width = 80
BorderSpacing.InnerBorder = 4
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 5
end
object btnEdit: TButton
Tag = 5
Left = 284
Height = 32
Top = 64
Width = 80
BorderSpacing.InnerBorder = 4
Caption = '&Edit...'
TabOrder = 2
end
end

View file

@ -1,27 +0,0 @@
unit fDlgCustomColors;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs;
type
TDlgCustomColors = class(TForm)
private
{ private declarations }
public
{ public declarations }
end;
var
DlgCustomColors: TDlgCustomColors;
implementation
initialization
{$I fDlgCustomColors.lrs}
end.

View file

@ -1,7 +1,7 @@
inherited frmOptions: TfrmOptions
Left = 202
Left = 214
Height = 359
Top = 100
Top = 87
Width = 577
HorzScrollBar.Page = 576
VertScrollBar.Page = 358
@ -131,7 +131,7 @@ inherited frmOptions: TfrmOptions
object pgBehav: TPage
Caption = 'pgBehav'
ClientWidth = 446
ClientHeight = 283
ClientHeight = 265
object lblTerm: TLabel
Left = 8
Height = 14
@ -478,58 +478,58 @@ inherited frmOptions: TfrmOptions
object pgColor: TPage
Caption = 'pgColor'
ClientWidth = 446
ClientHeight = 265
ClientHeight = 283
object cTextLabel: TLabel
Left = 25
Height = 14
Top = 31
Width = 23
Caption = 'Text'
Top = 34
Width = 55
Caption = 'Text Color:'
Color = clNone
ParentColor = False
end
object cBackGrndLabel: TLabel
Left = 23
Left = 25
Height = 14
Top = 58
Width = 58
Caption = 'BackGround'
Top = 64
Width = 62
Caption = 'BackGround:'
Color = clNone
ParentColor = False
end
object lblBackground2: TLabel
Left = 23
Left = 25
Height = 14
Top = 88
Width = 63
Caption = 'Background2'
Top = 94
Width = 70
Caption = 'Background 2:'
Color = clNone
ParentColor = False
end
object lblMarkColor: TLabel
Left = 25
Height = 14
Top = 123
Width = 52
Caption = 'Mark Color'
Top = 124
Width = 56
Caption = 'Mark Color:'
Color = clNone
ParentColor = False
end
object lblCursorColor: TLabel
Left = 25
Height = 14
Top = 158
Width = 61
Caption = 'Cursor Color'
Top = 154
Width = 65
Caption = 'Cursor Color:'
Color = clNone
ParentColor = False
end
object lblCursorText: TLabel
Left = 25
Height = 14
Top = 191
Width = 58
Caption = 'Cursor Text'
Top = 184
Width = 62
Caption = 'Cursor Text:'
Color = clNone
ParentColor = False
end
@ -571,7 +571,7 @@ inherited frmOptions: TfrmOptions
object cbBackColor: TColorBox
Left = 108
Height = 22
Top = 53
Top = 56
Width = 100
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 16
@ -604,7 +604,7 @@ inherited frmOptions: TfrmOptions
OnDropDown = cbColorBoxDropDown
end
object btnForeColor: TButton
Left = 209
Left = 210
Height = 22
Top = 26
Width = 28
@ -614,9 +614,9 @@ inherited frmOptions: TfrmOptions
TabOrder = 2
end
object btnBackColor: TButton
Left = 209
Height = 23
Top = 52
Left = 210
Height = 22
Top = 56
Width = 28
BorderSpacing.InnerBorder = 4
Caption = '>>'
@ -625,8 +625,8 @@ inherited frmOptions: TfrmOptions
end
object cbBackColor2: TColorBox
Left = 108
Height = 24
Top = 84
Height = 22
Top = 86
Width = 100
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 16
@ -660,7 +660,7 @@ inherited frmOptions: TfrmOptions
end
object cbMarkColor: TColorBox
Left = 108
Height = 24
Height = 22
Top = 116
Width = 100
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
@ -695,8 +695,8 @@ inherited frmOptions: TfrmOptions
end
object cbCursorColor: TColorBox
Left = 108
Height = 24
Top = 148
Height = 22
Top = 146
Width = 100
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 16
@ -730,8 +730,8 @@ inherited frmOptions: TfrmOptions
end
object cbCursorText: TColorBox
Left = 108
Height = 24
Top = 180
Height = 22
Top = 176
Width = 100
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 16
@ -765,8 +765,8 @@ inherited frmOptions: TfrmOptions
end
object btnMarkColor: TButton
Left = 210
Height = 23
Top = 117
Height = 22
Top = 116
Width = 28
BorderSpacing.InnerBorder = 4
Caption = '>>'
@ -775,8 +775,8 @@ inherited frmOptions: TfrmOptions
end
object btnCursorColor: TButton
Left = 210
Height = 23
Top = 149
Height = 22
Top = 146
Width = 28
BorderSpacing.InnerBorder = 4
Caption = '>>'
@ -785,8 +785,8 @@ inherited frmOptions: TfrmOptions
end
object btnCursorText: TButton
Left = 210
Height = 23
Top = 182
Height = 22
Top = 176
Width = 28
BorderSpacing.InnerBorder = 4
Caption = '>>'
@ -795,14 +795,31 @@ inherited frmOptions: TfrmOptions
end
object btnBackColor2: TButton
Left = 210
Height = 23
Top = 85
Height = 22
Top = 86
Width = 28
BorderSpacing.InnerBorder = 4
Caption = '>>'
OnClick = btnBackColor2Click
TabOrder = 11
end
object gbExample: TGroupBox
Left = 250
Height = 172
Top = 26
Width = 185
Caption = 'Example'
ClientHeight = 154
ClientWidth = 181
TabOrder = 12
object pbExample: TPaintBox
Left = 8
Height = 132
Top = 10
Width = 166
OnPaint = pbExamplePaint
end
end
end
object pgHotKey: TPage
Caption = 'pgHotKey'

View file

@ -92,6 +92,7 @@ type
edtTest3: TEdit;
edtViewerSize: TSpinEdit;
gb: TGroupBox;
gbExample: TGroupBox;
ilTreeView: TImageList;
lblBackground2: TLabel;
lblMarkColor: TLabel;
@ -112,6 +113,7 @@ type
nbNotebook: TNotebook;
odOpenDialog: TOpenDialog;
optColorDialog: TColorDialog;
pbExample: TPaintBox;
pcPluginsTypes: TPageControl;
pcPluginsType: TPageControl;
pgPlugins: TPage;
@ -160,6 +162,7 @@ type
procedure cbViewerFontChange(Sender: TObject);
procedure edHotKeyKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState
);
procedure pbExamplePaint(Sender: TObject);
procedure tsWCXShow(Sender: TObject);
procedure tvTreeViewChange(Sender: TObject; Node: TTreeNode);
private
@ -212,6 +215,7 @@ begin
cbActions.Text := vActions.Name+'('+ShortCutToText(vActions.ShortCut)+')';
end;
procedure TfrmOptions.btnForeColorClick(Sender: TObject);
begin
if optColorDialog.Execute then
@ -250,6 +254,7 @@ end;
procedure TfrmOptions.cbColorBoxChange(Sender: TObject);
begin
(Sender as TColorBox).Color := (Sender as TColorBox).Selection;
pbExample.Repaint;
end;
procedure TfrmOptions.cbExtChange(Sender: TObject);
@ -353,7 +358,7 @@ begin
cbCursorText.Selection := gCursorText;
cbCursorText.Color := gCursorText;
{ Icons sizes in file panels }
cbIconsSize.Text := IntToStr(gIconsSize) + 'x' + IntToStr(gIconsSize);
// ToDo lang to tsColor tsHotKey
@ -556,6 +561,74 @@ begin
btSetHotKey.Enabled := (edHotKey.Text <> '');
end;
procedure TfrmOptions.pbExamplePaint(Sender: TObject);
var
h, I : integer;
sText : String;
iTextTop, iTextLeft : Integer;
Rect : TRect;
begin
h := pbExample.Height div 6;
Rect.Left := 0;
Rect.Top := 0;
Rect.Right := pbExample.Width;
Rect.Bottom := h;
for I := 1 to 6 do
with pbExample.Canvas do
begin
case I of
1:
begin
Brush.Color := cbBackColor.Color;
Font.Color := cbMarkColor.Color;
sText := 'Mark';
end;
2:
begin
Brush.Color := cbBackColor2.Color;
Font.Color := cbMarkColor.Color;
sText := 'Mark';
end;
3:
begin
Brush.Color := cbBackColor.Color;
Font.Color := cbTextColor.Color;
sText := 'Text';
end;
4:
begin
Brush.Color := cbBackColor2.Color;
Font.Color := cbTextColor.Color;
sText := 'Text';
end;
5:
begin
Brush.Color := cbCursorColor.Color;
Font.Color := cbCursorText.Color;
sText := 'Cursor';
end;
6:
begin
Brush.Color := cbCursorColor.Color;
Font.Color := cbMarkColor.Color;
sText := 'Mark + Cursor';
end;
end; // case
Font.Style := EdtTest1.Font.Style;
Font.Size := EdtTest1.Font.Size;
Font.Name := EdtTest1.Font.Name;
iTextTop := Rect.Top + (h div 2) - (TextHeight(sText) div 2);
iTextLeft := Rect.Left + (pbExample.Width div 2) - (TextWidth(sText) div 2);
FillRect(Rect);
TextOut(iTextLeft, iTextTop, sText);
Rect.Top := Rect.Bottom;
Rect.Bottom := h * (I + 1);
end; // for
end;
procedure TfrmOptions.tsWCXShow(Sender: TObject);
var
I : Integer;
@ -691,6 +764,6 @@ end;
initialization
{$I foptions.lrs}
{$I fOptions.lrs}
end.