Стартовый пул
This commit is contained in:
BIN
RXLib/demos/rxdbgrid/WordWrap/WordWrapDemo.ico
Normal file
BIN
RXLib/demos/rxdbgrid/WordWrap/WordWrapDemo.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
80
RXLib/demos/rxdbgrid/WordWrap/WordWrapDemo.lpi
Normal file
80
RXLib/demos/rxdbgrid/WordWrap/WordWrapDemo.lpi
Normal 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="WordWrapDemo"/>
|
||||
<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="WordWrapDemo.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="WordWrapDemo"/>
|
||||
</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
RXLib/demos/rxdbgrid/WordWrap/WordWrapDemo.lpr
Normal file
21
RXLib/demos/rxdbgrid/WordWrap/WordWrapDemo.lpr
Normal file
@@ -0,0 +1,21 @@
|
||||
program WordWrapDemo;
|
||||
|
||||
{$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.
|
||||
|
230
RXLib/demos/rxdbgrid/WordWrap/unit1.lfm
Normal file
230
RXLib/demos/rxdbgrid/WordWrap/unit1.lfm
Normal file
@@ -0,0 +1,230 @@
|
||||
object Form1: TForm1
|
||||
Left = 585
|
||||
Height = 610
|
||||
Top = 311
|
||||
Width = 874
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 610
|
||||
ClientWidth = 874
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '1.9.0.0'
|
||||
object RxDBGrid1: TRxDBGrid
|
||||
Left = 0
|
||||
Height = 560
|
||||
Top = 50
|
||||
Width = 874
|
||||
ColumnDefValues.BlobText = '(данные)'
|
||||
TitleButtons = False
|
||||
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
|
||||
Footer.Value = 'Current:'
|
||||
Footer.ValueType = fvtStaticText
|
||||
Footers = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'NAME'
|
||||
Width = 350
|
||||
FieldName = 'NAME'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Пусто)'
|
||||
Filter.AllValue = '(Все значения)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footer.FieldName = 'NAME'
|
||||
Footer.ValueType = fvtFieldValue
|
||||
Footers = <>
|
||||
WordWrap = True
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'CODE'
|
||||
Width = 90
|
||||
FieldName = 'CODE'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Пусто)'
|
||||
Filter.AllValue = '(Все значения)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footer.Alignment = taRightJustify
|
||||
Footer.FieldName = 'CODE'
|
||||
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
|
||||
OnCalcRowHeight = RxDBGrid1CalcRowHeight
|
||||
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFooterRows, rdgAllowQuickFilter]
|
||||
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]
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 50
|
||||
Top = 0
|
||||
Width = 874
|
||||
Align = alTop
|
||||
Caption = 'Panel1'
|
||||
ClientHeight = 50
|
||||
ClientWidth = 874
|
||||
TabOrder = 1
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 16
|
||||
Height = 24
|
||||
Top = 8
|
||||
Width = 96
|
||||
Caption = 'Word wrap'
|
||||
Checked = True
|
||||
OnChange = CheckBox1Change
|
||||
State = cbChecked
|
||||
TabOrder = 0
|
||||
end
|
||||
object CheckBox2: TCheckBox
|
||||
Left = 152
|
||||
Height = 24
|
||||
Top = 8
|
||||
Width = 105
|
||||
Caption = 'Show footer'
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = RxMemoryData1
|
||||
Left = 328
|
||||
Top = 134
|
||||
end
|
||||
object RxMemoryData1: TRxMemoryData
|
||||
FieldDefs = <
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = ftInteger
|
||||
end
|
||||
item
|
||||
Name = 'NAME'
|
||||
DataType = ftString
|
||||
Size = 500
|
||||
end
|
||||
item
|
||||
Name = 'CODE'
|
||||
DataType = ftInteger
|
||||
end>
|
||||
PacketRecords = 0
|
||||
Left = 360
|
||||
Top = 134
|
||||
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 = 500
|
||||
end
|
||||
object RxMemoryData1CODE: TLongintField
|
||||
FieldKind = fkData
|
||||
FieldName = 'CODE'
|
||||
Index = 2
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
end
|
||||
end
|
||||
end
|
99
RXLib/demos/rxdbgrid/WordWrap/unit1.pas
Normal file
99
RXLib/demos/rxdbgrid/WordWrap/unit1.pas
Normal file
@@ -0,0 +1,99 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, rxdbgrid, rxmemds, Forms,
|
||||
Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, db;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
CheckBox1: TCheckBox;
|
||||
CheckBox2: TCheckBox;
|
||||
DataSource1: TDataSource;
|
||||
Panel1: TPanel;
|
||||
RxDBGrid1: TRxDBGrid;
|
||||
RxMemoryData1: TRxMemoryData;
|
||||
RxMemoryData1CODE: TLongintField;
|
||||
RxMemoryData1ID: TLongintField;
|
||||
RxMemoryData1NAME: TStringField;
|
||||
procedure CheckBox1Change(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure RxDBGrid1CalcRowHeight(Sender: TRxDBGrid; var ARowHegth: integer);
|
||||
private
|
||||
procedure FillTestDatabase;
|
||||
public
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
CheckBox1.OnChange := nil;
|
||||
CheckBox2.OnChange := nil;
|
||||
|
||||
CheckBox1.Checked := rdgWordWrap in RxDBGrid1.OptionsRx;
|
||||
CheckBox2.Checked := RxDBGrid1.FooterOptions.Active;
|
||||
|
||||
CheckBox1.OnChange := @CheckBox1Change;
|
||||
CheckBox2.OnChange := @CheckBox1Change;
|
||||
|
||||
RxMemoryData1.Open;
|
||||
FillTestDatabase;
|
||||
end;
|
||||
|
||||
procedure TForm1.RxDBGrid1CalcRowHeight(Sender: TRxDBGrid;
|
||||
var ARowHegth: integer);
|
||||
begin
|
||||
if RxMemoryData1ID.AsInteger mod 10 = 0 then
|
||||
ARowHegth:=ARowHegth + 1;
|
||||
end;
|
||||
|
||||
procedure TForm1.FillTestDatabase;
|
||||
var
|
||||
F:TextFile;
|
||||
S:string;
|
||||
I:integer;
|
||||
begin
|
||||
AssignFile(F, 'unit1.pas');
|
||||
Reset(F);
|
||||
I:=0;
|
||||
while not Eof(F) do
|
||||
begin
|
||||
Readln(F, S);
|
||||
if Trim(S)<>'' then
|
||||
begin
|
||||
RxMemoryData1.AppendRecord([i, S, i]);
|
||||
Inc(i);
|
||||
end;
|
||||
end;
|
||||
CloseFile(F);
|
||||
RxMemoryData1.First;
|
||||
end;
|
||||
|
||||
procedure TForm1.CheckBox1Change(Sender: TObject);
|
||||
begin
|
||||
if CheckBox1.Checked then
|
||||
RxDBGrid1.OptionsRx := RxDBGrid1.OptionsRx + [rdgWordWrap]
|
||||
else
|
||||
RxDBGrid1.OptionsRx := RxDBGrid1.OptionsRx - [rdgWordWrap];
|
||||
|
||||
RxDBGrid1.FooterOptions.Active := CheckBox2.Checked;
|
||||
|
||||
RxMemoryData1.First;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user