diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.ico b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.ico
new file mode 100644
index 000000000..0341321b5
Binary files /dev/null and b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.ico differ
diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lpi b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lpi
new file mode 100644
index 000000000..6f1045e16
--- /dev/null
+++ b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lpi
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lpr b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lpr
new file mode 100644
index 000000000..836bf6561
--- /dev/null
+++ b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lpr
@@ -0,0 +1,21 @@
+program project1;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Interfaces, // this includes the LCL widgetset
+ Forms, zcomponent, Unit1, rxnew
+ { you can add units after this };
+
+{$R *.res}
+
+begin
+ RequireDerivedFormResource:=True;
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
+
diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lps b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lps
new file mode 100644
index 000000000..2aed37d5f
--- /dev/null
+++ b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.lps
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.res b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.res
new file mode 100644
index 000000000..877868cb4
Binary files /dev/null and b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/project1.res differ
diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/unit1.lfm b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/unit1.lfm
new file mode 100644
index 000000000..b6841843c
--- /dev/null
+++ b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/unit1.lfm
@@ -0,0 +1,204 @@
+object Form1: TForm1
+ Left = 684
+ Height = 486
+ Top = 345
+ Width = 741
+ Caption = 'Form1'
+ ClientHeight = 486
+ ClientWidth = 741
+ OnCreate = FormCreate
+ LCLVersion = '1.9.0.0'
+ object RxDBGrid1: TRxDBGrid
+ Left = 0
+ Height = 486
+ Top = 0
+ Width = 741
+ ColumnDefValues.BlobText = '(данные)'
+ TitleButtons = False
+ AutoSort = True
+ Columns = <
+ item
+ Title.Alignment = taCenter
+ Title.Orientation = toHorizontal
+ Title.Caption = 'DEPT_NO'
+ Width = 70
+ FieldName = 'DEPT_NO'
+ EditButtons = <>
+ Filter.DropDownRows = 0
+ Filter.EmptyValue = '(Пусто)'
+ Filter.AllValue = '(Все значения)'
+ Filter.EmptyFont.Style = [fsItalic]
+ Filter.ItemIndex = -1
+ Footers = <>
+ end
+ item
+ Title.Alignment = taCenter
+ Title.Orientation = toHorizontal
+ Title.Caption = 'DEPARTMENT'
+ Width = 250
+ FieldName = 'DEPARTMENT'
+ EditButtons = <>
+ Filter.DropDownRows = 0
+ Filter.EmptyValue = '(Пусто)'
+ Filter.AllValue = '(Все значения)'
+ Filter.EmptyFont.Style = [fsItalic]
+ Filter.ItemIndex = -1
+ Footers = <>
+ end
+ item
+ Title.Alignment = taCenter
+ Title.Orientation = toHorizontal
+ Title.Caption = 'LOCATION'
+ Width = 250
+ FieldName = 'LOCATION'
+ EditButtons = <>
+ Filter.DropDownRows = 0
+ Filter.EmptyValue = '(Пусто)'
+ Filter.AllValue = '(Все значения)'
+ Filter.EmptyFont.Style = [fsItalic]
+ Filter.ItemIndex = -1
+ Filter.Style = rxfstDialog
+ Footers = <>
+ end>
+ KeyStrokes = <
+ item
+ Command = rxgcShowFindDlg
+ ShortCut = 16454
+ Enabled = True
+ end
+ item
+ Command = rxgcShowColumnsDlg
+ ShortCut = 16471
+ Enabled = True
+ end
+ item
+ Command = rxgcShowFilterDlg
+ ShortCut = 16468
+ Enabled = True
+ end
+ item
+ Command = rxgcShowSortDlg
+ ShortCut = 16467
+ Enabled = True
+ end
+ item
+ Command = rxgcShowQuickFilter
+ ShortCut = 16465
+ Enabled = True
+ end
+ item
+ Command = rxgcHideQuickFilter
+ ShortCut = 16456
+ Enabled = True
+ end
+ item
+ Command = rxgcSelectAll
+ ShortCut = 16449
+ Enabled = True
+ end
+ item
+ Command = rxgcDeSelectAll
+ ShortCut = 16429
+ Enabled = True
+ end
+ item
+ Command = rxgcInvertSelection
+ ShortCut = 16426
+ Enabled = True
+ end
+ item
+ Command = rxgcOptimizeColumnsWidth
+ ShortCut = 16427
+ Enabled = True
+ end
+ item
+ Command = rxgcCopyCellValue
+ ShortCut = 16451
+ Enabled = True
+ end>
+ FooterOptions.DrawFullLine = False
+ SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey]
+ SearchOptions.FromStart = False
+ OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgDblClickOptimizeColWidth, rdgFilter, rdgAllowQuickSearch, rdgAllowQuickFilter, rdgAllowFilterForm, rdgAllowSortForm, rdgAllowToolMenu]
+ Align = alClient
+ Color = clWindow
+ DrawFullLine = False
+ FocusColor = clRed
+ SelectedColor = clHighlight
+ GridLineStyle = psSolid
+ DataSource = DataSource1
+ Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
+ ParentColor = False
+ ReadOnly = True
+ TabOrder = 0
+ end
+ object ZConnection1: TZConnection
+ ControlsCodePage = cCP_UTF8
+ TransactIsolationLevel = tiReadCommitted
+ Connected = True
+ HostName = '127.0.0.1'
+ Port = 0
+ Database = 'employee'
+ User = 'sysdba'
+ Password = 'masterkey'
+ Protocol = 'firebirdd-2.5'
+ Left = 40
+ Top = 24
+ end
+ object ZReadOnlyQuery1: TZReadOnlyQuery
+ Connection = ZConnection1
+ OnFilterRecord = ZReadOnlyQuery1FilterRecord
+ SQL.Strings = (
+ 'select'
+ ' DEPARTMENT.DEPT_NO,'
+ ' DEPARTMENT.DEPARTMENT,'
+ ' DEPARTMENT.LOCATION'
+ 'from'
+ ' DEPARTMENT'
+ 'order by'
+ ' DEPARTMENT.DEPT_NO'
+ )
+ Params = <>
+ Left = 248
+ Top = 168
+ object ZReadOnlyQuery1DEPT_NO: TStringField
+ FieldKind = fkData
+ FieldName = 'DEPT_NO'
+ Index = 0
+ LookupCache = False
+ ProviderFlags = [pfInUpdate, pfInWhere]
+ ReadOnly = False
+ Required = True
+ Size = 12
+ end
+ object ZReadOnlyQuery1DEPARTMENT: TStringField
+ FieldKind = fkData
+ FieldName = 'DEPARTMENT'
+ Index = 1
+ LookupCache = False
+ ProviderFlags = [pfInUpdate, pfInWhere]
+ ReadOnly = False
+ Required = True
+ Size = 100
+ end
+ object ZReadOnlyQuery1LOCATION: TStringField
+ FieldKind = fkData
+ FieldName = 'LOCATION'
+ Index = 2
+ LookupCache = False
+ ProviderFlags = [pfInUpdate, pfInWhere]
+ ReadOnly = False
+ Required = False
+ Size = 60
+ end
+ end
+ object DataSource1: TDataSource
+ DataSet = ZReadOnlyQuery1
+ Left = 216
+ Top = 168
+ end
+ object RxSortZeos1: TRxSortZeos
+ Left = 95
+ Top = 24
+ end
+end
diff --git a/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/unit1.pas b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/unit1.pas
new file mode 100644
index 000000000..72cb6432c
--- /dev/null
+++ b/components/rx/trunk/Demos/RxDBGrid_Filter/ZEOS/unit1.pas
@@ -0,0 +1,55 @@
+unit Unit1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes, SysUtils, FileUtil, rxdbgrid, RxSortZeos, ZConnection, ZDataset,
+ Forms, Controls, Graphics, Dialogs, db;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ DataSource1: TDataSource;
+ RxDBGrid1: TRxDBGrid;
+ RxSortZeos1: TRxSortZeos;
+ ZConnection1: TZConnection;
+ ZReadOnlyQuery1: TZReadOnlyQuery;
+ ZReadOnlyQuery1DEPARTMENT: TStringField;
+ ZReadOnlyQuery1DEPT_NO: TStringField;
+ ZReadOnlyQuery1LOCATION: TStringField;
+ procedure FormCreate(Sender: TObject);
+ procedure ZReadOnlyQuery1FilterRecord(DataSet: TDataSet; var Accept: Boolean
+ );
+ private
+
+ public
+
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+ ZConnection1.Connected:=true;
+ ZReadOnlyQuery1.Open;
+end;
+
+procedure TForm1.ZReadOnlyQuery1FilterRecord(DataSet: TDataSet;
+ var Accept: Boolean);
+begin
+ //
+end;
+
+end.
+
diff --git a/components/rx/trunk/rxdb/rxdbgrid.pas b/components/rx/trunk/rxdb/rxdbgrid.pas
index 5719ec8b9..d65b5ceed 100644
--- a/components/rx/trunk/rxdb/rxdbgrid.pas
+++ b/components/rx/trunk/rxdb/rxdbgrid.pas
@@ -2395,25 +2395,12 @@ 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,
DT_RIGHT or {DT_EXPANDTABS or }DT_NOPREFIX,
DT_CENTER or {DT_EXPANDTABS or }DT_NOPREFIX);
-{ TITLE_SUBHEADER = 2;
- TITLE_DEFAULT = 1;
-
-const
- EdgeFlag: array[Boolean] of UINT = (BDR_RAISEDINNER, BDR_SUNKENINNER);}
-
procedure WriteTextHeader(ACanvas: TCanvas; ARect: TRect; const Text: string;
Alignment: TAlignment);
var
@@ -2555,8 +2542,6 @@ begin
FSortEngine := RxDBGridSortEngineList.Objects[Pos] as TRxDBGridSortEngine
else
FSortEngine := nil;
-{ FSortField := nil;
- FSortOrder := smNone;}
FSortColumns.Clear;
end;
end;
@@ -2568,7 +2553,6 @@ end;
function TRxDBGrid.GetColumns: TRxDbGridColumns;
begin
- //Result := TRxDbGridColumns(TCustomDrawGrid(Self).Columns);
Result := TRxDbGridColumns(inherited Columns);
end;
@@ -2654,7 +2638,6 @@ end;
procedure TRxDBGrid.SetColumns(const AValue: TRxDbGridColumns);
begin
- //TRxDbGridColumns(TCustomDrawGrid(Self).Columns).Assign(Avalue);
inherited Columns := TDBGridColumns(AValue);
end;
@@ -3534,20 +3517,6 @@ begin
FToolsList.Remove(ATools);
end;
-{
-procedure TRxDBGrid.UpdateHorzScrollBar(const aVisible: boolean; const aRange,
- aPage, aPos: Integer);
-begin
- inherited UpdateHorzScrollBar(aVisible, aRange, aPage, aPos);
-end;
-
-procedure TRxDBGrid.UpdateVertScrollbar(const aVisible: boolean; const aRange,
- aPage, aPos: Integer);
-begin
- inherited UpdateVertScrollbar(aVisible, aRange, aPage, aPos);
-end;
-}
-
procedure TRxDBGrid.DefaultDrawCellA(aCol, aRow: integer; aRect: TRect;
aState: TGridDrawState);
begin
@@ -3792,15 +3761,12 @@ begin
MyCol := Columns.RealIndex(aCol - 1);
with TRxColumn(Columns[MyCol]).Filter do
begin
-// Canvas.Brush.Color := Color;
-// Canvas.FillRect(aRect);
if (TitleStyle <> tsNative) then
begin
Canvas.Brush.Color := Color;
Canvas.FillRect(aRect);
end;
- //if Value <> '' then
if CurrentValues.Count > 0 then
begin
S:=CurrentValues[0];
@@ -3825,20 +3791,12 @@ begin
S:='';
Canvas.Font := TRxColumn(Columns[MyCol]).Filter.EmptyFont;
- //if (aRect.Right - aRect.Left) >= Canvas.TextWidth(Value) then
if (aRect.Right - aRect.Left) >= Canvas.TextWidth(S) then
TxS.Alignment := Alignment
else
TxS.Alignment := taLeftJustify;
Canvas.TextStyle := TxS;
-{
- if IsNull then
- DrawCellText(aCol, aRow, aRect, aState, TRxColumn(Columns[MyCol]).Filter.EmptyValue)
- else
- if IsAll then
- DrawCellText(aCol, aRow, aRect, aState, TRxColumn(Columns[MyCol]).Filter.AllValue)
-}
DrawCellText(aCol, aRow, aRect, aState, S)
end;
end;
@@ -5303,11 +5261,9 @@ begin
begin
with TRxColumn(Columns[i]) do
begin
- //if Filter.IsAll then
if Filter.State = rxfsAll then
Accept:=true
else
- //if Filter.IsNull then
if Filter.State = rxfsEmpty then
begin
Accept:=Field.IsNull;
@@ -5340,16 +5296,6 @@ begin
break;
end;
end
-{ else
- if (Filter.Value <> '') then
- begin
- if (Filter.Value <> Field.DisplayText) then
- begin
- Accept := False;
- break;
- end;
- end;}
-
end;
end;
if Assigned(F_EventOnFilterRec) then
diff --git a/components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.pas b/components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.pas
index 073a361d6..1a073c91d 100644
--- a/components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.pas
+++ b/components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.pas
@@ -248,6 +248,8 @@ var
begin
if ModalResult = mrOk then
begin
+ FRxDBGrid.DataSource.DataSet.DisableControls;
+ FRxDBGrid.DataSource.DataSet.Filtered := false;
if CheckBox1.Checked then
begin
FRxColumn.Filter.State:=rxfsAll;
@@ -274,6 +276,7 @@ begin
end;
FRxDBGrid.DataSource.DataSet.Filtered := True;
FRxDBGrid.DataSource.DataSet.First;
+ FRxDBGrid.DataSource.DataSet.EnableControls;
end;
end;