|
From: Peter T. <pe...@us...> - 2003-08-23 23:20:33
|
Update of /cvsroot/jvcl/dev/JVCL3/examples/JvTMTimeLine
In directory sc8-pr-cvs1:/tmp/cvs-serv5637/JVCL3/examples/JvTMTimeLine
Added Files:
SimpleTLTest1.dpr SimpleTLTest1.res TMTimeLineMainFormU.dfm
TMTimeLineMainFormU.pas TeamManagerImages.bmp frmMemoEdit.dfm
frmMemoEdit.pas il16.bmp
Log Message:
- Copied jvcl/devtools and jvcl/examples dev/JVCL3
- Copied JVCLConvert *.dat files to dev/JVCL3/converter
--- NEW FILE: SimpleTLTest1.dpr ---
program SimpleTLTest1;
uses
Forms,
frmMemoEdit in 'frmMemoEdit.pas' {MemoEditFrm},
TMTimeLineMainFormU in 'TMTimeLineMainFormU.pas' {TMTimeLineMainForm};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TTMTimeLineMainForm, TMTimeLineMainForm);
Application.Run;
end.
--- NEW FILE: SimpleTLTest1.res ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: TMTimeLineMainFormU.dfm ---
object TMTimeLineMainForm: TTMTimeLineMainForm
Left = 261
Top = 138
Width = 718
Height = 577
Caption = 'Team Manager Timeline demo'
Color = clBtnFace
Constraints.MinHeight = 376
Constraints.MinWidth = 710
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
ShowHint = True
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnMouseWheelDown = FormMouseWheelDown
OnMouseWheelUp = FormMouseWheelUp
PixelsPerInch = 96
TextHeight = 13
object Splitter1: TSplitter
Left = 0
Top = 149
Width = 710
Height = 3
Cursor = crVSplit
Align = alBottom
AutoSnap = False
end
object Panel1: TPanel
Left = 0
Top = 152
Width = 710
Height = 381
Align = alBottom
BevelOuter = bvNone
TabOrder = 0
TabStop = True
object Label6: TLabel
Left = 0
Top = 0
Width = 710
Height = 13
Align = alTop
Caption = 'Images:'
end
object Label7: TLabel
Left = 472
Top = 256
Width = 121
Height = 13
Caption = 'Keyboard navigation:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
end
object Label18: TLabel
Left = 496
Top = 274
Width = 159
Height = 26
Caption = 'Left/Right arrow:'#13#10#9'move Small Change days'
end
object Label19: TLabel
Left = 496
Top = 306
Width = 161
Height = 26
Caption = 'Ctrl+Left/Right arrow:'#13#10#9'move Large Change days'
end
object Label20: TLabel
Left = 496
Top = 338
Width = 152
Height = 26
Caption = 'Shift+Left/Right arrow:'#13#10#9'move selection one day'
end
object lvImages: TListView
Left = 0
Top = 13
Width = 710
Height = 56
Hint = 'The images available for the control'
Align = alTop
Columns = <>
IconOptions.Arrangement = iaLeft
LargeImages = il16
ReadOnly = True
PopupMenu = popTimeLine
SmallImages = il16
TabOrder = 0
OnSelectItem = lvImagesSelectItem
end
object gbDates: TGroupBox
Left = 464
Top = 80
Width = 241
Height = 161
Caption = ' Dates: '
TabOrder = 3
object Label2: TLabel
Left = 8
Top = 16
Width = 78
Height = 13
Caption = 'First visible date:'
end
object Label3: TLabel
Left = 8
Top = 64
Width = 69
Height = 13
Caption = 'Selected date:'
end
object Label4: TLabel
Left = 152
Top = 16
Width = 53
Height = 13
Caption = 'Add image:'
end
object Label5: TLabel
Left = 152
Top = 64
Width = 36
Height = 13
Caption = 'at date:'
end
object dtpFirstDate: TDateTimePicker
Left = 8
Top = 32
Width = 121
Height = 21
Hint = 'Sets the first displayed date'
Date = 36854.425169305600000000
Time = 36854.425169305600000000
TabOrder = 0
OnChange = dtpFirstDateChange
end
object dtpSelDate: TDateTimePicker
Left = 8
Top = 80
Width = 121
Height = 21
Hint = 'Sets the selected day'
Date = 36854.425169305600000000
Time = 36854.425169305600000000
TabOrder = 1
OnChange = dtpSelDateChange
end
object edImageNo: TEdit
Left = 152
Top = 32
Width = 65
Height = 21
Hint =
'Sets the imageindex to insert at the current date'#13#10'(use -1 to re' +
'move image)'
TabOrder = 2
Text = '-1'
end
object udImageNo: TUpDown
Left = 217
Top = 32
Width = 15
Height = 21
Associate = edImageNo
Min = -1
Position = -1
TabOrder = 3
end
object dtpImageDate: TDateTimePicker
Left = 152
Top = 80
Width = 81
Height = 21
Hint = 'Sets the date to insert / delete an image'
Date = 36854.587075949100000000
Time = 36854.587075949100000000
TabOrder = 4
end
object btnAdd: TButton
Left = 152
Top = 120
Width = 75
Height = 25
Hint = 'Adds an image to the chosen date'
Caption = '&Add'
TabOrder = 5
OnClick = btnAddClick
end
end
object gbAppearance: TGroupBox
Left = 200
Top = 80
Width = 257
Height = 161
Caption = ' Appearance: '
TabOrder = 2
object Label13: TLabel
Left = 115
Top = 48
Width = 102
Height = 13
Caption = 'Assigned object style:'
end
object chkReadOnly: TCheckBox
Left = 8
Top = 16
Width = 73
Height = 17
Hint = 'Makes the control read-only'
Caption = 'Read-only'
TabOrder = 0
OnClick = chkReadOnlyClick
end
object chkFlat: TCheckBox
Left = 8
Top = 32
Width = 41
Height = 17
Hint = 'Makes the control flat'
Caption = 'Flat'
TabOrder = 1
OnClick = chkFlatClick
end
object chkRClick: TCheckBox
Left = 8
Top = 48
Width = 105
Height = 17
Hint = 'Moves the selection on right-click too'
Caption = 'Right click select'
TabOrder = 2
OnClick = chkRClickClick
end
object chkEnabled: TCheckBox
Left = 8
Top = 64
Width = 97
Height = 17
Hint = 'Enables the control'
Caption = 'Enabled'
Checked = True
State = cbChecked
TabOrder = 3
OnClick = chkEnabledClick
end
object chkShowToday: TCheckBox
Left = 8
Top = 96
Width = 81
Height = 17
Caption = 'Show today'
Checked = True
State = cbChecked
TabOrder = 4
OnClick = chkShowTodayClick
end
object chkShowWeeks: TCheckBox
Left = 8
Top = 112
Width = 81
Height = 17
Caption = 'Show weeks'
Checked = True
State = cbChecked
TabOrder = 5
OnClick = chkShowWeeksClick
end
object chkShowMonths: TCheckBox
Left = 8
Top = 128
Width = 89
Height = 17
Caption = 'Show months'
Checked = True
State = cbChecked
TabOrder = 6
OnClick = chkShowMonthsClick
end
object lbObjFontStyle: TCheckListBox
Left = 115
Top = 64
Width = 126
Height = 64
Hint =
'Sets the font to use for day items that'#13#10'have a non-nil Objects ' +
'item'
OnClickCheck = lbObjFontStyleClickCheck
ItemHeight = 13
Items.Strings = (
'Bold'
'Italic'
'Underline'
'Strikeout')
TabOrder = 7
end
end
object gbMisc: TGroupBox
Left = 248
Top = 248
Width = 209
Height = 129
Caption = ' Misc. '
TabOrder = 5
object btnLoad: TButton
Left = 14
Top = 24
Width = 110
Height = 25
Hint = 'Loads a previously saved timeline file'
Caption = 'Load from file...'
TabOrder = 0
OnClick = btnLoadClick
end
object btnSave: TButton
Left = 14
Top = 56
Width = 110
Height = 25
Hint = 'Saves the current content to a timeline file'
Caption = 'Save to file...'
TabOrder = 1
OnClick = btnSaveClick
end
end
object gbFonts: TGroupBox
Left = 8
Top = 248
Width = 233
Height = 129
Caption = ' Fonts and colors: '
TabOrder = 4
object btnFont: TButton
Left = 14
Top = 56
Width = 90
Height = 25
Hint = 'Sets the font for days'
Caption = 'Font...'
TabOrder = 1
OnClick = btnFontClick
end
object btnColor: TButton
Left = 14
Top = 24
Width = 90
Height = 25
Hint = 'Sets the background color'
Caption = 'Color...'
TabOrder = 0
OnClick = btnColorClick
end
object btnMonthFont: TButton
Left = 14
Top = 88
Width = 90
Height = 25
Hint = 'Sets the font for months and years'
Caption = 'Month font...'
TabOrder = 2
OnClick = btnMonthFontClick
end
object btnTodayColor: TButton
Left = 118
Top = 56
Width = 90
Height = 25
Hint = 'Sets the background color for the today item'
Caption = 'Today color...'
TabOrder = 4
OnClick = btnTodayColorClick
end
object btnLineColor: TButton
Left = 118
Top = 24
Width = 90
Height = 25
Caption = 'Line color...'
TabOrder = 3
OnClick = btnLineColorClick
end
object btnPenColor: TButton
Left = 118
Top = 88
Width = 90
Height = 25
Hint = 'Sets the color of the selection frame'
Caption = 'Selection color...'
TabOrder = 5
OnClick = btnPenColorClick
end
end
object gbWidths: TGroupBox
Left = 8
Top = 80
Width = 185
Height = 161
Caption = ' Widths and sizes: '
TabOrder = 1
object Label1: TLabel
Left = 32
Top = 77
Width = 50
Height = 13
Caption = 'Day width:'
end
object Label8: TLabel
Left = 14
Top = 101
Width = 68
Height = 13
Caption = 'Sel. line width:'
end
object Label9: TLabel
Left = 15
Top = 27
Width = 67
Height = 13
Caption = 'Small change:'
end
object Label10: TLabel
Left = 13
Top = 52
Width = 69
Height = 13
Caption = 'Large change:'
end
object Label12: TLabel
Left = 20
Top = 126
Width = 62
Height = 13
Caption = 'Button width:'
end
object Label11: TLabel
Left = 140
Top = 28
Width = 22
Height = 13
Caption = 'days'
end
object Label14: TLabel
Left = 140
Top = 53
Width = 22
Height = 13
Caption = 'days'
end
object Label15: TLabel
Left = 140
Top = 77
Width = 26
Height = 13
Caption = 'pixels'
end
object Label16: TLabel
Left = 140
Top = 102
Width = 26
Height = 13
Caption = 'pixels'
end
object Label17: TLabel
Left = 140
Top = 126
Width = 26
Height = 13
Caption = 'pixels'
end
object edDayWidth: TEdit
Left = 88
Top = 73
Width = 33
Height = 21
Hint = 'Sets the width in pixels of a single day'
TabOrder = 4
Text = '19'
end
object udDayWidth: TUpDown
Left = 121
Top = 73
Width = 15
Height = 21
Associate = edDayWidth
Max = 32000
Position = 19
TabOrder = 5
OnClick = udDayWidthClick
end
object edPenWidth: TEdit
Left = 89
Top = 98
Width = 32
Height = 21
Hint = 'Sets the width of the selection frame'
TabOrder = 6
Text = '2'
end
object udPenWidth: TUpDown
Left = 121
Top = 98
Width = 15
Height = 21
Associate = edPenWidth
Position = 2
TabOrder = 7
OnClick = udPenWidthClick
end
object edScrollSmall: TEdit
Left = 88
Top = 24
Width = 33
Height = 21
Hint =
'Sets the number of days to scroll when clicking the buttons '#13#10'or' +
' when using the arrow-keys'
TabOrder = 0
Text = '7'
end
object udScrollSmall: TUpDown
Left = 121
Top = 24
Width = 15
Height = 21
Associate = edScrollSmall
Min = 1
Max = 365
Position = 7
TabOrder = 1
OnClick = udScrollSmallClick
end
object edScrollLarge: TEdit
Left = 88
Top = 49
Width = 33
Height = 21
Hint =
'Sets the number of days to scroll when Ctrl + clicking the butto' +
'ns '#13#10'or when using Ctrl+left arrow or Ctrl+right arrow'
TabOrder = 2
Text = '30'
end
object udScrollLarge: TUpDown
Left = 121
Top = 49
Width = 15
Height = 21
Associate = edScrollLarge
Min = 1
Max = 365
Position = 30
TabOrder = 3
OnClick = udScrollLargeClick
end
object edButtonWidth: TEdit
Left = 88
Top = 122
Width = 33
Height = 21
Hint = 'Sets the width of the scrollbuttons'
TabOrder = 8
Text = '12'
end
object udButtonWidth: TUpDown
Left = 121
Top = 122
Width = 15
Height = 21
Associate = edButtonWidth
Max = 35
Position = 12
TabOrder = 9
OnClick = udButtonWidthClick
end
end
end
object StatusBar: TStatusBar
Left = 0
Top = 533
Width = 710
Height = 19
Hint = 'Displays info about the control'
Panels = <
item
Width = 300
end
item
Width = 50
end>
OnResize = StatusBarResize
end
object popTimeLine: TPopupMenu
Left = 240
Top = 43
object mnuEditMemo: TMenuItem
Caption = 'Edit memo...'
Default = True
OnClick = mnuEditMemoClick
end
object mnuInsertImage: TMenuItem
Caption = 'Insert image'
ShortCut = 45
OnClick = mnuInsertImageClick
end
object mnuRemoveImage: TMenuItem
Caption = 'Remove image'
ShortCut = 46
OnClick = mnuRemoveImageClick
end
object N1: TMenuItem
Caption = '-'
end
object mnuToday: TMenuItem
Caption = 'Go to today'
ShortCut = 116
OnClick = mnuTodayClick
end
object mnuGotoDate: TMenuItem
Caption = 'Go to selected day'
ShortCut = 118
OnClick = mnuGotoDateClick
end
end
object il16: TImageList
Height = 18
Width = 14
Left = 560
Top = 16
Bitmap = {
494C01010800090004000E001200FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
000000000000360000002800000038000000360000000100100000000000A017
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000007C007C007C
007C007C00000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000007C007C007C007C007C0000000000000000
000000000000007C007C007C007C007C007C007C007C007C0000000000000000
000000001042FF7FFF7FFF7FFF7FFF7F00000000000000000000000000000000
1042FF7FFF7FFF7FFF7FFF7F00000000000000000000000000000000007C007C
007CFF7F007C007C007C000000000000000000000000007C007C007C007C007C
007C007C007C007C000000000000000000001042FF7FFF7FFF7FFF7FFF7FFF7F
FF7F0000000000000000000000001042FF7FFF7FFF7F00000000FF7FFF7F0000
00000000000000000000007C007C007CFF7FFF7FFF7F007C007C007C00000000
00000000007C007CFF7FFF7F007C007C007CFF7FFF7F007C007C000000000000
1042FF7FFF7FFF7F0002FF7FFF7FFF7FFF7FFF7F00000000000000001042FF7F
FF7FFF7FFF7F00000000FF7FFF7FFF7F0000000000000000007C007C007C007C
007CFF7F007C007C007C007C007C000000000000007C007C007CFF7FFF7F007C
FF7FFF7F007C007C007C0000000000001042FF7FFF7F000200020002FF7FFF7F
FF7FFF7F00000000000000001042FF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7F
0000000000000000007C007C007C007C007C007C007C007C007C007C007C0000
00000000007C007C007C007CFF7FFF7FFF7F007C007C007C007C000000000000
1042FF7FFF7F0002FF7F00020002FF7FFF7FFF7F00000000000000001042FF7F
FF7FFF7FFF7F00000000FF7FFF7FFF7F0000000000000000007C007C007C007C
007CFF7F007C007C007C007C007C000000000000007C007C007CFF7FFF7F007C
FF7FFF7F007C007C007C0000000000001042FF7FFF7FFF7FFF7FFF7F00020002
FF7FFF7F00000000000000001042FF7FFF7F0000FF7FFF7F00000000FF7FFF7F
0000000000000000007C007C007C007CFF7FFF7FFF7F007C007C007C007C0000
00000000007C007CFF7FFF7F007C007C007CFF7FFF7F007C007C000000000000
1042FF7FFF7FFF7FFF7FFF7FFF7F0002FF7FFF7F00000000000000001042FF7F
FF7F0000FF7FFF7F00000000FF7FFF7F0000000000000000007C007C007C007C
FF7FFF7FFF7F007C007C007C007C0000000000000000007C007C007C007C007C
007C007C007C007C000000000000000000001042FF7FFF7FFF7FFF7FFF7FFF7F
FF7F0000000000000000000000001042FF7FFF7F000000000000FF7FFF7F0000
00000000000000000000007C007C007CFF7FFF7FFF7F007C007C007C00000000
000000000000007C007C007C007C007C007C007C007C007C0000000000000000
000000001042FF7FFF7FFF7FFF7FFF7F00000000000000000000000000000000
1042FF7FFF7FFF7FFF7FFF7F00000000000000000000000000000000007C007C
007C007C007C007C007C00000000000000000000000000000000007C007C007C
007C007C00000000000000000000000000000000000010421042104210421042
0000000000000000000000000000000000001042104210421042104200000000
0000000000000000000000000000007C007C007C007C007C0000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000007C007C0000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000007C007C007C007C00000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000007C007C007C007C007C
007C000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000007C007C007CFF7FFF7F007C007C007C000000000000000000000000
000000000000007C007C00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000007C007C007C007C007C007C007C
007C007C007C0000000000000000000000000000007C007C007C007C00000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
007C007C007C007C007CFF7FFF7F007C007C007C007C007C0000000000000000
0000007C007C007C007C007C007C000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000007C007C007C007C007C007CFF7FFF7F007C
007C007C007C007C007C000000000000007C007C007CFF7FFF7F007C007C007C
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
007C007C007C007C007CFF7FFF7F007C007C007C007C007C000000000000007C
007C007C007C007C007C007C007C007C007C0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000007C007C007C007CFF7FFF7F007C
007C007C007C000000000000007C007C007C007C007CFF7FFF7F007C007C007C
007C007C00000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000007C007C007CFF7FFF7F007C007C007C000000000000007C007C007C
007C007C007CFF7FFF7F007C007C007C007C007C007C00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000007C007C0000007C007C007C007C007C
007C0000007C007C00000000007C007C007C007C007CFF7FFF7F007C007C007C
007C007C00000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000007C
007C007C007C0000007C007C007C007C0000007C007C007C007C00000000007C
007C007C007CFF7FFF7F007C007C007C007C0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000007C007C007C007C0000007C007C0000
007C007C007C007C0000000000000000007C007C007CFF7FFF7F007C007C007C
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000007C007C007C007C00000000007C007C007C007C00000000000000000000
0000007C007C007C007C007C007C000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000007C007C007C007C007C007C
007C007C00000000000000000000000000000000007C007C007C007C00000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000007C007C007C007C007C007C0000000000000000000000000000
000000000000007C007C00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000007C007C007C007C
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000007C007C000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000038000000360000000100010000000000B00100000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00
F07FC1FF07FC1F00C01F80FE03F80F00C01F007C01F00700800E003800E00300
800E003800E00300800E003800E00300800E003800E00300800E003800E00300
C01F007C01F00700C01F80FE03F80F00F07FC1FF07FC1F00FFFFFFFFFFFFFF00
FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FCFFF3FFFFFFFF00F87FE1FFFFFFFF00
F03FC0FFFFFFFF00E01F807FCFFFFF00C00F003F87FFFF008006001F03FF7F00
0000000E01FE3F008006001C00FC1F00C00F003800780F00E01F807000300700
9026409800780F000840210C00FC1F008486121E01FE3F00C30F0C3F03FF7F00
E01F807F87FFFF00F03FC0FFCFFFFF00F87FE1FFFFFFFF00FCFFF3FFFFFFFF00
00000000000000000000000000000000000000000000}
end
end
--- NEW FILE: TMTimeLineMainFormU.pas ---
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Peter Thörnqvist [pe...@pe...]
Portions created by Peter Thörnqvist are Copyright (C) 2002 Peter Thörnqvist.
All Rights Reserved.
Contributor(s):
Last Modified: 2002-05-26
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.sourceforge.net
Known Issues:
-----------------------------------------------------------------------------}
unit TMTimeLineMainFormU;
{
This demo demonstrates the different properties, methods and events unique to
the Team Manager Timeline.
}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, ComCtrls, JvTMTL, StdCtrls, Buttons, ImgList,
Menus, CheckLst;
type
TTMTimeLineMainForm = class(TForm)
Splitter1: TSplitter;
Panel1: TPanel;
Label6: TLabel;
lvImages: TListView;
popTimeLine: TPopupMenu;
mnuToday: TMenuItem;
mnuInsertImage: TMenuItem;
mnuRemoveImage: TMenuItem;
N1: TMenuItem;
mnuEditMemo: TMenuItem;
mnuGotoDate: TMenuItem;
StatusBar: TStatusBar;
il16: TImageList;
gbWidths: TGroupBox;
gbDates: TGroupBox;
gbAppearance: TGroupBox;
chkReadOnly: TCheckBox;
chkFlat: TCheckBox;
chkRClick: TCheckBox;
chkEnabled: TCheckBox;
chkShowToday: TCheckBox;
chkShowWeeks: TCheckBox;
chkShowMonths: TCheckBox;
Label13: TLabel;
lbObjFontStyle: TCheckListBox;
Label2: TLabel;
dtpFirstDate: TDateTimePicker;
Label3: TLabel;
dtpSelDate: TDateTimePicker;
Label4: TLabel;
Label5: TLabel;
edImageNo: TEdit;
udImageNo: TUpDown;
dtpImageDate: TDateTimePicker;
btnAdd: TButton;
Label1: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label12: TLabel;
edDayWidth: TEdit;
udDayWidth: TUpDown;
edPenWidth: TEdit;
udPenWidth: TUpDown;
edScrollSmall: TEdit;
udScrollSmall: TUpDown;
edScrollLarge: TEdit;
udScrollLarge: TUpDown;
edButtonWidth: TEdit;
udButtonWidth: TUpDown;
Label11: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
gbMisc: TGroupBox;
btnLoad: TButton;
btnSave: TButton;
gbFonts: TGroupBox;
btnFont: TButton;
btnColor: TButton;
btnMonthFont: TButton;
btnTodayColor: TButton;
btnLineColor: TButton;
btnPenColor: TButton;
Label7: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
procedure FormCreate(Sender: TObject);
procedure btnFontClick(Sender: TObject);
procedure btnMonthFontClick(Sender: TObject);
procedure chkReadOnlyClick(Sender: TObject);
procedure dtpFirstDateChange(Sender: TObject);
procedure dtpSelDateChange(Sender: TObject);
procedure udDayWidthClick(Sender: TObject; Button: TUDBtnType);
procedure btnColorClick(Sender: TObject);
procedure chkFlatClick(Sender: TObject);
procedure btnAddClick(Sender: TObject);
procedure lblWebPageClick(Sender: TObject);
procedure btnPenColorClick(Sender: TObject);
procedure udPenWidthClick(Sender: TObject; Button: TUDBtnType);
procedure udScrollSmallClick(Sender: TObject; Button: TUDBtnType);
procedure lvImagesSelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure btnTodayColorClick(Sender: TObject);
procedure chkRClickClick(Sender: TObject);
procedure mnuTodayClick(Sender: TObject);
procedure mnuInsertImageClick(Sender: TObject);
procedure udScrollLargeClick(Sender: TObject; Button: TUDBtnType);
procedure mnuRemoveImageClick(Sender: TObject);
procedure mnuEditMemoClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure udButtonWidthClick(Sender: TObject; Button: TUDBtnType);
procedure btnLoadClick(Sender: TObject);
procedure btnSaveClick(Sender: TObject);
procedure lbObjFontStyleClickCheck(Sender: TObject);
procedure chkEnabledClick(Sender: TObject);
procedure mnuGotoDateClick(Sender: TObject);
procedure StatusBarResize(Sender: TObject);
procedure chkShowMonthsClick(Sender: TObject);
procedure chkShowWeeksClick(Sender: TObject);
procedure chkShowTodayClick(Sender: TObject);
procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
procedure btnLineColorClick(Sender: TObject);
private
{ Private declarations }
sl:TJvTMTimeline;
procedure DoClick(Sender: TObject);
procedure DoDateChange(Sender: TObject);
procedure DoDblClick(Sender: TObject);
procedure DoObjectLoad(Sender: TObject; Stream: TStream;var AObject: TObject);
procedure DoObjectSave(Sender: TObject; Stream: TStream;const AObject: TObject);
end;
var
TMTimeLineMainForm: TTMTimeLineMainForm;
implementation
uses
ShellAPI, frmMemoEdit;
{$R *.DFM}
procedure TTMTimeLineMainForm.FormCreate(Sender: TObject);
var
i : integer;
begin
ForceCurrentDirectory := true;
sl := TJvTMTimeline.Create(self);
sl.Parent := self;
sl.PopUpMenu := popTimeline;
sl.OnChange := DoDateChange;
sl.OnClick := DoClick;
sl.OnDblClick := DoDblClick;
sl.Images := il16;
sl.Align := alClient;
sl.Hint := 'Double-click a date to edit it''s memo content.'#13#10'Right-click to display pop-up menu.';
dtpSelDate.Date := Date;
dtpFirstDate.Date := Date-7;
udDayWidth.Position := sl.DayWidth;
chkReadOnly.Checked := sl.ReadOnly;
sl.Date := dtpFirstDate.Date;
sl.SelDate := dtpSelDate.Date;
lbObjFontStyle.Checked[2] := true;
for i := 0 to il16.Count - 1 do
begin
with lvImages.Items.Add do
begin
ImageIndex := i;
Caption := IntToStr(i);
end;
end;
Splitter1.Top := sl.Height + 5;
end;
// Free any stringlists still around in the Objects array by calling the ClearObjects method
// Do NOT call this method unless the Objects array actually contains
// TObjects (or descendants): calling this method if you store ordinal values
// (like integers), will cause an AV
// You can freely mix object types in the array: the will be freed correctly anyway
procedure TTMTimeLineMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
sl.ClearObjects;
end;
// just update the controls when an item in the listview is clicked
procedure TTMTimeLineMainForm.lvImagesSelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
begin
if Assigned(Item) and Selected then
udImageNo.Position := Item.ImageIndex;
end;
// simple trick that launches your default web-browser and tries to go to my web-page:
// this even works with modem-connections
procedure TTMTimeLineMainForm.lblWebPageClick(Sender: TObject);
begin
ShellExecute(Handle,PChar('open'),PChar('http://www.peter3.com'),nil,nil,SW_SHOWNORMAL);
end;
procedure TTMTimeLineMainForm.btnLoadClick(Sender: TObject);
begin
with TOpenDialog.Create(nil) do
try
Filter := 'Timeline files|*.tm|All files|*.*';
DefaultExt := 'TM';
if Execute then
begin
sl.OnReadObject := DoObjectLoad;
sl.LoadFromFile(Filename);
end;
finally
Free;
end;
end;
procedure TTMTimeLineMainForm.btnSaveClick(Sender: TObject);
begin
with TSaveDialog.Create(nil) do
try
Filter := 'Timeline files|*.tm|All files|*.*';
DefaultExt := 'TM';
if Execute then
begin
sl.OnWriteObject := DoObjectSave;
sl.SaveToFile(Filename);
end;
finally
Free;
end;
end;
//****************************************************************************//
// set imageindex for the chosen date
procedure TTMTimeLineMainForm.btnAddClick(Sender: TObject);
begin
sl.ImageIndex[dtpImageDate.DateTime] := udImageNo.Position;
end;
// OnChange is called whenever the FirstDate (the first visible date) changes
// This happens when the user scrolls the display or when you set FirstDate programmatically
procedure TTMTimeLineMainForm.DoDateChange(Sender:TObject);
begin
dtpFirstDate.Date := sl.Date;
StatusBarResize(Sender);
end;
// the click event is called when the timeline is clicked. To keep track of Date
// (i.e. the currently selected date), assign a handler to this event
// If right-click select is true, Date is updated when you right-click too
procedure TTMTimeLineMainForm.DoClick(Sender:TObject);
begin
dtpSelDate.Date := sl.SelDate;
dtpImageDate.Date := sl.SelDate;
end;
// display the memo contents when double.clicking: the day number is
// automatically underlined when the Objects property has a non-nil value
procedure TTMTimeLineMainForm.DoDblClick(Sender:TObject);
begin
mnuEditMemo.Click;
end;
// the timeline font is the font used for the day numbers
procedure TTMTimeLineMainForm.btnFontClick(Sender: TObject);
begin
with TFontDialog.Create(nil) do
try
Font := sl.Font;
if Execute then
sl.Font := Font;
finally
Free;
end;
end;
// the timelines monthfont is the one used for displaying month names and the year
procedure TTMTimeLineMainForm.btnMonthFontClick(Sender: TObject);
begin
with TFontDialog.Create(nil) do
try
Font := sl.MonthFont;
if Execute then
sl.MonthFont := Font;
finally
Free;
end;
end;
// if the timeline is readonly, the scrollbuttons disappear
// and the user cannot scroll with the mouse or keyboard
// the selection frame is also removed
procedure TTMTimeLineMainForm.chkReadOnlyClick(Sender: TObject);
begin
sl.ReadOnly := chkReadOnly.Checked;
StatusBarResize(Sender);
end;
// enabled is not the same as read-only!
procedure TTMTimeLineMainForm.chkEnabledClick(Sender: TObject);
begin
sl.Enabled := chkEnabled.Checked;
end;
// DayWidth is simply the width in pixels for one day
procedure TTMTimeLineMainForm.udDayWidthClick(Sender: TObject; Button: TUDBtnType);
begin
sl.DayWidth := udDayWidth.Position;
udDayWidth.Position := sl.DayWidth;
StatusBarResize(Sender);
end;
// Color is the background color of the control
procedure TTMTimeLineMainForm.btnColorClick(Sender: TObject);
begin
with TColorDialog.Create(nil) do
try
Color := sl.Color;
if Execute then
sl.Color := Color;
finally
Free;
end;
end;
// the timeline doesn't have a Flat property: when setting BorderStyle to bsNone,
// the scroll buttons are automatically changed to have a flat appearance
procedure TTMTimeLineMainForm.chkFlatClick(Sender: TObject);
const
cBStyle:array [boolean] of TBorderStyle = (bsSingle,bsNone);
begin
sl.BorderStyle := cBStyle[chkFlat.Checked];
end;
// update the first visible date from the datetimepicker
procedure TTMTimeLineMainForm.dtpFirstDateChange(Sender: TObject);
begin
sl.Date := dtpFirstDate.Date;
end;
// update the selected date from the datetimepicker
procedure TTMTimeLineMainForm.dtpSelDateChange(Sender: TObject);
begin
sl.SelDate := dtpSelDate.Date;
end;
// change the selection frame Pen color
// You can also change any other property of the Selection, like
// Pen.Width, Pen.Style, Pen.Mode and whether the Selection frame is visible or not
// Setting Pen.Width to 0, has the same effect as Selection.Visible := false
procedure TTMTimeLineMainForm.btnPenColorClick(Sender: TObject);
begin
with TColorDialog.Create(nil) do
try
Color := sl.Selection.Pen.Color;
if Execute then
begin
sl.Selection.Pen.Color := Color;
end;
finally
Free;
end;
end;
// change the Selection frame Pen's width
procedure TTMTimeLineMainForm.udPenWidthClick(Sender: TObject; Button: TUDBtnType);
begin
sl.Selection.Pen.Width := udPenWidth.Position;
end;
// changes the background Color of Today
procedure TTMTimeLineMainForm.btnTodayColorClick(Sender: TObject);
begin
with TColorDialog.Create(nil) do
try
Color := sl.TodayColor;
if Execute then
sl.TodayColor := Color;
finally
Free;
end;
end;
// when RightClickSelect is true, a right-click changes
// the TJvTLTimeline.Date value
procedure TTMTimeLineMainForm.chkRClickClick(Sender: TObject);
begin
sl.RightClickSelect := chkRClick.Checked;
end;
// move today to the middle of the timeline; looks better
procedure TTMTimeLineMainForm.mnuTodayClick(Sender: TObject);
begin
sl.Date := Date - sl.VisibleDays div 2;
end;
// add or replace the image at the currently selected date
// if the imageindex is < 0 or > Images.Count - 1, the image is removed
procedure TTMTimeLineMainForm.mnuInsertImageClick(Sender: TObject);
begin
sl.ImageIndex[sl.SelDate] := udImageNo.Position;
end;
// the SmallChange value is used when you scroll without holding any additional
// keys down (like Shift or Ctrl). You can scroll both with the mouse and with
// the arrow-keys
procedure TTMTimeLineMainForm.udScrollSmallClick(Sender: TObject; Button: TUDBtnType);
begin
sl.SmallChange := udScrollSmall.Position;
end;
// the LargeChange value is used when you hold the Ctrl key while scrolling
procedure TTMTimeLineMainForm.udScrollLargeClick(Sender: TObject; Button: TUDBtnType);
begin
sl.LargeChange := udScrollLarge.Position;
end;
// remove an image by setting the imageindex to -1
procedure TTMTimeLineMainForm.mnuRemoveImageClick(Sender: TObject);
begin
sl.ImageIndex[sl.SelDate] := -1;
end;
// Get or create a TStringlist for the selected date.
// If the user empties the memo, the TStringlist is freed
procedure TTMTimeLineMainForm.mnuEditMemoClick(Sender: TObject);
var S:TStringlist;i:integer;Ico:TIcon;
begin
// WARNING: if you store integers or other ordinal values in the Objects array
// you will get an AV if you call the ClearObjects method:
// sl.Objects[sl.Date] := TObject(Random(100));
S := TStringlist(sl.Objects[sl.SelDate]);
// here's a trick: extract the image from the imagelist and assign t to the icon property of the form:
i := sl.ImageIndex[sl.SelDate];
if i > -1 then
begin
Ico := TIcon.Create;
il16.GetIcon(i,Ico);
end
else
Ico := nil;
if S = nil then
S := TStringlist.Create;
// TIP: add a class function to dialogs that you show modally.
// That way, you can keep all the creating and freeing stuff in the
// dialog unit instead of in the calling unit.
// This reduces the dialog call to a one-liner:
TMemoEditFrm.Edit(S,sl.SelDate,Ico); // the Edit function automatically updates S if the user clicked OK in the dialog
if Length(trim(S.Text)) = 0 then
begin // there is no text, so free the stringlist to conserve memory
S.Free;
S := nil;
end;
sl.Objects[sl.SelDate] := S; // either way, store the value (nil or TStringlist)
// if Objects[sl.Date] has a non-nil value, the day number is underlined for that date
Ico.Free;
end;
// changes the widths of the scrollbuttons
procedure TTMTimeLineMainForm.udButtonWidthClick(Sender: TObject; Button: TUDBtnType);
begin
sl.ButtonWidth := udButtonWidth.Position;
StatusBarResize(Sender);
end;
// By default, the timeline only stores the imageindex for the dates so if you need
// a little more functionality, here's where you have your chance:
// The OnWriteObject event is called for any date that has a non-nil Objects.
// Because we are storing stringlists in the objects array, we save each of them as a
// long text string to the stream here.
// If you want to store other values, you will have to save them accordingly.
procedure TTMTimeLineMainForm.DoObjectSave(Sender:TObject;Stream:TStream;const AObject:TObject);
var S:string;Count:integer;
begin
S := TStringlist(AObject).Text;
Count := Length(S);
// save length of string
Stream.Write(Count,sizeof(Count));
// need we store anything ?
if Count > 0 then
Stream.Write(S[1],Count);
end;
// The OnReadObject event is called for each object stored in a data file.
// The Timeline keeps track of all the dates that have non-nil objects and calls
// this method for each one of them.
// You don't have to worry about the actual date the object belongs to, because the
// timeline handles this for you.
//
// You must do two things in this handler:
// 1. Create an instance of your class (if it is a class you are storing)
// 2. Read the data from the stream and save it in AObject
procedure TTMTimeLineMainForm.DoObjectLoad(Sender:TObject;Stream:TStream;var AObject:TObject);
var S:string;Count:integer;
begin
// Get the length of the string:
Stream.Read(Count,sizeof(Count));
SetLength(S,Count);
// need we read any more ?
if Count > 0 then
begin
Stream.Read(S[1],Count);
AObject := TStringlist.Create;
TStringlist(AObject).Text := S;
end;
end;
procedure TTMTimeLineMainForm.lbObjFontStyleClickCheck(Sender: TObject);
var F:TFontStyles;
begin
F := [];
with lbObjFontStyle do
begin
if Checked[0] then
Include(F,fsBold);
if Checked[1] then
Include(F,fsItalic);
if Checked[2] then
Include(F,fsUnderline);
if Checked[3] then
Include(F,fsStrikeOut);
end;
sl.ObjectsFontStyle := F;
end;
// move to the selected day and center it on the display
procedure TTMTimeLineMainForm.mnuGotoDateClick(Sender: TObject);
begin
sl.Date := sl.SelDate - sl.VisibleDays div 2;
end;
// update the statusbar whnever anything changes
procedure TTMTimeLineMainForm.StatusBarResize(Sender: TObject);
begin
StatusBar.Panels[0].Text := Format('Visible days: %d',[sl.VisibleDays]);
StatusBar.Panels[1].Text := Format('Last visible date: %s',[DateToStr(sl.LastVisibleDate)]);
end;
// display options:
procedure TTMTimeLineMainForm.chkShowMonthsClick(Sender: TObject);
begin
sl.ShowMonths := chkShowMonths.Checked;
end;
procedure TTMTimeLineMainForm.chkShowWeeksClick(Sender: TObject);
begin
sl.ShowWeeks := chkShowWeeks.Checked;
end;
procedure TTMTimeLineMainForm.chkShowTodayClick(Sender: TObject);
begin
sl.ShowToday := chkShowToday.Checked;
end;
// handling the wheel:
procedure TTMTimeLineMainForm.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
if not sl.Focused and (ControlAtPos(ScreenToClient(MousePos),false,true) is TJvTMTimeline) then
begin
Handled := true;
if ssCtrl in Shift then
sl.ScrollDate(self,-udScrollSmall.Position)
else
sl.ScrollDate(self,-udScrollLarge.Position);
end;
end;
procedure TTMTimeLineMainForm.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
if not sl.Focused and (ControlAtPos(ScreenToClient(MousePos),false,true) is TJvTMTimeline) then
begin
Handled := true;
if ssCtrl in Shift then
sl.ScrollDate(self,udScrollSmall.Position)
else
sl.ScrollDate(self,udScrollLarge.Position);
end;
end;
procedure TTMTimeLineMainForm.btnLineColorClick(Sender: TObject);
begin
with TColorDialog.Create(nil) do
try
Color := sl.LineColor;
if Execute then
sl.LineColor := Color;
finally
Free;
end;
end;
end.
--- NEW FILE: TeamManagerImages.bmp ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: frmMemoEdit.dfm ---
object MemoEditFrm: TMemoEditFrm
Left = 427
Top = 205
Width = 305
Height = 305
ActiveControl = reLines
BorderStyle = bsSizeToolWin
Caption = 'Memo for %s'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 239
Width = 297
Height = 41
Align = alBottom
BevelOuter = bvNone
TabOrder = 0
object btnOK: TButton
Left = 129
Top = 8
Width = 75
Height = 25
Anchors = [akRight, akBottom]
Caption = '&OK'
Default = True
ModalResult = 1
TabOrder = 0
end
object btnCancel: TButton
Left = 209
Top = 8
Width = 75
Height = 25
Anchors = [akRight, akBottom]
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 1
end
end
object reLines: TRichEdit
Left = 0
Top = 0
Width = 297
Height = 239
Align = alClient
PopupMenu = popMemo
ScrollBars = ssBoth
TabOrder = 1
OnKeyUp = reLinesKeyUp
end
object popMemo: TPopupMenu
Left = 128
Top = 104
object Load1: TMenuItem
Caption = 'Load...'
ShortCut = 16463
OnClick = Load1Click
end
object Save1: TMenuItem
Caption = 'Save...'
ShortCut = 16467
OnClick = Save1Click
end
object N1: TMenuItem
Caption = '-'
end
object Cut1: TMenuItem
Caption = 'Cut'
ShortCut = 16472
OnClick = Cut1Click
end
object Copy1: TMenuItem
Caption = 'Copy'
ShortCut = 16451
OnClick = Copy1Click
end
object Paste1: TMenuItem
Caption = 'Paste'
ShortCut = 16470
OnClick = Paste1Click
end
object N2: TMenuItem
Caption = '-'
end
object Selectall1: TMenuItem
Caption = 'Select all'
ShortCut = 16449
OnClick = Selectall1Click
end
end
end
--- NEW FILE: frmMemoEdit.pas ---
unit frmMemoEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, ExtCtrls, Menus;
type
TMemoEditFrm = class(TForm)
Panel1: TPanel;
btnOK: TButton;
btnCancel: TButton;
reLines: TRichEdit;
popMemo: TPopupMenu;
Load1: TMenuItem;
Save1: TMenuItem;
N1: TMenuItem;
Cut1: TMenuItem;
Copy1: TMenuItem;
Paste1: TMenuItem;
Selectall1: TMenuItem;
N2: TMenuItem;
procedure Load1Click(Sender: TObject);
procedure Save1Click(Sender: TObject);
procedure Cut1Click(Sender: TObject);
procedure Copy1Click(Sender: TObject);
procedure Paste1Click(Sender: TObject);
procedure Selectall1Click(Sender: TObject);
procedure reLinesKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
public
class function Edit(Lines: TStrings;ADate:TDateTime;Icon:TIcon = nil): boolean;
end;
implementation
{$R *.DFM}
{ TMemoEditFrm }
class function TMemoEditFrm.Edit(Lines: TStrings;ADate:TDateTime;Icon:TIcon = nil): boolean;
var f:TMemoEditFrm;
begin
f := self.Create(nil);
try
f.Icon := Icon;
f.Caption := Format(f.Caption,[DateToStr(ADate)]);
f.reLines.Lines := Lines;
Result := f.ShowModal = MROK;
if Result then
Lines.Assign(f.ReLines.Lines);
finally
f.Free;
end;
end;
procedure TMemoEditFrm.Load1Click(Sender: TObject);
begin
with TOpenDialog.Create(nil) do
try
if Execute then
reLines.Lines.LoadFromFile(Filename);
finally
Free;
end;
end;
procedure TMemoEditFrm.Save1Click(Sender: TObject);
begin
with TSaveDialog.Create(nil) do
try
if Execute then
reLines.Lines.SaveToFile(Filename);
finally
Free;
end;
end;
procedure TMemoEditFrm.Cut1Click(Sender: TObject);
begin
reLines.CutToClipboard;
end;
procedure TMemoEditFrm.Copy1Click(Sender: TObject);
begin
reLines.CopyToClipboard;
end;
procedure TMemoEditFrm.Paste1Click(Sender: TObject);
begin
reLines.PasteFromClipboard;
end;
procedure TMemoEditFrm.Selectall1Click(Sender: TObject);
begin
reLines.SelectAll;
end;
procedure TMemoEditFrm.reLinesKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then
Close;
end;
end.
--- NEW FILE: il16.bmp ---
(This appears to be a binary file; contents omitted.)
|