RxFPC:RxLockupCombo - new property for lockup list - KeyList and PickList

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6745 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2018-12-05 10:28:46 +00:00
parent f474ac55d6
commit 8743258b2d
24 changed files with 644 additions and 7293 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@@ -0,0 +1,80 @@
<?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="3">
<Item1>
<PackageName Value="FCL"/>
</Item1>
<Item2>
<PackageName Value="rxnew"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="2">
<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>
</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>

View 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
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,226 @@
object Form1: TForm1
Left = 405
Height = 631
Top = 232
Width = 1094
Caption = 'Form1'
ClientHeight = 631
ClientWidth = 1094
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.9.0.0'
object Panel1: TPanel
Left = 0
Height = 66
Top = 0
Width = 1094
Align = alTop
ClientHeight = 66
ClientWidth = 1094
TabOrder = 0
object CheckBox1: TCheckBox
Left = 8
Height = 24
Top = 8
Width = 97
Caption = 'CheckBox1'
Checked = True
OnChange = CheckBox1Change
State = cbChecked
TabOrder = 0
end
end
object RxDBGrid1: TRxDBGrid
Left = 0
Height = 565
Top = 66
Width = 1094
ColumnDefValues.BlobText = '(данные)'
TitleButtons = True
AutoSort = True
Columns = <
item
Title.Alignment = taCenter
Title.Orientation = toHorizontal
Title.Caption = 'ID'
Width = 60
FieldName = 'ID'
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Пусто)'
Filter.AllValue = '(Все значения)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
Footers = <>
end
item
Title.Alignment = taCenter
Title.Orientation = toHorizontal
Title.Caption = 'NAME'
Width = 264
FieldName = 'NAME'
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Пусто)'
Filter.AllValue = '(Все значения)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
Footers = <>
end
item
Title.Alignment = taCenter
Title.Orientation = toHorizontal
Title.Caption = 'SUM'
Width = 164
FieldName = 'SUM'
EditButtons = <>
Filter.DropDownRows = 0
Filter.EmptyValue = '(Пусто)'
Filter.AllValue = '(Все значения)'
Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1
Footer.Alignment = taRightJustify
Footer.FieldName = 'SUM'
Footer.ValueType = fvtSum
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.Active = True
FooterOptions.Color = clYellow
FooterOptions.RowCount = 1
FooterOptions.DrawFullLine = True
SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey]
SearchOptions.FromStart = False
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFooterRows, rdgAllowQuickFilter, rdgAllowToolMenu]
FooterColor = clYellow
FooterRowCount = 1
Align = alClient
Color = clWindow
DrawFullLine = True
FocusColor = clRed
SelectedColor = clHighlight
GridLineStyle = psSolid
DataSource = DataSource1
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgHeaderPushedLook]
TabOrder = 1
end
object DataSource1: TDataSource
DataSet = RxMemoryData1
Left = 456
Top = 560
end
object RxMemoryData1: TRxMemoryData
FieldDefs = <
item
Name = 'ID'
DataType = ftInteger
Precision = -1
end
item
Name = 'NAME'
DataType = ftString
Precision = -1
Size = 100
end
item
Name = 'SUM'
DataType = ftCurrency
Precision = 2
end>
PacketRecords = 0
Left = 536
Top = 560
object RxMemoryData1ID: TLongintField
FieldKind = fkData
FieldName = 'ID'
Index = 0
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
end
object RxMemoryData1NAME: TStringField
FieldKind = fkData
FieldName = 'NAME'
Index = 1
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
Size = 100
end
object RxMemoryData1SUM: TCurrencyField
FieldKind = fkData
FieldName = 'SUM'
Index = 2
LookupCache = False
ProviderFlags = [pfInUpdate, pfInWhere]
ReadOnly = False
Required = False
MaxValue = 0
MinValue = 0
Precision = 2
end
end
object RxDBGridFooterTools1: TRxDBGridFooterTools
RxDBGrid = RxDBGrid1
Caption = 'Всего строк'
Left = 240
Top = 560
end
end

View File

@@ -0,0 +1,57 @@
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, rxdbgrid, rxmemds, RxDBGridFooterTools,
RxDBGridExportPdf, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, db;
type
{ TForm1 }
TForm1 = class(TForm)
CheckBox1: TCheckBox;
DataSource1: TDataSource;
Panel1: TPanel;
RxDBGrid1: TRxDBGrid;
RxDBGridFooterTools1: TRxDBGridFooterTools;
RxMemoryData1: TRxMemoryData;
RxMemoryData1ID: TLongintField;
RxMemoryData1NAME: TStringField;
RxMemoryData1SUM: TCurrencyField;
procedure CheckBox1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
RxMemoryData1.Open;
for i:=1 to 50 do
RxMemoryData1.AppendRecord([I, 'Line '+IntToStr(i), Random(1000)]);
end;
procedure TForm1.CheckBox1Change(Sender: TObject);
begin
RxDBGrid1.FooterOptions.Active:=CheckBox1.Checked;
end;
end.