ADD: frame border width now can be changed(for brief and full file view) through modifying doublecmd.xml, property name: BorderFrameWidth

This commit is contained in:
meteu 2016-03-28 17:37:29 +00:00
commit b5cd6dfa89
12 changed files with 225 additions and 123 deletions

View file

@ -1,84 +1,18 @@
@echo off
rem the next two line must be changed before run on your computer
set lazpath=D:\Alexx\Prog\FreePascal\Lazarus
rem Compiling components
set PATH=%lazpath%;%PATH%
rem Do not execute this script directly.
rem This script is called from ..\build.bat.
rem You can execute this script with different parameters:
rem components - compiling components needed for DC
rem plugins - compiling all DC plugins
rem all - compiling components, plugins and DC
rem default - compiling DC only
rem beta - compile in beta mode (using by default)
if not "%OS_TARGET%" == "" (
set DC_ARCH=%DC_ARCH% --os=%OS_TARGET%
)
if not "%CPU_TARGET%" == "" (
set DC_ARCH=%DC_ARCH% --cpu=%CPU_TARGET%
)
if "%1"=="components" ( call :components
) else (
if "%1"=="plugins" ( call :plugins
) else (
if "%1"=="beta" ( call :beta
) else (
if "%1"=="default" ( call :default
) else (
if "%1"=="nightly" ( call :nightly
) else (
if "%1"=="all" ( call :all
) else (
if "%1"=="" ( call :beta
) else (
echo ERROR: Mode not defined: %1
echo Available modes: components, plugins, default, nightly, all, beta
)))))))
pause
GOTO:EOF
:components
call components\build.bat
GOTO:EOF
:plugins
call plugins\build.bat
GOTO:EOF
:beta
call :components
call :plugins
rem Build Double Commander
call :replace_old
lazbuild src\doublecmd.lpi --bm=beta %DC_ARCH%
rem Build Dwarf LineInfo Extractor
lazbuild tools\extractdwrflnfo.lpi
rem Extract debug line info
tools\extractdwrflnfo doublecmd.dbg
GOTO:EOF
:all
call :components
call :plugins
call :default
GOTO:EOF
:default
call :replace_old
lazbuild src\doublecmd.lpi %DC_ARCH%
GOTO:EOF
:nightly
call :replace_old
lazbuild src\doublecmd.lpi --bm=nightly %DC_ARCH%
GOTO:EOF
:replace_old
del /Q doublecmd.exe.old
ren doublecmd.exe doublecmd.exe.old
GOTO:EOF
pushd components
lazbuild chsdet\chsdet.lpk %DC_ARCH%
lazbuild CmdLine\cmdbox.lpk %DC_ARCH%
lazbuild multithreadprocs\multithreadprocslaz.lpk %DC_ARCH%
lazbuild dcpcrypt\dcpcrypt.lpk %DC_ARCH%
lazbuild doublecmd\doublecmd_common.lpk %DC_ARCH%
lazbuild KASToolBar\kascomp.lpk %DC_ARCH%
lazbuild viewer\viewerpackage.lpk %DC_ARCH%
lazbuild gifanim\pkg_gifanim.lpk %DC_ARCH%
lazbuild ZVDateTimeCtrls\zvdatetimectrls.lpk %DC_ARCH%
popd

View file

