fix error in rxdbgrid title draw

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@881 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2009-06-29 16:01:00 +00:00
parent ae486ffc8b
commit d4075cf58c
12 changed files with 590 additions and 324 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@ -8,12 +8,19 @@
</Flags> </Flags>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<TargetFileExt Value=".exe"/> <TargetFileExt Value=".exe"/>
<Title Value="RxDBGrid demo"/>
<Icon Value="0"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="0"/> <ActiveEditorIndexAtStart Value="0"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <UseVersionInfo Value="True"/>
<Language Value=""/> <CurrentVersionNr Value="3"/>
<CharSet Value=""/> <CurrentMajorRevNr Value="1"/>
<CurrentMinorRevNr Value="1"/>
<ProjectVersion Value="3.1.1.0"/>
<FileDescription Value="Demo application from RXFPC library"/>
<LegalCopyright Value="Lagunov Aleksey, GPL 2"/>
</VersionInfo> </VersionInfo>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
@ -40,25 +47,25 @@
<MinVersion Major="1" Release="18" Build="56" Valid="True"/> <MinVersion Major="1" Release="18" Build="56" Valid="True"/>
</Item3> </Item3>
</RequiredPackages> </RequiredPackages>
<Units Count="10"> <Units Count="14">
<Unit0> <Unit0>
<Filename Value="RxDBGridDemo.lpr"/> <Filename Value="RxDBGridDemo.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="RxDBGridDemo"/> <UnitName Value="RxDBGridDemo"/>
<CursorPos X="3" Y="11"/> <CursorPos X="3" Y="11"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="24"/> <UsageCount Value="26"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="rxdbgridmainunit.pas"/> <Filename Value="rxdbgridmainunit.pas"/>
<ComponentName Value="RxDBGridMainForm"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="RxDBGridMainForm"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="RxDBGridMainUnit"/> <UnitName Value="RxDBGridMainUnit"/>
<CursorPos X="24" Y="53"/> <CursorPos X="26" Y="118"/>
<TopLine Value="127"/> <TopLine Value="77"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="24"/> <UsageCount Value="26"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
@ -84,11 +91,11 @@
<Unit5> <Unit5>
<Filename Value="../../rxdbgrid.pas"/> <Filename Value="../../rxdbgrid.pas"/>
<UnitName Value="rxdbgrid"/> <UnitName Value="rxdbgrid"/>
<CursorPos X="13" Y="626"/> <CursorPos X="6" Y="467"/>
<TopLine Value="608"/> <TopLine Value="462"/>
<UsageCount Value="12"/> <UsageCount Value="12"/>
<Bookmarks Count="1"> <Bookmarks Count="1">
<Item0 X="3" Y="1444" ID="1"/> <Item0 X="3" Y="1446" ID="1"/>
</Bookmarks> </Bookmarks>
</Unit5> </Unit5>
<Unit6> <Unit6>
@ -117,20 +124,40 @@
<UnitName Value="rxpopupunit"/> <UnitName Value="rxpopupunit"/>
<CursorPos X="15" Y="249"/> <CursorPos X="15" Y="249"/>
<TopLine Value="246"/> <TopLine Value="246"/>
<EditorIndex Value="1"/>
<UsageCount Value="11"/> <UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit9> </Unit9>
<Unit10>
<Filename Value="../../../../lcl/include/wincontrol.inc"/>
<CursorPos X="1" Y="7236"/>
<TopLine Value="7217"/>
<UsageCount Value="10"/>
</Unit10>
<Unit11>
<Filename Value="../../../../lcl/include/control.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit11>
<Unit12>
<Filename Value="../../../../lcl/lclmessageglue.pas"/>
<UnitName Value="LCLMessageGlue"/>
<CursorPos X="46" Y="96"/>
<TopLine Value="92"/>
<UsageCount Value="10"/>
</Unit12>
<Unit13>
<Filename Value="../../../../lcl/controls.pp"/>
<UnitName Value="Controls"/>
<CursorPos X="60" Y="1798"/>
<TopLine Value="1779"/>
<UsageCount Value="10"/>
</Unit13>
</Units> </Units>
<JumpHistory Count="2" HistoryIndex="1"> <JumpHistory Count="1" HistoryIndex="0">
<Position1> <Position1>
<Filename Value="rxdbgridmainunit.pas"/> <Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="52" Column="18" TopLine="9"/> <Caret Line="31" Column="22" TopLine="11"/>
</Position1> </Position1>
<Position2>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="15" Column="4" TopLine="9"/>
</Position2>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -8,9 +8,14 @@ uses
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms, Forms,
LResources,
RxDBGridMainUnit; RxDBGridMainUnit;
{$IFDEF WINDOWS}{$R RxDBGridDemo.rc}{$ENDIF}
begin begin
Application.Title:='RxDBGrid demo';
{$I RxDBGridDemo.lrs}
Application.Initialize; Application.Initialize;
Application.CreateForm(TRxDBGridMainForm, RxDBGridMainForm); Application.CreateForm(TRxDBGridMainForm, RxDBGridMainForm);
Application.Run; Application.Run;

View File

@ -0,0 +1,29 @@
LazarusResources.Add('MAINICON','ICO',[
#0#0#1#0#1#0' '#4#0#0#0#0#0#232#2#0#0#22#0#0#0'('#0#0#0' '#0#0#0'@'#0#0#0#1#0
+#4#0#0#0#0#0#0#2#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128
+#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0#192#192#192
+#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255#0#0#255#255
+#255#0#0#0#0#0#0#0#0#7'wp'#0#0#0#0#0#0#0#0#0#0#0#0'w'#0#0'pw'#0#0#0#0#0#0#0#0
+#0#0#0#7#6'`p'#7'p'#0#0#0#0#0#0#0#0#7#6'`'#6'`'#6'`pp'#0#0#0#0#0#0#0#7#6'fff'
+'f`pw'#0#0#0#0#0#0#0'`'#6'ffff`'#6#7'p'#0#0#0#0#0#6'ffn'#238#238#230'ff`'#0#0
+#0#0#0#0'pfn'#232#136#136#142#230'f'#7'w'#0#0#0#0#0#0'f'#8#136#136#136#136
+#142'f'#0#7'p'#0#0#0#6'f`'#248#136#136#136#136#136#230'f`p'#0#0#0#6'f`'#143
+#136#136#136#136#136#230'f`'#0#0#0#0'pf'#8#248#248#136#136#136#136#142'f'#7
+'w'#0#0#0#0'f'#8#143#143#128#8#136#136#142'f'#0#7#0#0#0'ff'#8#136#248#0#0#136
+#136#142'ff'#7#0#0#0'ff'#8#136#143#7#0#136#136#142'ff'#7#0#0#0#0'f'#8#136#136
+#128#8#136#136#142'f'#0#0#0#0#0#0'f'#8#136#136#136#143#136#136#142'f'#7'p'#0
+#0#0#6'f`'#136#136#136#248#248#136#230'f`p'#0#0#0#6'f`'#136#136#136#143#143
+#136#230'f`'#0#0#0#0#0#0'f'#8#136#136#136#248#142'f'#0#0#0#0#0#0#0#0'f`'#8
+#136#136#128#6'f'#7'p'#0#0#0'ww'#6'ff`'#0#0#6'ff`'#0#0#0#0#0#0#0'`'#6'ffff`'
+#6#0'ww'#0#8#136#135#0#8#6'ffff`'#128#0#0#7'p'#0#0#136'w'#0#0#0#0#0#0#0#0#7
+'wpw'#0#0#8#136'wwwwwwwwx'#0#135#7#0#0#0#136#136#136#136#136#136#136#136#136
+#128#0#8#7#0#0#0#136#136#136#136#136#136#136#136#136#128'p'#8#7#7'w'#8#136
+#255#255#255#255#255#255#255#255#248#0#143#0#0#0#136#255#0#0#0#0#0#0#0#0#15
+#255#240#0#15#255#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#255#254#31#255#255#240#19#255#255#224#1#255#255#128#1''#255#0#0'?'#254#0
+#0#31#252#0#0'?'#252#0#0#15#248#0#0#7#240#0#0#7#240#0#0#15#240#0#0#3#224#0#0
+#3#224#1#128#3#224#0#128#3#224#0#0#7#248#0#0#7#240#0#0#7#240#0#0#15#248#0#0
+#31#254#0#0#31#192#0#0'?'#130#0#0'C'#0#0#0#129#0#0#0#0#240#0#0#0#248#0#0'0'
+#248#0#0#16#128#0#0#1#0#0#0#3#0#255#255#135#131#255#255#255
]);

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="CompanyName.ProductName.YourApp" type="win32"/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -0,0 +1,33 @@
1 VERSIONINFO
FILEVERSION 3,1,1,0
PRODUCTVERSION 3,1,1,0
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "Comments", "\000"
VALUE "CompanyName", "\000"
VALUE "FileDescription", "Demo application from RXFPC library\000"
VALUE "FileVersion", "3.1.1.0\000"
VALUE "InternalName", "\000"
VALUE "LegalCopyright", "Lagunov Aleksey, GPL 2\000"
VALUE "LegalTrademarks", "\000"
VALUE "OriginalFilename", "\000"
VALUE "ProductName", "\000"
VALUE "ProductVersion", "3.1.1.0\000"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 0x04E4
}
}
#define RT_MANIFEST 24
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "RxDBGridDemo.manifest"
MAINICON ICON "RxDBGridDemo.ico"

View File

