RxFPC:in rxdbgrid filter dialog allow use columns in expressions

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6291 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2018-04-05 08:12:13 +00:00
parent 8d5997b3e3
commit 2b912d8e33
7 changed files with 358 additions and 326 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<Version Value="11"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
@ -17,9 +17,10 @@
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default"/>
</Modes>
</RunParams>
<RequiredPackages Count="4">
<Item1>
@ -35,7 +36,7 @@
<PackageName Value="LCL"/>
</Item4>
</RequiredPackages>
<Units Count="3">
<Units Count="2">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
@ -48,14 +49,6 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
</Unit1>
<Unit2>
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="RxDBGrid_PopUpFilterForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="RxDBGrid_PopUpFilterUnit"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -7,8 +7,7 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, Unit1, rxnew, lazcontrols, RxDBGrid_PopUpFilterUnit
{ you can add units after this };
Forms, Unit1, rxnew, lazcontrols;
{$R *.res}

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectSession>
<Version Value="10"/>
<Version Value="11"/>
<BuildModes Active="Default"/>
<Units Count="20">
<Units Count="22">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
@ -20,25 +20,21 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<TopLine Value="25"/>
<CursorPos X="16" Y="51"/>
<CursorPos X="6" Y="27"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
<Unit2>
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="RxDBGrid_PopUpFilterForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="RxDBGrid_PopUpFilterUnit"/>
<EditorIndex Value="1"/>
<EditorIndex Value="-1"/>
<TopLine Value="188"/>
<CursorPos X="60" Y="188"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit2>
<Unit3>
<Filename Value="../../../../lcl/forms.pp"/>
@ -50,7 +46,7 @@
</Unit3>
<Unit4>
<Filename Value="../../rxdb/rxdbgrid.pas"/>
<EditorIndex Value="3"/>
<EditorIndex Value="-1"/>
<TopLine Value="581"/>
<CursorPos X="15" Y="599"/>
<UsageCount Value="15"/>
@ -60,7 +56,6 @@
<Item2 Y="4864" ID="1"/>
<Item3 Y="4287" ID="2"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit4>
<Unit5>
<Filename Value="../../../lazcontrols/listfilteredit.pas"/>
@ -107,11 +102,10 @@
</Unit10>
<Unit11>
<Filename Value="../../rxtools/rxdconst.pas"/>
<EditorIndex Value="2"/>
<EditorIndex Value="-1"/>
<TopLine Value="226"/>
<CursorPos X="3" Y="239"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
<Filename Value="../../../../lcl/controls.pp"/>
@ -155,19 +149,16 @@
<Unit17>
<Filename Value="../../../../lcl/grids.pas"/>
<UnitName Value="Grids"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="5"/>
<EditorIndex Value="-1"/>
<TopLine Value="5387"/>
<CursorPos X="3" Y="5392"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit17>
<Unit18>
<Filename Value="../../../../lcl/dbgrids.pas"/>
<UnitName Value="DBGrids"/>
<EditorIndex Value="4"/>
<EditorIndex Value="-1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit18>
<Unit19>
<Filename Value="/home/install/source/fpcsrc/rtl/inc/typshrdh.inc"/>
@ -176,126 +167,153 @@
<CursorPos X="29" Y="158"/>
<UsageCount Value="10"/>
</Unit19>
<Unit20>
<Filename Value="../../../rxdb/rxdbgrid.pas"/>
<EditorIndex Value="1"/>
<TopLine Value="6203"/>
<CursorPos X="38" Y="6234"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<ComponentName Value="rxFilterByForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/>
<TopLine Value="340"/>
<CursorPos Y="370"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit21>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="../../../../lcl/dbgrids.pas"/>
<Caret Line="404" Column="15" TopLine="387"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="245" Column="3" TopLine="245"/>
</Position1>
<Position2>
<Filename Value="../../../../lcl/dbgrids.pas"/>
<Caret Line="3083" Column="3" TopLine="3080"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="246" Column="3" TopLine="246"/>
</Position2>
<Position3>
<Filename Value="../../../../lcl/dbgrids.pas"/>
<Caret Line="402" Column="15" TopLine="389"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="245" Column="3" TopLine="245"/>
</Position3>
<Position4>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="4133" Column="3" TopLine="4129"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="246" Column="3" TopLine="246"/>
</Position4>
<Position5>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="750" Column="12" TopLine="735"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="245" Column="3" TopLine="245"/>
</Position5>
<Position6>
<Filename Value="../../../../lcl/dbgrids.pas"/>
<Caret Line="3049" Column="3" TopLine="3045"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="246" Column="3" TopLine="246"/>
</Position6>
<Position7>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="976" Column="15" TopLine="959"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="245" Column="3" TopLine="245"/>
</Position7>
<Position8>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="4133" Column="3" TopLine="4129"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="246" Column="3" TopLine="246"/>
</Position8>
<Position9>
<Filename Value="../../../../lcl/dbgrids.pas"/>
<Caret Line="3049" Column="3" TopLine="3045"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="245" Column="3" TopLine="245"/>
</Position9>
<Position10>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="976" Column="15" TopLine="961"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="246" Column="3" TopLine="246"/>
</Position10>
<Position11>
<Filename Value="../../../../lcl/dbgrids.pas"/>
<Caret Line="3049" Column="3" TopLine="3045"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="245" Column="3" TopLine="245"/>
</Position11>
<Position12>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="4134" Column="15" TopLine="4129"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="256" Column="45" TopLine="246"/>
</Position12>
<Position13>
<Filename Value="../../../../lcl/grids.pas"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="255" Column="45" TopLine="245"/>
</Position13>
<Position14>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="4134" Column="27" TopLine="4106"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="279" Column="20" TopLine="279"/>
</Position14>
<Position15>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="4201" Column="27" TopLine="4148"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="105" Column="15" TopLine="87"/>
</Position15>
<Position16>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="7212" Column="27" TopLine="7184"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="186" Column="3" TopLine="181"/>
</Position16>
<Position17>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="7218" Column="27" TopLine="7190"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="105" Column="5" TopLine="87"/>
</Position17>
<Position18>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="7759" Column="52" TopLine="7731"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="197" Column="17" TopLine="178"/>
</Position18>
<Position19>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="8260" Column="62" TopLine="8232"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="198" TopLine="177"/>
</Position19>
<Position20>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="8266" Column="63" TopLine="8238"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="384" Column="27" TopLine="363"/>
</Position20>
<Position21>
<Filename Value="../../../../lcl/grids.pas"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="107" Column="14" TopLine="89"/>
</Position21>
<Position22>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="667" Column="18" TopLine="638"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="235" Column="30" TopLine="217"/>
</Position22>
<Position23>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="668" Column="45" TopLine="639"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="109" Column="15" TopLine="87"/>
</Position23>
<Position24>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="687" Column="22" TopLine="656"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="105" Column="15" TopLine="87"/>
</Position24>
<Position25>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="788" Column="31" TopLine="761"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="197" Column="33" TopLine="181"/>
</Position25>
<Position26>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="5392" Column="3" TopLine="5387"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="109" Column="15" TopLine="87"/>
</Position26>
<Position27>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="845" Column="15" TopLine="830"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="351" Column="11" TopLine="332"/>
</Position27>
<Position28>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="3373" Column="3" TopLine="3378"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="354" Column="70" TopLine="337"/>
</Position28>
<Position29>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="3846" Column="21" TopLine="3818"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="353" TopLine="337"/>
</Position29>
<Position30>
<Filename Value="../../../../lcl/grids.pas"/>
<Caret Line="788" Column="15" TopLine="773"/>
<Filename Value="../../../rxdb/rxfilterby.pas"/>
<Caret Line="354" TopLine="337"/>
</Position30>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0" ActiveMode="default"/>
</RunParams>
</ProjectSession>
</CONFIG>

