You've already forked lazarus-ccr
RxFPC:New style quick filter window in RxDBGrid
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5839 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
BIN
components/rx/trunk/Demos/RxDBGrid_Filter/project1.ico
Normal file
BIN
components/rx/trunk/Demos/RxDBGrid_Filter/project1.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
91
components/rx/trunk/Demos/RxDBGrid_Filter/project1.lpi
Normal file
91
components/rx/trunk/Demos/RxDBGrid_Filter/project1.lpi
Normal file
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="4">
|
||||
<Item1>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LazControls"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="rxnew"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item4>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<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>
|
||||
<Version Value="11"/>
|
||||
<Target>
|
||||
<Filename Value="project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
21
components/rx/trunk/Demos/RxDBGrid_Filter/project1.lpr
Normal file
21
components/rx/trunk/Demos/RxDBGrid_Filter/project1.lpr
Normal file
@ -0,0 +1,21 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1, rxnew, lazcontrols, RxDBGrid_PopUpFilterUnit
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
247
components/rx/trunk/Demos/RxDBGrid_Filter/project1.lps
Normal file
247
components/rx/trunk/Demos/RxDBGrid_Filter/project1.lps
Normal file
@ -0,0 +1,247 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<Version Value="10"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="16">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="-1"/>
|
||||
<TopLine Value="-1"/>
|
||||
<CursorPos X="-1" Y="-1"/>
|
||||
<UsageCount Value="30"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="25"/>
|
||||
<CursorPos X="16" Y="51"/>
|
||||
<UsageCount Value="30"/>
|
||||
<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"/>
|
||||
<TopLine Value="173"/>
|
||||
<CursorPos X="47" Y="184"/>
|
||||
<UsageCount Value="30"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="../../../../lcl/forms.pp"/>
|
||||
<UnitName Value="Forms"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="730"/>
|
||||
<CursorPos Y="748"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="../../rxdb/rxdbgrid.pas"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<TopLine Value="4296"/>
|
||||
<CursorPos X="25" Y="4305"/>
|
||||
<UsageCount Value="15"/>
|
||||
<Bookmarks Count="4">
|
||||
<Item0 X="14" Y="6400" ID="3"/>
|
||||
<Item1 X="24" Y="5181" ID="4"/>
|
||||
<Item2 Y="5267" ID="1"/>
|
||||
<Item3 Y="4301" ID="2"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="../../../lazcontrols/listfilteredit.pas"/>
|
||||
<UnitName Value="ListFilterEdit"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="307"/>
|
||||
<CursorPos X="3" Y="311"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="../../rxdb/rxfilterby.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="322"/>
|
||||
<CursorPos X="3" Y="235"/>
|
||||
<UsageCount Value="14"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="/home/install/source/fpcsrc/packages/fcl-db/src/base/db.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="1799"/>
|
||||
<CursorPos X="14" Y="1726"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="../../rxdb/rxmemds.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="819"/>
|
||||
<CursorPos Y="843"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="/home/install/source/fpcsrc/packages/fcl-db/src/base/dataset.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="842"/>
|
||||
<CursorPos X="3" Y="845"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="../../rxdb/rxdbgrid_findunit.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="93"/>
|
||||
<CursorPos X="3" Y="95"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<TopLine Value="226"/>
|
||||
<CursorPos X="3" Y="239"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="../../../../lcl/controls.pp"/>
|
||||
<UnitName Value="Controls"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="2152"/>
|
||||
<CursorPos X="14" Y="2168"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="../../../../lcl/buttons.pp"/>
|
||||
<UnitName Value="Buttons"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="352"/>
|
||||
<CursorPos X="3" Y="354"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
<Filename Value="../../../../lcl/lcltype.pp"/>
|
||||
<UnitName Value="LCLType"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="73"/>
|
||||
<CursorPos X="3" Y="90"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit14>
|
||||
<Unit15>
|
||||
<Filename Value="../../../../lcl/include/customform.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="131"/>
|
||||
<CursorPos Y="154"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit15>
|
||||
</Units>
|
||||
<JumpHistory Count="24" HistoryIndex="23">
|
||||
<Position1>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="209" Column="3" TopLine="222"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="180" TopLine="163"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="166" TopLine="160"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="168" Column="3" TopLine="160"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="167" TopLine="160"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="180" TopLine="159"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="../../rxdb/rxdbgrid.pas"/>
|
||||
<Caret Line="4310" Column="40" TopLine="4296"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="167" TopLine="160"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="212" TopLine="193"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="181" Column="7" TopLine="156"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="81" Column="24" TopLine="66"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="176" Column="30" TopLine="173"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="52" Column="3" TopLine="35"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="99" Column="10" TopLine="69"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="100" Column="14" TopLine="70"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="116" Column="16" TopLine="86"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="136" Column="12" TopLine="106"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="138" Column="35" TopLine="107"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="145" Column="10" TopLine="110"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="../../rxdb/rxdbgrid_popupfilterunit.pas"/>
|
||||
<Caret Line="183" Column="6" TopLine="173"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="../../rxtools/rxdconst.pas"/>
|
||||
<Caret Line="139" Column="68" TopLine="125"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="52" Column="16" TopLine="26"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="51" Column="16" TopLine="25"/>
|
||||
</Position24>
|
||||
</JumpHistory>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
BIN
components/rx/trunk/Demos/RxDBGrid_Filter/project1.res
Normal file
BIN
components/rx/trunk/Demos/RxDBGrid_Filter/project1.res
Normal file
Binary file not shown.
228
components/rx/trunk/Demos/RxDBGrid_Filter/unit1.lfm
Normal file
228
components/rx/trunk/Demos/RxDBGrid_Filter/unit1.lfm
Normal file
@ -0,0 +1,228 @@
|
||||
object Form1: TForm1
|
||||
Left = 612
|
||||
Height = 444
|
||||
Top = 268
|
||||
Width = 702
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 444
|
||||
ClientWidth = 702
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '1.9.0.0'
|
||||
object RxDBGrid1: TRxDBGrid
|
||||
Left = 0
|
||||
Height = 444
|
||||
Top = 0
|
||||
Width = 702
|
||||
ColumnDefValues.BlobText = '(blob)'
|
||||
TitleButtons = True
|
||||
AutoSort = True
|
||||
Columns = <
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'ID_R'
|
||||
Width = 60
|
||||
FieldName = 'ID_R'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Empty)'
|
||||
Filter.AllValue = '(All values)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footers = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'ID'
|
||||
Width = 60
|
||||
FieldName = 'ID'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Empty)'
|
||||
Filter.AllValue = '(All values)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Filter.Style = rxfstDialog
|
||||
Footers = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'CODE'
|
||||
Width = 60
|
||||
FieldName = 'CODE'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Empty)'
|
||||
Filter.AllValue = '(All values)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Filter.Style = rxfstDialog
|
||||
Footers = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'NAME'
|
||||
Width = 350
|
||||
FieldName = 'NAME'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Empty)'
|
||||
Filter.AllValue = '(All values)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footers = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'CODE1'
|
||||
FieldName = 'CODE'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Empty)'
|
||||
Filter.AllValue = '(All values)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
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, rdgFilter, rdgAllowQuickFilter, rdgAllowToolMenu]
|
||||
Align = alClient
|
||||
Color = clWindow
|
||||
DrawFullLine = False
|
||||
FocusColor = clRed
|
||||
SelectedColor = clHighlight
|
||||
GridLineStyle = psSolid
|
||||
DataSource = dsData
|
||||
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgHeaderPushedLook]
|
||||
ParentColor = False
|
||||
TabOrder = 0
|
||||
end
|
||||
object rxData: TRxMemoryData
|
||||
FieldDefs = <
|
||||
item
|
||||
Name = 'ID_R'
|
||||
DataType = ftInteger
|
||||
end
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = ftInteger
|
||||
end
|
||||
item
|
||||
Name = 'CODE'
|
||||
DataType = ftInteger
|
||||
end
|
||||
item
|
||||
Name = 'NAME'
|
||||
DataType = ftString
|
||||
Size = 200
|
||||
end>
|
||||
AfterInsert = rxDataAfterInsert
|
||||
PacketRecords = 0
|
||||
Left = 459
|
||||
Top = 245
|
||||
object rxDataID: TLongintField
|
||||
FieldKind = fkData
|
||||
FieldName = 'ID'
|
||||
Index = 0
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
end
|
||||
object rxDataCODE: TLongintField
|
||||
FieldKind = fkData
|
||||
FieldName = 'CODE'
|
||||
Index = 1
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
end
|
||||
object rxDataNAME: TStringField
|
||||
FieldKind = fkData
|
||||
FieldName = 'NAME'
|
||||
Index = 2
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
Size = 200
|
||||
end
|
||||
object rxDataID_R: TLongintField
|
||||
FieldKind = fkData
|
||||
FieldName = 'ID_R'
|
||||
Index = 3
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
end
|
||||
end
|
||||
object dsData: TDataSource
|
||||
DataSet = rxData
|
||||
Left = 416
|
||||
Top = 245
|
||||
end
|
||||
end
|
60
components/rx/trunk/Demos/RxDBGrid_Filter/unit1.pas
Normal file
60
components/rx/trunk/Demos/RxDBGrid_Filter/unit1.pas
Normal file
@ -0,0 +1,60 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, rxdbgrid, rxmemds, Forms, Controls, Graphics,
|
||||
Dialogs, StdCtrls, db;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
dsData: TDataSource;
|
||||
rxDataID_R: TLongintField;
|
||||
RxDBGrid1: TRxDBGrid;
|
||||
rxData: TRxMemoryData;
|
||||
rxDataCODE: TLongintField;
|
||||
rxDataID: TLongintField;
|
||||
rxDataNAME: TStringField;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure rxDataAfterInsert(DataSet: TDataSet);
|
||||
private
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
rxData.Open;
|
||||
for i:=1 to 20 do
|
||||
begin
|
||||
rxData.AppendRecord([i, i mod 4, Format('Line %d', [i])]);
|
||||
if i mod 5 = 0 then
|
||||
rxData.AppendRecord([null, null, 'Пустая строка']);
|
||||
end;
|
||||
rxData.First;
|
||||
end;
|
||||
|
||||
procedure TForm1.rxDataAfterInsert(DataSet: TDataSet);
|
||||
begin
|
||||
rxDataID_R.AsInteger:=rxData.RecordCount + 1;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -1,10 +1,18 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: rxdconst.sallvalues
|
||||
msgid "All values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sapptitlelabel
|
||||
msgid "Application \"%s\""
|
||||
msgstr "Aplicación \"%s\""
|
||||
|
||||
#: rxdconst.sascending
|
||||
msgid "Ascending"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sblobtext
|
||||
msgid "(blob)"
|
||||
msgstr ""
|
||||
@ -35,6 +43,12 @@ msgstr "Cambiar clave"
|
||||
msgid "Circular data link"
|
||||
msgstr "SCircularEnlaceDato"
|
||||
|
||||
#: rxdconst.sclearfilter
|
||||
#, fuzzy
|
||||
msgctxt "rxdconst.sclearfilter"
|
||||
msgid "Clear filter"
|
||||
msgstr "Limpiar Todo"
|
||||
|
||||
#: rxdconst.scollumnname
|
||||
msgid "Column name"
|
||||
msgstr ""
|
||||
@ -81,10 +95,20 @@ msgstr "Eliminar todos los registros seleccionados"
|
||||
msgid "Delete record?"
|
||||
msgstr "Eliminar registro"
|
||||
|
||||
#: rxdconst.sdescending
|
||||
#, fuzzy
|
||||
msgctxt "rxdconst.sdescending"
|
||||
msgid "Descending"
|
||||
msgstr "Descendente"
|
||||
|
||||
#: rxdconst.seditdata
|
||||
msgid "editing"
|
||||
msgstr "editando"
|
||||
|
||||
#: rxdconst.semptyvalues
|
||||
msgid "Empty values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.serrormsglabel
|
||||
msgid "Error message"
|
||||
msgstr "Mensaje de error"
|
||||
@ -233,12 +257,20 @@ msgstr ""
|
||||
msgid "Hide zero values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.shinthideonlycurrentitem
|
||||
msgid "Hide only current item"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.shintlabel
|
||||
#, fuzzy
|
||||
#| msgid "Enter you user name and password"
|
||||
msgid "Enter your user name and password"
|
||||
msgstr "Entre su nombre de usuario y clave"
|
||||
|
||||
#: rxdconst.shintshowonlycurrentitem
|
||||
msgid "Show only current item"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sinactivedata
|
||||
msgid "inactive"
|
||||
msgstr "inactivo"
|
||||
@ -303,6 +335,10 @@ msgstr "Control necesita bloquearlo por filtro"
|
||||
msgid "Dataset not in edit or insert mode"
|
||||
msgstr "Conjunto de Datos no esta en modo de edición o inserción"
|
||||
|
||||
#: rxdconst.snotempty
|
||||
msgid "Not empty"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.soldpasswordlabel
|
||||
msgid "&Old password:"
|
||||
msgstr "&Anterior clave:"
|
||||
@ -375,6 +411,10 @@ msgstr ""
|
||||
msgid "Print options"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.squickfilter
|
||||
msgid "Quick filter"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sregistration
|
||||
msgid "Register"
|
||||
msgstr "Registro"
|
||||
@ -521,6 +561,7 @@ msgid "Totals row"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.srxdescending
|
||||
msgctxt "rxdconst.srxdescending"
|
||||
msgid "Descending"
|
||||
msgstr "Descendente"
|
||||
|
||||
@ -669,6 +710,14 @@ msgstr ""
|
||||
msgid "Show column title"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.ssorting
|
||||
msgid "Sorting"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sstandartfilter
|
||||
msgid "Standart filter"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.stitlecolor
|
||||
msgid "Title color"
|
||||
msgstr ""
|
||||
|
@ -1,10 +1,18 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: rxdconst.sallvalues
|
||||
msgid "All values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sapptitlelabel
|
||||
msgid "Application \"%s\""
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sascending
|
||||
msgid "Ascending"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sblobtext
|
||||
msgid "(blob)"
|
||||
msgstr ""
|
||||
@ -33,6 +41,11 @@ msgstr ""
|
||||
msgid "Circular data link"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sclearfilter
|
||||
msgctxt "rxdconst.sclearfilter"
|
||||
msgid "Clear filter"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.scollumnname
|
||||
msgid "Column name"
|
||||
msgstr ""
|
||||
@ -77,10 +90,19 @@ msgstr ""
|
||||
msgid "Delete record?"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sdescending
|
||||
msgctxt "rxdconst.sdescending"
|
||||
msgid "Descending"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.seditdata
|
||||
msgid "editing"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.semptyvalues
|
||||
msgid "Empty values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.serrormsglabel
|
||||
msgid "Error message"
|
||||
msgstr ""
|
||||
@ -225,10 +247,18 @@ msgstr ""
|
||||
msgid "Hide zero values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.shinthideonlycurrentitem
|
||||
msgid "Hide only current item"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.shintlabel
|
||||
msgid "Enter your user name and password"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.shintshowonlycurrentitem
|
||||
msgid "Show only current item"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sinactivedata
|
||||
msgid "inactive"
|
||||
msgstr ""
|
||||
@ -289,6 +319,10 @@ msgstr ""
|
||||
msgid "Dataset not in edit or insert mode"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.snotempty
|
||||
msgid "Not empty"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.soldpasswordlabel
|
||||
msgid "&Old password:"
|
||||
msgstr ""
|
||||
@ -361,6 +395,10 @@ msgstr ""
|
||||
msgid "Print options"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.squickfilter
|
||||
msgid "Quick filter"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sregistration
|
||||
msgid "Register"
|
||||
msgstr ""
|
||||
@ -502,6 +540,7 @@ msgid "Totals row"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.srxdescending
|
||||
msgctxt "rxdconst.srxdescending"
|
||||
msgid "Descending"
|
||||
msgstr ""
|
||||
|
||||
@ -647,6 +686,14 @@ msgstr ""
|
||||
msgid "Show column title"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.ssorting
|
||||
msgid "Sorting"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sstandartfilter
|
||||
msgid "Standart filter"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.stitlecolor
|
||||
msgid "Title color"
|
||||
msgstr ""
|
||||
|
@ -9,12 +9,20 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
"X-Generator: Poedit 1.8.8\n"
|
||||
"X-Generator: Poedit 1.8.12\n"
|
||||
|
||||
#: rxdconst.sallvalues
|
||||
msgid "All values"
|
||||
msgstr "Все значения"
|
||||
|
||||
#: rxdconst.sapptitlelabel
|
||||
msgid "Application \"%s\""
|
||||
msgstr "Программа \"%s\""
|
||||
|
||||
#: rxdconst.sascending
|
||||
msgid "Ascending"
|
||||
msgstr "По возрастанию"
|
||||
|
||||
#: rxdconst.sblobtext
|
||||
msgid "(blob)"
|
||||
msgstr "(данные)"
|
||||
@ -43,6 +51,10 @@ msgstr "Изменить пароль"
|
||||
msgid "Circular data link"
|
||||
msgstr "Перекрёстная ссылка данных"
|
||||
|
||||
#: rxdconst.sclearfilter
|
||||
msgid "Clear filter"
|
||||
msgstr "Очистить фильтр"
|
||||
|
||||
#: rxdconst.scollumnname
|
||||
msgid "Column name"
|
||||
msgstr "Имя столбца"
|
||||
@ -87,10 +99,18 @@ msgstr "Удалить все выделенные записи"
|
||||
msgid "Delete record?"
|
||||
msgstr "Удалить запись"
|
||||
|
||||
#: rxdconst.sdescending
|
||||
msgid "Descending"
|
||||
msgstr "По убыванию"
|
||||
|
||||
#: rxdconst.seditdata
|
||||
msgid "editing"
|
||||
msgstr "редактирование"
|
||||
|
||||
#: rxdconst.semptyvalues
|
||||
msgid "Empty values"
|
||||
msgstr "По убыванию"
|
||||
|
||||
#: rxdconst.serrormsglabel
|
||||
msgid "Error message"
|
||||
msgstr "Сообщение об ошибке"
|
||||
@ -235,10 +255,18 @@ msgstr "Общее"
|
||||
msgid "Hide zero values"
|
||||
msgstr "Не отображать нулевые значения"
|
||||
|
||||
#: rxdconst.shinthideonlycurrentitem
|
||||
msgid "Hide only current item"
|
||||
msgstr "Скрыть только текущий элемент"
|
||||
|
||||
#: rxdconst.shintlabel
|
||||
msgid "Enter your user name and password"
|
||||
msgstr "Введите ваше имя и пароль"
|
||||
|
||||
#: rxdconst.shintshowonlycurrentitem
|
||||
msgid "Show only current item"
|
||||
msgstr "Показать только текущий элемент"
|
||||
|
||||
#: rxdconst.sinactivedata
|
||||
msgid "inactive"
|
||||
msgstr "не активный"
|
||||
@ -299,6 +327,10 @@ msgstr "Элементы управления должны быть захвач
|
||||
msgid "Dataset not in edit or insert mode"
|
||||
msgstr "Набор данных не в режиме редактирования или вставки"
|
||||
|
||||
#: rxdconst.snotempty
|
||||
msgid "Not empty"
|
||||
msgstr "Не пусто"
|
||||
|
||||
#: rxdconst.soldpasswordlabel
|
||||
msgid "&Old password:"
|
||||
msgstr "&Старый пароль"
|
||||
@ -371,6 +403,10 @@ msgstr "Печать списка"
|
||||
msgid "Print options"
|
||||
msgstr "Параметры печати"
|
||||
|
||||
#: rxdconst.squickfilter
|
||||
msgid "Quick filter"
|
||||
msgstr "Быстрый фильтр"
|
||||
|
||||
#: rxdconst.sregistration
|
||||
msgid "Register"
|
||||
msgstr "Регистрация"
|
||||
@ -512,6 +548,7 @@ msgid "Totals row"
|
||||
msgstr "Всего строк"
|
||||
|
||||
#: rxdconst.srxdescending
|
||||
msgctxt "rxdconst.srxdescending"
|
||||
msgid "Descending"
|
||||
msgstr "По убыванию"
|
||||
|
||||
@ -657,6 +694,14 @@ msgstr "Отображать заголовок отчёта"
|
||||
msgid "Show column title"
|
||||
msgstr "Отображать заголовки столбцов"
|
||||
|
||||
#: rxdconst.ssorting
|
||||
msgid "Sorting"
|
||||
msgstr "Сортировка"
|
||||
|
||||
#: rxdconst.sstandartfilter
|
||||
msgid "Standart filter"
|
||||
msgstr "Стандартный фильтр"
|
||||
|
||||
#: rxdconst.stitlecolor
|
||||
msgid "Title color"
|
||||
msgstr "Цвет заголовков"
|
||||
@ -696,4 +741,3 @@ msgstr "Использовать сырой JPEG"
|
||||
#: rxdconst.susernamelabel
|
||||
msgid "&User name:"
|
||||
msgstr "&Имя пользователя"
|
||||
|
||||
|
@ -10,10 +10,18 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
|
||||
#: rxdconst.sallvalues
|
||||
msgid "All values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sapptitlelabel
|
||||
msgid "Application \"%s\""
|
||||
msgstr "Програма \"%s\""
|
||||
|
||||
#: rxdconst.sascending
|
||||
msgid "Ascending"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sblobtext
|
||||
msgid "(blob)"
|
||||
msgstr ""
|
||||
@ -42,6 +50,12 @@ msgstr "Змінити пароль"
|
||||
msgid "Circular data link"
|
||||
msgstr "Перехресне посилання даних"
|
||||
|
||||
#: rxdconst.sclearfilter
|
||||
#, fuzzy
|
||||
msgctxt "rxdconst.sclearfilter"
|
||||
msgid "Clear filter"
|
||||
msgstr "Очистити фільтр"
|
||||
|
||||
#: rxdconst.scollumnname
|
||||
msgid "Column name"
|
||||
msgstr "Назва стовпця"
|
||||
@ -86,10 +100,20 @@ msgstr "Видалити всі виділені записи"
|
||||
msgid "Delete record?"
|
||||
msgstr "Видалити запис"
|
||||
|
||||
#: rxdconst.sdescending
|
||||
#, fuzzy
|
||||
msgctxt "rxdconst.sdescending"
|
||||
msgid "Descending"
|
||||
msgstr "За зменшенням"
|
||||
|
||||
#: rxdconst.seditdata
|
||||
msgid "editing"
|
||||
msgstr "Редагування"
|
||||
|
||||
#: rxdconst.semptyvalues
|
||||
msgid "Empty values"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.serrormsglabel
|
||||
msgid "Error message"
|
||||
msgstr "Повідомлення про помилку"
|
||||
@ -235,10 +259,18 @@ msgstr "Загальний"
|
||||
msgid "Hide zero values"
|
||||
msgstr "Ховати нульові значення"
|
||||
|
||||
#: rxdconst.shinthideonlycurrentitem
|
||||
msgid "Hide only current item"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.shintlabel
|
||||
msgid "Enter your user name and password"
|
||||
msgstr "Введіть ваші ім'я користувача та пароль"
|
||||
|
||||
#: rxdconst.shintshowonlycurrentitem
|
||||
msgid "Show only current item"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sinactivedata
|
||||
msgid "inactive"
|
||||
msgstr "бездіяльний"
|
||||
@ -299,6 +331,10 @@ msgstr "Елементи управління повинні бути захоп
|
||||
msgid "Dataset not in edit or insert mode"
|
||||
msgstr "Набір даних не в режимі редагування або вставки"
|
||||
|
||||
#: rxdconst.snotempty
|
||||
msgid "Not empty"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.soldpasswordlabel
|
||||
msgid "&Old password:"
|
||||
msgstr "&Старий пароль"
|
||||
@ -371,6 +407,10 @@ msgstr "Друк таблиці"
|
||||
msgid "Print options"
|
||||
msgstr "Налаштування друку"
|
||||
|
||||
#: rxdconst.squickfilter
|
||||
msgid "Quick filter"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sregistration
|
||||
msgid "Register"
|
||||
msgstr "Реєстрація"
|
||||
@ -513,6 +553,7 @@ msgid "Totals row"
|
||||
msgstr "Підсумковий рядок"
|
||||
|
||||
#: rxdconst.srxdescending
|
||||
msgctxt "rxdconst.srxdescending"
|
||||
msgid "Descending"
|
||||
msgstr "За зменшенням"
|
||||
|
||||
@ -658,6 +699,14 @@ msgstr "Показати заголовок звіту"
|
||||
msgid "Show column title"
|
||||
msgstr "Показати заголовок стовпця"
|
||||
|
||||
#: rxdconst.ssorting
|
||||
msgid "Sorting"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.sstandartfilter
|
||||
msgid "Standart filter"
|
||||
msgstr ""
|
||||
|
||||
#: rxdconst.stitlecolor
|
||||
msgid "Title color"
|
||||
msgstr "Колір заголовка"
|
||||
|
@ -359,7 +359,7 @@ type
|
||||
public
|
||||
property Items[Index: integer]: TRxColumnFooterItem read GetItem write SetItem; default;
|
||||
end;
|
||||
|
||||
(*
|
||||
{ TRxFilterItem }
|
||||
|
||||
TRxFilterItem = class
|
||||
@ -374,17 +374,24 @@ type
|
||||
TRxFilterItems = class(TFPList)
|
||||
function AcceptRecord:boolean;
|
||||
end;
|
||||
|
||||
*)
|
||||
{ TRxColumnFilter }
|
||||
|
||||
TRxFilterState = (rxfsAll, rxfsEmpty, rxfsNonEmpty, rxfsFilter{, rxfsTopXXXX});
|
||||
TRxFilterStyle = (rxfstSimple, rxfstDialog);
|
||||
|
||||
TRxColumnFilter = class(TPersistent)
|
||||
private
|
||||
FAllValue: string;
|
||||
FCurrentValues: TStringList;
|
||||
FEnabled: boolean;
|
||||
FIsAll: boolean;
|
||||
FIsNull: boolean;
|
||||
{ FIsAll: boolean;
|
||||
FIsNull: boolean;}
|
||||
FOwner: TRxColumn;
|
||||
FValue: string;
|
||||
FState: TRxFilterState;
|
||||
FStyle: TRxFilterStyle;
|
||||
// FTopRecord: Integer;
|
||||
// FValue: string;
|
||||
FValueList: TStringList;
|
||||
FEmptyValue: string;
|
||||
FEmptyFont: TFont;
|
||||
@ -399,21 +406,24 @@ type
|
||||
public
|
||||
constructor Create(Owner: TRxColumn); virtual;
|
||||
destructor Destroy; override;
|
||||
property State:TRxFilterState read FState write FState;
|
||||
property CurrentValues : TStringList read FCurrentValues;
|
||||
published
|
||||
property Value: string read FValue write FValue;
|
||||
property IsNull:boolean read FIsNull write FIsNull;
|
||||
property IsAll:boolean read FIsAll write FIsAll;
|
||||
// property Value: string read FValue write FValue;
|
||||
{ property IsNull:boolean read FIsNull write FIsNull;
|
||||
property IsAll:boolean read FIsAll write FIsAll;}
|
||||
property Font: TFont read FFont write SetFont;
|
||||
property Alignment: TAlignment read FAlignment write FAlignment default
|
||||
taLeftJustify;
|
||||
property DropDownRows: integer read FDropDownRows write FDropDownRows;
|
||||
property Color: TColor read FColor write SetColor default clWhite;
|
||||
property ValueList: TStringList read FValueList write FValueList;
|
||||
property ValueList: TStringList read FValueList {write FValueList};
|
||||
property EmptyValue: string read FEmptyValue write FEmptyValue;
|
||||
property AllValue: string read FAllValue write FAllValue;
|
||||
property EmptyFont: TFont read FEmptyFont write FEmptyFont;
|
||||
property ItemIndex: integer read GetItemIndex write SetItemIndex;
|
||||
property Enabled:boolean read FEnabled write FEnabled default true;
|
||||
property Style : TRxFilterStyle read FStyle write FStyle default rxfstSimple;
|
||||
end;
|
||||
|
||||
{ TRxColumnEditButton }
|
||||
@ -571,6 +581,16 @@ type
|
||||
property MouseFlag: boolean read FMouseFlag write FMouseFlag;
|
||||
end;
|
||||
|
||||
{ TFilterColDlgButton }
|
||||
|
||||
TFilterColDlgButton = class(TSpeedButton)
|
||||
private
|
||||
FGrid: TRxDBGrid;
|
||||
FCol: integer;
|
||||
public
|
||||
procedure Show(AGrid: TRxDBGrid; Col: integer);
|
||||
property Col: integer read FCol;
|
||||
end;
|
||||
|
||||
|
||||
{ TRxDBGrid }
|
||||
@ -621,6 +641,7 @@ type
|
||||
FColumnResizing: boolean;
|
||||
|
||||
FFilterListEditor: TFilterListCellEditor;
|
||||
FFilterColDlgButton: TFilterColDlgButton;
|
||||
|
||||
// FOldPosition: Integer;
|
||||
FVersion: integer;
|
||||
@ -675,7 +696,6 @@ type
|
||||
procedure UpdateJMenuStates;
|
||||
procedure UpdateJMenuKeys;
|
||||
function SortEngineOptions: TRxSortEngineOptions;
|
||||
// procedure WMVScroll(var Message : TLMVScroll); message LM_VScroll;
|
||||
procedure GetScrollbarParams(out aRange, aPage, aPos: Integer);
|
||||
procedure RestoreEditor;
|
||||
//storage
|
||||
@ -740,6 +760,8 @@ type
|
||||
procedure CMHintShow(var Message: TLMessage); message CM_HINTSHOW;
|
||||
procedure FFilterListEditorOnChange(Sender: TObject);
|
||||
procedure FFilterListEditorOnCloseUp(Sender: TObject);
|
||||
procedure FFilterColDlgButtonOnClick(Sender: TObject);
|
||||
|
||||
procedure InternalOptimizeColumnsWidth(AColList: TList);
|
||||
function IsDefaultRowHeightStored: boolean;
|
||||
procedure VisualChange; override;
|
||||
@ -972,6 +994,7 @@ procedure RegisterRxDBGridSortEngine(RxDBGridSortEngineClass: TRxDBGridSortEngin
|
||||
implementation
|
||||
|
||||
uses Math, rxdconst, rxstrutils, strutils, rxdbgrid_findunit, rxdbgrid_columsunit,
|
||||
RxDBGrid_PopUpFilterUnit,
|
||||
rxlookup, rxtooledit, LCLProc, Clipbrd, rxfilterby, rxsortby, variants, LazUTF8;
|
||||
|
||||
{$R rxdbgrid.res}
|
||||
@ -1074,6 +1097,16 @@ type
|
||||
procedure EditingDone; override;
|
||||
end;
|
||||
|
||||
{ TFilterColDlgButton }
|
||||
|
||||
procedure TFilterColDlgButton.Show(AGrid: TRxDBGrid; Col: integer);
|
||||
begin
|
||||
FGrid := AGrid;
|
||||
FCol := Col;
|
||||
Visible := True;
|
||||
//SetFocus;
|
||||
end;
|
||||
|
||||
{ TRxDBGridSearchOptions }
|
||||
|
||||
procedure TRxDBGridSearchOptions.AssignTo(Dest: TPersistent);
|
||||
@ -1665,7 +1698,7 @@ begin
|
||||
inherited Create;
|
||||
FOwner:=AOwner;
|
||||
end;
|
||||
|
||||
(*
|
||||
{ TRxFilterItems }
|
||||
|
||||
function TRxFilterItems.AcceptRecord: boolean;
|
||||
@ -1701,7 +1734,7 @@ begin
|
||||
Result:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
*)
|
||||
{ TRxDbGridColumnsSortList }
|
||||
|
||||
function TRxDbGridColumnsSortList.GetCollumn(Index: Integer): TRxColumn;
|
||||
@ -2615,17 +2648,7 @@ begin
|
||||
|
||||
UpdateJMenuKeys;
|
||||
end;
|
||||
{
|
||||
procedure TRxDBGrid.SetMarkerDown(AValue: TBitmap);
|
||||
begin
|
||||
FMarkerDown.Assign(AValue);
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.SetMarkerUp(AValue: TBitmap);
|
||||
begin
|
||||
FMarkerUp.Assign(AValue);
|
||||
end;
|
||||
}
|
||||
procedure TRxDBGrid.SetOptionsRx(const AValue: TOptionsRx);
|
||||
var
|
||||
OldOpt: TOptionsRx;
|
||||
@ -2639,18 +2662,13 @@ begin
|
||||
if (rdgFilter in AValue) and not (rdgFilter in OldOpt) then
|
||||
begin
|
||||
LayoutChanged;
|
||||
{ BeginUpdate;
|
||||
CalcTitle;
|
||||
EndUpdate;}
|
||||
end
|
||||
else
|
||||
if rdgFilter in OldOpt then
|
||||
begin
|
||||
FFilterListEditor.Hide;
|
||||
FFilterColDlgButton.Hide;
|
||||
LayoutChanged;
|
||||
{ BeginUpdate;
|
||||
CalcTitle;
|
||||
EndUpdate;}
|
||||
end;
|
||||
|
||||
FFooterOptions.FActive:=rdgFooterRows in FOptionsRx;
|
||||
@ -2658,7 +2676,6 @@ begin
|
||||
if (rdgWordWrap in OldOpt) and not (rdgWordWrap in FOptionsRx) then
|
||||
ResetRowHeght;
|
||||
|
||||
// VisualChange;
|
||||
EndUpdate;
|
||||
end;
|
||||
|
||||
@ -3693,6 +3710,7 @@ var
|
||||
ft: TFont;
|
||||
MyCol: integer;
|
||||
TxS: TTextStyle;
|
||||
S: String;
|
||||
|
||||
begin
|
||||
{ if (dgIndicator in Options) and (aCol = 0) then
|
||||
@ -3748,30 +3766,46 @@ begin
|
||||
Canvas.FillRect(aRect);
|
||||
end;
|
||||
|
||||
if Value <> '' then
|
||||
//if Value <> '' then
|
||||
if CurrentValues.Count > 0 then
|
||||
begin
|
||||
S:=CurrentValues[0];
|
||||
if CurrentValues.Count > 1 then
|
||||
S:=S + '(...)';
|
||||
Canvas.Font := Font;
|
||||
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;
|
||||
DrawCellText(aCol, aRow, aRect, aState, Value);
|
||||
DrawCellText(aCol, aRow, aRect, aState, S);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if State = rxfsEmpty then
|
||||
S:=TRxColumn(Columns[MyCol]).Filter.EmptyValue
|
||||
else
|
||||
if State = rxfsAll then
|
||||
S:=TRxColumn(Columns[MyCol]).Filter.AllValue
|
||||
else
|
||||
S:='';
|
||||
|
||||
Canvas.Font := TRxColumn(Columns[MyCol]).Filter.EmptyFont;
|
||||
if (aRect.Right - aRect.Left) >= Canvas.TextWidth(Value) then
|
||||
//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;
|
||||
|
||||
@ -4241,6 +4275,10 @@ begin
|
||||
QuickUTF8Search := '';
|
||||
|
||||
Cell := MouseCoord(X, Y);
|
||||
|
||||
if FFilterColDlgButton.Visible then
|
||||
FFilterColDlgButton.Hide;
|
||||
|
||||
if (DatalinkActive) and (DataSource.DataSet.State = dsBrowse) and
|
||||
(Button = mbLeft) and (Cell.X = 0) and (Cell.Y = 0) and
|
||||
(dgIndicator in Options) and (rdgAllowToolMenu in FOptionsRx) then
|
||||
@ -4259,6 +4297,8 @@ begin
|
||||
begin
|
||||
C:=TRxColumn (Columns[Columns.RealIndex(Cell.x - 1)]);
|
||||
if (C.Filter.Enabled) and (C.Filter.ValueList.Count > 0) then
|
||||
begin
|
||||
if C.Filter.Style = rxfstSimple then
|
||||
begin
|
||||
FFilterListEditor.Style := csDropDownList;
|
||||
if C.Filter.DropDownRows>0 then
|
||||
@ -4271,8 +4311,24 @@ begin
|
||||
|
||||
FFilterListEditor.Items.Assign(C.Filter.ValueList);
|
||||
|
||||
FFilterListEditor.Text := C.Filter.Value;
|
||||
if C.Filter.CurrentValues.Count>0 then
|
||||
FFilterListEditor.Text := C.Filter.CurrentValues[0]
|
||||
else
|
||||
FFilterListEditor.Text := '';
|
||||
FFilterListEditor.Show(Self, Cell.x - 1);
|
||||
end
|
||||
else
|
||||
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);
|
||||
end
|
||||
end;
|
||||
exit;
|
||||
end;
|
||||
@ -4761,22 +4817,29 @@ begin
|
||||
begin
|
||||
if (FFilterListEditor.Text = EmptyValue) then
|
||||
begin
|
||||
Value := '';
|
||||
CurrentValues.Clear;
|
||||
{ Value := '';
|
||||
IsNull:=true;
|
||||
IsAll:=false;
|
||||
IsAll:=false;}
|
||||
State:=rxfsEmpty;
|
||||
end
|
||||
else
|
||||
if (FFilterListEditor.Text = AllValue) then
|
||||
begin
|
||||
Value := '';
|
||||
CurrentValues.Clear;
|
||||
{ Value := '';
|
||||
IsNull:=false;
|
||||
IsAll:=true;
|
||||
IsAll:=true;}
|
||||
State:=rxfsAll;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Value := FFilterListEditor.Text;
|
||||
CurrentValues.Clear;
|
||||
CurrentValues.Add(FFilterListEditor.Text);
|
||||
{ Value := FFilterListEditor.Text;
|
||||
IsNull:=false;
|
||||
IsAll:=false;
|
||||
IsAll:=false;}
|
||||
State:=rxfsFilter;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -4799,6 +4862,21 @@ begin
|
||||
SetFocus;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.FFilterColDlgButtonOnClick(Sender: TObject);
|
||||
var
|
||||
RxDBGrid_PopUpFilterForm: TRxDBGrid_PopUpFilterForm;
|
||||
R: TPoint;
|
||||
FRxCol: TRxColumn;
|
||||
begin
|
||||
FRxCol:=TRxColumn(Columns[Columns.RealIndex(FFilterColDlgButton.Col)]);
|
||||
RxDBGrid_PopUpFilterForm:=TRxDBGrid_PopUpFilterForm.CreatePopUpFilterForm(FRxCol);
|
||||
R:=ClientToScreen(Point(FFilterColDlgButton.Left, FFilterColDlgButton.Top + FFilterColDlgButton.Width));
|
||||
RxDBGrid_PopUpFilterForm.Left:=R.X;
|
||||
RxDBGrid_PopUpFilterForm.Top:=R.Y;
|
||||
RxDBGrid_PopUpFilterForm.ShowModal;
|
||||
RxDBGrid_PopUpFilterForm.Free;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.InternalOptimizeColumnsWidth(AColList: TList);
|
||||
var
|
||||
P: TBookmark;
|
||||
@ -4881,6 +4959,12 @@ begin
|
||||
R:=CellRect(FFilterListEditor.Col+1,0);
|
||||
FFilterListEditor.Width:=Columns[FFilterListEditor.Col].Width;
|
||||
FFilterListEditor.Left:=R.Left;
|
||||
end
|
||||
else
|
||||
if FFilterColDlgButton.Visible then
|
||||
begin
|
||||
R:=CellRect(FFilterListEditor.Col+1,0);
|
||||
FFilterColDlgButton.Left := R.Right - FFilterColDlgButton.Width;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -5185,16 +5269,44 @@ begin
|
||||
begin
|
||||
with TRxColumn(Columns[i]) do
|
||||
begin
|
||||
if Filter.IsAll then
|
||||
//if Filter.IsAll then
|
||||
if Filter.State = rxfsAll then
|
||||
Accept:=true
|
||||
else
|
||||
if Filter.IsNull then
|
||||
//if Filter.IsNull then
|
||||
if Filter.State = rxfsEmpty then
|
||||
begin
|
||||
Accept:=Field.IsNull;
|
||||
if not Accept then
|
||||
Break;
|
||||
end
|
||||
else
|
||||
if Filter.State = rxfsNonEmpty then
|
||||
begin
|
||||
Accept:=not Field.IsNull;
|
||||
if not Accept then
|
||||
Break;
|
||||
end
|
||||
else
|
||||
{ if Filter.State = rxfsTopXXXX then
|
||||
begin
|
||||
if DataSet.State = dsFilter then
|
||||
Accept:=true
|
||||
else
|
||||
Accept:=DataSet.RecNo < Filter.TopRecord;
|
||||
if not Accept then
|
||||
Break;
|
||||
end
|
||||
else}
|
||||
if Filter.CurrentValues.Count > 0 then
|
||||
begin
|
||||
if Filter.CurrentValues.IndexOf(Field.DisplayText) < 0 then
|
||||
begin
|
||||
Accept := False;
|
||||
break;
|
||||
end;
|
||||
end
|
||||
{ else
|
||||
if (Filter.Value <> '') then
|
||||
begin
|
||||
if (Filter.Value <> Field.DisplayText) then
|
||||
@ -5202,7 +5314,7 @@ begin
|
||||
Accept := False;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;}
|
||||
|
||||
end;
|
||||
end;
|
||||
@ -5332,7 +5444,8 @@ begin
|
||||
begin
|
||||
C := TRxColumn(Columns[i]);
|
||||
C.Filter.ValueList.Clear;
|
||||
C.Filter.Value := '';
|
||||
// C.Filter.Value := '';
|
||||
C.Filter.CurrentValues.Clear;
|
||||
C.Filter.ItemIndex := -1;
|
||||
C.Filter.ValueList.Add(C.Filter.EmptyValue);
|
||||
C.Filter.ValueList.Add(C.Filter.AllValue);
|
||||
@ -5792,6 +5905,13 @@ begin
|
||||
OnChange := @FFilterListEditorOnChange;
|
||||
OnCloseUp := @FFilterListEditorOnCloseUp;
|
||||
end;
|
||||
|
||||
FFilterColDlgButton:=TFilterColDlgButton.Create(nil);
|
||||
FFilterColDlgButton.Name := 'FilterColDlgButton';
|
||||
FFilterColDlgButton.Visible := False;
|
||||
FFilterColDlgButton.OnClick := @FFilterColDlgButtonOnClick;
|
||||
FFilterColDlgButton.Glyph.Assign(FEllipsisRxBMP);
|
||||
|
||||
FColumnResizing := False;
|
||||
|
||||
FRxDbGridLookupComboEditor := TRxDBGridLookupComboEditor.Create(nil);
|
||||
@ -5814,6 +5934,7 @@ begin
|
||||
FreeAndNil(FRxDbGridDateEditor);
|
||||
FreeAndNil(FPropertyStorageLink);
|
||||
FreeAndNil(FFilterListEditor);
|
||||
FreeAndNil(FFilterColDlgButton);
|
||||
FreeAndNil(F_PopupMenu);
|
||||
FreeAndNil(F_MenuBMP);
|
||||
FreeAndNil(F_LastFilter);
|
||||
@ -5841,6 +5962,9 @@ begin
|
||||
inherited SetFocus;
|
||||
if FFilterListEditor.Visible then
|
||||
FFilterListEditor.Hide;
|
||||
|
||||
if FFilterColDlgButton.Visible then
|
||||
FFilterColDlgButton.Hide;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.ShowFindDialog;
|
||||
@ -6207,7 +6331,11 @@ end;
|
||||
|
||||
function TRxColumnFilter.GetItemIndex: integer;
|
||||
begin
|
||||
Result := FValueList.IndexOf(FValue);
|
||||
if CurrentValues.Count > 0 then
|
||||
Result := FValueList.IndexOf(CurrentValues[0])
|
||||
else
|
||||
Result := -1;
|
||||
// Result := FValueList.IndexOf(FValue);
|
||||
end;
|
||||
|
||||
procedure TRxColumnFilter.SetColor(const AValue: TColor);
|
||||
@ -6228,10 +6356,14 @@ procedure TRxColumnFilter.SetItemIndex(const AValue: integer);
|
||||
begin
|
||||
if (AValue >= -1) and (AValue < FValueList.Count) then
|
||||
begin
|
||||
if AValue = -1 then
|
||||
{ if AValue = -1 then
|
||||
FValue := ''
|
||||
else
|
||||
FValue := FValueList[AValue];
|
||||
FValue := FValueList[AValue];}
|
||||
CurrentValues.Clear;
|
||||
if AValue > -1 then
|
||||
CurrentValues.Add(FValueList[AValue]);
|
||||
|
||||
FOwner.ColumnChanged;
|
||||
end;
|
||||
end;
|
||||
@ -6244,9 +6376,15 @@ begin
|
||||
FEmptyFont := TFont.Create;
|
||||
FValueList := TStringList.Create;
|
||||
FValueList.Sorted := True;
|
||||
FCurrentValues:=TStringList.Create;
|
||||
FCurrentValues.Sorted:=true;
|
||||
|
||||
FColor := clWhite;
|
||||
FIsNull:=false;
|
||||
FIsAll:=true;
|
||||
{ FIsNull:=false;
|
||||
FIsAll:=true;}
|
||||
State:=rxfsAll;
|
||||
Style:=rxfstSimple;
|
||||
// FTopRecord:=10;
|
||||
|
||||
FEmptyFont.Style := [fsItalic];
|
||||
FEmptyValue := sRxDBGridEmptiFilter;
|
||||
@ -6259,6 +6397,7 @@ begin
|
||||
FreeAndNil(FFont);
|
||||
FreeAndNil(FEmptyFont);
|
||||
FreeAndNil(FValueList);
|
||||
FreeAndNil(FCurrentValues);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
@ -6416,6 +6555,12 @@ end;
|
||||
|
||||
initialization
|
||||
RegisterPropertyToSkip( TRxDBGrid, 'AllowedOperations', 'This property duplicated standart DBGrid.Options', '');
|
||||
RegisterPropertyToSkip( TRxColumnFilter, 'IsNull', 'depricated property', '');
|
||||
RegisterPropertyToSkip( TRxColumnFilter, 'IsAll', 'depricated property', '');
|
||||
RegisterPropertyToSkip( TRxColumnFilter, 'Value', 'depricated property', '');
|
||||
|
||||
{ FRxColumn.Filter.IsNull:=true;
|
||||
FRxColumn.Filter.IsAll:=false;}
|
||||
|
||||
//{$I rxdbgrid.lrs}
|
||||
// {$I rx_markerdown.lrs}
|
||||
|
318
components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.lfm
Normal file
318
components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.lfm
Normal file
@ -0,0 +1,318 @@
|
||||
object RxDBGrid_PopUpFilterForm: TRxDBGrid_PopUpFilterForm
|
||||
Left = 525
|
||||
Height = 448
|
||||
Top = 284
|
||||
Width = 279
|
||||
Caption = 'RxDBGrid_PopUpFilterForm'
|
||||
ClientHeight = 448
|
||||
ClientWidth = 279
|
||||
KeyPreview = True
|
||||
OnClose = FormClose
|
||||
OnKeyDown = FormKeyDown
|
||||
ShowHint = True
|
||||
LCLVersion = '1.9.0.0'
|
||||
object SpeedButton1: TSpeedButton
|
||||
Tag = 1
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = DividerBevel1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 24
|
||||
Top = 20
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'Ascending'
|
||||
Flat = True
|
||||
OnClick = SpeedButton1Click
|
||||
end
|
||||
object SpeedButton2: TSpeedButton
|
||||
Tag = -1
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SpeedButton1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 22
|
||||
Top = 44
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Caption = 'Descending'
|
||||
Flat = True
|
||||
OnClick = SpeedButton1Click
|
||||
end
|
||||
object DividerBevel1: TDividerBevel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 20
|
||||
Top = 0
|
||||
Width = 279
|
||||
Caption = 'Sorting'
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object DividerBevel2: TDividerBevel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SpeedButton2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 20
|
||||
Top = 66
|
||||
Width = 279
|
||||
Caption = 'Quick Filter'
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object SpeedButton3: TSpeedButton
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = DividerBevel2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 24
|
||||
Top = 86
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'Clear filter'
|
||||
Flat = True
|
||||
OnClick = SpeedButton3Click
|
||||
end
|
||||
object SpeedButton4: TSpeedButton
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SpeedButton3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 24
|
||||
Top = 110
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'Empty values'
|
||||
Flat = True
|
||||
OnClick = SpeedButton4Click
|
||||
end
|
||||
object SpeedButton5: TSpeedButton
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SpeedButton4
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 24
|
||||
Top = 134
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'Not empty'
|
||||
Flat = True
|
||||
OnClick = SpeedButton5Click
|
||||
end
|
||||
object DividerBevel3: TDividerBevel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SpeedButton5
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 20
|
||||
Top = 158
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object SpeedButton6: TSpeedButton
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = DividerBevel3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 24
|
||||
Top = 178
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'Standart filter'
|
||||
Flat = True
|
||||
OnClick = SpeedButton6Click
|
||||
end
|
||||
object CheckListBox1: TCheckListBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SpeedButton6
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = SpeedButton8
|
||||
Left = 0
|
||||
Height = 150
|
||||
Top = 202
|
||||
Width = 279
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Bottom = 6
|
||||
ItemHeight = 0
|
||||
OnClickCheck = CheckListBox1ClickCheck
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
end
|
||||
object ButtonPanel1: TButtonPanel
|
||||
Left = 6
|
||||
Height = 46
|
||||
Top = 396
|
||||
Width = 267
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.DefaultCaption = True
|
||||
HelpButton.Name = 'HelpButton'
|
||||
HelpButton.DefaultCaption = True
|
||||
CloseButton.Name = 'CloseButton'
|
||||
CloseButton.DefaultCaption = True
|
||||
CancelButton.Name = 'CancelButton'
|
||||
CancelButton.DefaultCaption = True
|
||||
TabOrder = 1
|
||||
ShowButtons = [pbOK, pbCancel]
|
||||
end
|
||||
object SpeedButton8: TSpeedButton
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ButtonPanel1
|
||||
Left = 241
|
||||
Height = 32
|
||||
Hint = 'Hide only current item'
|
||||
Top = 358
|
||||
Width = 32
|
||||
Anchors = [akRight, akBottom]
|
||||
BorderSpacing.Right = 6
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000BDBF
|
||||
BFFF8F9392FFC2C5C4FF00000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000969B
|
||||
99FFB9BCBBFF8D918FFFC4C6C5FF000000000000000000000000B2B5B4FF858A
|
||||
88FF858A88FF858A88FF858A88FF858A88FF858A88FFB0B2B1FF000000000000
|
||||
000000000000C6C8C8FFB5B8B7FF000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000C1C4
|
||||
C3FF8F9392FFC7CAC9FF00000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000969A
|
||||
99FFB9BCBBFF8D918FFFC9CBCBFF000000000000000000000000B5B7B6FF858A
|
||||
88FF858A88FF858A88FF858A88FF858A88FF858A88FFB2B4B3FF000000000000
|
||||
000000000000C9CCCBFFB6B9B8FF000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000196B
|
||||
D0FF005CCEFF1B6CD0FF000000000000000000000000000000006B9BD7FF0A62
|
||||
CFFF005CCEFF005CCEFF005CCEFF005CCEFF0961CFFF6598D7FF00000000065F
|
||||
CEFF00000000005CCEFF00000000000000000000000000000000055FCEFFBECE
|
||||
E0FF00000000000000000000000000000000C4D1E0FF045FCFFF00000000196B
|
||||
D0FF005CCEFF1B6DD1FF000000000000000000000000000000006B9CD8FF0A62
|
||||
CFFF005CCEFF005CCEFF005CCEFF005CCEFF0961CFFF6598D7FF000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = SpeedButton9Click
|
||||
end
|
||||
object SpeedButton9: TSpeedButton
|
||||
Tag = 1
|
||||
AnchorSideTop.Control = SpeedButton8
|
||||
AnchorSideRight.Control = SpeedButton8
|
||||
AnchorSideBottom.Control = SpeedButton8
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 203
|
||||
Height = 32
|
||||
Hint = 'Show only current item'
|
||||
Top = 358
|
||||
Width = 32
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
BorderSpacing.Right = 6
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000009195
|
||||
93FF878C8AFF919593FF00000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000878C
|
||||
8AFFDADBDBFF878C8AFF00000000000000000000000000000000969A98FF858A
|
||||
88FF858A88FF858A88FF858A88FF858A88FF858A88FF929695FF000000008F95
|
||||
93FF878C8AFF8F9593FF00000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000009296
|
||||
94FF878C8AFF929694FF00000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000878C
|
||||
8AFFDEDFDFFF878C8AFF00000000000000000000000000000000979B99FF858A
|
||||
88FF858A88FF858A88FF858A88FF858A88FF858A88FF939796FF000000009095
|
||||
93FF878C8AFF909593FF00000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000B7C9
|
||||
DEFF2874D2FF9DB9DBFF00000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000BCCCDFFF1D77
|
||||
D9FF47ACF5FF207DDCFFA2BDDCFF0000000000000000000000006499D8FF0661
|
||||
CFFF005CCEFF005CCEFF005CCEFF005CCEFF0B64D0FF7DA7DAFF72A9E0FF45AF
|
||||
F8FF95CAEFFF48B0F9FF1F7BDBFFA8C0DDFF00000000D6DCE2FF045FCFFF35A3
|
||||
F5FF3EAFFCFF3EAFFCFF3EAFFCFF3EAFFCFF2D98EFFF0E66D0FF99CCEEFFB3D4
|
||||
EAFF00000000BDD7E8FF48B0F9FF1E79DAFFABC2DEFF000000005D96D9FF0560
|
||||
D0FF005CCEFF005CCEFF005CCEFF005CCEFF0962D0FF77A4DAFF000000000000
|
||||
00000000000000000000BCD7E9FF49B1F9FF6FA8E1FF00000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000BBD8EBFF65BCF7FF00000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = SpeedButton9Click
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = SpeedButton9
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 24
|
||||
Top = 362
|
||||
Width = 88
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'All values'
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 2
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 64
|
||||
Top = 272
|
||||
object MenuItem1: TMenuItem
|
||||
Tag = 1
|
||||
Caption = 'Check all'
|
||||
OnClick = MenuItem1Click
|
||||
end
|
||||
object MenuItem3: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object MenuItem2: TMenuItem
|
||||
Caption = 'Unchec all'
|
||||
OnClick = MenuItem1Click
|
||||
end
|
||||
end
|
||||
end
|
283
components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.pas
Normal file
283
components/rx/trunk/rxdb/rxdbgrid_popupfilterunit.pas
Normal file
@ -0,0 +1,283 @@
|
||||
{ rxdbgrid unit
|
||||
|
||||
Copyright (C) 2005-2017 Lagunov Aleksey alexs75@yandex.ru and Lazarus team
|
||||
original conception from rx library for Delphi (c)
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version with the following modification:
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,and
|
||||
to copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the terms
|
||||
and conditions of the license of that module. An independent module is a
|
||||
module which is not derived from or based on this library. If you modify
|
||||
this library, you may extend this exception to your version of the library,
|
||||
but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
}
|
||||
|
||||
{$I rx.inc}
|
||||
|
||||
unit RxDBGrid_PopUpFilterUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, DividerBevel, ListFilterEdit, Forms, Controls,
|
||||
Graphics, Dialogs, Buttons, ComCtrls, CheckLst, ButtonPanel, StdCtrls, Menus,
|
||||
rxdbgrid;
|
||||
|
||||
type
|
||||
|
||||
{ TRxDBGrid_PopUpFilterForm }
|
||||
|
||||
TRxDBGrid_PopUpFilterForm = class(TForm)
|
||||
ButtonPanel1: TButtonPanel;
|
||||
CheckBox1: TCheckBox;
|
||||
CheckListBox1: TCheckListBox;
|
||||
DividerBevel1: TDividerBevel;
|
||||
DividerBevel2: TDividerBevel;
|
||||
DividerBevel3: TDividerBevel;
|
||||
MenuItem1: TMenuItem;
|
||||
MenuItem2: TMenuItem;
|
||||
MenuItem3: TMenuItem;
|
||||
PopupMenu1: TPopupMenu;
|
||||
SpeedButton1: TSpeedButton;
|
||||
SpeedButton2: TSpeedButton;
|
||||
SpeedButton3: TSpeedButton;
|
||||
SpeedButton4: TSpeedButton;
|
||||
SpeedButton5: TSpeedButton;
|
||||
SpeedButton6: TSpeedButton;
|
||||
SpeedButton8: TSpeedButton;
|
||||
SpeedButton9: TSpeedButton;
|
||||
procedure CheckBox1Change(Sender: TObject);
|
||||
procedure CheckListBox1ClickCheck(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure MenuItem1Click(Sender: TObject);
|
||||
procedure SpeedButton1Click(Sender: TObject);
|
||||
procedure SpeedButton3Click(Sender: TObject);
|
||||
procedure SpeedButton4Click(Sender: TObject);
|
||||
procedure SpeedButton5Click(Sender: TObject);
|
||||
procedure SpeedButton6Click(Sender: TObject);
|
||||
procedure SpeedButton9Click(Sender: TObject);
|
||||
private
|
||||
FRxDBGrid:TRxDBGrid;
|
||||
FRxColumn: TRxColumn;
|
||||
procedure UpdateChList;
|
||||
procedure Localize;
|
||||
public
|
||||
constructor CreatePopUpFilterForm(ARxColumn: TRxColumn);
|
||||
end;
|
||||
|
||||
implementation
|
||||
uses LCLType, rxdconst;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TRxDBGrid_PopUpFilterForm }
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.SpeedButton1Click(Sender: TObject);
|
||||
begin
|
||||
if TComponent(Sender).Tag > 0 then
|
||||
FRxColumn.SortOrder:=smUp
|
||||
else
|
||||
if TComponent(Sender).Tag < 0 then
|
||||
FRxColumn.SortOrder:=smDown
|
||||
else
|
||||
FRxColumn.SortOrder:=smNone;
|
||||
FRxDBGrid.SetSort([FRxColumn.FieldName], [FRxColumn.SortOrder], true);
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.SpeedButton3Click(Sender: TObject);
|
||||
begin
|
||||
FRxColumn.Filter.State:=rxfsAll;
|
||||
FRxColumn.Filter.CurrentValues.Clear;
|
||||
FRxDBGrid.DataSource.DataSet.Filtered := True;
|
||||
FRxDBGrid.DataSource.DataSet.First;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.SpeedButton4Click(Sender: TObject);
|
||||
begin
|
||||
FRxColumn.Filter.State:=rxfsEmpty;
|
||||
FRxDBGrid.DataSource.DataSet.Filtered := True;
|
||||
FRxDBGrid.DataSource.DataSet.First;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.SpeedButton5Click(Sender: TObject);
|
||||
begin
|
||||
FRxColumn.Filter.State:=rxfsNonEmpty;
|
||||
FRxDBGrid.DataSource.DataSet.Filtered := True;
|
||||
FRxDBGrid.DataSource.DataSet.First;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.SpeedButton6Click(Sender: TObject);
|
||||
begin
|
||||
Hide;
|
||||
Close;
|
||||
FRxDBGrid.ShowFilterDialog;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.SpeedButton9Click(Sender: TObject);
|
||||
var
|
||||
K, i: Integer;
|
||||
begin
|
||||
K:=CheckListBox1.ItemIndex;
|
||||
if K < 0 then
|
||||
K:=0;
|
||||
|
||||
for i:=0 to CheckListBox1.Items.Count-1 do
|
||||
if i = k then
|
||||
CheckListBox1.Checked[i]:=TComponent(Sender).Tag > 0
|
||||
else
|
||||
CheckListBox1.Checked[i]:=TComponent(Sender).Tag = 0;
|
||||
CheckListBox1ClickCheck(nil);
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.UpdateChList;
|
||||
var
|
||||
i: Integer;
|
||||
S: String;
|
||||
begin
|
||||
CheckListBox1.Items.BeginUpdate;
|
||||
CheckListBox1.Items.Clear;
|
||||
for i:=0 to FRxColumn.Filter.ValueList.Count - 1 do
|
||||
begin
|
||||
S:=FRxColumn.Filter.ValueList[i];
|
||||
if (S <> FRxColumn.Filter.AllValue) and (S <> FRxColumn.Filter.EmptyValue) then
|
||||
CheckListBox1.Checked[CheckListBox1.Items.Add(S)]:=FRxColumn.Filter.CurrentValues.IndexOf(S) >= 0;
|
||||
end;
|
||||
|
||||
CheckListBox1ClickCheck(nil);
|
||||
|
||||
CheckListBox1.Items.EndUpdate;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.Localize;
|
||||
begin
|
||||
DividerBevel1.Caption:=sSorting;
|
||||
SpeedButton1.Caption:=sAscending;
|
||||
SpeedButton2.Caption:=sAscending;
|
||||
DividerBevel2.Caption:=sQuickFilter;
|
||||
SpeedButton3.Caption:=sClearFilter;
|
||||
SpeedButton4.Caption:=sEmptyValues;
|
||||
SpeedButton5.Caption:=sNotEmpty;
|
||||
SpeedButton6.Caption:=sStandartFilter;
|
||||
CheckBox1.Caption:=sAllValues;
|
||||
SpeedButton9.Hint:=sHintShowOnlyCurrentItem;
|
||||
SpeedButton8.Hint:=sHintHideOnlyCurrentItem;
|
||||
end;
|
||||
|
||||
constructor TRxDBGrid_PopUpFilterForm.CreatePopUpFilterForm(ARxColumn: TRxColumn
|
||||
);
|
||||
begin
|
||||
inherited Create(ARxColumn.Grid);
|
||||
BorderStyle:=bsNone;
|
||||
FRxColumn:=ARxColumn;
|
||||
FRxDBGrid:=FRxColumn.Grid as TRxDBGrid;
|
||||
Localize;
|
||||
UpdateChList;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Key = VK_ESCAPE then
|
||||
ModalResult:=mrCancel;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.MenuItem1Click(Sender: TObject);
|
||||
begin
|
||||
CheckBox1.Checked:=TComponent(Sender).Tag = 1;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.CheckBox1Change(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i:=0 to CheckListBox1.Items.Count - 1 do
|
||||
CheckListBox1.Checked[i]:=CheckBox1.Checked;
|
||||
CheckListBox1ClickCheck(nil);
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.CheckListBox1ClickCheck(Sender: TObject);
|
||||
var
|
||||
AC, AU: Boolean;
|
||||
i: Integer;
|
||||
begin
|
||||
AC:=true;
|
||||
AU:=true;
|
||||
for i:=0 to CheckListBox1.Items.Count-1 do
|
||||
begin
|
||||
if not CheckListBox1.Checked[i] then
|
||||
AC:=false;
|
||||
if CheckListBox1.Checked[i] then
|
||||
AU:=false;
|
||||
end;
|
||||
|
||||
if AC then
|
||||
CheckBox1.Checked:=true
|
||||
else
|
||||
if AU then
|
||||
CheckBox1.Checked:=false
|
||||
else
|
||||
CheckBox1.State:=cbGrayed;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid_PopUpFilterForm.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if ModalResult = mrOk then
|
||||
begin
|
||||
if CheckBox1.Checked then
|
||||
begin
|
||||
FRxColumn.Filter.State:=rxfsAll;
|
||||
FRxColumn.Filter.CurrentValues.Assign(CheckListBox1.Items);
|
||||
end
|
||||
else
|
||||
if CheckBox1.State = cbUnchecked then
|
||||
begin
|
||||
FRxColumn.Filter.State:=rxfsAll;
|
||||
FRxColumn.Filter.CurrentValues.Clear;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FRxColumn.Filter.CurrentValues.BeginUpdate;
|
||||
FRxColumn.Filter.CurrentValues.Clear;
|
||||
for i:=0 to CheckListBox1.Items.Count-1 do
|
||||
if CheckListBox1.Checked[i] then
|
||||
FRxColumn.Filter.CurrentValues.Add(CheckListBox1.Items[i]);
|
||||
FRxColumn.Filter.CurrentValues.EndUpdate;
|
||||
if (FRxColumn.Filter.CurrentValues.Count > 0) then
|
||||
FRxColumn.Filter.State:=rxfsFilter
|
||||
else
|
||||
FRxColumn.Filter.State:=rxfsAll;
|
||||
end;
|
||||
FRxDBGrid.DataSource.DataSet.Filtered := True;
|
||||
FRxDBGrid.DataSource.DataSet.First;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
@ -23,11 +23,10 @@
|
||||
</CompilerOptions>
|
||||
<Description Value="Delphi VCL Extensions (RX)
|
||||
Copyright (c) 1998 Master-Bank
|
||||
translate to Lazarus by alexs in 2005 - 2016
|
||||
"/>
|
||||
translate to Lazarus by alexs in 2005 - 2017"/>
|
||||
<License Value="LGPL"/>
|
||||
<Version Major="2" Minor="9" Release="5" Build="201"/>
|
||||
<Files Count="69">
|
||||
<Version Major="2" Minor="9" Release="6" Build="203"/>
|
||||
<Files Count="70">
|
||||
<Item1>
|
||||
<Filename Value="registerrx.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
@ -307,6 +306,10 @@ translate to Lazarus by alexs in 2005 - 2016
|
||||
<Filename Value="rxcontrols\rxtooledit.pas"/>
|
||||
<UnitName Value="rxtooledit"/>
|
||||
</Item69>
|
||||
<Item70>
|
||||
<Filename Value="rxdb\rxdbgrid_popupfilterunit.pas"/>
|
||||
<UnitName Value="RxDBGrid_PopUpFilterUnit"/>
|
||||
</Item70>
|
||||
</Files>
|
||||
<LazDoc Paths="docs;\usr\local\share\lazarus\components\rxnew\docs"/>
|
||||
<i18n>
|
||||
|
@ -20,7 +20,7 @@ uses
|
||||
rxsortmemds, rxdice, rxduallist, rxfduallst, rxfolderlister, RXHistory,
|
||||
RxIniPropStorage, rxlclconst, rxlogin, RxMDI, rxpagemngr, rxpickdate,
|
||||
rxShortCutUnit, rxspin, rxswitch, RxSystemServices, rxtbrsetup, RxTimeEdit,
|
||||
rxtoolbar, rxtooledit, LazarusPackageIntf;
|
||||
rxtoolbar, rxtooledit, RxDBGrid_PopUpFilterUnit, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
<Description Value="
|
||||
"/>
|
||||
<License Value="LGPL"/>
|
||||
<Version Minor="2" Build="4"/>
|
||||
<Version Minor="3" Build="6"/>
|
||||
<Files Count="8">
|
||||
<Item1>
|
||||
<Filename Value="rxtools/rxcrc.pas"/>
|
||||
@ -49,6 +49,11 @@
|
||||
</Item8>
|
||||
</Files>
|
||||
<LazDoc Paths="docs;/usr/local/share/lazarus/components/rxnew/docs"/>
|
||||
<i18n>
|
||||
<EnableI18N Value="True"/>
|
||||
<OutDir Value="languages"/>
|
||||
<EnableI18NForLFM Value="True"/>
|
||||
</i18n>
|
||||
<RequiredPkgs Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="FCL"/>
|
||||
|
@ -233,6 +233,19 @@ resourcestring
|
||||
sOtherOptions = 'Other options';
|
||||
sFooterRowColor = 'Footer row color';
|
||||
|
||||
//TRxDBGrid_PopUpFilterForm
|
||||
sHintShowOnlyCurrentItem = 'Show only current item';
|
||||
sHintHideOnlyCurrentItem = 'Hide only current item';
|
||||
|
||||
sSorting = 'Sorting';
|
||||
sAscending = 'Ascending';
|
||||
sDescending = 'Descending';
|
||||
sQuickFilter = 'Quick filter';
|
||||
sClearFilter = 'Clear filter';
|
||||
sEmptyValues = 'Empty values';
|
||||
sNotEmpty = 'Not empty';
|
||||
sStandartFilter = 'Standart filter';
|
||||
sAllValues = 'All values';
|
||||
|
||||
|
||||
const
|
||||
|
Reference in New Issue
Block a user