@ -1,7 +1,7 @@
object RxDBGridMainForm: TRxDBGridMainForm object RxDBGridMainForm: TRxDBGridMainForm
Left = 299 Left = 263
Height = 582 Height = 582
Top = 161 Top = 219
Width = 969 Width = 969
ActiveControl = Panel1 ActiveControl = Panel1
Caption = 'RxDBGrid Demo (ver 3) ...' Caption = 'RxDBGrid Demo (ver 3) ...'
@ -14,8 +14,8 @@ object RxDBGridMainForm: TRxDBGridMainForm
Height = 533 Height = 533
Top = 49 Top = 49
Width = 969 Width = 969
TitleButtons = False TitleButtons = True
AutoSort = False AutoSort = True
Columns = < Columns = <
item item
Title.Alignment = taCenter Title.Alignment = taCenter
@ -29,16 +29,6 @@ object RxDBGridMainForm: TRxDBGridMainForm
Filter.Color = clLime Filter.Color = clLime
Filter.ItemIndex = -1 Filter.ItemIndex = -1
end end
item
Title.Alignment = taCenter
Title.Caption = 'Software Name'
Title.Orientation = toHorizontal
Width = 350
FieldName = 'NAME'
Filter.DropDownRows = 0
Filter.Color = clLime
Filter.ItemIndex = -1
end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
@ -50,7 +40,17 @@ object RxDBGridMainForm: TRxDBGridMainForm
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Cost' Title.Caption = 'Software|Name'
Title.Orientation = toHorizontal
Width = 350
FieldName = 'NAME'
Filter.DropDownRows = 0
Filter.Color = clLime
Filter.ItemIndex = -1
end
item
Title.Alignment = taCenter
Title.Caption = 'Software|Cost'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Width = 90 Width = 90
FieldName = 'PRICE' FieldName = 'PRICE'
@ -65,7 +65,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Date Present' Title.Caption = 'Software|Date Present'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Width = 100 Width = 100
FieldName = 'Date_Present' FieldName = 'Date_Present'
@ -89,10 +89,11 @@ object RxDBGridMainForm: TRxDBGridMainForm
SelectedColor = clHighlight SelectedColor = clHighlight
GridLineStyle = psSolid GridLineStyle = psSolid
DataSource = Datasource1 DataSource = Datasource1
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgTabs, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiselect] Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgTabs, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiselect, dgHeaderPushedLook]
ParentColor = False ParentColor = False
PopupMenu = PopupMenu1 PopupMenu = PopupMenu1
TabOrder = 0 TabOrder = 0
TitleStyle = tsNative
end end
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
@ -137,9 +138,9 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideTop.Control = Button1 AnchorSideTop.Control = Button1
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 275 Left = 275
Height = 22 Height = 21
Top = 13 Top = 14
Width = 81 Width = 80
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'Use filter' Caption = 'Use filter'
OnChange = CheckBox1Change OnChange = CheckBox1Change
@ -288,17 +289,14 @@ object RxDBGridMainForm: TRxDBGridMainForm
top = 197 top = 197
object actCalcTotal: TAction object actCalcTotal: TAction
Caption = 'Calc total...' Caption = 'Calc total...'
DisableIfNoHandler = True
OnExecute = actCalcTotalExecute OnExecute = actCalcTotalExecute
end end
object actOptimizeColumnsWidthAll: TAction object actOptimizeColumnsWidthAll: TAction
Caption = 'Optimize width for all...' Caption = 'Optimize width for all...'
DisableIfNoHandler = True
OnExecute = actOptimizeColumnsWidthAllExecute OnExecute = actOptimizeColumnsWidthAllExecute
end end
object actOptimizeWidthCol1: TAction object actOptimizeWidthCol1: TAction
Caption = 'Optimize width...' Caption = 'Optimize width...'
DisableIfNoHandler = True
OnExecute = actOptimizeWidthCol1Execute OnExecute = actOptimizeWidthCol1Execute
end end
end end

View File