View File

@ -26,6 +26,7 @@ object Form1: TForm1
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Empty)'
Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@ -40,6 +41,7 @@ object Form1: TForm1
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Empty)'
Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@ -55,6 +57,7 @@ object Form1: TForm1
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Empty)'
Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@ -70,6 +73,7 @@ object Form1: TForm1
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Empty)'
Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@ -84,6 +88,7 @@ object Form1: TForm1
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Empty)'
Filter.NotEmptyValue = '(Не пусто)'
Filter.AllValue = '(All values)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
@ -149,7 +154,7 @@ object Form1: TForm1
FooterOptions.DrawFullLine = False
SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey]
SearchOptions.FromStart = False
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFilter, rdgAllowQuickFilter, rdgAllowToolMenu]
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFilter, rdgAllowQuickFilter, rdgAllowFilterForm, rdgAllowToolMenu]
Align = alClient
Color = clWindow
DrawFullLine = False
@ -158,7 +163,6 @@ object Form1: TForm1
GridLineStyle = psSolid
DataSource = dsData
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgHeaderPushedLook]
ParentColor = False
TabOrder = 0
end
object rxData: TRxMemoryData

View File

@ -1,11 +1,10 @@
object rxFilterByForm: TrxFilterByForm
Left = 464
Height = 445
Height = 498
Top = 115
Width = 644
ActiveControl = Edit1
Caption = 'Filter conditions'
ClientHeight = 445
ClientHeight = 498
ClientWidth = 644
OnCreate = FormCreate
Position = poScreenCenter
@ -124,19 +123,6 @@ object rxFilterByForm: TrxFilterByForm
Style = csDropDownList
TabOrder = 1
end
object Edit1: TEdit
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 271
Height = 37
Top = 58
Width = 250
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6
OnChange = EditChange
TabOrder = 2
end
object ComboBox3: TComboBox
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
@ -154,7 +140,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 3
TabOrder = 2
end
object ComboBox4: TComboBox
AnchorSideLeft.Control = Owner
@ -172,7 +158,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 4
TabOrder = 3
end
object ComboBox5: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -190,23 +176,7 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 5
end
object Edit2: TEdit
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 100
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 6
TabOrder = 4
end
object ComboBox6: TComboBox
AnchorSideTop.Control = ComboBox1
@ -225,7 +195,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 7
TabOrder = 5
end
object ComboBox7: TComboBox
AnchorSideLeft.Control = Owner
@ -243,7 +213,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 8
TabOrder = 6
end
object ComboBox8: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -261,23 +231,7 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 9
end
object Edit3: TEdit
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox4
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 144
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 10
TabOrder = 7
end
object ComboBox9: TComboBox
AnchorSideTop.Control = ComboBox4
@ -296,7 +250,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 11
TabOrder = 8
end
object ComboBox10: TComboBox
AnchorSideLeft.Control = Owner
@ -314,7 +268,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 12
TabOrder = 9
end
object ComboBox11: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -332,23 +286,7 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 13
end
object Edit4: TEdit
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox7
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 188
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 14
TabOrder = 10
end
object ComboBox12: TComboBox
AnchorSideTop.Control = ComboBox7
@ -367,7 +305,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 15
TabOrder = 11
end
object ComboBox13: TComboBox
AnchorSideLeft.Control = Owner
@ -385,7 +323,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 16
TabOrder = 12
end
object ComboBox14: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -403,23 +341,7 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 17
end
object Edit5: TEdit
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox10
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 232
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 18
TabOrder = 13
end
object ComboBox15: TComboBox
AnchorSideTop.Control = ComboBox10
@ -438,7 +360,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 19
TabOrder = 14
end
object ComboBox16: TComboBox
AnchorSideLeft.Control = Owner
@ -456,7 +378,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 20
TabOrder = 15
end
object ComboBox17: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -474,23 +396,7 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 21
end
object Edit6: TEdit
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox13
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 276
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 22
TabOrder = 16
end
object ComboBox18: TComboBox
AnchorSideTop.Control = ComboBox13
@ -509,7 +415,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 23
TabOrder = 17
end
object ComboBox19: TComboBox
AnchorSideLeft.Control = Owner
@ -527,7 +433,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 24
TabOrder = 18
end
object ComboBox20: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -545,23 +451,7 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 25
end
object Edit7: TEdit
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox16
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 320
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 26
TabOrder = 19
end
object ComboBox21: TComboBox
AnchorSideTop.Control = ComboBox16
@ -580,7 +470,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 27
TabOrder = 20
end
object ComboBox22: TComboBox
AnchorSideLeft.Control = Owner
@ -598,7 +488,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 28
TabOrder = 21
end
object ComboBox23: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -616,23 +506,7 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 29
end
object Edit8: TEdit
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox19
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 364
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 30
TabOrder = 22
end
object ComboBox24: TComboBox
AnchorSideTop.Control = ComboBox19
@ -651,7 +525,7 @@ object rxFilterByForm: TrxFilterByForm
'Or'
)
Style = csDropDownList
TabOrder = 31
TabOrder = 23
end
object ComboBox25: TComboBox
AnchorSideLeft.Control = Owner
@ -669,7 +543,7 @@ object rxFilterByForm: TrxFilterByForm
BorderSpacing.Around = 2
ItemHeight = 0
Style = csDropDownList
TabOrder = 32
TabOrder = 24
end
object ComboBox26: TComboBox
AnchorSideLeft.Control = ComboBox2
@ -687,9 +561,209 @@ object rxFilterByForm: TrxFilterByForm
ItemHeight = 0
OnChange = ComboBoxChange
Style = csDropDownList
TabOrder = 25
end
object ComboBox27: TComboBox
AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 32
Top = 460
Width = 58
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
Items.Strings = (
'And'
'Or'
)
Style = csDropDownList
TabOrder = 26
Visible = False
end
object Button1: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 586
Height = 36
Top = 456
Width = 52
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Apply'
Default = True
OnClick = Button1Click
TabOrder = 27
end
object Button2: TButton
AnchorSideRight.Control = Button1
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 521
Height = 36
Top = 456
Width = 59
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Cancel = True
Caption = 'Cancel'
OnClick = Button2Click
TabOrder = 28
end
object Button3: TButton
AnchorSideRight.Control = Button2
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 432
Height = 36
Top = 456
Width = 83
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Clear filter'
OnClick = Button3Click
TabOrder = 29
end
object Edit1: TComboBox
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 271
Height = 37
Top = 58
Width = 250
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 30
end
object Edit2: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 100
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 31
end
object Edit3: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox4
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 144
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 32
end
object Edit4: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox7
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 188
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 33
end
object Edit9: TEdit
object Edit5: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox10
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 232
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 34
end
object Edit6: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox13
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 276
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 35
end
object Edit7: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox16
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 320
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 36
end
object Edit8: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox19
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 37
Top = 364
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 0
OnChange = EditChange
TabOrder = 37
end
object Edit9: TComboBox
AnchorSideLeft.Control = ComboBox2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ComboBox22
@ -702,74 +776,8 @@ object rxFilterByForm: TrxFilterByForm
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
OnChange = EditChange
TabOrder = 34
end
object ComboBox27: TComboBox
AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 32
Top = 407
Width = 58
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
Items.Strings = (
'And'
'Or'
)
Style = csDropDownList
TabOrder = 35
Visible = False
end
object Button1: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 586
Height = 36
Top = 403
Width = 52
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Apply'
Default = True
OnClick = Button1Click
TabOrder = 36
end
object Button2: TButton
AnchorSideRight.Control = Button1
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 521
Height = 36
Top = 403
Width = 59
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Cancel = True
Caption = 'Cancel'
OnClick = Button2Click
TabOrder = 37
end
object Button3: TButton
AnchorSideRight.Control = Button2
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 432
Height = 36
Top = 403
Width = 83
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Clear filter'
OnClick = Button3Click
OnChange = EditChange
TabOrder = 38
end
end

