in rxdbgridCollumn add property EditButtons - collection of custom buttons for edit cell. See RxDBGrid demo - collumn price
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2489 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
0cb1b33ac4
commit
774aa2e4f9
@ -54,30 +54,31 @@
|
||||
<MinVersion Major="1" Release="18" Build="56" Valid="True"/>
|
||||
</Item4>
|
||||
</RequiredPackages>
|
||||
<Units Count="58">
|
||||
<Units Count="63">
|
||||
<Unit0>
|
||||
<Filename Value="RxDBGridDemo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="RxDBGridDemo"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="9" Y="16"/>
|
||||
<UsageCount Value="54"/>
|
||||
<UsageCount Value="56"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="RxDBGridMainForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="RxDBGridMainUnit"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="105"/>
|
||||
<CursorPos X="3" Y="97"/>
|
||||
<UsageCount Value="54"/>
|
||||
<TopLine Value="196"/>
|
||||
<CursorPos X="21" Y="201"/>
|
||||
<UsageCount Value="56"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
@ -170,8 +171,8 @@
|
||||
<Filename Value="../../../install/2/rxdbgrid.diff"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="1" Y="21"/>
|
||||
<SyntaxHighlighter Value="None"/>
|
||||
<UsageCount Value="8"/>
|
||||
<DefaultSyntaxHighlighter Value="Diff"/>
|
||||
</Unit14>
|
||||
<Unit15>
|
||||
<Filename Value="../../../lcl/interfaces/gtk/gtkdevicecontext.inc"/>
|
||||
@ -431,9 +432,7 @@
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="429"/>
|
||||
<CursorPos X="33" Y="447"/>
|
||||
<SyntaxHighlighter Value="FreePascal"/>
|
||||
<UsageCount Value="9"/>
|
||||
<DefaultSyntaxHighlighter Value="Text"/>
|
||||
</Unit49>
|
||||
<Unit50>
|
||||
<Filename Value="../../../lcl/actnlist.pas"/>
|
||||
@ -441,9 +440,7 @@
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="206"/>
|
||||
<CursorPos X="33" Y="224"/>
|
||||
<SyntaxHighlighter Value="FreePascal"/>
|
||||
<UsageCount Value="9"/>
|
||||
<DefaultSyntaxHighlighter Value="Text"/>
|
||||
</Unit50>
|
||||
<Unit51>
|
||||
<Filename Value="../../../lcl/lclproc.pas"/>
|
||||
@ -451,18 +448,15 @@
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1154"/>
|
||||
<CursorPos X="10" Y="1165"/>
|
||||
<SyntaxHighlighter Value="FreePascal"/>
|
||||
<UsageCount Value="9"/>
|
||||
<DefaultSyntaxHighlighter Value="Text"/>
|
||||
</Unit51>
|
||||
<Unit52>
|
||||
<Filename Value="rxdbgridmainunit.lfm"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="100"/>
|
||||
<TopLine Value="133"/>
|
||||
<CursorPos X="5" Y="103"/>
|
||||
<SyntaxHighlighter Value="LFM"/>
|
||||
<UsageCount Value="9"/>
|
||||
<DefaultSyntaxHighlighter Value="Text"/>
|
||||
<UsageCount Value="10"/>
|
||||
<DefaultSyntaxHighlighter Value="LFM"/>
|
||||
</Unit52>
|
||||
<Unit53>
|
||||
<Filename Value="../../../install/fpcsrc/rtl/objpas/classes/collect.inc"/>
|
||||
@ -502,24 +496,180 @@
|
||||
<CursorPos X="49" Y="3"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit57>
|
||||
<Unit58>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<UnitName Value="rxdbgrid"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="556"/>
|
||||
<CursorPos X="15" Y="572"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Bookmarks Count="3">
|
||||
<Item0 X="3" Y="73" ID="1"/>
|
||||
<Item1 X="13" Y="328" ID="2"/>
|
||||
<Item2 X="15" Y="572" ID="3"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
</Unit58>
|
||||
<Unit59>
|
||||
<Filename Value="/usr/local/share/lazarus/lcl/dbgrids.pas"/>
|
||||
<UnitName Value="DBGrids"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="199"/>
|
||||
<CursorPos X="3" Y="220"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit59>
|
||||
<Unit60>
|
||||
<Filename Value="/usr/local/share/lazarus/lcl/grids.pas"/>
|
||||
<UnitName Value="Grids"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="7494"/>
|
||||
<CursorPos X="34" Y="7503"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit60>
|
||||
<Unit61>
|
||||
<Filename Value="../../../../../../install/fpcsrc/rtl/objpas/classes/classesh.inc"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1554"/>
|
||||
<CursorPos X="38" Y="1569"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit61>
|
||||
<Unit62>
|
||||
<Filename Value="/usr/local/share/lazarus/lcl/buttons.pp"/>
|
||||
<UnitName Value="Buttons"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="333"/>
|
||||
<CursorPos X="3" Y="360"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit62>
|
||||
</Units>
|
||||
<JumpHistory Count="4" HistoryIndex="3">
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="9" Column="11" TopLine="1"/>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="329" Column="37" TopLine="307"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="88" Column="11" TopLine="70"/>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="814" Column="24" TopLine="812"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="96" Column="3" TopLine="92"/>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="568" Column="15" TopLine="547"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="RxDBGridDemo.lpr"/>
|
||||
<Caret Line="16" Column="9" TopLine="1"/>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="73" Column="3" TopLine="52"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="332" Column="67" TopLine="303"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="24" Column="32" TopLine="1"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="187" Column="34" TopLine="185"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="326" Column="35" TopLine="303"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="327" Column="41" TopLine="297"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="332" Column="37" TopLine="310"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="333" Column="39" TopLine="319"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="200" Column="26" TopLine="189"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="332" Column="17" TopLine="307"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="138" Column="11" TopLine="113"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="73" Column="3" TopLine="57"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="839" Column="6" TopLine="836"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="1" Column="1" TopLine="1"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="568" Column="20" TopLine="542"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="3498" Column="26" TopLine="3472"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="3500" Column="18" TopLine="3474"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="1" Column="1" TopLine="1"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="2315" Column="50" TopLine="2292"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="2318" Column="50" TopLine="2292"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="336" Column="15" TopLine="305"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="317" Column="15" TopLine="301"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="/usr/local/share/lazarus/components/rxnew/rxdbgrid.pas"/>
|
||||
<Caret Line="328" Column="13" TopLine="302"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="144" Column="3" TopLine="141"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="83" Column="36" TopLine="65"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="199" Column="24" TopLine="196"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="rxdbgridmainunit.pas"/>
|
||||
<Caret Line="198" Column="27" TopLine="182"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
@ -574,4 +724,5 @@
|
||||
</Item1>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
<EditorMacros Count="0"/>
|
||||
</CONFIG>
|
||||
|
@ -1,19 +1,19 @@
|
||||
object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Left = 151
|
||||
Height = 786
|
||||
Top = 48
|
||||
Left = 296
|
||||
Height = 721
|
||||
Top = 115
|
||||
Width = 1187
|
||||
ActiveControl = Panel1
|
||||
Caption = 'RxDBGrid Demo'
|
||||
ClientHeight = 763
|
||||
ClientHeight = 698
|
||||
ClientWidth = 1187
|
||||
Menu = MainMenu1
|
||||
OnCreate = FormCreate
|
||||
ShowHint = True
|
||||
LCLVersion = '0.9.31'
|
||||
LCLVersion = '1.1'
|
||||
object RxDBGrid1: TRxDBGrid
|
||||
Left = 0
|
||||
Height = 699
|
||||
Height = 634
|
||||
Top = 64
|
||||
Width = 1187
|
||||
TitleButtons = True
|
||||
@ -38,6 +38,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyValue = '(Нет)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
EditButtons = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
@ -56,6 +57,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyValue = '(Нет)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
EditButtons = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
@ -71,6 +73,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyValue = '(Нет)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
EditButtons = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
@ -86,6 +89,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyValue = '(Нет)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
EditButtons = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
@ -106,6 +110,20 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyValue = '(Нет)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
EditButtons = <
|
||||
item
|
||||
Glyph.Data = {
|
||||
CE000000424DCE0000000000000076000000280000000B0000000B0000000100
|
||||
0400000000005800000000000000000000000000000000000000000000000000
|
||||
8000008000000080800080000000800080008080000080808000C0C0C0000000
|
||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00EEEEEEEEEEE0
|
||||
0000EEEEEEEEEEE00000EE00EEEE00E00000EEE00EE00EE00000EEEE0000EEE0
|
||||
0000EEEEE00EEEE00000EEEE0000EEE00000EEE00EE00EE00000EE00EEEE00E0
|
||||
0000EEEEEEEEEEE00000EEEEEEEEEEE00000
|
||||
}
|
||||
Hint = 'Clear value'
|
||||
OnClick = TRxColumnEditButtons2Click
|
||||
end>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
@ -120,6 +138,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyValue = '(Нет)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
EditButtons = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
@ -134,6 +153,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyValue = '(Нет)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
EditButtons = <>
|
||||
end
|
||||
item
|
||||
ButtonStyle = cbsPickList
|
||||
@ -152,6 +172,43 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
DirectInput = False
|
||||
EditButtons = <
|
||||
item
|
||||
Glyph.Data = {
|
||||
F6000000424DF600000000000000760000002800000010000000100000000100
|
||||
0400000000008000000000000000000000000000000000000000000000000000
|
||||
8000008000000080800080000000800080008080000080808000C0C0C0000000
|
||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00666666006666
|
||||
666666666077066666666666077B06666666600077B0700F766607777B0770FF
|
||||
007607BBB070000FFF067B0BB0077770F0060BBB70077700FF07607000077770
|
||||
FFF76660007777770F06666000077070000766600007770B00B0666000000007
|
||||
BB06666600000000006666666000066666666666666666666666
|
||||
}
|
||||
Hint = 'Первая кнопка'
|
||||
Width = 16
|
||||
OnClick = TRxColumnEditButtons0Click
|
||||
end
|
||||
item
|
||||
Glyph.Data = {
|
||||
C6010000424DC60100000000000036000000280000000A0000000A0000000100
|
||||
2000000000009001000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000808080FFFFFF
|
||||
FFFF000000000000000000000000000000000000000000000000000000008080
|
||||
80FF0000000000000000FFFFFFFF000000000000000000000000000000000000
|
||||
000000000000808080FF0000000000000000FFFFFFFF00000000000000000000
|
||||
00000000000000000000808080FF00000000000000000000000000000000FFFF
|
||||
FFFF00000000000000000000000000000000808080FF00000000000000000000
|
||||
000000000000FFFFFFFF000000000000000000000000808080FF000000000000
|
||||
000000000000000000000000000000000000FFFFFFFF00000000000000008080
|
||||
80FF808080FF808080FF808080FF808080FF808080FF808080FFFFFFFFFF0000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000
|
||||
}
|
||||
Hint = 'Вторая кнопка'
|
||||
OnClick = TRxColumnEditButtons1Click
|
||||
end>
|
||||
end>
|
||||
KeyStrokes = <
|
||||
item
|
||||
@ -223,9 +280,9 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Panel1
|
||||
Left = 270
|
||||
Height = 16
|
||||
Height = 15
|
||||
Top = 7
|
||||
Width = 36
|
||||
Width = 35
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Mode'
|
||||
ParentColor = False
|
||||
@ -276,7 +333,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 276
|
||||
Height = 25
|
||||
Top = 29
|
||||
Top = 28
|
||||
Width = 217
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 0
|
||||
@ -336,6 +393,12 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
TabOrder = 6
|
||||
end
|
||||
end
|
||||
object SpeedButton1: TSpeedButton
|
||||
Left = 596
|
||||
Height = 22
|
||||
Top = 443
|
||||
Width = 23
|
||||
end
|
||||
object RxMemoryData1: TRxMemoryData
|
||||
AutoCalcFields = False
|
||||
FieldDefs = <
|
||||
@ -383,6 +446,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
end>
|
||||
OnFilterRecord = RxMemoryData1FilterRecordEx
|
||||
OnFilterRecordEx = RxMemoryData1FilterRecordEx
|
||||
PacketRecords = 0
|
||||
left = 152
|
||||
top = 264
|
||||
object RxMemoryData1ID1: TLongintField
|
||||
@ -556,7 +620,8 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
Precision = 0
|
||||
Size = 130
|
||||
end>
|
||||
left = 240
|
||||
PacketRecords = 0
|
||||
left = 248
|
||||
top = 264
|
||||
object RxMemoryData2DEVELOPER_ID1: TLongintField
|
||||
DisplayWidth = 10
|
||||
@ -582,7 +647,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
end
|
||||
object XMLPropStorage1: TXMLPropStorage
|
||||
StoredValues = <>
|
||||
left = 241
|
||||
left = 272
|
||||
top = 128
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
@ -1239,7 +1304,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
|
||||
050505050505050505050505050505050505C3C3BFF84F17C91A5A01F4000000
|
||||
0049454E44AE426082
|
||||
}
|
||||
left = 858
|
||||
top = 28
|
||||
left = 856
|
||||
top = 48
|
||||
end
|
||||
end
|
||||
|
@ -21,6 +21,7 @@ type
|
||||
MenuItem9: TMenuItem;
|
||||
RxAboutDialog1: TRxAboutDialog;
|
||||
RxMemoryData1RAIT: TStringField;
|
||||
SpeedButton1: TSpeedButton;
|
||||
sysExit: TAction;
|
||||
hlpAbout: TAction;
|
||||
CheckBox2: TCheckBox;
|
||||
@ -77,6 +78,9 @@ type
|
||||
procedure showColumnsDialogExecute(Sender: TObject);
|
||||
procedure showFindDialogExecute(Sender: TObject);
|
||||
procedure sysExitExecute(Sender: TObject);
|
||||
procedure TRxColumnEditButtons0Click(Sender: TObject);
|
||||
procedure TRxColumnEditButtons1Click(Sender: TObject);
|
||||
procedure TRxColumnEditButtons2Click(Sender: TObject);
|
||||
private
|
||||
procedure DoFillFilters;
|
||||
public
|
||||
@ -129,9 +133,9 @@ begin
|
||||
RxMemoryData1.AppendRecord([14, 'Бух. комплекс "45-я Параллель"', 180, 'ООО "Boot"', EncodeDate(2007, 2, 1), 3]);
|
||||
RxMemoryData1.AppendRecord([15, 'Консультант+', 380, 'Консультант+', EncodeDate(2007, 2, 1), 3]);
|
||||
RxMemoryData1.AppendRecord([16, 'Гарант', 480, 'Гарант', EncodeDate(2007, 2, 1), 3]);
|
||||
// DoFillFilters;
|
||||
|
||||
RxMemoryData1.First;
|
||||
RxDBGrid1.CalcStatTotals; //fix error in GotoBookmark
|
||||
// RxDBGrid1.CalcStatTotals; //fix error in GotoBookmark
|
||||
|
||||
|
||||
end;
|
||||
@ -179,6 +183,24 @@ begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TRxDBGridMainForm.TRxColumnEditButtons0Click(Sender: TObject);
|
||||
begin
|
||||
ShowMessage('Click first button');
|
||||
end;
|
||||
|
||||
procedure TRxDBGridMainForm.TRxColumnEditButtons1Click(Sender: TObject);
|
||||
begin
|
||||
ShowMessage('Click next button');
|
||||
end;
|
||||
|
||||
procedure TRxDBGridMainForm.TRxColumnEditButtons2Click(Sender: TObject);
|
||||
begin
|
||||
if RxMemoryData1.State <> dsEdit then
|
||||
RxMemoryData1.Edit;
|
||||
RxMemoryData1PRICE1.Clear;
|
||||
RxMemoryData1.Post;
|
||||
end;
|
||||
|
||||
procedure TRxDBGridMainForm.DoFillFilters;
|
||||
var
|
||||
C:TRxColumn;
|
||||
@ -206,7 +228,7 @@ end;
|
||||
|
||||
procedure TRxDBGridMainForm.actCalcTotalExecute(Sender: TObject);
|
||||
begin
|
||||
RxDBGrid1.CalcStatTotals; //fix error in GotoBookmark
|
||||
RxDBGrid1.CalcStatTotals;
|
||||
end;
|
||||
|
||||
procedure TRxDBGridMainForm.actOptimizeColumnsWidthAllExecute(Sender: TObject);
|
||||
@ -254,7 +276,5 @@ begin
|
||||
RxDBGrid1.ReadOnly:=ComboBox1.ItemIndex <> 0;
|
||||
end;
|
||||
|
||||
//TRxAboutDialog
|
||||
|
||||
end.
|
||||
|
||||
|
@ -37,7 +37,7 @@ unit rxdbgrid;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, LCLType, LCLIntf, Forms, Controls,
|
||||
Classes, SysUtils, LResources, LCLType, LCLIntf, Forms, Controls, Buttons,
|
||||
Graphics, Dialogs, Grids, dbutils, DBGrids, DB, PropertyStorage, vclutils,
|
||||
LMessages, types, StdCtrls, Menus;
|
||||
|
||||
@ -70,6 +70,9 @@ type
|
||||
TRxDBGridAllowedOperation = (aoInsert, aoUpdate, aoDelete, aoAppend);
|
||||
TRxDBGridAllowedOperations = set of TRxDBGridAllowedOperation;
|
||||
|
||||
TRxColumnEditButtonStyle = (ebsDropDownRx, ebsEllipsisRx, ebsGlyphRx, ebsUpDownRx,
|
||||
ebsPlusRx, ebsMinusRx);
|
||||
|
||||
TFooterValueType = (fvtNon, fvtSum, fvtAvg, fvtCount, fvtFieldValue,
|
||||
fvtStaticText, fvtMax, fvtMin, fvtRecNo);
|
||||
|
||||
@ -294,11 +297,64 @@ type
|
||||
property ItemIndex: integer read GetItemIndex write SetItemIndex;
|
||||
end;
|
||||
|
||||
{ TRxColumnEditButton }
|
||||
|
||||
TRxColumnEditButton = class(TCollectionItem)
|
||||
private
|
||||
FShortCut: TShortCut;
|
||||
FStyle: TRxColumnEditButtonStyle;
|
||||
FButton:TSpeedButton;
|
||||
FVisible: Boolean;
|
||||
function GetGlyph: TBitmap;
|
||||
function GetHint: String;
|
||||
function GetNumGlyphs: Integer;
|
||||
function GetOnButtonClick: TNotifyEvent;
|
||||
function GetWidth: Integer;
|
||||
procedure SetGlyph(AValue: TBitmap);
|
||||
procedure SetHint(AValue: String);
|
||||
procedure SetNumGlyphs(AValue: Integer);
|
||||
procedure SetOnButtonClick(AValue: TNotifyEvent);
|
||||
procedure SetStyle(AValue: TRxColumnEditButtonStyle);
|
||||
procedure SetVisible(AValue: Boolean);
|
||||
procedure SetWidth(AValue: Integer);
|
||||
protected
|
||||
function GetDisplayName: string; override;
|
||||
public
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
destructor Destroy; override;
|
||||
published
|
||||
//property DropdownMenu: TPopupMenu read FDropdownMenu write FDropdownMenu; :TODO:
|
||||
property Glyph: TBitmap read GetGlyph write SetGlyph;
|
||||
property Hint: String read GetHint write SetHint;
|
||||
property NumGlyphs: Integer read GetNumGlyphs write SetNumGlyphs default 1;
|
||||
property ShortCut: TShortCut read FShortCut write FShortCut default scNone;
|
||||
property Style: TRxColumnEditButtonStyle read FStyle write SetStyle default ebsDropDownRx;
|
||||
property Visible: Boolean read FVisible write SetVisible default true;
|
||||
property Width: Integer read GetWidth write SetWidth default 15;
|
||||
property OnClick: TNotifyEvent read GetOnButtonClick write SetOnButtonClick;
|
||||
//property OnDown: TNotifyEvent read FOnButtonDown write FOnButtonDown;
|
||||
end;
|
||||
|
||||
TRxColumnEditButtons = class(TCollection)
|
||||
private
|
||||
FOwner: TPersistent;
|
||||
function GetItem(Index: integer): TRxColumnEditButton;
|
||||
procedure SetItem(Index: integer; AValue: TRxColumnEditButton);
|
||||
protected
|
||||
procedure Update(Item: TCollectionItem); override;
|
||||
public
|
||||
constructor Create(AOwner: TPersistent);
|
||||
function Add: TRxColumnEditButton;
|
||||
public
|
||||
property Items[Index: integer]: TRxColumnEditButton read GetItem write SetItem; default;
|
||||
end;
|
||||
|
||||
{ TRxColumn }
|
||||
|
||||
TRxColumn = class(TColumn)
|
||||
private
|
||||
FDirectInput: boolean;
|
||||
FEditButtons: TRxColumnEditButtons;
|
||||
FFooter: TRxColumnFooter;
|
||||
FFilter: TRxColumnFilter;
|
||||
FImageList: TImageList;
|
||||
@ -306,6 +362,7 @@ type
|
||||
FNotInKeyListIndex: integer;
|
||||
function GetFooter: TRxColumnFooter;
|
||||
function GetKeyList: TStrings;
|
||||
procedure SetEditButtons(AValue: TRxColumnEditButtons);
|
||||
procedure SetFilter(const AValue: TRxColumnFilter);
|
||||
procedure SetFooter(const AValue: TRxColumnFooter);
|
||||
procedure SetImageList(const AValue: TImageList);
|
||||
@ -325,6 +382,7 @@ type
|
||||
write SetNotInKeyListIndex default -1;
|
||||
property Filter: TRxColumnFilter read FFilter write SetFilter;
|
||||
property DirectInput : boolean read FDirectInput write FDirectInput default true;
|
||||
property EditButtons:TRxColumnEditButtons read FEditButtons write SetEditButtons;
|
||||
end;
|
||||
|
||||
{ TRxDbGridColumns }
|
||||
@ -469,6 +527,7 @@ type
|
||||
override;
|
||||
procedure LinkActive(Value: boolean); override;
|
||||
procedure DrawFooterRows; virtual;
|
||||
|
||||
procedure DoTitleClick(ACol: longint; AField: TField); virtual;
|
||||
procedure MouseMove(Shift: TShiftState; X, Y: integer); override;
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||
@ -508,6 +567,10 @@ type
|
||||
procedure OnChooseVisibleFields(Sender: TObject);
|
||||
procedure Loaded; override;
|
||||
procedure UpdateFooterRowOnUpdateActive;
|
||||
|
||||
procedure DoEditorHide; override;
|
||||
procedure DoEditorShow; override;
|
||||
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -743,6 +806,125 @@ type
|
||||
procedure EditingDone; override;
|
||||
end;
|
||||
|
||||
{ TRxColumnEditButton }
|
||||
|
||||
function TRxColumnEditButton.GetGlyph: TBitmap;
|
||||
begin
|
||||
Result:=FButton.Glyph;
|
||||
end;
|
||||
|
||||
function TRxColumnEditButton.GetHint: String;
|
||||
begin
|
||||
Result:=FButton.Hint;
|
||||
end;
|
||||
|
||||
function TRxColumnEditButton.GetNumGlyphs: Integer;
|
||||
begin
|
||||
Result:=FButton.NumGlyphs;
|
||||
end;
|
||||
|
||||
function TRxColumnEditButton.GetOnButtonClick: TNotifyEvent;
|
||||
begin
|
||||
Result:=FButton.OnClick;
|
||||
end;
|
||||
|
||||
function TRxColumnEditButton.GetWidth: Integer;
|
||||
begin
|
||||
Result:=FButton.Width;
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButton.SetGlyph(AValue: TBitmap);
|
||||
begin
|
||||
FButton.Glyph.Assign(AValue);
|
||||
if not (csLoading in TRxDBGrid(TRxColumnEditButtons(Collection).Owner).ComponentState) then
|
||||
FStyle:=ebsGlyphRx;
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButton.SetHint(AValue: String);
|
||||
begin
|
||||
FButton.Hint:=AValue;
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButton.SetNumGlyphs(AValue: Integer);
|
||||
begin
|
||||
FButton.NumGlyphs:=AValue;
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButton.SetOnButtonClick(AValue: TNotifyEvent);
|
||||
begin
|
||||
FButton.OnClick:=AValue;
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButton.SetStyle(AValue: TRxColumnEditButtonStyle);
|
||||
begin
|
||||
if FStyle=AValue then Exit;
|
||||
FStyle:=AValue;
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButton.SetVisible(AValue: Boolean);
|
||||
begin
|
||||
if FVisible=AValue then Exit;
|
||||
FVisible:=AValue;
|
||||
FButton.Visible:=AValue;
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButton.SetWidth(AValue: Integer);
|
||||
begin
|
||||
FButton.Width:=AValue;
|
||||
end;
|
||||
|
||||
function TRxColumnEditButton.GetDisplayName: string;
|
||||
begin
|
||||
if Hint<>'' then
|
||||
Result:=Hint
|
||||
else
|
||||
Result:='TRxColumnEditButton';
|
||||
end;
|
||||
|
||||
constructor TRxColumnEditButton.Create(ACollection: TCollection);
|
||||
begin
|
||||
inherited Create(ACollection);
|
||||
FButton:=TSpeedButton.Create(nil);
|
||||
FButton.Glyph:=LoadLazResBitmapImage('rx_markerdown');
|
||||
FVisible:=true;
|
||||
Width:=15;
|
||||
end;
|
||||
|
||||
destructor TRxColumnEditButton.Destroy;
|
||||
begin
|
||||
FreeAndNil(FButton);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
{ TRxColumnEditButtons }
|
||||
|
||||
function TRxColumnEditButtons.GetItem(Index: integer): TRxColumnEditButton;
|
||||
begin
|
||||
Result:= TRxColumnEditButton(inherited Items[Index]);
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButtons.SetItem(Index: integer;
|
||||
AValue: TRxColumnEditButton);
|
||||
begin
|
||||
inherited SetItem(Index, AValue);
|
||||
end;
|
||||
|
||||
procedure TRxColumnEditButtons.Update(Item: TCollectionItem);
|
||||
begin
|
||||
inherited Update(Item);
|
||||
end;
|
||||
|
||||
constructor TRxColumnEditButtons.Create(AOwner: TPersistent);
|
||||
begin
|
||||
inherited Create(TRxColumnEditButton);
|
||||
FOwner:=AOwner;
|
||||
end;
|
||||
|
||||
function TRxColumnEditButtons.Add: TRxColumnEditButton;
|
||||
begin
|
||||
Result := TRxColumnEditButton(inherited Add);
|
||||
end;
|
||||
|
||||
{ TRxDBGridFooterOptions }
|
||||
|
||||
procedure TRxDBGridFooterOptions.SetActive(AValue: boolean);
|
||||
@ -3335,6 +3517,57 @@ begin
|
||||
FOldDataSetState:=dsInactive;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.DoEditorHide;
|
||||
var
|
||||
R:TRxColumn;
|
||||
i, w:integer;
|
||||
begin
|
||||
inherited DoEditorHide;
|
||||
R:=SelectedColumn as TRxColumn;
|
||||
|
||||
if Assigned(Editor) then
|
||||
for i:=0 to R.EditButtons.Count-1 do
|
||||
R.EditButtons[i].FButton.Visible:=false;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.DoEditorShow;
|
||||
var
|
||||
R:TRxColumn;
|
||||
i, w:integer;
|
||||
begin
|
||||
inherited DoEditorShow;
|
||||
|
||||
R:=SelectedColumn as TRxColumn;
|
||||
|
||||
if Assigned(Editor) then
|
||||
begin
|
||||
W:=0;
|
||||
for i:=0 to R.EditButtons.Count-1 do
|
||||
begin
|
||||
if R.EditButtons[i].Visible then
|
||||
W:=W+R.EditButtons[i].Width;
|
||||
end;
|
||||
|
||||
if W>0 then
|
||||
begin
|
||||
Editor.Width:=Editor.Width - W;
|
||||
W:=Editor.Width + Editor.Left;
|
||||
|
||||
for i:=0 to R.EditButtons.Count-1 do
|
||||
if R.EditButtons[i].Visible then
|
||||
begin
|
||||
R.EditButtons[i].FButton.Parent:=Self;
|
||||
R.EditButtons[i].FButton.Left:=W;
|
||||
R.EditButtons[i].FButton.Top:=Editor.Top;
|
||||
R.EditButtons[i].FButton.Height:=Editor.Height;
|
||||
R.EditButtons[i].FButton.Visible:=true;
|
||||
|
||||
W:=W+R.EditButtons[i].FButton.Width;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxDBGrid.GetOnCreateLookup;
|
||||
begin
|
||||
if Assigned(F_CreateLookup) then
|
||||
@ -3490,6 +3723,11 @@ begin
|
||||
Result := FKeyList;
|
||||
end;
|
||||
|
||||
procedure TRxColumn.SetEditButtons(AValue: TRxColumnEditButtons);
|
||||
begin
|
||||
FEditButtons.Assign(AValue);
|
||||
end;
|
||||
|
||||
procedure TRxColumn.SetFilter(const AValue: TRxColumnFilter);
|
||||
begin
|
||||
FFilter.Assign(AValue);
|
||||
@ -3546,10 +3784,12 @@ begin
|
||||
FFooter := TRxColumnFooter.Create(Self);
|
||||
FFilter := TRxColumnFilter.Create(Self);
|
||||
FDirectInput := true;
|
||||
FEditButtons:=TRxColumnEditButtons.Create(Self);
|
||||
end;
|
||||
|
||||
destructor TRxColumn.Destroy;
|
||||
begin
|
||||
FreeAndNil(FEditButtons);
|
||||
if FKeyList <> nil then
|
||||
begin
|
||||
FKeyList.Free;
|
||||
|
Loading…
Reference in New Issue
Block a user