@ -1,110 +1,110 @@
{ ��� - ���� ��������, ������������� ��������� lazarus } { ��� - ���� ��������, ������������� ��������� lazarus }
LazarusResources.Add('TRxDBGridMainForm','FORMDATA',[ LazarusResources.Add('TRxDBGridMainForm','FORMDATA',[
'TPF0'#17'TRxDBGridMainForm'#16'RxDBGridMainForm'#4'Left'#3'+'#1#6'Height'#3 'TPF0'#17'TRxDBGridMainForm'#16'RxDBGridMainForm'#4'Left'#3#7#1#6'Height'#3'F'
+'F'#2#3'Top'#3#161#0#5'Width'#3#201#3#13'ActiveControl'#7#6'Panel1'#7'Captio' +#2#3'Top'#3#219#0#5'Width'#3#201#3#13'ActiveControl'#7#6'Panel1'#7'Caption'#6
+'n'#6#26'RxDBGrid Demo (ver 3) ...'#12'ClientHeight'#3'F'#2#11'ClientWidth' +#26'RxDBGrid Demo (ver 3) ...'#12'ClientHeight'#3'F'#2#11'ClientWidth'#3#201
+#3#201#3#8'OnCreate'#7#10'FormCreate'#10'LCLVersion'#6#6'0.9.27'#0#9'TRxDBGr' +#3#8'OnCreate'#7#10'FormCreate'#10'LCLVersion'#6#6'0.9.27'#0#9'TRxDBGrid'#9
+'id'#9'RxDBGrid1'#4'Left'#2#0#6'Height'#3#21#2#3'Top'#2'1'#5'Width'#3#201#3 +'RxDBGrid1'#4'Left'#2#0#6'Height'#3#21#2#3'Top'#2'1'#5'Width'#3#201#3#12'Tit'
+#12'TitleButtons'#8#8'AutoSort'#8#7'Columns'#14#1#15'Title.Alignment'#7#8'ta' +'leButtons'#9#8'AutoSort'#9#7'Columns'#14#1#15'Title.Alignment'#7#8'taCenter'
+'Center'#13'Title.Caption'#6#4'Code'#17'Title.Orientation'#7#12'toHorizontal' +#13'Title.Caption'#6#4'Code'#17'Title.Orientation'#7#12'toHorizontal'#9'Fiel'
+#9'FieldName'#6#2'ID'#16'Footer.Alignment'#7#14'taRightJustify'#20'Footer.Di' +'dName'#6#2'ID'#16'Footer.Alignment'#7#14'taRightJustify'#20'Footer.DisplayF'
+'splayFormat'#6#9'Count: %d'#16'Footer.ValueType'#7#8'fvtCount'#19'Filter.Dr' +'ormat'#6#9'Count: %d'#16'Footer.ValueType'#7#8'fvtCount'#19'Filter.DropDown'
+'opDownRows'#2#0#12'Filter.Color'#7#6'clLime'#16'Filter.ItemIndex'#2#255#0#1 +'Rows'#2#0#12'Filter.Color'#7#6'clLime'#16'Filter.ItemIndex'#2#255#0#1#15'Ti'
+#15'Title.Alignment'#7#8'taCenter'#13'Title.Caption'#6#13'Software Name'#17 +'tle.Alignment'#7#8'taCenter'#17'Title.Orientation'#7#12'toHorizontal'#5'Wid'
+'Title.Orientation'#7#12'toHorizontal'#5'Width'#3'^'#1#9'FieldName'#6#4'NAME' +'th'#3#150#0#9'FieldName'#6#9'Developer'#19'Filter.DropDownRows'#2#0#12'Filt'
+#19'Filter.DropDownRows'#2#0#12'Filter.Color'#7#6'clLime'#16'Filter.ItemInde' +'er.Color'#7#6'clLime'#16'Filter.ItemIndex'#2#255#0#1#15'Title.Alignment'#7#8
+'x'#2#255#0#1#15'Title.Alignment'#7#8'taCenter'#17'Title.Orientation'#7#12't' +'taCenter'#13'Title.Caption'#6#13'Software|Name'#17'Title.Orientation'#7#12
+'oHorizontal'#5'Width'#3#150#0#9'FieldName'#6#9'Developer'#19'Filter.DropDow' +'toHorizontal'#5'Width'#3'^'#1#9'FieldName'#6#4'NAME'#19'Filter.DropDownRows'
+'nRows'#2#0#12'Filter.Color'#7#6'clLime'#16'Filter.ItemIndex'#2#255#0#1#15'T' +#2#0#12'Filter.Color'#7#6'clLime'#16'Filter.ItemIndex'#2#255#0#1#15'Title.Al'
+'itle.Alignment'#7#8'taCenter'#13'Title.Caption'#6#4'Cost'#17'Title.Orientat' +'ignment'#7#8'taCenter'#13'Title.Caption'#6#13'Software|Cost'#17'Title.Orien'
+'ion'#7#12'toHorizontal'#5'Width'#2'Z'#9'FieldName'#6#5'PRICE'#13'DisplayFor' +'tation'#7#12'toHorizontal'#5'Width'#2'Z'#9'FieldName'#6#5'PRICE'#13'Display'
+'mat'#6#8'#,##0.00'#16'Footer.Alignment'#7#14'taRightJustify'#20'Footer.Disp' +'Format'#6#8'#,##0.00'#16'Footer.Alignment'#7#14'taRightJustify'#20'Footer.D'
+'layFormat'#6#8'#,##0.00'#16'Footer.FieldName'#6#5'PRICE'#16'Footer.ValueTyp' +'isplayFormat'#6#8'#,##0.00'#16'Footer.FieldName'#6#5'PRICE'#16'Footer.Value'
+'e'#7#6'fvtSum'#19'Filter.DropDownRows'#2#0#12'Filter.Color'#7#6'clLime'#16 +'Type'#7#6'fvtSum'#19'Filter.DropDownRows'#2#0#12'Filter.Color'#7#6'clLime'
+'Filter.ItemIndex'#2#255#0#1#15'Title.Alignment'#7#8'taCenter'#13'Title.Capt' +#16'Filter.ItemIndex'#2#255#0#1#15'Title.Alignment'#7#8'taCenter'#13'Title.C'
+'ion'#6#12'Date Present'#17'Title.Orientation'#7#12'toHorizontal'#5'Width'#2 +'aption'#6#21'Software|Date Present'#17'Title.Orientation'#7#12'toHorizontal'
+'d'#9'FieldName'#6#12'Date_Present'#19'Filter.DropDownRows'#2#0#16'Filter.It' +#5'Width'#2'd'#9'FieldName'#6#12'Date_Present'#19'Filter.DropDownRows'#2#0#16
+'emIndex'#2#255#0#1#15'Title.Alignment'#7#8'taCenter'#17'Title.Orientation'#7 +'Filter.ItemIndex'#2#255#0#1#15'Title.Alignment'#7#8'taCenter'#17'Title.Orie'
+#12'toHorizontal'#5'Width'#3#150#0#9'FieldName'#6#12'DEVELOPER_ID'#19'Filter' +'ntation'#7#12'toHorizontal'#5'Width'#3#150#0#9'FieldName'#6#12'DEVELOPER_ID'
+'.DropDownRows'#2#0#16'Filter.ItemIndex'#2#255#0#0#9'OptionsRx'#11#13'rdgFoo' +#19'Filter.DropDownRows'#2#0#16'Filter.ItemIndex'#2#255#0#0#9'OptionsRx'#11
+'terRows'#0#11'FooterColor'#7#8'clYellow'#14'FooterRowCount'#2#1#9'OnFiltred' +#13'rdgFooterRows'#0#11'FooterColor'#7#8'clYellow'#14'FooterRowCount'#2#1#9
+#7#16'RxDBGrid1Filtred'#5'Align'#7#8'alClient'#10'FocusColor'#7#5'clRed'#13 +'OnFiltred'#7#16'RxDBGrid1Filtred'#5'Align'#7#8'alClient'#10'FocusColor'#7#5
+'SelectedColor'#7#11'clHighlight'#13'GridLineStyle'#7#7'psSolid'#10'DataSour' +'clRed'#13'SelectedColor'#7#11'clHighlight'#13'GridLineStyle'#7#7'psSolid'#10
+'ce'#7#11'Datasource1'#7'Options'#11#9'dgEditing'#8'dgTitles'#11'dgIndicator' +'DataSource'#7#11'Datasource1'#7'Options'#11#9'dgEditing'#8'dgTitles'#11'dgI'
+#14'dgColumnResize'#12'dgColumnMove'#10'dgColLines'#10'dgRowLines'#6'dgTabs' +'ndicator'#14'dgColumnResize'#12'dgColumnMove'#10'dgColLines'#10'dgRowLines'
+#21'dgAlwaysShowSelection'#15'dgConfirmDelete'#14'dgCancelOnExit'#13'dgMulti' +#6'dgTabs'#21'dgAlwaysShowSelection'#15'dgConfirmDelete'#14'dgCancelOnExit'
+'select'#0#11'ParentColor'#8#9'PopupMenu'#7#10'PopupMenu1'#8'TabOrder'#2#0#0 +#13'dgMultiselect'#18'dgHeaderPushedLook'#0#11'ParentColor'#8#9'PopupMenu'#7
+#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'1'#3'Top'#2#0#5'Width'#3#201#3 +#10'PopupMenu1'#8'TabOrder'#2#0#10'TitleStyle'#7#8'tsNative'#0#0#6'TPanel'#6
+#5'Align'#7#5'alTop'#8'AutoSize'#9#12'ClientHeight'#2'1'#11'ClientWidth'#3 +'Panel1'#4'Left'#2#0#6'Height'#2'1'#3'Top'#2#0#5'Width'#3#201#3#5'Align'#7#5
+#201#3#8'TabOrder'#2#1#0#7'TButton'#7'Button1'#22'AnchorSideLeft.Control'#7#6 +'alTop'#8'AutoSize'#9#12'ClientHeight'#2'1'#11'ClientWidth'#3#201#3#8'TabOrd'
+'Panel1'#21'AnchorSideTop.Control'#7#6'Panel1'#4'Left'#2#6#6'Height'#2'%'#3 +'er'#2#1#0#7'TButton'#7'Button1'#22'AnchorSideLeft.Control'#7#6'Panel1'#21'A'
+'Top'#2#6#5'Width'#2'\'#6'Action'#7#12'actCalcTotal'#8'AutoSize'#9#20'Border' +'nchorSideTop.Control'#7#6'Panel1'#4'Left'#2#6#6'Height'#2'%'#3'Top'#2#6#5'W'
+'Spacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#0#0#0#7 +'idth'#2'\'#6'Action'#7#12'actCalcTotal'#8'AutoSize'#9#20'BorderSpacing.Arou'
+'TButton'#7'Button2'#22'AnchorSideLeft.Control'#7#7'Button1'#19'AnchorSideLe' +'nd'#2#6#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#0#0#0#7'TButton'#7
+'ft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7#6'Panel1'#4'Left'#2'h'#6 +'Button2'#22'AnchorSideLeft.Control'#7#7'Button1'#19'AnchorSideLeft.Side'#7#9
+'Height'#2'%'#3'Top'#2#6#5'Width'#3#165#0#6'Action'#7#26'actOptimizeColumnsW' +'asrBottom'#21'AnchorSideTop.Control'#7#6'Panel1'#4'Left'#2'h'#6'Height'#2'%'
+'idthAll'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerB' +#3'Top'#2#6#5'Width'#3#165#0#6'Action'#7#26'actOptimizeColumnsWidthAll'#8'Au'
+'order'#2#4#8'TabOrder'#2#1#0#0#9'TCheckBox'#9'CheckBox1'#22'AnchorSideLeft.' +'toSize'#9#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#8
+'Control'#7#7'Button2'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideT' +'TabOrder'#2#1#0#0#9'TCheckBox'#9'CheckBox1'#22'AnchorSideLeft.Control'#7#7
+'op.Control'#7#7'Button1'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#3#19 +'Button2'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7
+#1#6'Height'#2#22#3'Top'#2#13#5'Width'#2'Q'#18'BorderSpacing.Left'#2#6#7'Cap' +#7'Button1'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#3#19#1#6'Height'#2
+'tion'#6#10'Use filter'#8'OnChange'#7#15'CheckBox1Change'#8'TabOrder'#2#2#0#0 +#21#3'Top'#2#14#5'Width'#2'P'#18'BorderSpacing.Left'#2#6#7'Caption'#6#10'Use'
+#0#13'TRxMemoryData'#13'RxMemoryData1'#14'AutoCalcFields'#8#9'FieldDefs'#14#1 +' filter'#8'OnChange'#7#15'CheckBox1Change'#8'TabOrder'#2#2#0#0#0#13'TRxMemo'
+#4'Name'#6#2'ID'#8'DataType'#7#9'ftInteger'#9'Precision'#2#255#4'Size'#2#7#0 +'ryData'#13'RxMemoryData1'#14'AutoCalcFields'#8#9'FieldDefs'#14#1#4'Name'#6#2
+#1#4'Name'#6#4'NAME'#8'DataType'#7#8'ftString'#9'Precision'#2#255#4'Size'#3 +'ID'#8'DataType'#7#9'ftInteger'#9'Precision'#2#255#4'Size'#2#7#0#1#4'Name'#6
+#150#0#0#1#4'Name'#6#5'PRICE'#8'DataType'#7#7'ftFloat'#9'Precision'#2#2#4'Si' +#4'NAME'#8'DataType'#7#8'ftString'#9'Precision'#2#255#4'Size'#3#150#0#0#1#4
+'ze'#2#12#0#1#4'Name'#6#9'Developer'#8'DataType'#7#8'ftString'#9'Precision'#2 +'Name'#6#5'PRICE'#8'DataType'#7#7'ftFloat'#9'Precision'#2#2#4'Size'#2#12#0#1
+#255#4'Size'#3#150#0#0#1#4'Name'#6#12'Date_Present'#8'DataType'#7#6'ftDate'#9 +#4'Name'#6#9'Developer'#8'DataType'#7#8'ftString'#9'Precision'#2#255#4'Size'
+'Precision'#2#0#4'Size'#2#0#0#1#4'Name'#6#12'DEVELOPER_ID'#8'DataType'#7#9'f' +#3#150#0#0#1#4'Name'#6#12'Date_Present'#8'DataType'#7#6'ftDate'#9'Precision'
+'tInteger'#9'Precision'#2#0#4'Size'#2#0#0#0#16'OnFilterRecordEx'#7#27'RxMemo' +#2#0#4'Size'#2#0#0#1#4'Name'#6#12'DEVELOPER_ID'#8'DataType'#7#9'ftInteger'#9
+'ryData1FilterRecordEx'#4'left'#3#152#0#3'top'#3#8#1#0#13'TLongintField'#16 +'Precision'#2#0#4'Size'#2#0#0#0#16'OnFilterRecordEx'#7#27'RxMemoryData1Filte'
+'RxMemoryData1ID1'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkData'#9'FieldNam' +'rRecordEx'#4'left'#3#152#0#3'top'#3#8#1#0#13'TLongintField'#16'RxMemoryData'
+'e'#6#2'ID'#5'Index'#2#0#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdat' +'1ID1'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkData'#9'FieldName'#6#2'ID'#5
+'e'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#12'TStringField'#18'RxMem' +'Index'#2#0#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pfInWher'
+'oryData1NAME1'#12'DisplayWidth'#3#150#0#9'FieldKind'#7#6'fkData'#9'FieldNam' +'e'#0#8'ReadOnly'#8#8'Required'#8#0#0#12'TStringField'#18'RxMemoryData1NAME1'
+'e'#6#4'NAME'#5'Index'#2#1#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpd' +#12'DisplayWidth'#3#150#0#9'FieldKind'#7#6'fkData'#9'FieldName'#6#4'NAME'#5
+'ate'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#3#150#0#0#0#11'TFlo' +'Index'#2#1#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pfInWher'
,'atField'#19'RxMemoryData1PRICE1'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkD' ,'e'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#3#150#0#0#0#11'TFloatField'#19'RxM'
+'ata'#9'FieldName'#6#5'PRICE'#5'Index'#2#2#11'LookupCache'#8#13'ProviderFlag' +'emoryData1PRICE1'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkData'#9'FieldNam'
+'s'#11#10'pfInUpdate'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#13'DisplayF' +'e'#6#5'PRICE'#5'Index'#2#2#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUp'
+'ormat'#6#8'#,##0.00'#8'MaxValue'#5#0#0#0#0#0#0#0#0#0#0#8'MinValue'#5#0#0#0#0 +'date'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#13'DisplayFormat'#6#8'#,##'
+#0#0#0#0#0#0#9'Precision'#2#2#0#0#12'TStringField'#23'RxMemoryData1Developer' +'0.00'#8'MaxValue'#5#0#0#0#0#0#0#0#0#0#0#8'MinValue'#5#0#0#0#0#0#0#0#0#0#0#9
+'1'#12'DisplayWidth'#3#150#0#9'FieldKind'#7#6'fkData'#9'FieldName'#6#9'Devel' +'Precision'#2#2#0#0#12'TStringField'#23'RxMemoryData1Developer1'#12'DisplayW'
+'oper'#5'Index'#2#3#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9 +'idth'#3#150#0#9'FieldKind'#7#6'fkData'#9'FieldName'#6#9'Developer'#5'Index'
+'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#3#150#0#0#0#10'TDateField' +#2#3#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pfInWhere'#0#8
+#26'RxMemoryData1Date_Present1'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkDat' +'ReadOnly'#8#8'Required'#8#4'Size'#3#150#0#0#0#10'TDateField'#26'RxMemoryDat'
+'a'#9'FieldName'#6#12'Date_Present'#5'Index'#2#4#11'LookupCache'#8#13'Provid' +'a1Date_Present1'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkData'#9'FieldName'
+'erFlags'#11#10'pfInUpdate'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#13 +#6#12'Date_Present'#5'Index'#2#4#11'LookupCache'#8#13'ProviderFlags'#11#10'p'
+'TLongintField'#26'RxMemoryData1DEVELOPER_ID1'#12'DisplayWidth'#2#10#9'Field' +'fInUpdate'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0#13'TLongintField'
+'Kind'#7#6'fkData'#9'FieldName'#6#12'DEVELOPER_ID'#5'Index'#2#5#9'KeyFields' +#26'RxMemoryData1DEVELOPER_ID1'#12'DisplayWidth'#2#10#9'FieldKind'#7#6'fkDat'
+#6#12'DEVELOPER_ID'#11'LookupCache'#8#13'LookupDataSet'#7#13'RxMemoryData2' +'a'#9'FieldName'#6#12'DEVELOPER_ID'#5'Index'#2#5#9'KeyFields'#6#12'DEVELOPER'
+#15'LookupKeyFields'#6#12'DEVELOPER_ID'#17'LookupResultField'#6#14'DEVELOPER' +'_ID'#11'LookupCache'#8#13'LookupDataSet'#7#13'RxMemoryData2'#15'LookupKeyFi'
+'_NAME'#13'ProviderFlags'#11#10'pfInUpdate'#9'pfInWhere'#0#8'ReadOnly'#8#8'R' +'elds'#6#12'DEVELOPER_ID'#17'LookupResultField'#6#14'DEVELOPER_NAME'#13'Prov'
+'equired'#8#0#0#0#11'TDatasource'#11'Datasource1'#7'DataSet'#7#13'RxMemoryDa' +'iderFlags'#11#10'pfInUpdate'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#0#0
+'ta1'#4'left'#2'x'#3'top'#3#8#1#0#0#10'TPopupMenu'#10'PopupMenu1'#4'left'#3 +#0#11'TDatasource'#11'Datasource1'#7'DataSet'#7#13'RxMemoryData1'#4'left'#2
+#152#0#3'top'#3#197#0#0#9'TMenuItem'#9'MenuItem1'#6'Action'#7#20'actOptimize' +'x'#3'top'#3#8#1#0#0#10'TPopupMenu'#10'PopupMenu1'#4'left'#3#152#0#3'top'#3
+'WidthCol1'#7'OnClick'#7#27'actOptimizeWidthCol1Execute'#0#0#9'TMenuItem'#9 +#197#0#0#9'TMenuItem'#9'MenuItem1'#6'Action'#7#20'actOptimizeWidthCol1'#7'On'
+'MenuItem2'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9'MenuItem4'#6'Action'#7#12'a' +'Click'#7#27'actOptimizeWidthCol1Execute'#0#0#9'TMenuItem'#9'MenuItem2'#7'Ca'
+'ctCalcTotal'#7'OnClick'#7#19'actCalcTotalExecute'#0#0#9'TMenuItem'#9'MenuIt' +'ption'#6#1'-'#0#0#9'TMenuItem'#9'MenuItem4'#6'Action'#7#12'actCalcTotal'#7
+'em3'#6'Action'#7#26'actOptimizeColumnsWidthAll'#7'OnClick'#7'!actOptimizeCo' +'OnClick'#7#19'actCalcTotalExecute'#0#0#9'TMenuItem'#9'MenuItem3'#6'Action'#7
+'lumnsWidthAllExecute'#0#0#0#11'TActionList'#11'ActionList1'#4'left'#3#206#0 +#26'actOptimizeColumnsWidthAll'#7'OnClick'#7'!actOptimizeColumnsWidthAllExec'
+#3'top'#3#197#0#0#7'TAction'#12'actCalcTotal'#7'Caption'#6#13'Calc total...' +'ute'#0#0#0#11'TActionList'#11'ActionList1'#4'left'#3#206#0#3'top'#3#197#0#0
+#18'DisableIfNoHandler'#9#9'OnExecute'#7#19'actCalcTotalExecute'#0#0#7'TActi' +#7'TAction'#12'actCalcTotal'#7'Caption'#6#13'Calc total...'#9'OnExecute'#7#19
+'on'#26'actOptimizeColumnsWidthAll'#7'Caption'#6#25'Optimize width for all..' +'actCalcTotalExecute'#0#0#7'TAction'#26'actOptimizeColumnsWidthAll'#7'Captio'
+'.'#18'DisableIfNoHandler'#9#9'OnExecute'#7'!actOptimizeColumnsWidthAllExecu' +'n'#6#25'Optimize width for all...'#9'OnExecute'#7'!actOptimizeColumnsWidthA'
+'te'#0#0#7'TAction'#20'actOptimizeWidthCol1'#7'Caption'#6#17'Optimize width.' +'llExecute'#0#0#7'TAction'#20'actOptimizeWidthCol1'#7'Caption'#6#17'Optimize'
+'..'#18'DisableIfNoHandler'#9#9'OnExecute'#7#27'actOptimizeWidthCol1Execute' +' width...'#9'OnExecute'#7#27'actOptimizeWidthCol1Execute'#0#0#0#11'TDatasou'
+#0#0#0#11'TDatasource'#11'Datasource2'#7'DataSet'#7#13'RxMemoryData2'#4'left' +'rce'#11'Datasource2'#7'DataSet'#7#13'RxMemoryData2'#4'left'#3#207#0#3'top'#3
+#3#207#0#3'top'#3#8#1#0#0#13'TRxMemoryData'#13'RxMemoryData2'#14'AutoCalcFie' +#8#1#0#0#13'TRxMemoryData'#13'RxMemoryData2'#14'AutoCalcFields'#8#9'FieldDef'
+'lds'#8#9'FieldDefs'#14#1#4'Name'#6#12'DEVELOPER_ID'#8'DataType'#7#9'ftInteg' +'s'#14#1#4'Name'#6#12'DEVELOPER_ID'#8'DataType'#7#9'ftInteger'#9'Precision'#2
+'er'#9'Precision'#2#0#4'Size'#2#0#0#1#4'Name'#6#14'DEVELOPER_NAME'#8'DataTyp' +#0#4'Size'#2#0#0#1#4'Name'#6#14'DEVELOPER_NAME'#8'DataType'#7#8'ftString'#9
+'e'#7#8'ftString'#9'Precision'#2#0#4'Size'#3#130#0#0#0#4'left'#3#240#0#3'top' +'Precision'#2#0#4'Size'#3#130#0#0#0#4'left'#3#240#0#3'top'#3#8#1#0#13'TLongi'
+#3#8#1#0#13'TLongintField'#26'RxMemoryData2DEVELOPER_ID1'#12'DisplayWidth'#2 +'ntField'#26'RxMemoryData2DEVELOPER_ID1'#12'DisplayWidth'#2#10#9'FieldKind'#7
+#10#9'FieldKind'#7#6'fkData'#9'FieldName'#6#12'DEVELOPER_ID'#5'Index'#2#0#11 +#6'fkData'#9'FieldName'#6#12'DEVELOPER_ID'#5'Index'#2#0#11'LookupCache'#8#13
+'ProviderFlags'#11#10'pfInUpdate'#9'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8
+#0#0#12'TStringField'#28'RxMemoryData2DEVELOPER_NAME1'#12'DisplayWidth'#3#130
+#0#9'FieldKind'#7#6'fkData'#9'FieldName'#6#14'DEVELOPER_NAME'#5'Index'#2#1#11
+'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pfInWhere'#0#8'ReadOnl' +'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9'pfInWhere'#0#8'ReadOnl'
+'y'#8#8'Required'#8#0#0#12'TStringField'#28'RxMemoryData2DEVELOPER_NAME1'#12 +'y'#8#8'Required'#8#4'Size'#3#130#0#0#0#0#0
+'DisplayWidth'#3#130#0#9'FieldKind'#7#6'fkData'#9'FieldName'#6#14'DEVELOPER_'
+'NAME'#5'Index'#2#1#11'LookupCache'#8#13'ProviderFlags'#11#10'pfInUpdate'#9
+'pfInWhere'#0#8'ReadOnly'#8#8'Required'#8#4'Size'#3#130#0#0#0#0#0
]); ]);