@ -1,21 +1,22 @@
{ Diese Datei wurde automatisch von Lazarus erzeugt. Sie darf nicht bearbeitet werden!
Dieser Quelltext dient nur dem Übersetzen und Installieren des Packages.
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
unit cmdbox;
unit cmdbox;
{$warn 5023 off : no warning about unused units}
interface
uses
uCmdBox, LazarusPackageIntf;
uCmdBox, LazarusPackageIntf;
implementation
procedure Register;
procedure Register;
begin
RegisterUnit('uCmdBox', @uCmdBox.Register);
end;
RegisterUnit('uCmdBox', @uCmdBox.Register);
end;
initialization
RegisterPackage('cmdbox', @Register);
RegisterPackage('cmdbox', @Register);
end.

View file

@ -4,11 +4,12 @@
unit KASComp;
{$warn 5023 off : no warning about unused units}
interface
uses
KASToolBar, KASProgressBar, KASPathEdit, KASToolItems,
KASComboBox, LazarusPackageIntf;
KASToolBar, KASProgressBar, KASPathEdit, KASToolItems, KASComboBox,
LazarusPackageIntf;
implementation

View file

@ -2,13 +2,14 @@
This source is only used to compile and install the package.
}
unit chsdet;
unit chsdet;
{$warn 5023 off : no warning about unused units}
interface
uses
Big5Freq, CharDistribution, chsdIntf, CustomDetector, EUCKRFreq,
EUCSampler, EUCTWFreq, GB2312Freq, JISFreq, JpCntx, MBUnicodeMultiProber,
Big5Freq, CharDistribution, chsdIntf, CustomDetector, EUCKRFreq, EUCSampler,
EUCTWFreq, GB2312Freq, JISFreq, JpCntx, MBUnicodeMultiProber,
MultiModelProber, nsCodingStateMachine, nsCore, nsEscCharsetProber,
nsGroupProber, nsHebrewProber, nsLatin1Prober, nsMBCSMultiProber, nsPkg,
nsSBCharSetProber, nsSBCSGroupProber, nsUniversalDetector,

View file

@ -4,6 +4,7 @@
unit dcpcrypt;
{$warn 5023 off : no warning about unused units}
interface
uses

View file

@ -28,7 +28,7 @@ unit DCStrUtils;
interface
uses
Classes, SysUtils, DCBasicTypes;
Classes, SysUtils, DCBasicTypes,LazUtf8;
type
TPathType = (ptNone, ptRelative, ptAbsolute);
@ -180,6 +180,27 @@ function ExcludeBackPathDelimiter(const Path: String): String;
@returns(Position of character in string)
}
function CharPos(C: Char; const S: string; StartPos: Integer = 1): Integer;
{en
Return position of any of tag-characters in string T in string S begun from start position
@param(T set of characters)
@param(S String)
@param(StartPos Start position)
@param(SearchBackward set @True if need search backwards)
@returns(Position of character in string)
}
function TagPos(T: string; const S: string; StartPos: Integer;SearchBackward: boolean=False): Integer;
{en
}
function scopy(IndexBegin,IndexEnd:integer;str:string):string;
{en
Split file name on name and extension
@param(sFileName File name)
@ -647,6 +668,7 @@ begin
Result:= Path;
end;
procedure DivFileName(const sFileName:String; out n,e:String);
var
i:Integer;
@ -736,6 +758,57 @@ else
Result := Pos(C, S);
end;
function TagPos(T: string; const S: string; StartPos: Integer;
SearchBackward: boolean): Integer;
// in future this function will moved to DCStrUtils
var
i,cnt:integer;
ch:char;
begin
Result:=0;
i:=StartPos;
if i=0 then i:=1;
cnt:=UTF8Length(S);
if SearchBackward then
begin
while (i>0)do
begin
ch:=S[UTF8CharToByteIndex(PChar(S), length(S), i)];
if Pos(ch,T)=0 then
dec(i)
else
break;
end;
end
else
while (i<=cnt)do
begin
ch:=S[UTF8CharToByteIndex(PChar(S), length(S), i)];
if Pos(ch,T)=0 then
inc(i)
else
break;
end;
Result:=i;
end;
function scopy(IndexBegin,IndexEnd:integer;str:string):string;
begin
if (IndexBegin<=IndexEnd) then
Result:=copy(str,IndexBegin,(IndexEnd-IndexBegin+1))
else
Result:='';
end;
function NumCountChars(const Char: char; const S: String): Integer;
var
I : Integer;
@ -1087,5 +1160,8 @@ begin
result:=Format('%d-%2.2d-%2.2d@%2.2d-%2.2d-%2.2d', [MyYear, MyMonth, MyDay, MyHour, MyMin, MySec]);
end;
end.

View file

@ -4,6 +4,7 @@
unit doublecmd_common;
{$warn 5023 off : no warning about unused units}
interface
uses

View file

@ -1,21 +1,22 @@
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
This source is only used to compile and install the package.
}
unit pkg_gifanim;
unit pkg_gifanim;
{$warn 5023 off : no warning about unused units}
interface
uses
GifAnim, LazarusPackageIntf;
GifAnim, LazarusPackageIntf;
implementation
procedure Register;
procedure Register;
begin
RegisterUnit('GifAnim', @GifAnim.Register);
end;
RegisterUnit('GifAnim', @GifAnim.Register);
end;
initialization
RegisterPackage('pkg_gifanim', @Register);
RegisterPackage('pkg_gifanim', @Register);
end.