View File

@ -74,15 +74,15 @@ type
ComboBox7: TComboBox;
ComboBox8: TComboBox;
ComboBox9: TComboBox;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit1: TComboBox;
Edit2: TComboBox;
Edit3: TComboBox;
Edit4: TComboBox;
Edit5: TComboBox;
Edit6: TComboBox;
Edit7: TComboBox;
Edit8: TComboBox;
Edit9: TComboBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
@ -98,13 +98,13 @@ type
private
Combo_1 : Array[1..9] of TComboBox;
Combo_2 : Array[1..9] of TComboBox;
Edit_1 : Array[1..9] of TEdit;
Edit_1 : Array[1..9] of TComboBox;
Combo_3 : Array[1..9] of TComboBox;
FGrid : TRxDBGrid;
procedure ClearALL(AGrid : TRxDBGrid);
function FindCombo(CB:TComboBox):Integer;
function FindEdit(ED:TEdit):Integer;
function FindEdit(ED: TComboBox): Integer;
public
function Execute(AGrid : TRxDBGrid; var FilterStr : String; var LastFilter : TstringList):Boolean;
end;
@ -153,9 +153,9 @@ end;
procedure TrxFilterByForm.EditChange(Sender: TObject);
var
EDN : Integer;
ED : TEdit;
ED : TComboBox;
begin
ED := (Sender AS TEdit);
ED := (Sender AS TComboBox);
EDN := FindEdit(ED);
if EDN=0 Then Exit;
if ED.Text='' Then Combo_1[EDN].ItemIndex:=-1;
@ -193,7 +193,9 @@ begin
begin
if Assigned(AGrid.Columns[i].Field) and (AGrid.Columns[i].Field.FieldKind=fkData) and (AGrid.Columns[i].Visible) then
begin
Combo_1[1].Items.Objects[Combo_1[1].Items.Add(AGrid.Columns[i].Title.Caption)]:=AGrid.Columns[i].Field;
Combo_1[1].Items.AddObject(AGrid.Columns[i].Title.Caption, AGrid.Columns[i].Field);
Edit_1[1].Items.AddObject(AGrid.Columns[i].Title.Caption, AGrid.Columns[i].Field);
wt := Canvas.TextWidth(AGrid.Columns[i].Title.Caption);
if wt > w then
w := wt;
@ -242,6 +244,7 @@ var
S, S1 : String;
SD : String;
C : TColumn;
C1: TRxColumn;
begin
Result := False;
//*****************************************************************************
@ -344,6 +347,13 @@ begin
FilterStr := FilterStr+Combo_3[X-1].Text+' ';
C:=FGrid.ColumnByCaption(Combo_1[X].Text);
if Edit_1[X].Items.IndexOf(Edit_1[X].Text)>-1 then
begin
C1:=FGrid.ColumnByCaption(Edit_1[X].Text);
FilterStr := FilterStr+'('+C.FieldName+Combo_2[X].Text+C1.FieldName+') ';
end
else
if Pos('NULL', Combo_2[X].Text) > 0 then
FilterStr := FilterStr+'('+C.FieldName+Combo_2[X].Text+') '
else
@ -379,7 +389,7 @@ begin
end;
end;
function TrxFilterByForm.FindEdit(ED:TEdit):Integer;
function TrxFilterByForm.FindEdit(ED:TComboBox):Integer;
var
X : Integer;
begin