View File

@ -57,6 +57,7 @@ var
RxDBGridMainForm: TRxDBGridMainForm; RxDBGridMainForm: TRxDBGridMainForm;
implementation implementation
uses rxsortmemds;
{ TRxDBGridMainForm } { TRxDBGridMainForm }

View File

@ -20,6 +20,8 @@
+ Добавлен пример для использования автоматической сортировки в RxDBGrid + Добавлен пример для использования автоматической сортировки в RxDBGrid
- Исправлена сортировка при использовании TRxMemDataSet - Исправлена сортировка при использовании TRxMemDataSet
- Исправлена отрисова кнопки в ToolPanel при отрисовке с использованием текущей темы - Исправлена отрисова кнопки в ToolPanel при отрисовке с использованием текущей темы
+ Реализована возможность объединения ячеек в заголовке таблицы
(смотрите в демке на RxDBGrid)
22.05.2008 - версия 2.0.0.136 (svn revision 100) 22.05.2008 - версия 2.0.0.136 (svn revision 100)
+ У объекта TRxCustomDBLookupCombo введён контроль на CircularDataLink + У объекта TRxCustomDBLookupCombo введён контроль на CircularDataLink
+ У объекта TRxCustomDBLookupCombo ускорена отрисовка данных + У объекта TRxCustomDBLookupCombo ускорена отрисовка данных

