diff --git a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi
index e2f2c45f9..6a7885324 100644
--- a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi
+++ b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi
@@ -55,7 +55,7 @@
-
+
@@ -70,11 +70,11 @@
-
+
@@ -96,15 +96,16 @@
-
-
-
+
+
+
-
+
-
+
+
@@ -435,17 +436,18 @@
-
-
+
+
-
-
-
+
+
+
+
@@ -505,9 +507,13 @@
-
-
-
+
+
+
+
+
+
+
@@ -871,8 +877,145 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/rx/trunk/rxdbgrid.pas b/components/rx/trunk/rxdbgrid.pas
index 584520dfb..35fe15714 100644
--- a/components/rx/trunk/rxdbgrid.pas
+++ b/components/rx/trunk/rxdbgrid.pas
@@ -113,7 +113,7 @@ type
);
- TRxDSState = (rxdsInactive, rxdsActive);
+ //TRxDSState = (rxdsInactive, rxdsActive);
TRxFilterOpCode = (fopEQ, fopNotEQ, fopStartFrom, fopEndTo, fopLike, fopNotLike);
{ TRxDBGridKeyStroke }
@@ -548,7 +548,7 @@ type
TRxDBGrid = class(TCustomDBGrid)
private
FColumnDefValues: TRxDBGridColumnDefValues;
- FrxDSState:TRxDSState;
+ //FrxDSState:TRxDSState;
FFooterOptions: TRxDBGridFooterOptions;
FSortColumns: TRxDbGridColumnsSortList;
FSortingNow:Boolean;
@@ -718,8 +718,6 @@ type
procedure ColRowMoved(IsColumn: boolean; FromIndex, ToIndex: integer); override;
procedure Paint; override;
- procedure UpdateActive; override;
- procedure UpdateData; override;
procedure MoveSelection; override;
function GetBufferCount: integer; override;
procedure CMHintShow(var Message: TLMessage); message CM_HINTSHOW;
@@ -749,12 +747,12 @@ type
procedure DoEditorHide; override;
procedure DoEditorShow; override;
- procedure EraseBackground(DC: HDC); override;
property Editor;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
+ procedure EraseBackground(DC: HDC); override;
procedure FilterRec(DataSet: TDataSet; var Accept: boolean);
function EditorByStyle(Style: TColumnButtonStyle): TWinControl; override;
procedure LayoutChanged; override;
@@ -953,7 +951,7 @@ procedure RegisterRxDBGridSortEngine(RxDBGridSortEngineClass: TRxDBGridSortEngin
implementation
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}
@@ -1535,7 +1533,7 @@ end;
function TRxDBGridAbstractTools.DoExecTools: boolean;
begin
- //
+ Result:=false;
end;
function TRxDBGridAbstractTools.DoSetupTools: boolean;
@@ -1837,15 +1835,9 @@ begin
end;
constructor TRxColumnEditButton.Create(ACollection: TCollection);
-var
- P: TBitmap;
begin
inherited Create(ACollection);
FButton:=TSpeedButton.Create(nil);
- //FButton.Glyph:=LoadLazResBitmapImage('rx_markerdown');
-{ P:=CreateResBitmap('rx_markerdown');
- FButton.Glyph:=P;
- P.Free;}
FSpinBtn:=TRxSpinButton.Create(nil);
FSpinBtn.OnBottomClick:=@DoBottomClick;
@@ -2304,12 +2296,13 @@ begin
end;
{ TRxDBGrid }
+(*
const
ALIGN_FLAGS: array[TAlignment] of integer =
(DT_LEFT 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);
-
+*)
const
ALIGN_FLAGS_HEADER: array[TAlignment] of integer =
(DT_LEFT or {DT_EXPANDTABS or} DT_NOPREFIX,
@@ -2391,7 +2384,7 @@ procedure TRxDBGrid.WMVScroll(var Message: TLMVScroll);
var
IsSeq: boolean;
aPos, aRange, aPage: Integer;
- DeltaRec: integer;
+ //DeltaRec: integer;
function MaxPos: Integer;
begin
@@ -2441,6 +2434,7 @@ begin
if EditorMode then
RestoreEditor;
+ inherited;
{$ifdef dbgDBGrid}
DebugLn('---- Diff=',dbgs(DeltaRec), ' FinalPos=',dbgs(aPos));
{$endif}
@@ -2695,13 +2689,13 @@ end;
procedure TRxDBGrid.CalcTitle;
var
i, j: integer;
- H, H1, W, H2, W1: integer;
+ H, H1, W, {H2,} W1: integer;
rxCol, rxColNext: TRxColumn;
rxTit, rxTitleNext: TRxColumnTitle;
MLRec1, P: TMLCaptionItem;
MLRec2: TMLCaptionItem;
tmpCanvas: TCanvas;
- S: string;
+ //S: string;
begin
{ TODO -oalexs : need rewrite code - split to 2 step:
1. make links between column
@@ -2710,7 +2704,6 @@ begin
exit;
tmpCanvas := GetWorkingCanvas(Canvas);
try
-// H := 1;
ClearMLCaptionPointers;
for i := 0 to Columns.Count - 1 do
begin
@@ -2817,7 +2810,7 @@ begin
for j := 0 to rxTit.CaptionLinesCount - 1 do
begin
MLRec1 := rxTit.CaptionLine(j);
- S := MLRec1.Caption;
+ //S := MLRec1.Caption;
if not Assigned(MLRec1.Prior) then
begin
W := rxCol.Width;
@@ -2914,8 +2907,8 @@ end;
procedure TRxDBGrid.OutCaptionCellText(aCol, aRow: integer; const aRect: TRect;
aState: TGridDrawState; const ACaption: string);
-var
- T1, T2: TTextStyle;
+//var
+// T1, T2: TTextStyle;
begin
if (TitleStyle = tsNative) then
DrawThemedCell(aCol, aRow, aRect, aState)
@@ -3244,6 +3237,7 @@ var
Asc:array of boolean;
begin
if (FSortColumns.Count = 0) then exit;
+ S:='';
FSortingNow:=true;
if (FSortColumns.Count>1) or (Pos(';', FSortColumns[0].GetSortFields)>0) then
begin
@@ -3278,7 +3272,7 @@ end;
function TRxDBGrid.UpdateRowsHeight: integer;
var
i, J, H, H1, H2:integer;
- B:boolean;
+ //B:boolean;
F:TField;
S:string;
CurActiveRecord: Integer;
@@ -3514,7 +3508,7 @@ var
FTitle: TRxColumnTitle;
GrdCol: TRxColumn;
- MLI, MLINext, MLI1: TMLCaptionItem;
+ MLI{, MLINext, MLI1}: TMLCaptionItem;
begin
if (dgIndicator in Options) and (aCol = 0) then
@@ -4440,8 +4434,8 @@ begin
end;
procedure TRxDBGrid.KeyDown(var Key: word; Shift: TShiftState);
-var
- FTmpReadOnly: boolean;
+//var
+// FTmpReadOnly: boolean;
procedure DoShowFindDlg;
begin
@@ -4643,28 +4637,6 @@ begin
Dec(FInProcessCalc);
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;
begin
inherited MoveSelection;
@@ -4876,9 +4848,8 @@ var
P_26: TBookmark;
{$ENDIF}
P: TBookmark;
- i, cnt, K: integer;
+ i, cnt: integer;
APresent: boolean;
- BB:Double;
DHL:THackDataLink;
DHS:THackDataSet;
@@ -5034,7 +5005,7 @@ begin
if Min(DHL.RecordCount + SavePos - 1, DHS.RecNo) > 0 then
DHS.RecNo := Min(DHL.RecordCount + SavePos - 1, DHS.RecNo);
- K:=DHS.RecNo;
+ //K:=DHS.RecNo;
while not DHS.BOF do
begin
@@ -5299,9 +5270,6 @@ begin
end;
procedure TRxDBGrid.OnFilterClose(Sender: TObject);
-var
- C: TRxColumn;
- i: integer;
begin
OptionsRx := OptionsRx - [rdgFilter];
DataSource.DataSet.Filtered := False;
@@ -5461,7 +5429,7 @@ end;
procedure TRxDBGrid.DoEditorHide;
var
R:TRxColumn;
- i, w:integer;
+ i:integer;
begin
inherited DoEditorHide;
R:=SelectedColumn as TRxColumn;
diff --git a/components/rx/trunk/rxdbgridfootertools.pas b/components/rx/trunk/rxdbgridfootertools.pas
index 729fd5741..7f90b226a 100644
--- a/components/rx/trunk/rxdbgridfootertools.pas
+++ b/components/rx/trunk/rxdbgridfootertools.pas
@@ -114,18 +114,10 @@ type
function TRxDBGridFooterTools.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: integer): boolean;
-var
- Cell: TGridCoord;
begin
- if (Y > THackRxDBGrid(RxDBGrid).GCache.ClientHeight - (RxDBGrid.DefaultRowHeight * RxDBGrid.FooterOptions.RowCount)) then
- begin
- Result:=true;
- Cell := RxDBGrid.MouseCoord(X, Y);
- if (ssDouble in Shift) then
- DoSetupTools;
- end
- else
- Result:=false;
+ Result:=(Y > THackRxDBGrid(RxDBGrid).GCache.ClientHeight - (RxDBGrid.DefaultRowHeight * RxDBGrid.FooterOptions.RowCount));
+ if Result and (ssDouble in Shift) then
+ DoSetupTools;
end;
constructor TRxDBGridFooterTools.Create(AOwner: TComponent);
diff --git a/components/rx/trunk/rxnew.lpk b/components/rx/trunk/rxnew.lpk
index 509d86e0c..b3b6c2c67 100644
--- a/components/rx/trunk/rxnew.lpk
+++ b/components/rx/trunk/rxnew.lpk
@@ -24,7 +24,7 @@ Copyright (c) 1998 Master-Bank
translate to Lazarus by alexs in 2005 - 2016
"/>
-
+
diff --git a/components/rx/trunk/rxsortby.lfm b/components/rx/trunk/rxsortby.lfm
index b670be3b7..546af2060 100644
--- a/components/rx/trunk/rxsortby.lfm
+++ b/components/rx/trunk/rxsortby.lfm
@@ -9,15 +9,15 @@ object rxSortByForm: TrxSortByForm
ClientWidth = 684
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '1.1'
+ LCLVersion = '1.7'
object Label1: TLabel
AnchorSideLeft.Control = AddBtn
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
- Left = 417
- Height = 15
+ Left = 421
+ Height = 20
Top = 6
- Width = 105
+ Width = 113
BorderSpacing.Around = 6
Caption = '&Fields for sorting:'
FocusControl = ListBox1
@@ -27,9 +27,9 @@ object rxSortByForm: TrxSortByForm
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
- Height = 15
+ Height = 20
Top = 6
- Width = 55
+ Width = 60
BorderSpacing.Around = 6
Caption = '&All fields:'
FocusControl = ListBox2
@@ -42,14 +42,14 @@ object rxSortByForm: TrxSortByForm
AnchorSideRight.Control = AddBtn
AnchorSideBottom.Control = CheckBox1
Left = 6
- Height = 289
- Top = 27
- Width = 262
+ Height = 282
+ Top = 32
+ Width = 258
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
OnDblClick = ListBox2DblClick
- ScrollWidth = 260
+ ScrollWidth = 256
TabOrder = 0
TopIndex = -1
end
@@ -59,10 +59,10 @@ object rxSortByForm: TrxSortByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = AddBtn
AnchorSideRight.Side = asrBottom
- Left = 274
+ Left = 270
Height = 35
- Top = 68
- Width = 137
+ Top = 73
+ Width = 145
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 6
@@ -91,10 +91,10 @@ object rxSortByForm: TrxSortByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = AddBtn
AnchorSideRight.Side = asrBottom
- Left = 274
+ Left = 270
Height = 36
- Top = 109
- Width = 137
+ Top = 114
+ Width = 145
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 6
@@ -123,10 +123,10 @@ object rxSortByForm: TrxSortByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = AddBtn
AnchorSideRight.Side = asrBottom
- Left = 274
+ Left = 270
Height = 36
- Top = 151
- Width = 137
+ Top = 156
+ Width = 145
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 6
@@ -157,16 +157,16 @@ object rxSortByForm: TrxSortByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = CheckBox1
- Left = 417
- Height = 289
- Top = 27
- Width = 261
+ Left = 421
+ Height = 282
+ Top = 32
+ Width = 257
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
OnDblClick = SpeedButton1Click
OnDrawItem = ListBox1DrawItem
- ScrollWidth = 259
+ ScrollWidth = 255
Style = lbOwnerDrawFixed
TabOrder = 5
TopIndex = -1
@@ -175,10 +175,10 @@ object rxSortByForm: TrxSortByForm
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ListBox1
- Left = 274
+ Left = 270
Height = 35
- Top = 27
- Width = 137
+ Top = 32
+ Width = 145
AutoSize = True
Caption = '&Add field to sort'
Glyph.Data = {
@@ -221,9 +221,9 @@ object rxSortByForm: TrxSortByForm
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = ButtonPanel1
Left = 6
- Height = 22
- Top = 322
- Width = 151
+ Height = 24
+ Top = 320
+ Width = 158
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'Case insensitive sort'
diff --git a/components/rx/trunk/rxsortby.pas b/components/rx/trunk/rxsortby.pas
index 46f3846c2..72305f313 100644
--- a/components/rx/trunk/rxsortby.pas
+++ b/components/rx/trunk/rxsortby.pas
@@ -128,13 +128,13 @@ procedure TrxSortByForm.ListBox1DrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
var
X, Y:integer;
- P:TRxColumn;
+ //P:TRxColumn;
S1, S2:string;
Cnv:TCanvas;
begin
Cnv:=ListBox1.Canvas;
Cnv.FillRect(ARect); { clear the rectangle }
- P:=TRxColumn(ListBox1.Items.Objects[Index]);
+ //P:=TRxColumn(ListBox1.Items.Objects[Index]);
S1:=ListBox1.Items[Index];
S2:=Copy(S1, 1, 1);
Delete(S1, 1, 1);
@@ -222,7 +222,7 @@ end;
function TrxSortByForm.Execute(ADBGrid: TRxDBGrid; SortNames: TStringList
): Boolean;
var
- i, j : Integer;
+ i : Integer;
S : String;
C:TRxColumn;
begin