View file

@ -1,20 +1,21 @@
{ This file was automatically created by Lazarus. do not edit!
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
unit MultiThreadProcsLaz;
unit MultiThreadProcsLaz;
{$warn 5023 off : no warning about unused units}
interface
uses
MTProcs, MTPUtils, MTPCPU, LazarusPackageIntf;
MTProcs, MTPUtils, MTPCPU, LazarusPackageIntf;
implementation
procedure Register;
procedure Register;
begin
end;
end;
initialization
RegisterPackage('MultiThreadProcsLaz', @Register);
RegisterPackage('MultiThreadProcsLaz', @Register);
end.

View file

@ -1508,24 +1508,102 @@ var
end;// of PrepareColors;
procedure DrawLines;
var
delta:integer;
begin
// Draw frame cursor.
Canvas.Pen.Width := ColumnsSet.GetColumnBorderFrameWidth(ACol);
if Canvas.Pen.Width<=1 then
begin
delta:=0;
end else
begin
if odd(Canvas.Pen.Width) then
delta:=Canvas.Pen.Width shr 1
else
delta:=(Canvas.Pen.Width shr 1)+1;
end;
if gUseFrameCursor and (gdSelected in aState) and (ColumnsView.Active OR ColumnsSet.GetColumnUseInactiveSelColor(Acol)) then
begin
if ColumnsView.Active then
Canvas.Pen.Color := ColumnsSet.GetColumnCursorColor(ACol)
else
Canvas.Pen.Color := ColumnsSet.GetColumnInactiveCursorColor(ACol);
Canvas.Line(aRect.Left, aRect.Top, aRect.Right, aRect.Top);
Canvas.Line(aRect.Left, aRect.Bottom - 1, aRect.Right, aRect.Bottom - 1);
if ACol=0 then
begin
Canvas.Line(aRect.Left + 1, aRect.Top + delta , aRect.Right , aRect.Top + delta );
Canvas.Line(aRect.Left + 1, aRect.Bottom - 1 - delta, aRect.Right, aRect.Bottom - 1 - delta);
Canvas.Line(aRect.Left + delta, aRect.Top + delta , aRect.Left + delta, aRect.Bottom - delta - 1);
end else
if ACol<ColCount-1 then
begin
Canvas.Line(aRect.Left, aRect.Top + delta , aRect.Right , aRect.Top + delta );
Canvas.Line(aRect.Left, aRect.Bottom - 1 - delta, aRect.Right, aRect.Bottom - 1 - delta);
end else
begin
Canvas.Line(aRect.Left, aRect.Top + delta , aRect.Right - delta - 1, aRect.Top + delta );
Canvas.Line(aRect.Left, aRect.Bottom - 1 - delta, aRect.Right - delta -1, aRect.Bottom - 1 - delta);
Canvas.Line(aRect.Right - delta - 1, aRect.Top + delta , aRect.Right - delta - 1, aRect.Bottom - delta - 1);
end;
{
Canvas.Pen.Color:=clred;
Canvas.Brush.Style:=bsClear;
// Canvas.Rectangle(Rect(aRect.Left + delta , aRect.Top + delta , aRect.Right - delta,aRect.Bottom - delta));
}
end;
// Draw drop selection.
if ARow - FixedRows = ColumnsView.FDropFileIndex then
begin
Canvas.Pen.Color := ColumnsSet.GetColumnTextColor(ACol);
Canvas.Line(aRect.Left, aRect.Top, aRect.Right, aRect.Top);
Canvas.Line(aRect.Left, aRect.Bottom - 1, aRect.Right, aRect.Bottom - 1);
if ACol=0 then
begin
Canvas.Line(aRect.Left + 1, aRect.Top + delta , aRect.Right , aRect.Top + delta );
Canvas.Line(aRect.Left + 1, aRect.Bottom - 1 - delta, aRect.Right, aRect.Bottom - 1 - delta);
Canvas.Line(aRect.Left + delta, aRect.Top + delta , aRect.Left + delta, aRect.Bottom - delta - 1);
end else
if ACol<ColCount-1 then
begin
Canvas.Line(aRect.Left, aRect.Top + delta , aRect.Right , aRect.Top + delta );
Canvas.Line(aRect.Left, aRect.Bottom - 1 - delta, aRect.Right, aRect.Bottom - 1 - delta);
end else
begin
Canvas.Line(aRect.Left, aRect.Top + delta , aRect.Right - delta - 1, aRect.Top + delta );
Canvas.Line(aRect.Left, aRect.Bottom - 1 - delta, aRect.Right - delta -1, aRect.Bottom - 1 - delta);
Canvas.Line(aRect.Right - delta - 1, aRect.Top + delta , aRect.Right - delta - 1, aRect.Bottom - delta - 1);
end;
{
// Canvas.Rectangle(aRect);
Canvas.Line(aRect.Left, aRect.Top + delta , aRect.Right - delta, aRect.Top + delta );
Canvas.Line(aRect.Left, aRect.Bottom - 1 - delta, aRect.Right - delta, aRect.Bottom - 1 - delta);
if ACol=0 then
Canvas.Line(aRect.Left + delta, aRect.Top + delta , aRect.Left + delta, aRect.Bottom - delta - 1);
if ACol=ColCount-1 then
Canvas.Line(aRect.Right - delta - 1, aRect.Top + delta , aRect.Right - delta - 1, aRect.Bottom - delta - 1);
}
{
Canvas.Pen.Color:=clred;
Canvas.Brush.Style:=bsClear;
Canvas.Rectangle(Rect(aRect.Left {+ delta} , aRect.Top {+ delta} , aRect.Right - delta,aRect.Bottom - delta));
}
end;
end;
//------------------------------------------------------

View file

@ -309,26 +309,28 @@ end;
procedure TFileViewGrid.DrawLines(aIdx, aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState);
var
delta:integer;
begin
//Canvas.Pen.Width := ColumnsSet.GetColumnBorderFrameWidth(ACol);
Canvas.Pen.Width := gBorderFrameWidth;
delta := Canvas.Pen.Width shr 1;
Canvas.Brush.Style:=bsClear;
// Draw frame cursor.
if gUseFrameCursor and (gdSelected in aState) and FFileView.Active then
begin
Canvas.Pen.Color := gCursorColor;
Canvas.Line(aRect.Left, aRect.Top, aRect.Right, aRect.Top);
Canvas.Line(aRect.Left, aRect.Bottom - 1, aRect.Right, aRect.Bottom - 1);
Canvas.Line(aRect.Left, aRect.Top, aRect.Left, aRect.Bottom-1);
Canvas.Line(aRect.Right-1, aRect.Top, aRect.Right-1, aRect.Bottom-1);
Canvas.Rectangle(Rect(aRect.Left+delta, aRect.Top+delta , aRect.Right - delta, aRect.Bottom - delta));
end;
// Draw drop selection.
if (FFileView.FDropFileIndex >= 0) and (aIdx = FFileView.FDropFileIndex) then
begin
Canvas.Pen.Color := gForeColor;
Canvas.Line(aRect.Left, aRect.Top, aRect.Right, aRect.Top);
Canvas.Line(aRect.Left, aRect.Bottom - 1, aRect.Right, aRect.Bottom - 1);
Canvas.Line(aRect.Left, aRect.Top, aRect.Left, aRect.Bottom-1);
Canvas.Line(aRect.Right-1, aRect.Top, aRect.Right-1, aRect.Bottom-1);
Canvas.Rectangle(Rect(aRect.Left+delta, aRect.Top+delta , aRect.Right - delta, aRect.Bottom - delta));
end;
Canvas.Brush.Style:=bsSolid;
end;
procedure TFileViewGrid.PrepareColors(aFile: TDisplayFile; aCol, aRow: Integer;

View file

@ -332,6 +332,7 @@ var
gUseInvertedSelection: Boolean;
gUseInactiveSelColor: Boolean;
gAllowOverColor: Boolean;
gBorderFrameWidth :integer;
gInactivePanelBrightness: Integer; // 0 .. 100 (black .. full color)
gIndUseGradient : Boolean; // use gradient on drive label
@ -1348,6 +1349,7 @@ begin
gUseInvertedSelection := False;
gUseInactiveSelColor := False;
gAllowOverColor := True;
gBorderFrameWidth:=1;
gInactivePanelBrightness := 100; // Full brightness
gIndUseGradient := True;
@ -2056,7 +2058,8 @@ begin
gInactiveMarkColor := gIni.ReadInteger('Colors', 'InactiveMarkColor', gInactiveMarkColor);
gUseInvertedSelection := gIni.ReadBool('Colors', 'UseInvertedSelection', gUseInvertedSelection);
gUseInactiveSelColor := gIni.ReadBool('Colors', 'UseInactiveSelColor', gUseInactiveSelColor);
gAllowOverColor := gIni.ReadBool('Colors', 'AllowOverColor', gAllowOverColor);
gAllowOverColor := gIni.ReadBool('Colors', 'AllowOverColor', gAllowOverColor);
gBorderFrameWidth := gIni.ReadInteger('Colors', 'gBorderFrameWidth', gBorderFrameWidth);
gInactivePanelBrightness := gIni.ReadInteger('Colors', 'InactivePanelBrightness', gInactivePanelBrightness);
{ File operations }
@ -2356,7 +2359,8 @@ begin
gInactiveMarkColor := GetValue(Node, 'InactiveMark', gInactiveMarkColor);
gUseInvertedSelection := GetValue(Node, 'UseInvertedSelection', gUseInvertedSelection);
gUseInactiveSelColor := GetValue(Node, 'UseInactiveSelColor', gUseInactiveSelColor);
gAllowOverColor := GetValue(Node, 'AllowOverColor', gAllowOverColor);
gAllowOverColor := GetValue(Node, 'AllowOverColor', gAllowOverColor);
gBorderFrameWidth := GetValue(Node, 'gBorderFrameWidth', gBorderFrameWidth);
gInactivePanelBrightness := GetValue(Node, 'InactivePanelBrightness', gInactivePanelBrightness);
gIndUseGradient := GetValue(Node, 'FreeSpaceIndicator/UseGradient', gIndUseGradient);
@ -2881,6 +2885,7 @@ begin
SetValue(Node, 'UseInvertedSelection', gUseInvertedSelection);
SetValue(Node, 'UseInactiveSelColor', gUseInactiveSelColor);
SetValue(Node, 'AllowOverColor', gAllowOverColor);
SetValue(Node, 'gBorderFrameWidth', gBorderFrameWidth);
SetValue(Node, 'InactivePanelBrightness', gInactivePanelBrightness);
SetValue(Node, 'FreeSpaceIndicator/UseGradient', gIndUseGradient);