You've already forked lazarus-ccr
RxFPC:cleanup code
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4647 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -55,7 +55,7 @@
|
|||||||
<MinVersion Major="1" Release="18" Build="56" Valid="True"/>
|
<MinVersion Major="1" Release="18" Build="56" Valid="True"/>
|
||||||
</Item5>
|
</Item5>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="126">
|
<Units Count="128">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="RxDBGridDemo.lpr"/>
|
<Filename Value="RxDBGridDemo.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -70,11 +70,11 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="RxDBGridMainUnit"/>
|
<UnitName Value="RxDBGridMainUnit"/>
|
||||||
<IsVisibleTab Value="True"/>
|
|
||||||
<TopLine Value="68"/>
|
<TopLine Value="68"/>
|
||||||
<CursorPos X="133" Y="85"/>
|
<CursorPos X="133" Y="85"/>
|
||||||
<UsageCount Value="107"/>
|
<UsageCount Value="107"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="../../../fpcsrc/fcl/db/db.pp"/>
|
<Filename Value="../../../fpcsrc/fcl/db/db.pp"/>
|
||||||
@ -96,15 +96,16 @@
|
|||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
<Filename Value="../../rxdbgrid.pas"/>
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="1"/>
|
||||||
<TopLine Value="773"/>
|
<TopLine Value="734"/>
|
||||||
<CursorPos Y="797"/>
|
<CursorPos Y="756"/>
|
||||||
<UsageCount Value="21"/>
|
<UsageCount Value="21"/>
|
||||||
<Bookmarks Count="3">
|
<Bookmarks Count="3">
|
||||||
<Item0 X="37" Y="1740" ID="1"/>
|
<Item0 X="37" Y="1738" ID="1"/>
|
||||||
<Item1 Y="588" ID="2"/>
|
<Item1 Y="588" ID="2"/>
|
||||||
<Item2 Y="5651" ID="3"/>
|
<Item2 Y="5619" ID="3"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit5>
|
</Unit5>
|
||||||
<Unit6>
|
<Unit6>
|
||||||
<Filename Value="../../../lcl/lresources.pp"/>
|
<Filename Value="../../../lcl/lresources.pp"/>
|
||||||
@ -435,17 +436,18 @@
|
|||||||
<Filename Value="../../../../lcl/dbgrids.pas"/>
|
<Filename Value="../../../../lcl/dbgrids.pas"/>
|
||||||
<UnitName Value="DBGrids"/>
|
<UnitName Value="DBGrids"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="201"/>
|
<TopLine Value="1339"/>
|
||||||
<CursorPos X="3" Y="218"/>
|
<CursorPos X="3" Y="1339"/>
|
||||||
<UsageCount Value="22"/>
|
<UsageCount Value="22"/>
|
||||||
</Unit58>
|
</Unit58>
|
||||||
<Unit59>
|
<Unit59>
|
||||||
<Filename Value="../../../../lcl/grids.pas"/>
|
<Filename Value="../../../../lcl/grids.pas"/>
|
||||||
<UnitName Value="Grids"/>
|
<UnitName Value="Grids"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="3"/>
|
||||||
<TopLine Value="12049"/>
|
<TopLine Value="1185"/>
|
||||||
<CursorPos X="3" Y="12052"/>
|
<CursorPos X="15" Y="1215"/>
|
||||||
<UsageCount Value="23"/>
|
<UsageCount Value="23"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit59>
|
</Unit59>
|
||||||
<Unit60>
|
<Unit60>
|
||||||
<Filename Value="../../../../../../install/fpcsrc/rtl/objpas/classes/classesh.inc"/>
|
<Filename Value="../../../../../../install/fpcsrc/rtl/objpas/classes/classesh.inc"/>
|
||||||
@ -505,9 +507,13 @@
|
|||||||
<ComponentName Value="rxSortByForm"/>
|
<ComponentName Value="rxSortByForm"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<TopLine Value="50"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<CursorPos X="14" Y="65"/>
|
<EditorIndex Value="2"/>
|
||||||
<UsageCount Value="9"/>
|
<TopLine Value="123"/>
|
||||||
|
<CursorPos X="5" Y="137"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit68>
|
</Unit68>
|
||||||
<Unit69>
|
<Unit69>
|
||||||
<Filename Value="../../rxfilterby.pas"/>
|
<Filename Value="../../rxfilterby.pas"/>
|
||||||
@ -871,8 +877,145 @@
|
|||||||
<CursorPos X="37" Y="501"/>
|
<CursorPos X="37" Y="501"/>
|
||||||
<UsageCount Value="11"/>
|
<UsageCount Value="11"/>
|
||||||
</Unit125>
|
</Unit125>
|
||||||
|
<Unit126>
|
||||||
|
<Filename Value="../../../../lcl/lclproc.pas"/>
|
||||||
|
<UnitName Value="LCLProc"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="321"/>
|
||||||
|
<CursorPos X="10" Y="338"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit126>
|
||||||
|
<Unit127>
|
||||||
|
<Filename Value="../../rxdbgridfootertools.pas"/>
|
||||||
|
<UnitName Value="RxDBGridFooterTools"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="97"/>
|
||||||
|
<CursorPos X="64" Y="119"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit127>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory HistoryIndex="-1"/>
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
|
<Position1>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5305" TopLine="5288"/>
|
||||||
|
</Position1>
|
||||||
|
<Position2>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5303" TopLine="5287"/>
|
||||||
|
</Position2>
|
||||||
|
<Position3>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="4882" TopLine="4901"/>
|
||||||
|
</Position3>
|
||||||
|
<Position4>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="4880" Column="9" TopLine="4863"/>
|
||||||
|
</Position4>
|
||||||
|
<Position5>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="4954" Column="8" TopLine="4937"/>
|
||||||
|
</Position5>
|
||||||
|
<Position6>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="721" Column="7" TopLine="706"/>
|
||||||
|
</Position6>
|
||||||
|
<Position7>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="716" Column="7" TopLine="700"/>
|
||||||
|
</Position7>
|
||||||
|
<Position8>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="4445" Column="3" TopLine="4429"/>
|
||||||
|
</Position8>
|
||||||
|
<Position9>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="3518" Column="16" TopLine="3501"/>
|
||||||
|
</Position9>
|
||||||
|
<Position10>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="3282" Column="5" TopLine="3265"/>
|
||||||
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="3248" Column="9" TopLine="3238"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2919" Column="3" TopLine="2905"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2705" Column="3" TopLine="2718"/>
|
||||||
|
</Position13>
|
||||||
|
<Position14>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2699" Column="18" TopLine="2682"/>
|
||||||
|
</Position14>
|
||||||
|
<Position15>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2833" Column="61" TopLine="2816"/>
|
||||||
|
</Position15>
|
||||||
|
<Position16>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="956" Column="80" TopLine="938"/>
|
||||||
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2705" TopLine="2686"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="4648" TopLine="4631"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5016" Column="5" TopLine="5019"/>
|
||||||
|
</Position19>
|
||||||
|
<Position20>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="721" TopLine="707"/>
|
||||||
|
</Position20>
|
||||||
|
<Position21>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="750" Column="31" TopLine="734"/>
|
||||||
|
</Position21>
|
||||||
|
<Position22>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2722" TopLine="2768"/>
|
||||||
|
</Position22>
|
||||||
|
<Position23>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2703" Column="5" TopLine="2686"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2818" Column="17" TopLine="2818"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2443" Column="13" TopLine="2408"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="2403" Column="13" TopLine="2385"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="1841" TopLine="1822"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="1536" Column="16" TopLine="1534"/>
|
||||||
|
</Position28>
|
||||||
|
<Position29>
|
||||||
|
<Filename Value="../../rxdbgrid.pas"/>
|
||||||
|
<Caret Line="750" Column="15" TopLine="735"/>
|
||||||
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="../../rxsortby.pas"/>
|
||||||
|
<Caret Line="65" Column="14" TopLine="50"/>
|
||||||
|
</Position30>
|
||||||
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
|
@ -113,7 +113,7 @@ type
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
TRxDSState = (rxdsInactive, rxdsActive);
|
//TRxDSState = (rxdsInactive, rxdsActive);
|
||||||
|
|
||||||
TRxFilterOpCode = (fopEQ, fopNotEQ, fopStartFrom, fopEndTo, fopLike, fopNotLike);
|
TRxFilterOpCode = (fopEQ, fopNotEQ, fopStartFrom, fopEndTo, fopLike, fopNotLike);
|
||||||
{ TRxDBGridKeyStroke }
|
{ TRxDBGridKeyStroke }
|
||||||
@ -548,7 +548,7 @@ type
|
|||||||
TRxDBGrid = class(TCustomDBGrid)
|
TRxDBGrid = class(TCustomDBGrid)
|
||||||
private
|
private
|
||||||
FColumnDefValues: TRxDBGridColumnDefValues;
|
FColumnDefValues: TRxDBGridColumnDefValues;
|
||||||
FrxDSState:TRxDSState;
|
//FrxDSState:TRxDSState;
|
||||||
FFooterOptions: TRxDBGridFooterOptions;
|
FFooterOptions: TRxDBGridFooterOptions;
|
||||||
FSortColumns: TRxDbGridColumnsSortList;
|
FSortColumns: TRxDbGridColumnsSortList;
|
||||||
FSortingNow:Boolean;
|
FSortingNow:Boolean;
|
||||||
@ -718,8 +718,6 @@ type
|
|||||||
|
|
||||||
procedure ColRowMoved(IsColumn: boolean; FromIndex, ToIndex: integer); override;
|
procedure ColRowMoved(IsColumn: boolean; FromIndex, ToIndex: integer); override;
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
procedure UpdateActive; override;
|
|
||||||
procedure UpdateData; override;
|
|
||||||
procedure MoveSelection; override;
|
procedure MoveSelection; override;
|
||||||
function GetBufferCount: integer; override;
|
function GetBufferCount: integer; override;
|
||||||
procedure CMHintShow(var Message: TLMessage); message CM_HINTSHOW;
|
procedure CMHintShow(var Message: TLMessage); message CM_HINTSHOW;
|
||||||
@ -749,12 +747,12 @@ type
|
|||||||
procedure DoEditorHide; override;
|
procedure DoEditorHide; override;
|
||||||
procedure DoEditorShow; override;
|
procedure DoEditorShow; override;
|
||||||
|
|
||||||
procedure EraseBackground(DC: HDC); override;
|
|
||||||
property Editor;
|
property Editor;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
|
procedure EraseBackground(DC: HDC); override;
|
||||||
procedure FilterRec(DataSet: TDataSet; var Accept: boolean);
|
procedure FilterRec(DataSet: TDataSet; var Accept: boolean);
|
||||||
function EditorByStyle(Style: TColumnButtonStyle): TWinControl; override;
|
function EditorByStyle(Style: TColumnButtonStyle): TWinControl; override;
|
||||||
procedure LayoutChanged; override;
|
procedure LayoutChanged; override;
|
||||||
@ -953,7 +951,7 @@ procedure RegisterRxDBGridSortEngine(RxDBGridSortEngineClass: TRxDBGridSortEngin
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses Math, rxdconst, rxstrutils, strutils, rxdbgrid_findunit, rxdbgrid_columsunit,
|
uses Math, rxdconst, rxstrutils, strutils, rxdbgrid_findunit, rxdbgrid_columsunit,
|
||||||
rxlookup, tooledit, LCLProc, Clipbrd, rxfilterby, rxsortby, variants;
|
rxlookup, tooledit, LCLProc, Clipbrd, rxfilterby, rxsortby, variants, LazUTF8;
|
||||||
|
|
||||||
{$R rxdbgrid.res}
|
{$R rxdbgrid.res}
|
||||||
|
|
||||||
@ -1535,7 +1533,7 @@ end;
|
|||||||
|
|
||||||
function TRxDBGridAbstractTools.DoExecTools: boolean;
|
function TRxDBGridAbstractTools.DoExecTools: boolean;
|
||||||
begin
|
begin
|
||||||
//
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRxDBGridAbstractTools.DoSetupTools: boolean;
|
function TRxDBGridAbstractTools.DoSetupTools: boolean;
|
||||||
@ -1837,15 +1835,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TRxColumnEditButton.Create(ACollection: TCollection);
|
constructor TRxColumnEditButton.Create(ACollection: TCollection);
|
||||||
var
|
|
||||||
P: TBitmap;
|
|
||||||
begin
|
begin
|
||||||
inherited Create(ACollection);
|
inherited Create(ACollection);
|
||||||
FButton:=TSpeedButton.Create(nil);
|
FButton:=TSpeedButton.Create(nil);
|
||||||
//FButton.Glyph:=LoadLazResBitmapImage('rx_markerdown');
|
|
||||||
{ P:=CreateResBitmap('rx_markerdown');
|
|
||||||
FButton.Glyph:=P;
|
|
||||||
P.Free;}
|
|
||||||
|
|
||||||
FSpinBtn:=TRxSpinButton.Create(nil);
|
FSpinBtn:=TRxSpinButton.Create(nil);
|
||||||
FSpinBtn.OnBottomClick:=@DoBottomClick;
|
FSpinBtn.OnBottomClick:=@DoBottomClick;
|
||||||
@ -2304,12 +2296,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ TRxDBGrid }
|
{ TRxDBGrid }
|
||||||
|
(*
|
||||||
const
|
const
|
||||||
ALIGN_FLAGS: array[TAlignment] of integer =
|
ALIGN_FLAGS: array[TAlignment] of integer =
|
||||||
(DT_LEFT or DT_SINGLELINE {or DT_EXPANDTABS} or DT_NOPREFIX,
|
(DT_LEFT or DT_SINGLELINE {or DT_EXPANDTABS} or DT_NOPREFIX,
|
||||||
DT_RIGHT or DT_SINGLELINE {or DT_EXPANDTABS} or DT_NOPREFIX,
|
DT_RIGHT or DT_SINGLELINE {or DT_EXPANDTABS} or DT_NOPREFIX,
|
||||||
DT_CENTER or DT_SINGLELINE {or DT_EXPANDTABS} or DT_NOPREFIX);
|
DT_CENTER or DT_SINGLELINE {or DT_EXPANDTABS} or DT_NOPREFIX);
|
||||||
|
*)
|
||||||
const
|
const
|
||||||
ALIGN_FLAGS_HEADER: array[TAlignment] of integer =
|
ALIGN_FLAGS_HEADER: array[TAlignment] of integer =
|
||||||
(DT_LEFT or {DT_EXPANDTABS or} DT_NOPREFIX,
|
(DT_LEFT or {DT_EXPANDTABS or} DT_NOPREFIX,
|
||||||
@ -2391,7 +2384,7 @@ procedure TRxDBGrid.WMVScroll(var Message: TLMVScroll);
|
|||||||
var
|
var
|
||||||
IsSeq: boolean;
|
IsSeq: boolean;
|
||||||
aPos, aRange, aPage: Integer;
|
aPos, aRange, aPage: Integer;
|
||||||
DeltaRec: integer;
|
//DeltaRec: integer;
|
||||||
|
|
||||||
function MaxPos: Integer;
|
function MaxPos: Integer;
|
||||||
begin
|
begin
|
||||||
@ -2441,6 +2434,7 @@ begin
|
|||||||
|
|
||||||
if EditorMode then
|
if EditorMode then
|
||||||
RestoreEditor;
|
RestoreEditor;
|
||||||
|
inherited;
|
||||||
{$ifdef dbgDBGrid}
|
{$ifdef dbgDBGrid}
|
||||||
DebugLn('---- Diff=',dbgs(DeltaRec), ' FinalPos=',dbgs(aPos));
|
DebugLn('---- Diff=',dbgs(DeltaRec), ' FinalPos=',dbgs(aPos));
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -2695,13 +2689,13 @@ end;
|
|||||||
procedure TRxDBGrid.CalcTitle;
|
procedure TRxDBGrid.CalcTitle;
|
||||||
var
|
var
|
||||||
i, j: integer;
|
i, j: integer;
|
||||||
H, H1, W, H2, W1: integer;
|
H, H1, W, {H2,} W1: integer;
|
||||||
rxCol, rxColNext: TRxColumn;
|
rxCol, rxColNext: TRxColumn;
|
||||||
rxTit, rxTitleNext: TRxColumnTitle;
|
rxTit, rxTitleNext: TRxColumnTitle;
|
||||||
MLRec1, P: TMLCaptionItem;
|
MLRec1, P: TMLCaptionItem;
|
||||||
MLRec2: TMLCaptionItem;
|
MLRec2: TMLCaptionItem;
|
||||||
tmpCanvas: TCanvas;
|
tmpCanvas: TCanvas;
|
||||||
S: string;
|
//S: string;
|
||||||
begin
|
begin
|
||||||
{ TODO -oalexs : need rewrite code - split to 2 step:
|
{ TODO -oalexs : need rewrite code - split to 2 step:
|
||||||
1. make links between column
|
1. make links between column
|
||||||
@ -2710,7 +2704,6 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
tmpCanvas := GetWorkingCanvas(Canvas);
|
tmpCanvas := GetWorkingCanvas(Canvas);
|
||||||
try
|
try
|
||||||
// H := 1;
|
|
||||||
ClearMLCaptionPointers;
|
ClearMLCaptionPointers;
|
||||||
for i := 0 to Columns.Count - 1 do
|
for i := 0 to Columns.Count - 1 do
|
||||||
begin
|
begin
|
||||||
@ -2817,7 +2810,7 @@ begin
|
|||||||
for j := 0 to rxTit.CaptionLinesCount - 1 do
|
for j := 0 to rxTit.CaptionLinesCount - 1 do
|
||||||
begin
|
begin
|
||||||
MLRec1 := rxTit.CaptionLine(j);
|
MLRec1 := rxTit.CaptionLine(j);
|
||||||
S := MLRec1.Caption;
|
//S := MLRec1.Caption;
|
||||||
if not Assigned(MLRec1.Prior) then
|
if not Assigned(MLRec1.Prior) then
|
||||||
begin
|
begin
|
||||||
W := rxCol.Width;
|
W := rxCol.Width;
|
||||||
@ -2914,8 +2907,8 @@ end;
|
|||||||
|
|
||||||
procedure TRxDBGrid.OutCaptionCellText(aCol, aRow: integer; const aRect: TRect;
|
procedure TRxDBGrid.OutCaptionCellText(aCol, aRow: integer; const aRect: TRect;
|
||||||
aState: TGridDrawState; const ACaption: string);
|
aState: TGridDrawState; const ACaption: string);
|
||||||
var
|
//var
|
||||||
T1, T2: TTextStyle;
|
// T1, T2: TTextStyle;
|
||||||
begin
|
begin
|
||||||
if (TitleStyle = tsNative) then
|
if (TitleStyle = tsNative) then
|
||||||
DrawThemedCell(aCol, aRow, aRect, aState)
|
DrawThemedCell(aCol, aRow, aRect, aState)
|
||||||
@ -3244,6 +3237,7 @@ var
|
|||||||
Asc:array of boolean;
|
Asc:array of boolean;
|
||||||
begin
|
begin
|
||||||
if (FSortColumns.Count = 0) then exit;
|
if (FSortColumns.Count = 0) then exit;
|
||||||
|
S:='';
|
||||||
FSortingNow:=true;
|
FSortingNow:=true;
|
||||||
if (FSortColumns.Count>1) or (Pos(';', FSortColumns[0].GetSortFields)>0) then
|
if (FSortColumns.Count>1) or (Pos(';', FSortColumns[0].GetSortFields)>0) then
|
||||||
begin
|
begin
|
||||||
@ -3278,7 +3272,7 @@ end;
|
|||||||
function TRxDBGrid.UpdateRowsHeight: integer;
|
function TRxDBGrid.UpdateRowsHeight: integer;
|
||||||
var
|
var
|
||||||
i, J, H, H1, H2:integer;
|
i, J, H, H1, H2:integer;
|
||||||
B:boolean;
|
//B:boolean;
|
||||||
F:TField;
|
F:TField;
|
||||||
S:string;
|
S:string;
|
||||||
CurActiveRecord: Integer;
|
CurActiveRecord: Integer;
|
||||||
@ -3514,7 +3508,7 @@ var
|
|||||||
FTitle: TRxColumnTitle;
|
FTitle: TRxColumnTitle;
|
||||||
GrdCol: TRxColumn;
|
GrdCol: TRxColumn;
|
||||||
|
|
||||||
MLI, MLINext, MLI1: TMLCaptionItem;
|
MLI{, MLINext, MLI1}: TMLCaptionItem;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if (dgIndicator in Options) and (aCol = 0) then
|
if (dgIndicator in Options) and (aCol = 0) then
|
||||||
@ -4440,8 +4434,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRxDBGrid.KeyDown(var Key: word; Shift: TShiftState);
|
procedure TRxDBGrid.KeyDown(var Key: word; Shift: TShiftState);
|
||||||
var
|
//var
|
||||||
FTmpReadOnly: boolean;
|
// FTmpReadOnly: boolean;
|
||||||
|
|
||||||
procedure DoShowFindDlg;
|
procedure DoShowFindDlg;
|
||||||
begin
|
begin
|
||||||
@ -4643,28 +4637,6 @@ begin
|
|||||||
Dec(FInProcessCalc);
|
Dec(FInProcessCalc);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRxDBGrid.UpdateActive;
|
|
||||||
begin
|
|
||||||
{ if FInProcessCalc > 0 then
|
|
||||||
exit;}
|
|
||||||
inherited UpdateActive;
|
|
||||||
{ if FInProcessCalc < 0 then
|
|
||||||
begin
|
|
||||||
FInProcessCalc := 0;
|
|
||||||
UpdateFooterRowOnUpdateActive;
|
|
||||||
end
|
|
||||||
{ else
|
|
||||||
if FFooterOptions.Active and (FFooterOptions.RowCount > 0) then
|
|
||||||
UpdateFooterRowOnUpdateActive;}
|
|
||||||
}
|
|
||||||
// UpdateRowsHeight;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TRxDBGrid.UpdateData;
|
|
||||||
begin
|
|
||||||
inherited UpdateData;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TRxDBGrid.MoveSelection;
|
procedure TRxDBGrid.MoveSelection;
|
||||||
begin
|
begin
|
||||||
inherited MoveSelection;
|
inherited MoveSelection;
|
||||||
@ -4876,9 +4848,8 @@ var
|
|||||||
P_26: TBookmark;
|
P_26: TBookmark;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
P: TBookmark;
|
P: TBookmark;
|
||||||
i, cnt, K: integer;
|
i, cnt: integer;
|
||||||
APresent: boolean;
|
APresent: boolean;
|
||||||
BB:Double;
|
|
||||||
|
|
||||||
DHL:THackDataLink;
|
DHL:THackDataLink;
|
||||||
DHS:THackDataSet;
|
DHS:THackDataSet;
|
||||||
@ -5034,7 +5005,7 @@ begin
|
|||||||
|
|
||||||
if Min(DHL.RecordCount + SavePos - 1, DHS.RecNo) > 0 then
|
if Min(DHL.RecordCount + SavePos - 1, DHS.RecNo) > 0 then
|
||||||
DHS.RecNo := Min(DHL.RecordCount + SavePos - 1, DHS.RecNo);
|
DHS.RecNo := Min(DHL.RecordCount + SavePos - 1, DHS.RecNo);
|
||||||
K:=DHS.RecNo;
|
//K:=DHS.RecNo;
|
||||||
|
|
||||||
while not DHS.BOF do
|
while not DHS.BOF do
|
||||||
begin
|
begin
|
||||||
@ -5299,9 +5270,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRxDBGrid.OnFilterClose(Sender: TObject);
|
procedure TRxDBGrid.OnFilterClose(Sender: TObject);
|
||||||
var
|
|
||||||
C: TRxColumn;
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
OptionsRx := OptionsRx - [rdgFilter];
|
OptionsRx := OptionsRx - [rdgFilter];
|
||||||
DataSource.DataSet.Filtered := False;
|
DataSource.DataSet.Filtered := False;
|
||||||
@ -5461,7 +5429,7 @@ end;
|
|||||||
procedure TRxDBGrid.DoEditorHide;
|
procedure TRxDBGrid.DoEditorHide;
|
||||||
var
|
var
|
||||||
R:TRxColumn;
|
R:TRxColumn;
|
||||||
i, w:integer;
|
i:integer;
|
||||||
begin
|
begin
|
||||||
inherited DoEditorHide;
|
inherited DoEditorHide;
|
||||||
R:=SelectedColumn as TRxColumn;
|
R:=SelectedColumn as TRxColumn;
|
||||||
|
@ -114,18 +114,10 @@ type
|
|||||||
|
|
||||||
function TRxDBGridFooterTools.MouseDown(Button: TMouseButton;
|
function TRxDBGridFooterTools.MouseDown(Button: TMouseButton;
|
||||||
Shift: TShiftState; X, Y: integer): boolean;
|
Shift: TShiftState; X, Y: integer): boolean;
|
||||||
var
|
|
||||||
Cell: TGridCoord;
|
|
||||||
begin
|
begin
|
||||||
if (Y > THackRxDBGrid(RxDBGrid).GCache.ClientHeight - (RxDBGrid.DefaultRowHeight * RxDBGrid.FooterOptions.RowCount)) then
|
Result:=(Y > THackRxDBGrid(RxDBGrid).GCache.ClientHeight - (RxDBGrid.DefaultRowHeight * RxDBGrid.FooterOptions.RowCount));
|
||||||
begin
|
if Result and (ssDouble in Shift) then
|
||||||
Result:=true;
|
DoSetupTools;
|
||||||
Cell := RxDBGrid.MouseCoord(X, Y);
|
|
||||||
if (ssDouble in Shift) then
|
|
||||||
DoSetupTools;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Result:=false;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TRxDBGridFooterTools.Create(AOwner: TComponent);
|
constructor TRxDBGridFooterTools.Create(AOwner: TComponent);
|
||||||
|
@ -24,7 +24,7 @@ Copyright (c) 1998 Master-Bank
|
|||||||
translate to Lazarus by alexs in 2005 - 2016
|
translate to Lazarus by alexs in 2005 - 2016
|
||||||
"/>
|
"/>
|
||||||
<License Value="LGPL"/>
|
<License Value="LGPL"/>
|
||||||
<Version Major="2" Minor="9" Release="1" Build="183"/>
|
<Version Major="2" Minor="9" Release="2" Build="190"/>
|
||||||
<Files Count="68">
|
<Files Count="68">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Filename Value="autopanel.pas"/>
|
<Filename Value="autopanel.pas"/>
|
||||||
|
@ -9,15 +9,15 @@ object rxSortByForm: TrxSortByForm
|
|||||||
ClientWidth = 684
|
ClientWidth = 684
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.1'
|
LCLVersion = '1.7'
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
AnchorSideLeft.Control = AddBtn
|
AnchorSideLeft.Control = AddBtn
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
Left = 417
|
Left = 421
|
||||||
Height = 15
|
Height = 20
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 105
|
Width = 113
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = '&Fields for sorting:'
|
Caption = '&Fields for sorting:'
|
||||||
FocusControl = ListBox1
|
FocusControl = ListBox1
|
||||||
@ -27,9 +27,9 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 15
|
Height = 20
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 55
|
Width = 60
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = '&All fields:'
|
Caption = '&All fields:'
|
||||||
FocusControl = ListBox2
|
FocusControl = ListBox2
|
||||||
@ -42,14 +42,14 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideRight.Control = AddBtn
|
AnchorSideRight.Control = AddBtn
|
||||||
AnchorSideBottom.Control = CheckBox1
|
AnchorSideBottom.Control = CheckBox1
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 289
|
Height = 282
|
||||||
Top = 27
|
Top = 32
|
||||||
Width = 262
|
Width = 258
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnDblClick = ListBox2DblClick
|
OnDblClick = ListBox2DblClick
|
||||||
ScrollWidth = 260
|
ScrollWidth = 256
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
end
|
end
|
||||||
@ -59,10 +59,10 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = AddBtn
|
AnchorSideRight.Control = AddBtn
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 274
|
Left = 270
|
||||||
Height = 35
|
Height = 35
|
||||||
Top = 68
|
Top = 73
|
||||||
Width = 137
|
Width = 145
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -91,10 +91,10 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = AddBtn
|
AnchorSideRight.Control = AddBtn
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 274
|
Left = 270
|
||||||
Height = 36
|
Height = 36
|
||||||
Top = 109
|
Top = 114
|
||||||
Width = 137
|
Width = 145
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -123,10 +123,10 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = AddBtn
|
AnchorSideRight.Control = AddBtn
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 274
|
Left = 270
|
||||||
Height = 36
|
Height = 36
|
||||||
Top = 151
|
Top = 156
|
||||||
Width = 137
|
Width = 145
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -157,16 +157,16 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = CheckBox1
|
AnchorSideBottom.Control = CheckBox1
|
||||||
Left = 417
|
Left = 421
|
||||||
Height = 289
|
Height = 282
|
||||||
Top = 27
|
Top = 32
|
||||||
Width = 261
|
Width = 257
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnDblClick = SpeedButton1Click
|
OnDblClick = SpeedButton1Click
|
||||||
OnDrawItem = ListBox1DrawItem
|
OnDrawItem = ListBox1DrawItem
|
||||||
ScrollWidth = 259
|
ScrollWidth = 255
|
||||||
Style = lbOwnerDrawFixed
|
Style = lbOwnerDrawFixed
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
@ -175,10 +175,10 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = ListBox1
|
AnchorSideTop.Control = ListBox1
|
||||||
Left = 274
|
Left = 270
|
||||||
Height = 35
|
Height = 35
|
||||||
Top = 27
|
Top = 32
|
||||||
Width = 137
|
Width = 145
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = '&Add field to sort'
|
Caption = '&Add field to sort'
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
@ -221,9 +221,9 @@ object rxSortByForm: TrxSortByForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideBottom.Control = ButtonPanel1
|
AnchorSideBottom.Control = ButtonPanel1
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 22
|
Height = 24
|
||||||
Top = 322
|
Top = 320
|
||||||
Width = 151
|
Width = 158
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'Case insensitive sort'
|
Caption = 'Case insensitive sort'
|
||||||
|
@ -128,13 +128,13 @@ procedure TrxSortByForm.ListBox1DrawItem(Control: TWinControl; Index: Integer;
|
|||||||
ARect: TRect; State: TOwnerDrawState);
|
ARect: TRect; State: TOwnerDrawState);
|
||||||
var
|
var
|
||||||
X, Y:integer;
|
X, Y:integer;
|
||||||
P:TRxColumn;
|
//P:TRxColumn;
|
||||||
S1, S2:string;
|
S1, S2:string;
|
||||||
Cnv:TCanvas;
|
Cnv:TCanvas;
|
||||||
begin
|
begin
|
||||||
Cnv:=ListBox1.Canvas;
|
Cnv:=ListBox1.Canvas;
|
||||||
Cnv.FillRect(ARect); { clear the rectangle }
|
Cnv.FillRect(ARect); { clear the rectangle }
|
||||||
P:=TRxColumn(ListBox1.Items.Objects[Index]);
|
//P:=TRxColumn(ListBox1.Items.Objects[Index]);
|
||||||
S1:=ListBox1.Items[Index];
|
S1:=ListBox1.Items[Index];
|
||||||
S2:=Copy(S1, 1, 1);
|
S2:=Copy(S1, 1, 1);
|
||||||
Delete(S1, 1, 1);
|
Delete(S1, 1, 1);
|
||||||
@ -222,7 +222,7 @@ end;
|
|||||||
function TrxSortByForm.Execute(ADBGrid: TRxDBGrid; SortNames: TStringList
|
function TrxSortByForm.Execute(ADBGrid: TRxDBGrid; SortNames: TStringList
|
||||||
): Boolean;
|
): Boolean;
|
||||||
var
|
var
|
||||||
i, j : Integer;
|
i : Integer;
|
||||||
S : String;
|
S : String;
|
||||||
C:TRxColumn;
|
C:TRxColumn;
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user