Стартовый пул
This commit is contained in:
@@ -0,0 +1,434 @@
|
||||
object Form1: TForm1
|
||||
Left = 469
|
||||
Height = 537
|
||||
Top = 245
|
||||
Width = 898
|
||||
Caption = 'RxDBGrid demo - SelectedFont'
|
||||
ClientHeight = 537
|
||||
ClientWidth = 898
|
||||
OnCreate = FormCreate
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.9.0.0'
|
||||
object Panel1: TPanel
|
||||
Left = 698
|
||||
Height = 537
|
||||
Top = 0
|
||||
Width = 200
|
||||
Align = alRight
|
||||
ClientHeight = 537
|
||||
ClientWidth = 200
|
||||
TabOrder = 0
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = ColorBox1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 20
|
||||
Top = 105
|
||||
Width = 87
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Selected font'
|
||||
ParentColor = False
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = Panel1
|
||||
Left = 7
|
||||
Height = 24
|
||||
Top = 7
|
||||
Width = 97
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Row select'
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 0
|
||||
end
|
||||
object Label2: TLabel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideBottom.Control = SpinEdit1
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 20
|
||||
Top = 217
|
||||
Width = 58
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Font size'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = CheckBox1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 20
|
||||
Top = 37
|
||||
Width = 93
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Selected color'
|
||||
ParentColor = False
|
||||
end
|
||||
object ColorBox1: TColorBox
|
||||
AnchorSideLeft.Control = Label3
|
||||
AnchorSideTop.Control = Label3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 13
|
||||
Height = 36
|
||||
Top = 63
|
||||
Width = 180
|
||||
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 0
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 1
|
||||
end
|
||||
object Label4: TLabel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = Label1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 20
|
||||
Top = 131
|
||||
Width = 68
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Font name'
|
||||
ParentColor = False
|
||||
end
|
||||
object EditButton1: TEditButton
|
||||
AnchorSideLeft.Control = Label4
|
||||
AnchorSideTop.Control = Label4
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 13
|
||||
Height = 37
|
||||
Top = 157
|
||||
Width = 180
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ButtonWidth = 23
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
|
||||
FF00FFFFFF00E69B6266E69A61FFE5975EFFE2945BFFE3935AFFE3915733FFFF
|
||||
FF00E38F5499E28D53FFE28C51FFE28A50FFE28A50FFE28A5099FFFFFF00FFFF
|
||||
FF00FFFFFF00E79F6611E79C6477E8A573FFDB915FFEDC905DA9E5945B10FFFF
|
||||
FF00E3915722E3905677E59A68FFEAAD83FFE4945EFFE28A5044FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00E79E6666E5A575FFDD9868FFDA905E2DFFFF
|
||||
FF00FFFFFF00FFFFFF00E39057FFE9A77AFFE28D54CCFFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E7A16888E1A579FFDC9462F5DB91
|
||||
61BDDA905EBDD88D5BBDDF9A6CFFE9A779FFE39056BBFFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E9A36A11E6A169E3E3AA80FFDC95
|
||||
64ADDB946203FFFFFF00E5975DFFE9A676FFE3935A99FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E9A56D33E5A472FFDF9B
|
||||
68FAE59C6653E79C6477E9A673FFE8A572FFE5955D77FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00419149E539853FFF317A37FF2A702FFF86864AFBE4AA
|
||||
7CFFDF9C69D1E7A16879EAAA79FFE9A876FFE69A6177FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00419149F99BD2A2FF95D09DFF2A702FF8E7A6
|
||||
70DBE2A16DF9E29F6ABAEDB487FFE9A672FFE79C6444FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF0051A75A8A71B67AFFA6D8ADFF9ED3A5FF317A37FCEAAA
|
||||
7322E5A670FAE3A26FFCEEBC95FFEAA975FFE7A16844FFFFFF00DB7423DDD970
|
||||
1EFFD86B1BCC84A052CA80C588FFB0DCB6FF75B87CFF419149F539853FFBE5A9
|
||||
76E7E5A874F4EABB92FFE9BA93FFE7B489FFE09E6CE8FFFFFF00E49555FFDB77
|
||||
25EEDB701F778CA453F288CB90FF83C68BFF619F52BF499C5203419149E1E6AC
|
||||
788AE5AA7791E7A976D4E6A974E2E5A671E2E2A27094FFFFFF00E18E42FFDF7E
|
||||
2EEEDB792733DB74235592AA5DFF85A151F958B16203FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E28B3A55DF85
|
||||
35DDE18C41FFDD7B2ACCE7A36CFFDE813AFFD86C1B44FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E2904022E28D
|
||||
3CBBE1873977DF843177DF7E2ECCE49859FFDB742388FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E6954722E698
|
||||
4EFFE28E40DDE28B3A11DF853588E69F60FFDD7B2ABBFFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E697
|
||||
4755E49445DDE39344FFE69A52FFE28E43FFDF843188FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
|
||||
}
|
||||
MaxLength = 0
|
||||
NumGlyphs = 1
|
||||
OnButtonClick = EditButton1ButtonClick
|
||||
PasswordChar = #0
|
||||
Spacing = 0
|
||||
TabOrder = 2
|
||||
Text = 'EditButton1'
|
||||
end
|
||||
object SpinEdit1: TSpinEdit
|
||||
AnchorSideLeft.Control = Label2
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = EditButton1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 71
|
||||
Height = 37
|
||||
Top = 200
|
||||
Width = 89
|
||||
BorderSpacing.Around = 6
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 3
|
||||
Value = 1
|
||||
end
|
||||
object CheckBox2: TCheckBox
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = SpinEdit1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 24
|
||||
Top = 243
|
||||
Width = 55
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Bold'
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 4
|
||||
end
|
||||
object CheckBox3: TCheckBox
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = CheckBox2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 24
|
||||
Top = 273
|
||||
Width = 56
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Italic'
|
||||
TabOrder = 5
|
||||
end
|
||||
object CheckBox4: TCheckBox
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = CheckBox3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 24
|
||||
Top = 303
|
||||
Width = 88
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Underline'
|
||||
TabOrder = 6
|
||||
end
|
||||
object CheckBox5: TCheckBox
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = CheckBox4
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 24
|
||||
Top = 333
|
||||
Width = 87
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'StrikeOut'
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 7
|
||||
end
|
||||
object Label5: TLabel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = CheckBox5
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 7
|
||||
Height = 20
|
||||
Top = 363
|
||||
Width = 65
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Font color'
|
||||
ParentColor = False
|
||||
end
|
||||
object ColorBox2: TColorBox
|
||||
AnchorSideLeft.Control = Label3
|
||||
AnchorSideTop.Control = Label5
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 13
|
||||
Height = 36
|
||||
Top = 389
|
||||
Width = 180
|
||||
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 0
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 8
|
||||
end
|
||||
end
|
||||
object RxDBGrid1: TRxDBGrid
|
||||
Left = 0
|
||||
Height = 537
|
||||
Top = 0
|
||||
Width = 698
|
||||
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.NotEmptyValue = '(Не пусто)'
|
||||
Filter.AllValue = '(Все значения)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footers = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'Caption'
|
||||
Width = 450
|
||||
FieldName = 'Caption'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Пусто)'
|
||||
Filter.NotEmptyValue = '(Не пусто)'
|
||||
Filter.AllValue = '(Все значения)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footers = <>
|
||||
end
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'EditDate'
|
||||
Width = 150
|
||||
FieldName = 'EditDate'
|
||||
EditButtons = <>
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Пусто)'
|
||||
Filter.NotEmptyValue = '(Не пусто)'
|
||||
Filter.AllValue = '(Все значения)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footers = <>
|
||||
end>
|
||||
KeyStrokes = <
|
||||
item
|
||||
Command = rxgcShowFindDlg
|
||||
ShortCut = 16454
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowColumnsDlg
|
||||
ShortCut = 16471
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowFilterDlg
|
||||
ShortCut = 16468
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowSortDlg
|
||||
ShortCut = 16467
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowQuickFilter
|
||||
ShortCut = 16465
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcHideQuickFilter
|
||||
ShortCut = 16456
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcSelectAll
|
||||
ShortCut = 16449
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcDeSelectAll
|
||||
ShortCut = 16429
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcInvertSelection
|
||||
ShortCut = 16426
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcOptimizeColumnsWidth
|
||||
ShortCut = 16427
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcCopyCellValue
|
||||
ShortCut = 16451
|
||||
Enabled = True
|
||||
end>
|
||||
FooterOptions.DrawFullLine = False
|
||||
SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey]
|
||||
SearchOptions.FromStart = False
|
||||
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgAllowQuickFilter]
|
||||
Align = alClient
|
||||
Color = clWindow
|
||||
DrawFullLine = False
|
||||
FocusColor = clRed
|
||||
SelectedColor = clHighlight
|
||||
GridLineStyle = psSolid
|
||||
DataSource = dsData
|
||||
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
|
||||
TabOrder = 1
|
||||
end
|
||||
object rxData: TRxMemoryData
|
||||
FieldDefs = <
|
||||
item
|
||||
Name = 'ID'
|
||||
DataType = ftInteger
|
||||
end
|
||||
item
|
||||
Name = 'Caption'
|
||||
DataType = ftString
|
||||
Size = 250
|
||||
end
|
||||
item
|
||||
Name = 'EditDate'
|
||||
DataType = ftDateTime
|
||||
end>
|
||||
PacketRecords = 0
|
||||
Left = 224
|
||||
Top = 80
|
||||
object rxDataID: TLongintField
|
||||
FieldKind = fkData
|
||||
FieldName = 'ID'
|
||||
Index = 0
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
end
|
||||
object rxDataCaption: TStringField
|
||||
FieldKind = fkData
|
||||
FieldName = 'Caption'
|
||||
Index = 1
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
Size = 250
|
||||
end
|
||||
object rxDataEditDate: TDateTimeField
|
||||
FieldKind = fkData
|
||||
FieldName = 'EditDate'
|
||||
Index = 2
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
end
|
||||
end
|
||||
object dsData: TDataSource
|
||||
DataSet = rxData
|
||||
Left = 184
|
||||
Top = 80
|
||||
end
|
||||
object FontDialog1: TFontDialog
|
||||
Width = 459
|
||||
Height = 359
|
||||
MinFontSize = 0
|
||||
MaxFontSize = 0
|
||||
Left = 784
|
||||
Top = 136
|
||||
end
|
||||
end
|
@@ -0,0 +1,202 @@
|
||||
object Form1: TForm1
|
||||
Left = 369
|
||||
Height = 500
|
||||
Top = 228
|
||||
Width = 536
|
||||
ActiveControl = RadioGroup1.RadioButton4
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 500
|
||||
ClientWidth = 536
|
||||
OnCreate = FormCreate
|
||||
SessionProperties = 'Edit1.Text'
|
||||
LCLVersion = '1.7'
|
||||
object PaintBox1: TPaintBox
|
||||
Left = 16
|
||||
Height = 129
|
||||
Top = 16
|
||||
Width = 184
|
||||
OnPaint = PaintBox1Paint
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 8
|
||||
Height = 37
|
||||
Top = 152
|
||||
Width = 192
|
||||
OnChange = Edit1Change
|
||||
TabOrder = 0
|
||||
Text = 'Edit1'
|
||||
end
|
||||
object RadioGroup1: TRadioGroup
|
||||
Left = 208
|
||||
Height = 153
|
||||
Top = 8
|
||||
Width = 78
|
||||
AutoFill = True
|
||||
AutoSize = True
|
||||
Caption = 'Direction'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 1
|
||||
ClientHeight = 132
|
||||
ClientWidth = 76
|
||||
ItemIndex = 4
|
||||
Items.Strings = (
|
||||
'0 %'
|
||||
'90 %'
|
||||
'180 %'
|
||||
'270 %'
|
||||
'360 %'
|
||||
)
|
||||
OnClick = CheckBox1Change
|
||||
TabOrder = 1
|
||||
end
|
||||
object RxDBGrid1: TRxDBGrid
|
||||
Left = 0
|
||||
Height = 308
|
||||
Top = 192
|
||||
Width = 536
|
||||
ColumnDefValues.BlobText = '(данные)'
|
||||
TitleButtons = False
|
||||
AutoSort = False
|
||||
Columns = <
|
||||
item
|
||||
Title.Alignment = taCenter
|
||||
Title.Orientation = toHorizontal
|
||||
Title.Caption = 'DEMO_1'
|
||||
FieldName = 'DEMO_1'
|
||||
EditButtons = <>
|
||||
Filter.IsNull = False
|
||||
Filter.IsAll = True
|
||||
Filter.DropDownRows = 0
|
||||
Filter.EmptyValue = '(Пусто)'
|
||||
Filter.AllValue = '(All values)'
|
||||
Filter.EmptyFont.Style = [fsItalic]
|
||||
Filter.ItemIndex = -1
|
||||
Footers = <>
|
||||
end>
|
||||
KeyStrokes = <
|
||||
item
|
||||
Command = rxgcShowFindDlg
|
||||
ShortCut = 16454
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowColumnsDlg
|
||||
ShortCut = 16471
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowFilterDlg
|
||||
ShortCut = 16468
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowSortDlg
|
||||
ShortCut = 16467
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcShowQuickFilter
|
||||
ShortCut = 16465
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcHideQuickFilter
|
||||
ShortCut = 16456
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcSelectAll
|
||||
ShortCut = 16449
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcDeSelectAll
|
||||
ShortCut = 16429
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcInvertSelection
|
||||
ShortCut = 16426
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcOptimizeColumnsWidth
|
||||
ShortCut = 16427
|
||||
Enabled = True
|
||||
end
|
||||
item
|
||||
Command = rxgcCopyCellValue
|
||||
ShortCut = 16451
|
||||
Enabled = True
|
||||
end>
|
||||
FooterOptions.DrawFullLine = False
|
||||
OptionsRx = []
|
||||
Align = alBottom
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
Color = clWindow
|
||||
DrawFullLine = False
|
||||
FocusColor = clRed
|
||||
SelectedColor = clHighlight
|
||||
GridLineStyle = psSolid
|
||||
DataSource = Datasource1
|
||||
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
|
||||
ParentColor = False
|
||||
TabOrder = 2
|
||||
TitleStyle = tsNative
|
||||
end
|
||||
object RxMemoryData1: TRxMemoryData
|
||||
AutoCalcFields = False
|
||||
FieldDefs = <
|
||||
item
|
||||
Name = 'DEMO_1'
|
||||
DataType = ftInteger
|
||||
Precision = -1
|
||||
end
|
||||
item
|
||||
Name = 'Demo2'
|
||||
DataType = ftString
|
||||
Precision = -1
|
||||
Size = 40
|
||||
end>
|
||||
PacketRecords = 0
|
||||
left = 312
|
||||
top = 64
|
||||
object RxMemoryData1DEMO_11: TLongintField
|
||||
DisplayWidth = 10
|
||||
FieldKind = fkData
|
||||
FieldName = 'DEMO_1'
|
||||
Index = 0
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
end
|
||||
object RxMemoryData1Demo21: TStringField
|
||||
DisplayWidth = 40
|
||||
FieldKind = fkData
|
||||
FieldName = 'Demo2'
|
||||
Index = 1
|
||||
LookupCache = False
|
||||
ProviderFlags = [pfInUpdate, pfInWhere]
|
||||
ReadOnly = False
|
||||
Required = False
|
||||
Size = 40
|
||||
end
|
||||
end
|
||||
object Datasource1: TDataSource
|
||||
DataSet = RxMemoryData1
|
||||
left = 312
|
||||
top = 32
|
||||
end
|
||||
object IniPropStorage1: TIniPropStorage
|
||||
StoredValues = <>
|
||||
left = 447
|
||||
top = 19
|
||||
end
|
||||
end
|
@@ -0,0 +1,120 @@
|
||||
{ RxStrUtils unit
|
||||
|
||||
Copyright (C) 2005-2017 Lagunov Aleksey alexs@yandex.ru and Lazarus team
|
||||
original conception from rx library for Delphi (c)
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version with the following modification:
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,and
|
||||
to copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the terms
|
||||
and conditions of the license of that module. An independent module is a
|
||||
module which is not derived from or based on this library. If you modify
|
||||
this library, you may extend this exception to your version of the library,
|
||||
but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
}
|
||||
|
||||
unit rxutils;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
|
||||
procedure SwapValues (var X, Y : Byte); inline; overload;
|
||||
procedure SwapValues (var X, Y : Word); inline; overload;
|
||||
procedure SwapValues (var X, Y : Integer); inline; overload;
|
||||
//procedure SwapValues (var X, Y : Longint); inline; overload;
|
||||
procedure SwapValues (var X, Y : Cardinal); inline; overload;
|
||||
procedure SwapValues (var X, Y : QWord); inline; overload;
|
||||
procedure SwapValues (var X, Y : Int64); inline; overload;
|
||||
{procedure Swap (X : Integer) : Integer;{$ifdef SYSTEMINLINE}inline;{$endif}[internconst:fpc_in_const_swap_word];
|
||||
function swap (X : Longint) : Longint;{$ifdef SYSTEMINLINE}inline;{$endif}[internconst:fpc_in_const_swap_long];
|
||||
function Swap (X : Cardinal) : Cardinal;{$ifdef SYSTEMINLINE}inline;{$endif}[internconst:fpc_in_const_swap_long];
|
||||
function Swap (X : QWord) : QWord;{$ifdef SYSTEMINLINE}inline;{$endif}[internconst:fpc_in_const_swap_qword];
|
||||
function swap (X : Int64) : Int64;{$ifdef SYSTEMINLINE}inline;{$endif}[internconst:fpc_in_const_swap_qword];
|
||||
}
|
||||
implementation
|
||||
|
||||
procedure SwapValues(var X, Y: Byte);
|
||||
var
|
||||
T: Byte;
|
||||
begin
|
||||
T:=X;
|
||||
X:=Y;
|
||||
Y:=T;
|
||||
end;
|
||||
|
||||
procedure SwapValues(var X, Y: Word);
|
||||
var
|
||||
T: Word;
|
||||
begin
|
||||
T:=X;
|
||||
X:=Y;
|
||||
Y:=T;
|
||||
end;
|
||||
|
||||
procedure SwapValues(var X, Y: Integer);
|
||||
var
|
||||
T: Integer;
|
||||
begin
|
||||
T:=X;
|
||||
X:=Y;
|
||||
Y:=T;
|
||||
end;
|
||||
{
|
||||
procedure SwapValues(var X, Y: Longint);
|
||||
var
|
||||
T: LongInt;
|
||||
begin
|
||||
T:=X;
|
||||
X:=Y;
|
||||
Y:=T;
|
||||
end;
|
||||
}
|
||||
procedure SwapValues(var X, Y: Cardinal);
|
||||
var
|
||||
T: Cardinal;
|
||||
begin
|
||||
T:=X;
|
||||
X:=Y;
|
||||
Y:=T;
|
||||
end;
|
||||
|
||||
procedure SwapValues(var X, Y: QWord);
|
||||
var
|
||||
T: QWord;
|
||||
begin
|
||||
T:=X;
|
||||
X:=Y;
|
||||
Y:=T;
|
||||
end;
|
||||
|
||||
procedure SwapValues(var X, Y: Int64);
|
||||
var
|
||||
T: Int64;
|
||||
begin
|
||||
T:=X;
|
||||
X:=Y;
|
||||
Y:=T;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@@ -0,0 +1,188 @@
|
||||
{ duallist unit
|
||||
|
||||
Copyright (C) 2005-2017 Lagunov Aleksey alexs75@yandex.ru and Lazarus team
|
||||
original conception from rx library for Delphi (c)
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version with the following modification:
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,and
|
||||
to copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the terms
|
||||
and conditions of the license of that module. An independent module is a
|
||||
module which is not derived from or based on this library. If you modify
|
||||
this library, you may extend this exception to your version of the library,
|
||||
but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
}
|
||||
|
||||
unit rxduallist;
|
||||
|
||||
interface
|
||||
|
||||
{$I rx.inc}
|
||||
|
||||
uses Classes, Controls;
|
||||
|
||||
type
|
||||
|
||||
{ TDualListDialog }
|
||||
|
||||
TDualListDialog = class(TComponent)
|
||||
private
|
||||
FCtl3D: Boolean;
|
||||
FSorted: Boolean;
|
||||
FTitle:string;
|
||||
FLabel1Caption: TCaption;
|
||||
FLabel2Caption: TCaption;
|
||||
FOkBtnCaption: TCaption;
|
||||
FCancelBtnCaption: TCaption;
|
||||
FHelpBtnCaption: TCaption;
|
||||
FHelpContext: THelpContext;
|
||||
FList1: TStrings;
|
||||
FList2: TStrings;
|
||||
FShowHelp: Boolean;
|
||||
procedure SetList1(Value: TStrings);
|
||||
procedure SetList2(Value: TStrings);
|
||||
function IsLabel1Custom: Boolean;
|
||||
function IsLabel2Custom: Boolean;
|
||||
function IsOkBtnCustom: Boolean;
|
||||
function IsCancelBtnCustom: Boolean;
|
||||
function IsHelpBtnCustom: Boolean;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
function Execute: Boolean;
|
||||
published
|
||||
property Ctl3D: Boolean read FCtl3D write FCtl3D default True;
|
||||
property Sorted: Boolean read FSorted write FSorted;
|
||||
property Title: string read FTitle write FTitle;
|
||||
property Label1Caption: TCaption read FLabel1Caption write FLabel1Caption
|
||||
stored IsLabel1Custom;
|
||||
property Label2Caption: TCaption read FLabel2Caption write FLabel2Caption
|
||||
stored IsLabel2Custom;
|
||||
property OkBtnCaption: TCaption read FOkBtnCaption write FOkBtnCaption
|
||||
stored IsOkBtnCustom;
|
||||
property CancelBtnCaption: TCaption read FCancelBtnCaption write FCancelBtnCaption
|
||||
stored IsCancelBtnCustom;
|
||||
property HelpBtnCaption: TCaption read FHelpBtnCaption write FHelpBtnCaption
|
||||
stored IsHelpBtnCustom;
|
||||
property HelpContext: THelpContext read FHelpContext write FHelpContext;
|
||||
property List1: TStrings read FList1 write SetList1;
|
||||
property List2: TStrings read FList2 write SetList2;
|
||||
property ShowHelp: Boolean read FShowHelp write FShowHelp default True;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses SysUtils, Forms, rxfduallst, LCLStrConsts, rxconst;
|
||||
|
||||
{ TDualListDialog }
|
||||
|
||||
constructor TDualListDialog.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FCtl3D := True;
|
||||
FShowHelp := True;
|
||||
FList1 := TStringList.Create;
|
||||
FList2 := TStringList.Create;
|
||||
FLabel1Caption := SDualListSrcCaption;
|
||||
FLabel2Caption := SDualListDestCaption;
|
||||
OkBtnCaption := rsmbOK;
|
||||
CancelBtnCaption := rsmbCancel;
|
||||
HelpBtnCaption := rsmbHelp;
|
||||
Title:=SDualListCaption;
|
||||
end;
|
||||
|
||||
destructor TDualListDialog.Destroy;
|
||||
begin
|
||||
List1.Free;
|
||||
List2.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TDualListDialog.SetList1(Value: TStrings);
|
||||
begin
|
||||
FList1.Assign(Value);
|
||||
end;
|
||||
|
||||
procedure TDualListDialog.SetList2(Value: TStrings);
|
||||
begin
|
||||
FList2.Assign(Value);
|
||||
end;
|
||||
|
||||
function TDualListDialog.IsLabel1Custom: Boolean;
|
||||
begin
|
||||
Result := CompareStr(Label1Caption, SDualListSrcCaption) <> 0;
|
||||
end;
|
||||
|
||||
function TDualListDialog.IsLabel2Custom: Boolean;
|
||||
begin
|
||||
Result := CompareStr(Label2Caption, SDualListDestCaption) <> 0;
|
||||
end;
|
||||
|
||||
function TDualListDialog.IsOkBtnCustom: Boolean;
|
||||
begin
|
||||
Result := CompareStr(OkBtnCaption, rsmbOK) <> 0;
|
||||
end;
|
||||
|
||||
function TDualListDialog.IsCancelBtnCustom: Boolean;
|
||||
begin
|
||||
Result := CompareStr(CancelBtnCaption, rsmbCancel) <> 0;
|
||||
end;
|
||||
|
||||
function TDualListDialog.IsHelpBtnCustom: Boolean;
|
||||
begin
|
||||
Result := CompareStr(HelpBtnCaption, rsmbHelp) <> 0;
|
||||
end;
|
||||
|
||||
function TDualListDialog.Execute: Boolean;
|
||||
var
|
||||
Form: TDualListForm;
|
||||
begin
|
||||
Form := TDualListForm.Create(Application);
|
||||
try
|
||||
with Form do
|
||||
begin
|
||||
Ctl3D := Self.Ctl3D;
|
||||
if NewStyleControls then Font.Style := [];
|
||||
ShowHelp := Self.ShowHelp;
|
||||
SrcList.Sorted := Sorted;
|
||||
DstList.Sorted := Sorted;
|
||||
SrcList.Items := List1;
|
||||
DstList.Items := List2;
|
||||
if Self.Title <> '' then Form.Caption := Self.Title;
|
||||
if Label1Caption <> '' then SrcLabel.Caption := Label1Caption;
|
||||
if Label2Caption <> '' then DstLabel.Caption := Label2Caption;
|
||||
ButtonPanel1.OKButton.Caption := OkBtnCaption;
|
||||
ButtonPanel1.CancelButton.Caption := CancelBtnCaption;
|
||||
ButtonPanel1.HelpButton.Caption := HelpBtnCaption;
|
||||
|
||||
HelpContext := Self.HelpContext;
|
||||
ButtonPanel1.HelpButton.HelpContext := HelpContext;
|
||||
end;
|
||||
Result := (Form.ShowModal = mrOk);
|
||||
if Result then
|
||||
begin
|
||||
List1 := Form.SrcList.Items;
|
||||
List2 := Form.DstList.Items;
|
||||
end;
|
||||
finally
|
||||
Form.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
@@ -0,0 +1,463 @@
|
||||
{ RxHistoryNavigator unit
|
||||
|
||||
Copyright (C) 2005-2017 Lagunov Aleksey alexs75@yandex.ru and Lazarus team
|
||||
original conception from rx library for Delphi (c)
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version with the following modification:
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,and
|
||||
to copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the terms
|
||||
and conditions of the license of that module. An independent module is a
|
||||
module which is not derived from or based on this library. If you modify
|
||||
this library, you may extend this exception to your version of the library,
|
||||
but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
}
|
||||
|
||||
unit RxHistoryNavigator;
|
||||
|
||||
{$I rx.inc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, rxtoolbar,
|
||||
Menus;
|
||||
|
||||
type
|
||||
PNavigateRec = ^TNavigateRec;
|
||||
TNavigateRec = record
|
||||
Name:string;
|
||||
Cond:string;
|
||||
Next:PNavigateRec;
|
||||
end;
|
||||
|
||||
type
|
||||
TRxHistoryNavigator = class;
|
||||
THistoryNavigateEvent = procedure(Sender:TRxHistoryNavigator; AInfo:string; AProcessed:boolean) of object;
|
||||
|
||||
{ TRxHistoryNavigator }
|
||||
|
||||
TRxHistoryNavigator = class(TComponent)
|
||||
private
|
||||
FForwardBtnItem:TToolbarItem;
|
||||
FForwardBtn: string;
|
||||
|
||||
FBackBtnItem:TToolbarItem;
|
||||
FBackBtn: string;
|
||||
First:PNavigateRec;
|
||||
Curr:PNavigateRec;
|
||||
FMaxPopupItems: integer;
|
||||
|
||||
FOnHistoryNavigate: THistoryNavigateEvent;
|
||||
FToolPanel: TToolPanel;
|
||||
PMBack:TPopupMenu;
|
||||
PMForw:TPopupMenu;
|
||||
function GetBackBtn: string;
|
||||
function GetForwardBtn: string;
|
||||
procedure SetBackBtn(AValue: string);
|
||||
procedure SetForwardBtn(AValue: string);
|
||||
procedure SetToolPanel(AValue: TToolPanel);
|
||||
procedure ClearFromCurrent(var C:PNavigateRec);
|
||||
|
||||
procedure CreateBackMenu;
|
||||
procedure CreateRetrMenu;
|
||||
|
||||
function Last:PNavigateRec;
|
||||
function Prior(R:PNavigateRec):PNavigateRec;
|
||||
procedure CheckTop;
|
||||
procedure CheckBottom;
|
||||
procedure EnableAction(ActName:byte; Enable:boolean);
|
||||
procedure BackProc(Sender: TObject);
|
||||
procedure ForwardProc(Sender: TObject);
|
||||
procedure DoSetItems;
|
||||
protected
|
||||
function Navigate(ToTop:boolean; Count:integer):boolean;
|
||||
procedure Loaded; override;
|
||||
procedure Notification(AComponent: TComponent;
|
||||
Operation: TOperation); override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
procedure ClearHistory;
|
||||
procedure AddToHistory(AHistoryCaption, AInfo:string);
|
||||
published
|
||||
property ToolPanel: TToolPanel read FToolPanel write SetToolPanel;
|
||||
property BackBtn:string read GetBackBtn write SetBackBtn;
|
||||
property ForwardBtn:string read GetForwardBtn write SetForwardBtn;
|
||||
property OnHistoryNavigate:THistoryNavigateEvent read FOnHistoryNavigate write FOnHistoryNavigate;
|
||||
property MaxPopupItems:integer read FMaxPopupItems write FMaxPopupItems default 10;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
uses ActnList, rxconst;
|
||||
|
||||
{ TRxHistoryNavigator }
|
||||
|
||||
procedure TRxHistoryNavigator.SetToolPanel(AValue: TToolPanel);
|
||||
begin
|
||||
if FToolPanel=AValue then Exit;
|
||||
FToolPanel:=AValue;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.ClearFromCurrent(var C: PNavigateRec);
|
||||
var
|
||||
R:PNavigateRec;
|
||||
begin
|
||||
while C<>nil do
|
||||
begin
|
||||
R:=C;
|
||||
C:=C^.Next;
|
||||
Dispose(R);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.CreateRetrMenu;
|
||||
var i:integer;
|
||||
S:PNavigateRec;
|
||||
Item:TMenuItem;
|
||||
begin
|
||||
if Curr=nil then exit;
|
||||
PMForw.Items.Clear;
|
||||
i:=0;
|
||||
S:=Curr^.Next;
|
||||
while (i<FMaxPopupItems) and (S<>nil) do
|
||||
begin
|
||||
Item := TMenuItem.Create(Self);
|
||||
Item.Caption := S^.Name;
|
||||
Item.OnClick := @ForwardProc;
|
||||
Item.Hint:=Format(sHistoryDesc, [S^.Cond]);
|
||||
Item.Tag:=i;
|
||||
PMForw.Items.Add(Item);
|
||||
inc(i);
|
||||
S:=S^.Next;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRxHistoryNavigator.Last: PNavigateRec;
|
||||
begin
|
||||
if First=nil then Result:=nil
|
||||
else
|
||||
begin
|
||||
Result:=First;
|
||||
while Result^.Next<>nil do Result:=Result^.Next;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRxHistoryNavigator.Prior(R: PNavigateRec): PNavigateRec;
|
||||
var
|
||||
L:PNavigateRec;
|
||||
begin
|
||||
if First=nil then Result:=nil
|
||||
else
|
||||
begin
|
||||
L:=First;
|
||||
while (L^.Next<>nil) and (L^.Next<>R) do
|
||||
begin
|
||||
L:=L^.Next;
|
||||
end;
|
||||
if L^.Next=nil then Result:=nil else Result:=l;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.CheckTop;
|
||||
begin
|
||||
EnableAction(0, (Curr<>nil) and (Curr<>First));
|
||||
end;
|
||||
|
||||
|
||||
procedure TRxHistoryNavigator.CheckBottom;
|
||||
begin
|
||||
EnableAction(1, (Curr<>nil) and (Curr^.Next<>nil));
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.EnableAction(ActName: byte; Enable: boolean);
|
||||
begin
|
||||
if First=nil then Enable:=false;
|
||||
if ActName = 0 then
|
||||
begin
|
||||
if Assigned(FBackBtnItem) then
|
||||
(FBackBtnItem.Action as TAction).Enabled:=Enable
|
||||
end
|
||||
else
|
||||
if Assigned(FForwardBtnItem) then
|
||||
(FForwardBtnItem.Action as TAction).Enabled:=Enable
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.BackProc(Sender: TObject);
|
||||
begin
|
||||
Navigate(true, (Sender as TComponent).Tag);
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.ForwardProc(Sender: TObject);
|
||||
begin
|
||||
Navigate(false, (Sender as TComponent).Tag);
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.DoSetItems;
|
||||
begin
|
||||
if Assigned(FToolPanel) then
|
||||
begin
|
||||
FForwardBtnItem:=FToolPanel.Items.ByActionName[FForwardBtn];
|
||||
if Assigned(FForwardBtnItem) then
|
||||
begin
|
||||
FForwardBtnItem.DropDownMenu:=PMForw;
|
||||
FForwardBtnItem.Action.OnExecute:=@ForwardProc;
|
||||
end;
|
||||
|
||||
FBackBtnItem:=FToolPanel.Items.ByActionName[FBackBtn];
|
||||
if Assigned(FBackBtnItem) then
|
||||
begin
|
||||
FBackBtnItem.DropDownMenu:=PMBack;
|
||||
FBackBtnItem.Action.OnExecute:=@BackProc;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRxHistoryNavigator.Navigate(ToTop: boolean; Count: integer): boolean;
|
||||
var
|
||||
F:boolean;
|
||||
Condit: string;
|
||||
begin
|
||||
Result:=false;
|
||||
if First=nil then exit;
|
||||
if ToTop then
|
||||
begin
|
||||
inc(Count);
|
||||
repeat
|
||||
Curr:=Prior(Curr);
|
||||
if Curr=nil then Curr:=First;
|
||||
Dec(Count);
|
||||
until (Count=0) or (Curr=First);
|
||||
Result:=true;
|
||||
Condit:=Curr^.Cond;
|
||||
CreateBackMenu;
|
||||
CreateRetrMenu;
|
||||
end
|
||||
else
|
||||
begin
|
||||
inc(Count);
|
||||
repeat
|
||||
if Curr^.Next<>nil then Curr:=Curr^.Next;
|
||||
Dec(Count);
|
||||
until (Count=0) or (Curr^.Next=nil);
|
||||
Result:=true;
|
||||
Condit:=Curr^.Cond;
|
||||
CreateRetrMenu;
|
||||
CreateBackMenu;
|
||||
end;
|
||||
CheckTop;
|
||||
CheckBottom;
|
||||
F:=true;
|
||||
if Assigned(FOnHistoryNavigate) and Assigned(Curr) then
|
||||
FOnHistoryNavigate(Self, Condit, F);
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
DoSetItems;
|
||||
CheckTop;
|
||||
CheckBottom;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.Notification(AComponent: TComponent;
|
||||
Operation: TOperation);
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
if Operation = opRemove then
|
||||
begin
|
||||
if AComponent = FToolPanel then
|
||||
begin
|
||||
if Assigned(FForwardBtnItem) then
|
||||
begin
|
||||
FForwardBtnItem.Action.OnExecute:=nil;
|
||||
FForwardBtnItem:=nil;
|
||||
end;
|
||||
|
||||
if Assigned(FBackBtnItem) then
|
||||
begin
|
||||
FBackBtnItem.Action.OnExecute:=nil;
|
||||
FBackBtnItem:=nil;
|
||||
end;
|
||||
end
|
||||
else
|
||||
if AComponent = Self then
|
||||
begin
|
||||
if Assigned(FForwardBtnItem) then
|
||||
begin
|
||||
FForwardBtnItem.Action.OnExecute:=nil;
|
||||
FForwardBtnItem.DropDownMenu:=nil;
|
||||
FForwardBtnItem:=nil;
|
||||
end;
|
||||
|
||||
if Assigned(FBackBtnItem) then
|
||||
begin
|
||||
FBackBtnItem.Action.OnExecute:=nil;
|
||||
FBackBtnItem.DropDownMenu:=nil;
|
||||
FBackBtnItem:=nil;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.CreateBackMenu;
|
||||
var i:integer;
|
||||
S:PNavigateRec;
|
||||
Item:TMenuItem;
|
||||
begin
|
||||
if Curr=nil then exit;
|
||||
PMBack.Items.Clear;
|
||||
i:=0;
|
||||
S:=Curr;
|
||||
while (i<FMaxPopupItems) and (S<>First) do
|
||||
begin
|
||||
Item := TMenuItem.Create(Self);
|
||||
Item.Caption := S^.Name;
|
||||
Item.OnClick := @BackProc;
|
||||
Item.Hint:=Format(sHistoryDesc, [S^.Cond]);
|
||||
Item.Tag:=i;
|
||||
PMBack.Items.Add(Item);
|
||||
inc(i);
|
||||
S:=Prior(S);
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TRxHistoryNavigator.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
PMBack:=TPopupMenu.Create(Self);
|
||||
PMBack.Parent:=Self;
|
||||
PMForw:=TPopupMenu.Create(Self);
|
||||
PMForw.Parent:=Self;
|
||||
FMaxPopupItems:=10;
|
||||
end;
|
||||
|
||||
destructor TRxHistoryNavigator.Destroy;
|
||||
begin
|
||||
Curr:=nil;
|
||||
ClearFromCurrent(First);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.ClearHistory;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.AddToHistory(AHistoryCaption, AInfo: string);
|
||||
var
|
||||
R, L:PNavigateRec;
|
||||
begin
|
||||
New(R);
|
||||
FillChar(R^, SizeOf(TNavigateRec), 0);
|
||||
R^.Name:=AHistoryCaption;
|
||||
R^.Cond:=AInfo;
|
||||
if First<>nil then
|
||||
begin
|
||||
L:=Last;
|
||||
if Curr<>L then ClearFromCurrent(Curr^.Next);
|
||||
Curr^.Next:=R;
|
||||
Curr:=R;
|
||||
end
|
||||
else
|
||||
begin
|
||||
First:=R;
|
||||
Curr:=R;
|
||||
end;
|
||||
CreateBackMenu;
|
||||
CreateRetrMenu;
|
||||
CheckTop;
|
||||
CheckBottom;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.SetBackBtn(AValue: string);
|
||||
begin
|
||||
if FBackBtn=AValue then Exit;
|
||||
|
||||
if ForwardBtn = AValue then
|
||||
ForwardBtn:='';
|
||||
|
||||
FBackBtn:=AValue;
|
||||
|
||||
if Assigned(FBackBtnItem) then
|
||||
begin
|
||||
FBackBtnItem.DropDownMenu:=nil;
|
||||
FBackBtnItem.Action.OnExecute:=nil;
|
||||
end;
|
||||
|
||||
if Assigned(FToolPanel) and (FBackBtn<>'') then
|
||||
begin
|
||||
FBackBtnItem:=FToolPanel.Items.ByActionName[FBackBtn];
|
||||
if Assigned(FBackBtnItem) then
|
||||
begin
|
||||
FBackBtnItem.DropDownMenu:=PMBack;
|
||||
FBackBtnItem.Action.OnExecute:=@BackProc;
|
||||
end;
|
||||
end
|
||||
else
|
||||
FBackBtnItem:=nil;
|
||||
end;
|
||||
|
||||
function TRxHistoryNavigator.GetBackBtn: string;
|
||||
begin
|
||||
if Assigned(FBackBtnItem) then
|
||||
Result:=FBackBtnItem.Action.Name
|
||||
else
|
||||
Result:=FBackBtn;
|
||||
end;
|
||||
|
||||
function TRxHistoryNavigator.GetForwardBtn: string;
|
||||
begin
|
||||
if Assigned(FForwardBtnItem) then
|
||||
Result:=FForwardBtnItem.Action.Name
|
||||
else
|
||||
Result:=FForwardBtn;
|
||||
end;
|
||||
|
||||
procedure TRxHistoryNavigator.SetForwardBtn(AValue: string);
|
||||
begin
|
||||
if FForwardBtn=AValue then Exit;
|
||||
|
||||
if BackBtn = AValue then
|
||||
BackBtn:='';
|
||||
|
||||
FForwardBtn:=AValue;
|
||||
|
||||
|
||||
if Assigned(FForwardBtnItem) then
|
||||
begin
|
||||
FForwardBtnItem.DropDownMenu:=nil;
|
||||
FForwardBtnItem.Action.OnExecute:=nil;
|
||||
end;
|
||||
|
||||
if Assigned(FToolPanel) and (AValue <>'') then
|
||||
begin
|
||||
FForwardBtnItem:=FToolPanel.Items.ByActionName[FForwardBtn];
|
||||
if Assigned(FForwardBtnItem) then
|
||||
begin
|
||||
FForwardBtnItem.DropDownMenu:=PMForw;
|
||||
FForwardBtnItem.Action.OnExecute:=@ForwardProc;
|
||||
end;
|
||||
end
|
||||
else
|
||||
FForwardBtnItem:=nil;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user