You've already forked lazarus-ccr
RxFPC:RxDBGrid - new style for filter - rxfstBoth
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6101 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="10"/>
|
<Version Value="11"/>
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
<LRSInOutputDirectory Value="False"/>
|
<LRSInOutputDirectory Value="False"/>
|
||||||
@ -31,10 +31,14 @@
|
|||||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<FormatVersion Value="2"/>
|
||||||
<FormatVersion Value="1"/>
|
<Modes Count="1">
|
||||||
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
<Mode0 Name="default">
|
||||||
</local>
|
<local>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</Mode0>
|
||||||
|
</Modes>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="5">
|
<RequiredPackages Count="5">
|
||||||
<Item1>
|
<Item1>
|
||||||
@ -55,13 +59,13 @@
|
|||||||
<MinVersion Major="1" Release="18" Build="56" Valid="True"/>
|
<MinVersion Major="1" Release="18" Build="56" Valid="True"/>
|
||||||
</Item5>
|
</Item5>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="65">
|
<Units Count="67">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="RxDBGridDemo.lpr"/>
|
<Filename Value="RxDBGridDemo.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<CursorPos Y="17"/>
|
<CursorPos Y="17"/>
|
||||||
<UsageCount Value="127"/>
|
<UsageCount Value="129"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="rxdbgridmainunit.pas"/>
|
<Filename Value="rxdbgridmainunit.pas"/>
|
||||||
@ -70,10 +74,9 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="RxDBGridMainUnit"/>
|
<UnitName Value="RxDBGridMainUnit"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<TopLine Value="152"/>
|
||||||
<TopLine Value="126"/>
|
<CursorPos X="138" Y="188"/>
|
||||||
<CursorPos X="51" Y="152"/>
|
<UsageCount Value="129"/>
|
||||||
<UsageCount Value="127"/>
|
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
@ -474,10 +477,16 @@
|
|||||||
</Unit56>
|
</Unit56>
|
||||||
<Unit57>
|
<Unit57>
|
||||||
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<TopLine Value="404"/>
|
<EditorIndex Value="1"/>
|
||||||
<CursorPos X="14" Y="422"/>
|
<TopLine Value="5975"/>
|
||||||
<UsageCount Value="11"/>
|
<CursorPos X="98" Y="6004"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Bookmarks Count="2">
|
||||||
|
<Item0 X="3" Y="7314" ID="1"/>
|
||||||
|
<Item1 X="17" Y="4353" ID="2"/>
|
||||||
|
</Bookmarks>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit57>
|
</Unit57>
|
||||||
<Unit58>
|
<Unit58>
|
||||||
<Filename Value="../../../rxdb/rxmemds.pas"/>
|
<Filename Value="../../../rxdb/rxmemds.pas"/>
|
||||||
@ -506,10 +515,11 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="RxDBGrid_PopUpFilterUnit"/>
|
<UnitName Value="RxDBGrid_PopUpFilterUnit"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="2"/>
|
||||||
<TopLine Value="154"/>
|
<TopLine Value="142"/>
|
||||||
<CursorPos X="14" Y="180"/>
|
<CursorPos X="3" Y="161"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit61>
|
</Unit61>
|
||||||
<Unit62>
|
<Unit62>
|
||||||
<Filename Value="../../../rxtools/rxfileutils.pas"/>
|
<Filename Value="../../../rxtools/rxfileutils.pas"/>
|
||||||
@ -534,16 +544,143 @@
|
|||||||
<CursorPos X="26" Y="119"/>
|
<CursorPos X="26" Y="119"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit64>
|
</Unit64>
|
||||||
|
<Unit65>
|
||||||
|
<Filename Value="/home/install/source/fpcsrc/rtl/inc/typshrdh.inc"/>
|
||||||
|
<EditorIndex Value="3"/>
|
||||||
|
<TopLine Value="126"/>
|
||||||
|
<CursorPos X="17" Y="154"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit65>
|
||||||
|
<Unit66>
|
||||||
|
<Filename Value="/home/install/source/fpcsrc/rtl/objpas/classes/classesh.inc"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="706"/>
|
||||||
|
<CursorPos X="14" Y="723"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit66>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="2" HistoryIndex="1">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="rxdbgridmainunit.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="117" TopLine="86"/>
|
<Caret Line="5975" TopLine="5967"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="rxdbgridmainunit.pas"/>
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Caret Line="117" Column="70" TopLine="86"/>
|
<Caret Line="5977" TopLine="5967"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
|
<Position3>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5979" TopLine="5967"/>
|
||||||
|
</Position3>
|
||||||
|
<Position4>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5980" TopLine="5967"/>
|
||||||
|
</Position4>
|
||||||
|
<Position5>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5975" TopLine="5967"/>
|
||||||
|
</Position5>
|
||||||
|
<Position6>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5977" TopLine="5967"/>
|
||||||
|
</Position6>
|
||||||
|
<Position7>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5979" TopLine="5967"/>
|
||||||
|
</Position7>
|
||||||
|
<Position8>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5980" TopLine="5967"/>
|
||||||
|
</Position8>
|
||||||
|
<Position9>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5975" TopLine="5967"/>
|
||||||
|
</Position9>
|
||||||
|
<Position10>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5977" TopLine="5967"/>
|
||||||
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5979" TopLine="5967"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5982" TopLine="5967"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5989" TopLine="5967"/>
|
||||||
|
</Position13>
|
||||||
|
<Position14>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6007" TopLine="5989"/>
|
||||||
|
</Position14>
|
||||||
|
<Position15>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6025" TopLine="5992"/>
|
||||||
|
</Position15>
|
||||||
|
<Position16>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6018" TopLine="5992"/>
|
||||||
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6013" Column="57" TopLine="5992"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5974" TopLine="5994"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6010" Column="15" TopLine="5995"/>
|
||||||
|
</Position19>
|
||||||
|
<Position20>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6018" Column="16" TopLine="5995"/>
|
||||||
|
</Position20>
|
||||||
|
<Position21>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6012" Column="11" TopLine="5994"/>
|
||||||
|
</Position21>
|
||||||
|
<Position22>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6028" Column="80" TopLine="5991"/>
|
||||||
|
</Position22>
|
||||||
|
<Position23>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6019" TopLine="5992"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5977" TopLine="5974"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5979" TopLine="5972"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5980" TopLine="5972"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5981" TopLine="5972"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="6010" TopLine="5977"/>
|
||||||
|
</Position28>
|
||||||
|
<Position29>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5988" Column="27" TopLine="5967"/>
|
||||||
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
|
<Caret Line="5989" TopLine="5972"/>
|
||||||
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
@ -575,7 +712,7 @@
|
|||||||
<WatchScope Value="wpsLocal"/>
|
<WatchScope Value="wpsLocal"/>
|
||||||
<WatchKind Value="wpkWrite"/>
|
<WatchKind Value="wpkWrite"/>
|
||||||
<Source Value="../../../rxdb/rxdbgrid.pas"/>
|
<Source Value="../../../rxdb/rxdbgrid.pas"/>
|
||||||
<Line Value="6068"/>
|
<Line Value="6094"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
</BreakPoints>
|
</BreakPoints>
|
||||||
<Exceptions Count="2">
|
<Exceptions Count="2">
|
||||||
|
@ -36,6 +36,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.Font.Style = [fsItalic]
|
Filter.Font.Style = [fsItalic]
|
||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.EmptyValue = '(Нет)'
|
Filter.EmptyValue = '(Нет)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(All values)'
|
Filter.AllValue = '(All values)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
@ -61,6 +62,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.Color = clLime
|
Filter.Color = clLime
|
||||||
Filter.EmptyValue = '(Нет)'
|
Filter.EmptyValue = '(Нет)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(All values)'
|
Filter.AllValue = '(All values)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
@ -83,10 +85,11 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.Color = clLime
|
Filter.Color = clLime
|
||||||
Filter.EmptyValue = '(Пустые значения)'
|
Filter.EmptyValue = '(Пустые значения)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(Все значения)'
|
Filter.AllValue = '(Все значения)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
Filter.Style = rxfstDialog
|
Filter.Style = rxfstBoth
|
||||||
Footer.Value = 'This is test'
|
Footer.Value = 'This is test'
|
||||||
Footer.ValueType = fvtStaticText
|
Footer.ValueType = fvtStaticText
|
||||||
Footer.Font.Color = clRed
|
Footer.Font.Color = clRed
|
||||||
@ -110,6 +113,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.Color = clLime
|
Filter.Color = clLime
|
||||||
Filter.EmptyValue = '(Нет)'
|
Filter.EmptyValue = '(Нет)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(All values)'
|
Filter.AllValue = '(All values)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
@ -144,6 +148,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.Color = clLime
|
Filter.Color = clLime
|
||||||
Filter.EmptyValue = '(Нет)'
|
Filter.EmptyValue = '(Нет)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(All values)'
|
Filter.AllValue = '(All values)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
@ -177,6 +182,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.Font.Style = [fsItalic]
|
Filter.Font.Style = [fsItalic]
|
||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.EmptyValue = '(Нет)'
|
Filter.EmptyValue = '(Нет)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(All values)'
|
Filter.AllValue = '(All values)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
@ -194,6 +200,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.Font.Style = [fsItalic]
|
Filter.Font.Style = [fsItalic]
|
||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.EmptyValue = '(Нет)'
|
Filter.EmptyValue = '(Нет)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(All values)'
|
Filter.AllValue = '(All values)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
@ -355,6 +362,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
|||||||
Filter.Font.Style = [fsItalic]
|
Filter.Font.Style = [fsItalic]
|
||||||
Filter.DropDownRows = 0
|
Filter.DropDownRows = 0
|
||||||
Filter.EmptyValue = '(Нет)'
|
Filter.EmptyValue = '(Нет)'
|
||||||
|
Filter.NotEmptyValue = '(Не пусто)'
|
||||||
Filter.AllValue = '(All values)'
|
Filter.AllValue = '(All values)'
|
||||||
Filter.EmptyFont.Style = [fsItalic]
|
Filter.EmptyFont.Style = [fsItalic]
|
||||||
Filter.ItemIndex = -1
|
Filter.ItemIndex = -1
|
||||||
|
@ -384,13 +384,14 @@ type
|
|||||||
{ TRxColumnFilter }
|
{ TRxColumnFilter }
|
||||||
|
|
||||||
TRxFilterState = (rxfsAll, rxfsEmpty, rxfsNonEmpty, rxfsFilter{, rxfsTopXXXX});
|
TRxFilterState = (rxfsAll, rxfsEmpty, rxfsNonEmpty, rxfsFilter{, rxfsTopXXXX});
|
||||||
TRxFilterStyle = (rxfstSimple, rxfstDialog, rxfstManualEdit);
|
TRxFilterStyle = (rxfstSimple, rxfstDialog, rxfstManualEdit, rxfstBoth);
|
||||||
|
|
||||||
TRxColumnFilter = class(TPersistent)
|
TRxColumnFilter = class(TPersistent)
|
||||||
private
|
private
|
||||||
FAllValue: string;
|
FAllValue: string;
|
||||||
FCurrentValues: TStringList;
|
FCurrentValues: TStringList;
|
||||||
FEnabled: boolean;
|
FEnabled: boolean;
|
||||||
|
FManulEditValue: string;
|
||||||
FNotEmptyValue: string;
|
FNotEmptyValue: string;
|
||||||
FOwner: TRxColumn;
|
FOwner: TRxColumn;
|
||||||
FState: TRxFilterState;
|
FState: TRxFilterState;
|
||||||
@ -402,6 +403,7 @@ type
|
|||||||
FAlignment: TAlignment;
|
FAlignment: TAlignment;
|
||||||
FDropDownRows: integer;
|
FDropDownRows: integer;
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
|
function GetDisplayFilterValue: string;
|
||||||
function GetItemIndex: integer;
|
function GetItemIndex: integer;
|
||||||
procedure SetColor(const AValue: TColor);
|
procedure SetColor(const AValue: TColor);
|
||||||
procedure SetFont(const AValue: TFont);
|
procedure SetFont(const AValue: TFont);
|
||||||
@ -409,8 +411,12 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(Owner: TRxColumn); virtual;
|
constructor Create(Owner: TRxColumn); virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure ClearFilter;
|
||||||
|
|
||||||
property State:TRxFilterState read FState write FState;
|
property State:TRxFilterState read FState write FState;
|
||||||
property CurrentValues : TStringList read FCurrentValues;
|
property CurrentValues : TStringList read FCurrentValues;
|
||||||
|
property ManulEditValue : string read FManulEditValue write FManulEditValue;
|
||||||
|
property DisplayFilterValue:string read GetDisplayFilterValue;
|
||||||
published
|
published
|
||||||
property Font: TFont read FFont write SetFont;
|
property Font: TFont read FFont write SetFont;
|
||||||
property Alignment: TAlignment read FAlignment write FAlignment default
|
property Alignment: TAlignment read FAlignment write FAlignment default
|
||||||
@ -3446,19 +3452,14 @@ begin
|
|||||||
|
|
||||||
if rdgFilter in OptionsRx then
|
if rdgFilter in OptionsRx then
|
||||||
begin
|
begin
|
||||||
if Assigned(FFilterListEditor) then
|
H:=FDefRowH;
|
||||||
begin
|
if Assigned(FFilterListEditor) then
|
||||||
RowHeights[0] := RowHeights[0] + FFilterListEditor.Height
|
H:=Max(H, FFilterListEditor.Height);
|
||||||
end
|
|
||||||
else
|
|
||||||
if Assigned(FFilterSimpleEdit) then
|
if Assigned(FFilterSimpleEdit) then
|
||||||
begin
|
H:=Max(H, FFilterSimpleEdit.Height);
|
||||||
RowHeights[0] := RowHeights[0] + FFilterSimpleEdit.Height
|
|
||||||
end
|
RowHeights[0] := RowHeights[0] + H;
|
||||||
else
|
|
||||||
begin
|
|
||||||
RowHeights[0] := RowHeights[0] + FDefRowH;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
@ -4336,6 +4337,18 @@ begin
|
|||||||
Canvas.FillRect(aRect);
|
Canvas.FillRect(aRect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
S:=DisplayFilterValue;
|
||||||
|
if (aRect.Right - aRect.Left) >= Canvas.TextWidth(S) then
|
||||||
|
TxS.Alignment := Alignment
|
||||||
|
else
|
||||||
|
TxS.Alignment := taLeftJustify;
|
||||||
|
Canvas.TextStyle := TxS;
|
||||||
|
|
||||||
|
if State in [rxfsEmpty, rxfsNonEmpty] then
|
||||||
|
Canvas.Font := TRxColumn(Columns[MyCol]).Filter.EmptyFont;
|
||||||
|
|
||||||
|
DrawCellText(aCol, aRow, aRect, aState, S);
|
||||||
|
(*
|
||||||
if CurrentValues.Count > 0 then
|
if CurrentValues.Count > 0 then
|
||||||
begin
|
begin
|
||||||
S:=CurrentValues[0];
|
S:=CurrentValues[0];
|
||||||
@ -4351,14 +4364,17 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if (Style in (rxfstManualEdit, rxfstBoth)) and (ManulEditValue<>'') then
|
||||||
|
S:=ManulEditValue
|
||||||
|
else
|
||||||
if State = rxfsEmpty then
|
if State = rxfsEmpty then
|
||||||
S:=TRxColumn(Columns[MyCol]).Filter.EmptyValue
|
S:=Filter.EmptyValue
|
||||||
else
|
else
|
||||||
if State = rxfsNonEmpty then
|
if State = rxfsNonEmpty then
|
||||||
S:=TRxColumn(Columns[MyCol]).Filter.NotEmptyValue
|
S:=Filter.NotEmptyValue
|
||||||
else
|
else
|
||||||
if State = rxfsAll then
|
if State = rxfsAll then
|
||||||
S:=TRxColumn(Columns[MyCol]).Filter.AllValue
|
S:=Filter.AllValue
|
||||||
else
|
else
|
||||||
S:='';
|
S:='';
|
||||||
|
|
||||||
@ -4370,7 +4386,7 @@ begin
|
|||||||
|
|
||||||
Canvas.TextStyle := TxS;
|
Canvas.TextStyle := TxS;
|
||||||
DrawCellText(aCol, aRow, aRect, aState, S)
|
DrawCellText(aCol, aRow, aRect, aState, S)
|
||||||
end;
|
end; *)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Canvas.Font := ft;
|
// Canvas.Font := ft;
|
||||||
@ -4965,12 +4981,13 @@ begin
|
|||||||
FFilterSimpleEdit.Height := Rect.Bottom - Rect.Top;
|
FFilterSimpleEdit.Height := Rect.Bottom - Rect.Top;
|
||||||
FFilterSimpleEdit.BoundsRect := Rect;
|
FFilterSimpleEdit.BoundsRect := Rect;
|
||||||
FFilterSimpleEdit.Show(Self, Cell.x - 1);
|
FFilterSimpleEdit.Show(Self, Cell.x - 1);
|
||||||
if C.Filter.CurrentValues.Count>0 then
|
{ if C.Filter.CurrentValues.Count>0 then
|
||||||
FFilterSimpleEdit.Text := C.Filter.CurrentValues[0]
|
FFilterSimpleEdit.Text := C.Filter.CurrentValues[C.Filter.CurrentValues.Count - 1]
|
||||||
else
|
else}
|
||||||
FFilterSimpleEdit.Text := '';
|
FFilterSimpleEdit.Text := C.Filter.ManulEditValue;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
if C.Filter.Style = rxfstDialog then
|
||||||
begin
|
begin
|
||||||
if FFilterListEditor.Visible then
|
if FFilterListEditor.Visible then
|
||||||
FFilterListEditor.Hide;
|
FFilterListEditor.Hide;
|
||||||
@ -4985,6 +5002,30 @@ begin
|
|||||||
FFilterColDlgButton.Left := Rect.Right - FFilterColDlgButton.Width;
|
FFilterColDlgButton.Left := Rect.Right - FFilterColDlgButton.Width;
|
||||||
FFilterColDlgButton.Show(Self, Cell.x - 1);
|
FFilterColDlgButton.Show(Self, Cell.x - 1);
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if C.Filter.Style = rxfstBoth then
|
||||||
|
begin
|
||||||
|
if FFilterListEditor.Visible then
|
||||||
|
FFilterListEditor.Hide;
|
||||||
|
|
||||||
|
FFilterColDlgButton.Parent:=Self;
|
||||||
|
FFilterColDlgButton.Width := 32;
|
||||||
|
FFilterColDlgButton.Height := Rect.Bottom - Rect.Top;
|
||||||
|
FFilterColDlgButton.Top := Rect.Top;
|
||||||
|
FFilterColDlgButton.Left := Rect.Right - FFilterColDlgButton.Width;
|
||||||
|
FFilterColDlgButton.Show(Self, Cell.x - 1);
|
||||||
|
|
||||||
|
FFilterSimpleEdit.Parent := Self;
|
||||||
|
FFilterSimpleEdit.Width := Rect.Right - Rect.Left - FFilterColDlgButton.Width;
|
||||||
|
FFilterSimpleEdit.Height := Rect.Bottom - Rect.Top;
|
||||||
|
Rect.Width:=Rect.Width - FFilterColDlgButton.Width;
|
||||||
|
FFilterSimpleEdit.BoundsRect := Rect;
|
||||||
|
FFilterSimpleEdit.Show(Self, Cell.x - 1);
|
||||||
|
{ if C.Filter.CurrentValues.Count>0 then
|
||||||
|
FFilterSimpleEdit.Text := C.Filter.CurrentValues[0]
|
||||||
|
else}
|
||||||
|
FFilterSimpleEdit.Text := C.Filter.ManulEditValue;
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -5425,18 +5466,19 @@ begin
|
|||||||
begin
|
begin
|
||||||
if (FFilterListEditor.Text = EmptyValue) then
|
if (FFilterListEditor.Text = EmptyValue) then
|
||||||
begin
|
begin
|
||||||
CurrentValues.Clear;
|
ClearFilter;
|
||||||
State:=rxfsEmpty;
|
{ CurrentValues.Clear;
|
||||||
|
State:=rxfsEmpty;}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (FFilterListEditor.Text = AllValue) then
|
if (FFilterListEditor.Text = AllValue) then
|
||||||
begin
|
begin
|
||||||
CurrentValues.Clear;
|
ClearFilter;
|
||||||
State:=rxfsAll;
|
State:=rxfsAll;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
CurrentValues.Clear;
|
ClearFilter;
|
||||||
CurrentValues.Add(FFilterListEditor.Text);
|
CurrentValues.Add(FFilterListEditor.Text);
|
||||||
State:=rxfsFilter;
|
State:=rxfsFilter;
|
||||||
end;
|
end;
|
||||||
@ -5493,16 +5535,14 @@ procedure TRxDBGrid.FFilterSimpleEditOnChange(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
with TRxColumn(Columns[Columns.RealIndex(FFilterSimpleEdit.Col)]).Filter do
|
with TRxColumn(Columns[Columns.RealIndex(FFilterSimpleEdit.Col)]).Filter do
|
||||||
begin
|
begin
|
||||||
if FFilterSimpleEdit.Text = '' then
|
if (FFilterSimpleEdit.Text = '') and (Style = rxfstManualEdit) then
|
||||||
begin
|
begin
|
||||||
CurrentValues.Clear;
|
CurrentValues.Clear;
|
||||||
State:=rxfsAll;
|
State:=rxfsAll;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
|
||||||
CurrentValues.Text:=FFilterSimpleEdit.Text;
|
|
||||||
State:=rxfsFilter;
|
State:=rxfsFilter;
|
||||||
end;
|
ManulEditValue:=FFilterSimpleEdit.Text;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DataSource.DataSet.DisableControls;
|
DataSource.DataSet.DisableControls;
|
||||||
@ -5930,29 +5970,23 @@ end;
|
|||||||
procedure TRxDBGrid.FilterRec(DataSet: TDataSet; var Accept: boolean);
|
procedure TRxDBGrid.FilterRec(DataSet: TDataSet; var Accept: boolean);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
|
Filter: TRxColumnFilter;
|
||||||
|
F: TField;
|
||||||
begin
|
begin
|
||||||
Accept := True;
|
Accept := True;
|
||||||
for i := 0 to Columns.Count - 1 do
|
for i := 0 to Columns.Count - 1 do
|
||||||
begin
|
begin
|
||||||
with TRxColumn(Columns[i]) do
|
Filter:=TRxColumn(Columns[i]).Filter;
|
||||||
begin
|
F:=TRxColumn(Columns[i]).Field;
|
||||||
if Filter.State = rxfsAll then
|
if Filter.State = rxfsAll then
|
||||||
Accept:=true
|
Accept:=true
|
||||||
else
|
else
|
||||||
if Filter.State = rxfsEmpty then
|
if Filter.State = rxfsEmpty then
|
||||||
begin
|
Accept:=F.IsNull
|
||||||
Accept:=Field.IsNull;
|
else
|
||||||
if not Accept then
|
if Filter.State = rxfsNonEmpty then
|
||||||
Break;
|
Accept:=not F.IsNull
|
||||||
end
|
else
|
||||||
else
|
|
||||||
if Filter.State = rxfsNonEmpty then
|
|
||||||
begin
|
|
||||||
Accept:=not Field.IsNull;
|
|
||||||
if not Accept then
|
|
||||||
Break;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
{ if Filter.State = rxfsTopXXXX then
|
{ if Filter.State = rxfsTopXXXX then
|
||||||
begin
|
begin
|
||||||
if DataSet.State = dsFilter then
|
if DataSet.State = dsFilter then
|
||||||
@ -5963,23 +5997,15 @@ begin
|
|||||||
Break;
|
Break;
|
||||||
end
|
end
|
||||||
else}
|
else}
|
||||||
|
begin
|
||||||
if Filter.CurrentValues.Count > 0 then
|
if Filter.CurrentValues.Count > 0 then
|
||||||
begin
|
Accept := Filter.CurrentValues.IndexOf(F.DisplayText) >= 0;
|
||||||
if Filter.Style = rxfstManualEdit then
|
|
||||||
begin
|
if Accept and (Filter.Style in [rxfstBoth, rxfstManualEdit]) and (Filter.ManulEditValue<>'') then
|
||||||
if UTF8Pos(UTF8UpperCase(Filter.CurrentValues[0]), UTF8UpperCase(Field.DisplayText)) < 1 then
|
Accept := UTF8Pos(UTF8UpperCase(Filter.ManulEditValue), UTF8UpperCase(F.DisplayText)) > 0;
|
||||||
begin
|
|
||||||
Accept := False;
|
if not Accept then
|
||||||
break;
|
Break;
|
||||||
end;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if Filter.CurrentValues.IndexOf(Field.DisplayText) < 0 then
|
|
||||||
begin
|
|
||||||
Accept := False;
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if Assigned(F_EventOnFilterRec) then
|
if Assigned(F_EventOnFilterRec) then
|
||||||
@ -6109,6 +6135,7 @@ begin
|
|||||||
C := TRxColumn(Columns[i]);
|
C := TRxColumn(Columns[i]);
|
||||||
C.Filter.ValueList.Clear;
|
C.Filter.ValueList.Clear;
|
||||||
C.Filter.CurrentValues.Clear;
|
C.Filter.CurrentValues.Clear;
|
||||||
|
C.Filter.ManulEditValue:='';
|
||||||
C.Filter.ItemIndex := -1;
|
C.Filter.ItemIndex := -1;
|
||||||
C.Filter.ValueList.Add(C.Filter.EmptyValue);
|
C.Filter.ValueList.Add(C.Filter.EmptyValue);
|
||||||
C.Filter.ValueList.Add(C.Filter.AllValue);
|
C.Filter.ValueList.Add(C.Filter.AllValue);
|
||||||
@ -7263,6 +7290,29 @@ begin
|
|||||||
Result := -1;
|
Result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TRxColumnFilter.GetDisplayFilterValue: string;
|
||||||
|
begin
|
||||||
|
Result:='';
|
||||||
|
if CurrentValues.Count > 0 then
|
||||||
|
begin
|
||||||
|
Result:=CurrentValues[0];
|
||||||
|
if CurrentValues.Count > 1 then
|
||||||
|
Result:=Result + '(...)';
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (Style in [rxfstManualEdit, rxfstBoth]) and (ManulEditValue<>'') then
|
||||||
|
Result:=ManulEditValue
|
||||||
|
else
|
||||||
|
if State = rxfsEmpty then
|
||||||
|
Result:=EmptyValue
|
||||||
|
else
|
||||||
|
if State = rxfsNonEmpty then
|
||||||
|
Result:=NotEmptyValue
|
||||||
|
else
|
||||||
|
if State = rxfsAll then
|
||||||
|
Result:=AllValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TRxColumnFilter.SetColor(const AValue: TColor);
|
procedure TRxColumnFilter.SetColor(const AValue: TColor);
|
||||||
begin
|
begin
|
||||||
if FColor = AValue then
|
if FColor = AValue then
|
||||||
@ -7320,6 +7370,13 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TRxColumnFilter.ClearFilter;
|
||||||
|
begin
|
||||||
|
CurrentValues.Clear;
|
||||||
|
FManulEditValue:='';
|
||||||
|
FState:=rxfsEmpty;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TExDBGridSortEngine }
|
{ TExDBGridSortEngine }
|
||||||
|
|
||||||
procedure TRxDBGridSortEngine.SortList(ListField: string; ADataSet: TDataSet;
|
procedure TRxDBGridSortEngine.SortList(ListField: string; ADataSet: TDataSet;
|
||||||
|
@ -153,12 +153,17 @@ end;
|
|||||||
|
|
||||||
procedure TRxDBGrid_PopUpFilterForm.UpdateChList;
|
procedure TRxDBGrid_PopUpFilterForm.UpdateChList;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i, Cnt: Integer;
|
||||||
S: String;
|
S: String;
|
||||||
begin
|
begin
|
||||||
CheckListBox1.Items.BeginUpdate;
|
CheckListBox1.Items.BeginUpdate;
|
||||||
CheckListBox1.Items.Clear;
|
CheckListBox1.Items.Clear;
|
||||||
for i:=0 to FRxColumn.Filter.ValueList.Count - 1 do
|
Cnt:=FRxColumn.Filter.ValueList.Count - 1;
|
||||||
|
|
||||||
|
if FRxColumn.Filter.Style = rxfstBoth then
|
||||||
|
Dec(Cnt);
|
||||||
|
|
||||||
|
for i:=0 to Cnt do
|
||||||
begin
|
begin
|
||||||
S:=FRxColumn.Filter.ValueList[i];
|
S:=FRxColumn.Filter.ValueList[i];
|
||||||
if (S <> FRxColumn.Filter.AllValue) and (S <> FRxColumn.Filter.EmptyValue) then
|
if (S <> FRxColumn.Filter.AllValue) and (S <> FRxColumn.Filter.EmptyValue) then
|
||||||
|
Reference in New Issue
Block a user