View File

@ -51,21 +51,31 @@ type
end; end;
TExDBGridSortEngineClass = class of TExDBGridSortEngine; TExDBGridSortEngineClass = class of TExDBGridSortEngine;
TMLCaptionItem = class
Caption:string;
Width:integer;
Hegth:integer;
Next:TMLCaptionItem;
Prior:TMLCaptionItem;
end;
{ TRxColumnTitle } { TRxColumnTitle }
TRxColumnTitle = class(TColumnTitle) TRxColumnTitle = class(TColumnTitle)
private private
FHint: string; FHint: string;
FOrientation: TTextOrientation; FOrientation: TTextOrientation;
FShowHint: boolean; FShowHint: boolean;
FMultiLines:TStringList; FCaptionLines:TFPList;
function GetCaptionLinesCount: integer;
procedure SetOrientation(const AValue: TTextOrientation); procedure SetOrientation(const AValue: TTextOrientation);
function MCountLines:integer; procedure ClearCaptionML;
function MGetLine(ALine:integer):string;
protected protected
procedure SetCaption(const AValue: TCaption); override; procedure SetCaption(const AValue: TCaption); override;
public public
constructor Create(TheColumn: TGridColumn); override; constructor Create(TheColumn: TGridColumn); override;
destructor Destroy; override; destructor Destroy; override;
property CaptionLinesCount:integer read GetCaptionLinesCount;
function CaptionLine(ALine:integer):TMLCaptionItem;
published published
property Orientation:TTextOrientation read FOrientation write SetOrientation; property Orientation:TTextOrientation read FOrientation write SetOrientation;
property Hint: string read FHint write FHint; property Hint: string read FHint write FHint;
@ -206,12 +216,11 @@ type
FFooterRowCount: integer; FFooterRowCount: integer;
FOnGetCellProps: TGetCellPropsEvent; FOnGetCellProps: TGetCellPropsEvent;
FOptionsRx: TOptionsRx; FOptionsRx: TOptionsRx;
FTitleLines: Integer; // FTitleLines: Integer;
FAutoSort: boolean; FAutoSort: boolean;
FMarkerUp, FMarkerDown: TBitmap; FMarkerUp, FMarkerDown: TBitmap;
FOnGetBtnParams: TGetBtnParamsEvent; FOnGetBtnParams: TGetBtnParamsEvent;
FOnFiltred : TNotifyEvent; FOnFiltred : TNotifyEvent;
FTitleButtons: boolean;
//auto sort support //auto sort support
FSortField:TField; FSortField:TField;
FSortOrder:TSortMarker; FSortOrder:TSortMarker;
@ -234,6 +243,7 @@ type
function GetColumns: TRxDbGridColumns; function GetColumns: TRxDbGridColumns;
function GetPropertyStorage: TCustomPropertyStorage; function GetPropertyStorage: TCustomPropertyStorage;
function GetTitleButtons: boolean;
function IsColumnsStored: boolean; function IsColumnsStored: boolean;
procedure SetAutoSort(const AValue: boolean); procedure SetAutoSort(const AValue: boolean);
procedure SetColumns(const AValue: TRxDbGridColumns); procedure SetColumns(const AValue: TRxDbGridColumns);
@ -245,16 +255,19 @@ type
procedure TrackButton(X, Y: Integer); procedure TrackButton(X, Y: Integer);
procedure StopTracking; procedure StopTracking;
procedure CalcTitle; procedure CalcTitle;
procedure ClearMLCaptionPointers;
function getFilterRect(bRect : TRect):TRect; function getFilterRect(bRect : TRect):TRect;
function getTitleRect(bRect : TRect):TRect; function getTitleRect(bRect : TRect):TRect;
procedure OutCaptionCellText(aCol,aRow: Integer;const aRect: TRect; aState: TGridDrawState;const ACaption:string);
procedure OutCaptionCellText90(aCol,aRow: Integer;const aRect: TRect; aState: TGridDrawState;const ACaption:string;const TextOrient:TTextOrientation);
procedure OutCaptionSortMarker(const aRect: TRect; ASortMarker: TSortMarker);
procedure OutCaptionMLCellText(aCol,aRow: Integer; aRect: TRect; aState: TGridDrawState; MLI:TMLCaptionItem);
//storage //storage
procedure OnIniSave(Sender: TObject); procedure OnIniSave(Sender: TObject);
procedure OnIniLoad(Sender: TObject); procedure OnIniLoad(Sender: TObject);
protected protected
{$IFDEF Win32} // procedure CreateWnd; override;
procedure CreateWnd; override;
{$ENDIF}
function DatalinkActive:boolean; function DatalinkActive:boolean;
procedure DefaultDrawCellA(aCol,aRow: Integer; aRect: TRect; aState: TGridDrawState); procedure DefaultDrawCellA(aCol,aRow: Integer; aRect: TRect; aState: TGridDrawState);
procedure DefaultDrawTitle(aCol,aRow: Integer; aRect: TRect; aState: TGridDrawState); procedure DefaultDrawTitle(aCol,aRow: Integer; aRect: TRect; aState: TGridDrawState);
@ -273,6 +286,7 @@ type
procedure DrawCellBitmap(RxColumn:TRxColumn; aRect: TRect; aState: TGridDrawState; AImageIndex:integer); virtual; procedure DrawCellBitmap(RxColumn:TRxColumn; aRect: TRect; aState: TGridDrawState; AImageIndex:integer); virtual;
procedure SetEditText(ACol, ARow: Longint; const Value: string); override; procedure SetEditText(ACol, ARow: Longint; const Value: string); override;
procedure CheckNewCachedSizes(var AGCache:TGridDataCache); override; procedure CheckNewCachedSizes(var AGCache:TGridDataCache); override;
procedure ColRowMoved(IsColumn: Boolean; FromIndex,ToIndex: Integer); override;
procedure Paint;override; procedure Paint;override;
procedure UpdateActive;override; procedure UpdateActive;override;
procedure UpdateData;override; procedure UpdateData;override;
@ -282,10 +296,11 @@ type
procedure FFilterListEditorOnCloseUp(Sender: TObject); procedure FFilterListEditorOnCloseUp(Sender: TObject);
procedure InternalOptimizeColumnsWidth(AColList:TList); procedure InternalOptimizeColumnsWidth(AColList:TList);
function IsDefaultRowHeightStored:boolean; function IsDefaultRowHeightStored:boolean;
function EditorByStyle(Style: TColumnButtonStyle): TWinControl; override; procedure VisualChange; override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
function EditorByStyle(Style: TColumnButtonStyle): TWinControl; override;
procedure LayoutChanged; override; procedure LayoutChanged; override;
procedure ShowFindDialog; procedure ShowFindDialog;
procedure ShowColumnsDialog; procedure ShowColumnsDialog;
@ -304,7 +319,7 @@ type
procedure UpdateTitleHight; procedure UpdateTitleHight;
published published
property OnGetBtnParams: TGetBtnParamsEvent read FOnGetBtnParams write FOnGetBtnParams; property OnGetBtnParams: TGetBtnParamsEvent read FOnGetBtnParams write FOnGetBtnParams;
property TitleButtons: boolean read FTitleButtons write SetTitleButtons; property TitleButtons: boolean read GetTitleButtons write SetTitleButtons;
property AutoSort:boolean read FAutoSort write SetAutoSort; property AutoSort:boolean read FAutoSort write SetAutoSort;
property OnGetCellProps: TGetCellPropsEvent read FOnGetCellProps property OnGetCellProps: TGetCellPropsEvent read FOnGetCellProps
write FOnGetCellProps; write FOnGetCellProps;
@ -462,8 +477,8 @@ type
procedure msg_GetValue(var Msg: TGridMessage); message GM_GETVALUE; procedure msg_GetValue(var Msg: TGridMessage); message GM_GETVALUE;
procedure msg_SelectAll(var Msg: TGridMessage); message GM_SELECTALL; procedure msg_SelectAll(var Msg: TGridMessage); message GM_SELECTALL;
procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); override;
public public
// procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); override;
procedure EditingDone; override; procedure EditingDone; override;
end; end;
@ -591,11 +606,13 @@ begin
SelectAll; SelectAll;
end; end;
procedure TRxDBGridDateEditor.SetBounds(aLeft, aTop, aWidth, aHeight: integer); {procedure TRxDBGridDateEditor.SetBounds(aLeft, aTop, aWidth, aHeight: integer);
begin begin
BeginUpdateBounds;
Dec(aWidth, 25); Dec(aWidth, 25);
inherited SetBounds(aLeft, aTop, aWidth, aHeight); inherited SetBounds(aLeft, aTop, aWidth, aHeight);
end; EndUpdateBounds;
end;}
procedure TRxDBGridDateEditor.EditingDone; procedure TRxDBGridDateEditor.EditingDone;
begin begin
@ -693,11 +710,11 @@ const
DT_RIGHT or {DT_EXPANDTABS or }DT_NOPREFIX, DT_RIGHT or {DT_EXPANDTABS or }DT_NOPREFIX,
DT_CENTER or {DT_EXPANDTABS or }DT_NOPREFIX); DT_CENTER or {DT_EXPANDTABS or }DT_NOPREFIX);
TITLE_SUBHEADER = 2; { TITLE_SUBHEADER = 2;
TITLE_DEFAULT = 1; TITLE_DEFAULT = 1;
const const
EdgeFlag: array[Boolean] of UINT = (BDR_RAISEDINNER, BDR_SUNKENINNER); EdgeFlag: array[Boolean] of UINT = (BDR_RAISEDINNER, BDR_SUNKENINNER);}
procedure WriteTextHeader(ACanvas: TCanvas; ARect: TRect; const Text: string; procedure WriteTextHeader(ACanvas: TCanvas; ARect: TRect; const Text: string;
Alignment: TAlignment); Alignment: TAlignment);
@ -723,8 +740,10 @@ end;
procedure TRxDBGrid.SetTitleButtons(const AValue: boolean); procedure TRxDBGrid.SetTitleButtons(const AValue: boolean);
begin begin
if FTitleButtons=AValue then exit; if AValue then
FTitleButtons:=AValue; Options:=Options + [dgHeaderPushedLook]
else
Options:=Options - [dgHeaderPushedLook];
end; end;
procedure TRxDBGrid.SetAutoSort(const AValue: boolean); procedure TRxDBGrid.SetAutoSort(const AValue: boolean);
@ -756,6 +775,11 @@ begin
Result:=FPropertyStorageLink.Storage; Result:=FPropertyStorageLink.Storage;
end; end;
function TRxDBGrid.GetTitleButtons: boolean;
begin
Result:=dgHeaderPushedLook in Options;
end;
function TRxDBGrid.IsColumnsStored: boolean; function TRxDBGrid.IsColumnsStored: boolean;
begin begin
result := TRxDbGridColumns(TCustomDrawGrid(Self).Columns).Enabled; result := TRxDbGridColumns(TCustomDrawGrid(Self).Columns).Enabled;
@ -838,52 +862,90 @@ end;
procedure TRxDBGrid.CalcTitle; procedure TRxDBGrid.CalcTitle;
var var
i, j:integer; i, j:integer;
H, H1, W, H2, W1:integer; H, H1, W, H2:integer;
rxCol:TRxColumn; rxCol, rxColNext:TRxColumn;
rxTit:TRxColumnTitle; rxTit, rxTitleNext:TRxColumnTitle;
sCapt:string; MLRec1:TMLCaptionItem;
MLRec2:TMLCaptionItem;
begin begin
H:=1; H:=1;
ClearMLCaptionPointers;
for i:=0 to Columns.Count-1 do for i:=0 to Columns.Count-1 do
begin begin
rxCol:=TRxColumn(Columns[i]); rxCol:=TRxColumn(Columns[i]);
if rxCol.Visible then if Assigned(rxCol) and rxCol.Visible then
begin begin
rxTit:=TRxColumnTitle(rxCol.Title); rxTit:=TRxColumnTitle(rxCol.Title);
if rxTit.Orientation in [toVertical270, toVertical90] then if Assigned(rxTit) then
H:=Max((Canvas.TextWidth(Columns[i].Title.Caption)+ Canvas.TextWidth('W')) div DefaultRowHeight, H)
else
begin begin
W:=Max(rxCol.Width-2, 1); if rxTit.Orientation in [toVertical270, toVertical90] then
if rxTit.MCountLines > 0 then H:=Max((Canvas.TextWidth(Columns[i].Title.Caption)+ Canvas.TextWidth('W')) div DefaultRowHeight, H)
begin
H2:=0;
H1:=0;
for j:=0 to rxTit.MCountLines-1 do
begin
sCapt:=rxTit.MGetLine(j);
W1:=Canvas.TextWidth(sCapt)+2;
if W>W1 then
H2:=1
else
H2:=W1 div W + 1;
if H2>WordCount(sCapt, [' ']) then
H2:=WordCount(sCapt, [' ']);
H1:=H1+H2;
end
end
else else
begin begin
sCapt:=rxTit.Caption; rxColNext:=nil;
rxTitleNext:=nil;
if i < Columns.Count-1 then
begin
rxColNext:=TRxColumn(Columns[i+1]);
rxTitleNext:=TRxColumnTitle(rxColNext.Title);
end;
{ TODO -oalexs : Тут необходимо также обработать скрытые столбцы }
{
j:=i;
while j < Columns.Count-1 then
begin
if
inc(j);
end;
}
H1:=Max((Canvas.TextWidth(sCapt)+2) div W + 1, H); W:=Max(rxCol.Width-2, 1);
if H1>WordCount(sCapt, [' ']) then if rxTit.CaptionLinesCount > 0 then
H1:=WordCount(sCapt, [' ']); begin
H2:=0;
H1:=0;
for j:=0 to rxTit.CaptionLinesCount-1 do
begin
MLRec1:=rxTit.CaptionLine(j);
if Assigned(rxTitleNext) and (rxTitleNext.CaptionLinesCount>j) then
begin
MLRec2:=rxTitleNext.CaptionLine(j);
if MLRec1.Caption = MLRec2.Caption then
begin
MLRec1.Next:=MLRec2;
MLRec2.Prior:=MLRec1;
end;
end;
MLRec1.Width:=Canvas.TextWidth(MLRec1.Caption)+2;
if W > MLRec1.Width then
H2:=1
else
H2:=MLRec1.Width div W + 1;
if H2>WordCount(MLRec1.Caption, [' ']) then
H2:=WordCount(MLRec1.Caption, [' ']);
H1:=H1+H2;
end
end
else
begin
H1:=Max((Canvas.TextWidth(rxTit.Caption)+2) div W + 1, H);
if H1>WordCount(rxTit.Caption, [' ']) then
H1:=WordCount(rxTit.Caption, [' ']);
end;
H:=Max(H1, H);
end; end;
H:=Max(H1, H);
for j:=0 to rxTit.CaptionLinesCount-1 do
begin
MLRec1:=rxTit.CaptionLine(j);
if MLRec1.Width < rxTit.Column.Width then
MLRec1.Width:=rxTit.Column.Width;
end;
end; end;
end; end;
end; end;
@ -897,6 +959,30 @@ begin
end; end;
end; end;
procedure TRxDBGrid.ClearMLCaptionPointers;
var
i, j:integer;
rxCol:TRxColumn;
rxTit:TRxColumnTitle;
begin
for i:=0 to Columns.Count-1 do
begin
rxCol:=TRxColumn(Columns[i]);
if Assigned(rxCol) then
begin
rxTit:= TRxColumnTitle(rxCol.Title);
if Assigned(rxTit) then
begin
for j:=0 to rxTit.CaptionLinesCount - 1 do
begin
rxTit.CaptionLine(j).Next:=nil;
rxTit.CaptionLine(j).Prior:=nil;
end;
end
end
end;
end;
function TRxDBGrid.getFilterRect(bRect: TRect): TRect; function TRxDBGrid.getFilterRect(bRect: TRect): TRect;
begin begin
Result := bRect; Result := bRect;
@ -909,6 +995,67 @@ begin
Result.Bottom := bRect.Bottom - DefaultRowHeight; Result.Bottom := bRect.Bottom - DefaultRowHeight;
end; end;
procedure TRxDBGrid.OutCaptionCellText(aCol, aRow: Integer;const aRect: TRect;
aState: TGridDrawState; const ACaption: string);
begin
Canvas.FillRect(aRect);
DrawCellGrid(aCol, aRow, aRect, aState);
if ACaption <> '' then
WriteTextHeader(Canvas, aRect, ACaption, GetColumnAlignment(aCol, true))
end;
procedure TRxDBGrid.OutCaptionCellText90(aCol,aRow: Integer;const aRect: TRect;
aState: TGridDrawState;const ACaption:string; const TextOrient:TTextOrientation);
var
dW:integer;
begin
Canvas.FillRect(aRect);
DrawCellGrid(aCol,aRow,aRect,aState);
if TextOrient in [toVertical90, toVertical270] then
dW:=((aRect.Bottom - aRect.Top) - Canvas.TextWidth(ACaption)) div 2
else
dW:=0;
OutTextXY90(Canvas, aRect.Left, aRect.Top+dw, ACaption, TextOrient);
end;
procedure TRxDBGrid.OutCaptionSortMarker(const aRect: TRect;
ASortMarker: TSortMarker);
var
X,Y:integer;
begin
if (dgHeaderPushedLook in Options) then
begin
if ASortMarker = smDown then
begin
X:=aRect.Right - FMarkerDown.Width - 6;
Y:=Trunc((aRect.Top+aRect.Bottom-FMarkerDown.Height)/2);
Canvas.Draw(X, Y, FMarkerDown);
end
else
if ASortMarker = smUp then
begin
X:=aRect.Right - FMarkerUp.Width - 6;
Y:=Trunc((aRect.Top+aRect.Bottom-FMarkerUp.Height)/2);
Canvas.Draw(X, Y, FMarkerUp);
end;
end;
end;
procedure TRxDBGrid.OutCaptionMLCellText(aCol, aRow: Integer;
aRect: TRect; aState: TGridDrawState; MLI: TMLCaptionItem);
var
MLINext: TMLCaptionItem;
begin
MLINext:=MLI.Next;
while Assigned(MLINext) do
begin
aRect.Right:=aRect.Right + MLINext.Width;
MLINext:=MLINext.Next;
end;
OutCaptionCellText(aCol, aRow, aRect, aState, MLI.Caption);
end;
procedure TRxDBGrid.OnIniSave(Sender: TObject); procedure TRxDBGrid.OnIniSave(Sender: TObject);
var var
i:integer; i:integer;
@ -945,7 +1092,7 @@ end;
var var
i, ACount:integer; i, ACount:integer;
S, S1, ColumName{, S2}:string; S, S1, ColumName:string;
C:TRxColumn; C:TRxColumn;
begin begin
@ -969,18 +1116,16 @@ begin
end; end;
end; end;
{$IFDEF Win32} {procedure TRxDBGrid.CreateWnd;
procedure TRxDBGrid.CreateWnd;
begin begin
BeginUpdate; BeginUpdate;
try try
inherited CreateWnd; inherited CreateWnd;
CalcTitle; // CalcTitle;
finally finally
EndUpdate; EndUpdate;
end; end;
end; end;}
{$ENDIF}
procedure TRxDBGrid.DefaultDrawCellA(aCol, aRow: Integer; aRect: TRect; procedure TRxDBGrid.DefaultDrawCellA(aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState); aState: TGridDrawState);
@ -998,7 +1143,7 @@ end;
procedure TRxDBGrid.DefaultDrawTitle(aCol, aRow: Integer; aRect: TRect; procedure TRxDBGrid.DefaultDrawTitle(aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState); aState: TGridDrawState);
procedure FixRectangle; { procedure FixRectangle;
begin begin
case Canvas.TextStyle.Alignment of case Canvas.TextStyle.Alignment of
Classes.taLeftJustify: Inc(aRect.Left, 3); Classes.taLeftJustify: Inc(aRect.Left, 3);
@ -1008,29 +1153,18 @@ procedure TRxDBGrid.DefaultDrawTitle(aCol, aRow: Integer; aRect: TRect;
tlTop: Inc(aRect.Top, 3); tlTop: Inc(aRect.Top, 3);
tlBottom: Dec(aRect.Bottom, 3); tlBottom: Dec(aRect.Bottom, 3);
end; end;
end; end;}
var var
ASortMarker: TSortMarker; ASortMarker: TSortMarker;
Background: TColor; Background: TColor;
X1,Y1, dW, i, dww:integer; i:integer;
Down:boolean; Down:boolean;
aRect1,
aRect2: TRect; aRect2: TRect;
FTit:TRxColumnTitle; FTitle :TRxColumnTitle;
FCap:string;
TextOrient:TTextOrientation;
GrdCol:TGridColumn; GrdCol:TGridColumn;
MLI, MLINext:TMLCaptionItem;
function ATextWidth(S:string):integer;
var
wc:integer;
begin
Result:=(Canvas.TextWidth(S)+4) div GrdCol.Width + 1;
wc:=WordCount(s, [' ']);
if Result>wc then
Result:=wc;
end;
begin begin
if (dgIndicator in Options) and (aCol=0) then if (dgIndicator in Options) and (aCol=0) then
@ -1040,11 +1174,12 @@ begin
exit; exit;
end; end;
Down := FPressed and FTitleButtons and (FPressedCol = TColumn(ColumnFromGridColumn(aCol))); Down := FPressed and (dgHeaderPushedLook in Options) and (FPressedCol = TColumn(ColumnFromGridColumn(aCol)));
PrepareCanvas(aCol, aRow, aState);
ASortMarker := smNone; ASortMarker := smNone;
if (FSortField = GetFieldFromGridColumn(aCol)) then ASortMarker := FSortOrder; if (FSortField = GetFieldFromGridColumn(aCol)) then ASortMarker := FSortOrder;
if Assigned(FOnGetBtnParams) and Assigned(GetFieldFromGridColumn(aCol)) then if Assigned(FOnGetBtnParams) and Assigned(GetFieldFromGridColumn(aCol)) then
begin begin
Background:=Canvas.Brush.Color; Background:=Canvas.Brush.Color;
@ -1053,102 +1188,89 @@ begin
Canvas.Brush.Color:=Background; Canvas.Brush.Color:=Background;
end; end;
Canvas.FillRect(aRect);
DrawCellGrid(aCol,aRow,aRect,aState);
if (gdFixed in aState) and (aRow=0) and (ACol>=FixedCols) then if (gdFixed in aState) and (aRow=0) and (ACol>=FixedCols) then
begin begin
aRect1:=aRect;
FixRectangle;
TextOrient:=toHorizontal;
GrdCol:=ColumnFromGridColumn(aCol); GrdCol:=ColumnFromGridColumn(aCol);
if Assigned(GrdCol) then if Assigned(GrdCol) then
FTit:=TRxColumnTitle(GrdCol.Title) FTitle:=TRxColumnTitle(GrdCol.Title)
else else
FTit:=nil; FTitle:=nil;
if not Assigned(FTit) then if Assigned(FTitle) then
FCap:=GetDefaultColumnTitle(aCol)
else
begin begin
FCap:=FTit.Caption; if FTitle.Orientation <> toHorizontal then
TextOrient:=FTit.Orientation;
end;
if TextOrient = toHorizontal then
begin
aRect2:=aRect;
// aRect2.Left:=aRect2.Left - 2;
Inc(aRect2.Left, 2);
Dec(aRect2.Right, 2);
if ASortMarker <> smNone then
aRect2.Right := aRect2.Right - FMarkerDown.Width;
if Assigned(FTit) and (FTit.MCountLines>0) then
begin begin
dW:=Canvas.TextHeight('W') + 4; OutCaptionCellText90(aCol, aRow, aRect, aState, FTitle.Caption, FTitle.Orientation);
for i:=0 to FTit.MCountLines-1 do if Down then
aState:= aState + [gdPushed];
end
else
if (FTitle.CaptionLinesCount>0) then
begin
aRect2.Left:=aRect.Left;
aRect2.Right:=aRect.Right;
aRect2.Top:=aRect.Top;
for i:=0 to FTitle.CaptionLinesCount - 1 do
begin begin
FCap:=FTit.MGetLine(i); MLI:=FTitle.CaptionLine(i);
dww:=ATextWidth(FCap) * dW; aRect2.Right:=aRect.Right;
aRect2.Bottom:=aRect2.Top + dww;
if i = FTitle.CaptionLinesCount - 1 then
WriteTextHeader(Canvas, aRect2, FCap, GetColumnAlignment(aCol, true));
aRect2.Top:=aRect2.Top + dww;
if (rdgMultiTitleLines in OptionsRx) and (i < FTit.MCountLines-1) then
begin begin
Canvas.Pen.Style := psSolid; aRect2.Bottom:=aRect.Bottom;
Canvas.Pen.Color := cl3DShadow; aRect.Top:=ARect2.Top;
Canvas.Line(aRect2.Right - 4, aRect2.Top, aRect2.Left, aRect2.Top); if Down then
Canvas.Pen.Color := cl3DHilight; aState:= aState + [gdPushed];
Canvas.Line(aRect2.Right - 4, aRect2.Top+1, aRect2.Left, aRect2.Top+1); end
else
begin
aRect2.Bottom:=aRect2.Top + DefaultRowHeight;
end; end;
aRect2.Top:=aRect2.Top + 1;
if Assigned(MLI.Next) then
begin
if Assigned(MLI.Prior) then
begin
if aCol = LeftCol then
OutCaptionMLCellText(aCol, aRow, aRect2, aState, MLI);
end
else
OutCaptionMLCellText(aCol, aRow, aRect2, aState, MLI);
end
else
begin
if not Assigned(MLI.Prior) then
begin
OutCaptionCellText(aCol, aRow, aRect2, aState, MLI.Caption);
end
else
if aCol = LeftCol then
OutCaptionMLCellText(aCol, aRow, aRect2, aState, MLI);
end;
aRect2.Top:=aRect2.Bottom;
end; end;
end end
else else
begin begin
WriteTextHeader(Canvas, aRect2, FCap, GetColumnAlignment(aCol, true)) if Down then
aState:= aState + [gdPushed];
OutCaptionCellText(aCol, aRow, aRect, aState, FTitle.Caption);
end; end;
end end
else else
begin begin
if TextOrient in [toVertical90, toVertical270] then OutCaptionCellText(aCol, aRow, aRect, aState, GetDefaultColumnTitle(aCol));
dW:=((aRect.Bottom - aRect.Top) - Canvas.TextWidth(FCap)) div 2
else
dw:=0;
OutTextXY90(Canvas, aRect.Left, aRect.Top+dw, FCap, FTit.Orientation);
end; end;
OutCaptionSortMarker(aRect, ASortMarker);
// aRect1:=aRect;
if FTitleButtons then
begin
if ASortMarker = smDown then
begin
X1:=aRect.Right - FMarkerDown.Width - 6;
Y1:=Trunc((aRect.Top+aRect.Bottom-FMarkerDown.Height)/2);
Canvas.Draw(X1, Y1, FMarkerDown);
end
else
if ASortMarker = smUp then
begin
X1:=aRect.Right - FMarkerUp.Width - 6;
Y1:=Trunc((aRect.Top+aRect.Bottom-FMarkerUp.Height)/2);
Canvas.Draw(X1, Y1, FMarkerUp);
end;
end;
if (FTitleButtons or ([dgRowLines, dgColLines] * Options =
[dgRowLines, dgColLines])) and Down then
begin
DrawEdge(Canvas.Handle, ARect1, EdgeFlag[Down], BF_BOTTOMRIGHT);
DrawEdge(Canvas.Handle, ARect1, EdgeFlag[Down], BF_TOPLEFT);
end
end end
else else
DefaultDrawCell(aCol, aRow, aRect, aState); begin
if Down then
aState:= aState + [gdPushed];
OutCaptionCellText(aCol, aRow, aRect, aState, '');
end;
end; end;
procedure TRxDBGrid.DefaultDrawFilter(aCol, aRow: Integer; aRect: TRect; procedure TRxDBGrid.DefaultDrawFilter(aCol, aRow: Integer; aRect: TRect;
@ -1274,7 +1396,7 @@ var
AImageIndex:integer; AImageIndex:integer;
FBackground: TColor; FBackground: TColor;
begin begin
if {FTitleButtons and }(gdFixed in aState) and (aRow=0){ and (ACol>=FixedCols)} then if (gdFixed in aState) and (aRow=0) then
DefaultDrawCellA(aCol, aRow, aRect, aState) DefaultDrawCellA(aCol, aRow, aRect, aState)
else else
if not ((gdFixed in aState) or (aCol=0) or (aRow=0)) then if not ((gdFixed in aState) or (aCol=0) or (aRow=0)) then
@ -1355,12 +1477,9 @@ begin
R.Bottom:=TotalYOffs + DefaultRowHeight * FooterRowCount + 2; R.Bottom:=TotalYOffs + DefaultRowHeight * FooterRowCount + 2;
Canvas.Brush.Color := FFooterColor; Canvas.Brush.Color := FFooterColor;
// Writeln('[]Name ='+Owner.Name+'.'+Name);
if (Columns.Count > 0) then if (Columns.Count > 0) then
begin begin
TxS:=Canvas.TextStyle; TxS:=Canvas.TextStyle;
// writeln('GCache.VisibleGrid.Left =',GCache.VisibleGrid.Left,' GCache.VisibleGrid.Right=', GCache.VisibleGrid.Right);
// writeln('Columns.Count=',Columns.Count);
for i := GCache.VisibleGrid.Left to GCache.VisibleGrid.Right do for i := GCache.VisibleGrid.Left to GCache.VisibleGrid.Right do
begin begin
ColRowToOffset(True, True, i, R.Left, R.Right); ColRowToOffset(True, True, i, R.Left, R.Right);
@ -1368,8 +1487,6 @@ begin
DrawCellGrid(i, 0, R, []); DrawCellGrid(i, 0, R, []);
C := ColumnFromGridColumn(i) as TRxColumn; C := ColumnFromGridColumn(i) as TRxColumn;
// if C = nil then
// Writeln('i=',i,';', ' C = nil = ',C=nil);
if Assigned(C) then if Assigned(C) then
begin begin
TxS.Alignment:=C.Footer.Alignment; TxS.Alignment:=C.Footer.Alignment;
@ -1393,7 +1510,7 @@ end;
procedure TRxDBGrid.DoTitleClick(ACol: Longint; AField: TField); procedure TRxDBGrid.DoTitleClick(ACol: Longint; AField: TField);
begin begin
if FAutoSort and (FSortEngine<>nil) then if FAutoSort and (FSortEngine<>nil) and (AField<>nil) then
begin begin
if AField=FSortField then if AField=FSortField then
begin begin
@ -1545,7 +1662,7 @@ var
begin begin
FColumnResizing := false; FColumnResizing := false;
if FTitleButtons and FTracking and (FPressedCol <> nil) then if (dgHeaderPushedLook in Options) and FTracking and (FPressedCol <> nil) then
begin begin
Cell := MouseCoord(X, Y); Cell := MouseCoord(X, Y);
DoClick := PtInRect(Rect(0, 0, ClientWidth, ClientHeight), Point(X, Y)) DoClick := PtInRect(Rect(0, 0, ClientWidth, ClientHeight), Point(X, Y))
@ -1663,6 +1780,14 @@ begin
Dec(GCache.ClientHeight, DefaultRowHeight * FooterRowCount + 2); Dec(GCache.ClientHeight, DefaultRowHeight * FooterRowCount + 2);
end; end;
procedure TRxDBGrid.ColRowMoved(IsColumn: Boolean; FromIndex, ToIndex: Integer
);
begin
inherited ColRowMoved(IsColumn, FromIndex, ToIndex);
if IsColumn then
CalcTitle;
end;
procedure TRxDBGrid.Paint; procedure TRxDBGrid.Paint;
begin begin
inherited Paint; inherited Paint;
@ -1739,7 +1864,6 @@ var
WA:PIntegerArray; WA:PIntegerArray;
begin begin
GetMem(WA, SizeOf(Integer) * AColList.Count); GetMem(WA, SizeOf(Integer) * AColList.Count);
// FillChar(WA^, SizeOf(Integer) * AColList.Count, 0);
for I := 0 to AColList.Count-1 do for I := 0 to AColList.Count-1 do
WA^[i]:=20; WA^[i]:=20;
@ -1779,6 +1903,13 @@ begin
Result:=DefaultRowHeight = Canvas.TextHeight('W'); Result:=DefaultRowHeight = Canvas.TextHeight('W');
end; end;
procedure TRxDBGrid.VisualChange;
begin
inherited VisualChange;
if Canvas.HandleAllocated then
CalcTitle;
end;
function TRxDBGrid.EditorByStyle(Style: TColumnButtonStyle): TWinControl; function TRxDBGrid.EditorByStyle(Style: TColumnButtonStyle): TWinControl;
var var
F:TField; F:TField;
@ -1809,7 +1940,7 @@ var
P:TBookmark; P:TBookmark;
DS:TDataSet; DS:TDataSet;
i:integer; i:integer;
J:integer; // J:integer;
begin begin
if (not ((rdgFooterRows in OptionsRx) and DatalinkActive)) or (Columns.Count = 0) then if (not ((rdgFooterRows in OptionsRx) and DatalinkActive)) or (Columns.Count = 0) then
Exit; Exit;
@ -1893,16 +2024,12 @@ begin
FMarkerUp := LoadLazResBitmapImage('rx_markerup'); FMarkerUp := LoadLazResBitmapImage('rx_markerup');
FMarkerDown := LoadLazResBitmapImage('rx_markerdown'); FMarkerDown := LoadLazResBitmapImage('rx_markerdown');
{ FMarkerUp := TBitmap.Create;
FMarkerUp.LoadFromLazarusResource('rx_markerup');
FMarkerDown := TBitmap.Create;
FMarkerDown.LoadFromLazarusResource('rx_markerdown');}
FPropertyStorageLink:=TPropertyStorageLink.Create; FPropertyStorageLink:=TPropertyStorageLink.Create;
FPropertyStorageLink.OnSave:=@OnIniSave; FPropertyStorageLink.OnSave:=@OnIniSave;
FPropertyStorageLink.OnLoad:=@OnIniLoad; FPropertyStorageLink.OnLoad:=@OnIniLoad;
FTitleLines := TITLE_DEFAULT; // FTitleLines := TITLE_DEFAULT;
FAllowedOperations:=[aoInsert, aoUpdate, aoDelete, aoAppend]; FAllowedOperations:=[aoInsert, aoUpdate, aoDelete, aoAppend];
FFooterColor:=clWindow; FFooterColor:=clWindow;
@ -2070,38 +2197,64 @@ begin
TRxColumn(Column).ColumnChanged; TRxColumn(Column).ColumnChanged;
end; end;
function TRxColumnTitle.MCountLines: integer; function TRxColumnTitle.GetCaptionLinesCount: integer;
begin begin
Result:=FMultiLines.Count; if Assigned(FCaptionLines) then
Result:=FCaptionLines.Count
else
Result:=0;
end; end;
function TRxColumnTitle.MGetLine(ALine: integer): string; function TRxColumnTitle.CaptionLine(ALine:integer):TMLCaptionItem;
begin begin
if (FMultiLines.Count>0) and (ALine>=0) and (FMultiLines.Count>ALine) then if Assigned(FCaptionLines) and (FCaptionLines.Count>0) and (ALine>=0) and (FCaptionLines.Count>ALine) then
Result:=FMultiLines[ALine] Result:=TMLCaptionItem(FCaptionLines[ALine])
else else
Result:=''; Result:=nil;
end;
procedure TRxColumnTitle.ClearCaptionML;
var
i:integer;
R:TMLCaptionItem;
begin
for i:=0 to FCaptionLines.Count - 1 do
begin
R:=TMLCaptionItem(FCaptionLines[i]);
R.Free;
end;
FCaptionLines.Clear;
end; end;
procedure TRxColumnTitle.SetCaption(const AValue: TCaption); procedure TRxColumnTitle.SetCaption(const AValue: TCaption);
var var
c:integer; c:integer;
s:string; s:string;
procedure AddMLStr(AStr:string);
var
R:TMLCaptionItem;
begin
R:=TMLCaptionItem.Create;
R.Caption:=AStr;
FCaptionLines.Add(R);
end;
begin begin
inherited SetCaption(AValue); inherited SetCaption(AValue);
FMultiLines.Clear; ClearCaptionML;
c:=Pos('|', AValue); c:=Pos('|', AValue);
if C>0 then if C>0 then
begin begin
S:=AValue; S:=AValue;
while C>0 do while C>0 do
begin begin
FMultiLines.Add(Copy(S, 1, C-1)); AddMLStr(Copy(S, 1, C-1));
System.Delete(S, 1, C); System.Delete(S, 1, C);
c:=Pos('|', S); c:=Pos('|', S);
end; end;
if S<>'' then if S<>'' then
FMultiLines.Add(S); AddMLStr(S);
end; end;
if not (csLoading in Column.Grid.ComponentState) and Column.Grid.HandleAllocated then if not (csLoading in Column.Grid.ComponentState) and Column.Grid.HandleAllocated then
TRxDBGrid(Column.Grid).CalcTitle; TRxDBGrid(Column.Grid).CalcTitle;
@ -2110,15 +2263,16 @@ end;
constructor TRxColumnTitle.Create(TheColumn: TGridColumn); constructor TRxColumnTitle.Create(TheColumn: TGridColumn);
begin begin
inherited Create(TheColumn); inherited Create(TheColumn);
FMultiLines:=TStringList.Create;
{$IFDEF NEW_STYLE_TITLE_ALIGNMENT_RXDBGRID} {$IFDEF NEW_STYLE_TITLE_ALIGNMENT_RXDBGRID}
Alignment:=taCenter; Alignment:=taCenter;
{$ENDIF} {$ENDIF}
FCaptionLines:=TFPList.Create;
end; end;
destructor TRxColumnTitle.Destroy; destructor TRxColumnTitle.Destroy;
begin begin
FreeAndNil(FMultiLines); ClearCaptionML;
FreeAndNil(FCaptionLines);
inherited Destroy; inherited Destroy;
end; end;

View File

@ -25,7 +25,7 @@ translate to Lazarus by alexs in 2005 - 2009
"/> "/>
<License Value="free ware <License Value="free ware
"/> "/>
<Version Major="2" Release="1" Build="103"/> <Version Major="2" Minor="1" Release="1" Build="103"/>
<Files Count="51"> <Files Count="51">
<Item1> <Item1>
<Filename Value="rxlookup.pas"/> <Filename Value="rxlookup.pas"/>