You've already forked lazarus-ccr
jvcllaz: Fix display of day names in JvYearGrid. Some cosmetic changes and some more features in JvYearGrid demo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6964 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="11"/>
|
<Version Value="12"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<General>
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<CompatibilityMode Value="True"/>
|
||||||
|
</Flags>
|
||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
|
||||||
<Title Value="YearGrid_Demo"/>
|
<Title Value="YearGrid_Demo"/>
|
||||||
<Scaled Value="True"/>
|
<Scaled Value="True"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
@ -13,7 +15,6 @@
|
|||||||
<XPManifest>
|
<XPManifest>
|
||||||
<DpiAware Value="True"/>
|
<DpiAware Value="True"/>
|
||||||
</XPManifest>
|
</XPManifest>
|
||||||
<Icon Value="0"/>
|
|
||||||
</General>
|
</General>
|
||||||
<BuildModes Count="1">
|
<BuildModes Count="1">
|
||||||
<Item1 Name="Default" Default="True"/>
|
<Item1 Name="Default" Default="True"/>
|
||||||
@ -43,7 +44,7 @@
|
|||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="main.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ComponentName Value="Form1"/>
|
<ComponentName Value="MainForm"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
|
@ -16,8 +16,9 @@ begin
|
|||||||
{$IF LCL_FULLVERSION >= 1080000}
|
{$IF LCL_FULLVERSION >= 1080000}
|
||||||
Application.Scaled := True;
|
Application.Scaled := True;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
Application.Scaled:=True;
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TForm1, Form1);
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
Application.Run;
|
Application.Run;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -1,23 +1,25 @@
|
|||||||
object Form1: TForm1
|
object MainForm: TMainForm
|
||||||
Left = 310
|
Left = 361
|
||||||
Height = 777
|
Height = 371
|
||||||
Top = 127
|
Top = 215
|
||||||
Width = 838
|
Width = 885
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Form1'
|
Caption = 'JvYearGrid Demo'
|
||||||
ClientHeight = 777
|
ClientHeight = 371
|
||||||
ClientWidth = 838
|
ClientWidth = 885
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '1.9.0.0'
|
OnShow = FormShow
|
||||||
|
LCLVersion = '2.1.0.0'
|
||||||
object JvYearGrid1: TJvYearGrid
|
object JvYearGrid1: TJvYearGrid
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 248
|
Height = 248
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 734
|
Width = 882
|
||||||
HTMLBorder = False
|
HTMLBorder = False
|
||||||
HTMLFontName = 'Arial'
|
HTMLFontName = 'Arial'
|
||||||
|
BorderColor = clCream
|
||||||
Year = 2018
|
Year = 2018
|
||||||
AutoSizeOptions = [aoGrid, aoFirstColumn, aoFirstRow, aoColumns, aoRows]
|
AutoSizeOptions = [aoGrid, aoFirstColumn, aoFirstRow, aoColumns, aoRows]
|
||||||
FirstColWidth = 67
|
FirstColWidth = 67
|
||||||
@ -26,52 +28,54 @@ object Form1: TForm1
|
|||||||
CellMargins.Top = 2
|
CellMargins.Top = 2
|
||||||
CellMargins.Right = 2
|
CellMargins.Right = 2
|
||||||
CellMargins.Bottom = 2
|
CellMargins.Bottom = 2
|
||||||
|
DayFormat = dfShort
|
||||||
WeekendDays = [wdSaturday, wdSunday]
|
WeekendDays = [wdSaturday, wdSunday]
|
||||||
MonthNamesAlignment = taCenter
|
MonthNamesAlignment = taCenter
|
||||||
DayNamesAlignment = taCenter
|
DayNamesAlignment = taCenter
|
||||||
DaysAlignment = taCenter
|
DaysAlignment = taCenter
|
||||||
|
DefaultColWidth = 19
|
||||||
BorderSpacing.Around = 8
|
BorderSpacing.Around = 8
|
||||||
ScrollBars = ssNone
|
ScrollBars = ssNone
|
||||||
TitleStyle = tsStandard
|
TitleStyle = tsStandard
|
||||||
ColWidths = (
|
ColWidths = (
|
||||||
67
|
67
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
18
|
22
|
||||||
)
|
)
|
||||||
RowHeights = (
|
RowHeights = (
|
||||||
19
|
19
|
||||||
@ -96,11 +100,12 @@ object Form1: TForm1
|
|||||||
Left = 0
|
Left = 0
|
||||||
Height = 97
|
Height = 97
|
||||||
Top = 264
|
Top = 264
|
||||||
Width = 558
|
Width = 722
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 97
|
ClientHeight = 97
|
||||||
ClientWidth = 558
|
ClientWidth = 722
|
||||||
|
ParentFont = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object EdLeftMargin: TSpinEdit
|
object EdLeftMargin: TSpinEdit
|
||||||
AnchorSideLeft.Control = Panel1
|
AnchorSideLeft.Control = Panel1
|
||||||
@ -113,6 +118,7 @@ object Form1: TForm1
|
|||||||
BorderSpacing.Left = 16
|
BorderSpacing.Left = 16
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
OnChange = EdLeftMarginChange
|
OnChange = EdLeftMarginChange
|
||||||
|
ParentFont = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object EdRightMargin: TSpinEdit
|
object EdRightMargin: TSpinEdit
|
||||||
@ -125,6 +131,7 @@ object Form1: TForm1
|
|||||||
Width = 50
|
Width = 50
|
||||||
BorderSpacing.Left = 4
|
BorderSpacing.Left = 4
|
||||||
OnChange = EdRightMarginChange
|
OnChange = EdRightMarginChange
|
||||||
|
ParentFont = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object EdTopMargin: TSpinEdit
|
object EdTopMargin: TSpinEdit
|
||||||
@ -138,6 +145,7 @@ object Form1: TForm1
|
|||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
OnChange = EdTopMarginChange
|
OnChange = EdTopMarginChange
|
||||||
|
ParentFont = False
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
end
|
end
|
||||||
object EdBottomMargin: TSpinEdit
|
object EdBottomMargin: TSpinEdit
|
||||||
@ -150,13 +158,14 @@ object Form1: TForm1
|
|||||||
Width = 58
|
Width = 58
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
OnChange = EdBottomMarginChange
|
OnChange = EdBottomMarginChange
|
||||||
|
ParentFont = False
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object CbDayNamesAlignment: TComboBox
|
object cmbDayNamesAlignment: TComboBox
|
||||||
AnchorSideLeft.Control = Label1
|
AnchorSideLeft.Control = Label1
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = EdTopMargin
|
AnchorSideTop.Control = EdTopMargin
|
||||||
Left = 363
|
Left = 406
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 4
|
Top = 4
|
||||||
Width = 100
|
Width = 100
|
||||||
@ -167,45 +176,48 @@ object Form1: TForm1
|
|||||||
'taRightJustify'
|
'taRightJustify'
|
||||||
'taCenter'
|
'taCenter'
|
||||||
)
|
)
|
||||||
OnChange = CbDayNamesAlignmentChange
|
OnChange = cmbDayNamesAlignmentChange
|
||||||
|
ParentFont = False
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
AnchorSideTop.Control = CbDayNamesAlignment
|
AnchorSideTop.Control = cmbDayNamesAlignment
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = Label2
|
AnchorSideRight.Control = Label2
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 242
|
Left = 242
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 113
|
Width = 156
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'DayNamesAlignment'
|
Caption = 'Day names alignment/format'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
AnchorSideLeft.Control = EdRightMargin
|
AnchorSideLeft.Control = EdRightMargin
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = CbMonthNamesAlignment
|
AnchorSideTop.Control = cmbMonthNamesAlignment
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = Label1
|
AnchorSideRight.Control = Label1
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 226
|
Left = 226
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 35
|
Top = 35
|
||||||
Width = 129
|
Width = 172
|
||||||
BorderSpacing.Left = 40
|
BorderSpacing.Left = 40
|
||||||
Caption = 'MonthNamesAlignment'
|
Caption = 'Month names alignment/format'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object CbMonthNamesAlignment: TComboBox
|
object cmbMonthNamesAlignment: TComboBox
|
||||||
AnchorSideLeft.Control = CbDayNamesAlignment
|
AnchorSideLeft.Control = cmbDayNamesAlignment
|
||||||
AnchorSideTop.Control = CbDayNamesAlignment
|
AnchorSideTop.Control = cmbDayNamesAlignment
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = CbDayNamesAlignment
|
AnchorSideRight.Control = cmbDayNamesAlignment
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 363
|
Left = 406
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 31
|
Top = 31
|
||||||
Width = 100
|
Width = 100
|
||||||
@ -217,30 +229,32 @@ object Form1: TForm1
|
|||||||
'taRightJustify'
|
'taRightJustify'
|
||||||
'taCenter'
|
'taCenter'
|
||||||
)
|
)
|
||||||
OnChange = CbMonthNamesAlignmentChange
|
OnChange = cmbMonthNamesAlignmentChange
|
||||||
|
ParentFont = False
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
end
|
end
|
||||||
object Label3: TLabel
|
object Label3: TLabel
|
||||||
AnchorSideTop.Control = CbDaysAlignment
|
AnchorSideTop.Control = cmbDaysAlignment
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = Label1
|
AnchorSideRight.Control = Label1
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 274
|
Left = 316
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 62
|
Top = 62
|
||||||
Width = 81
|
Width = 82
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'DaysAlignment'
|
Caption = 'Days alignment'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object CbDaysAlignment: TComboBox
|
object cmbDaysAlignment: TComboBox
|
||||||
AnchorSideLeft.Control = CbDayNamesAlignment
|
AnchorSideLeft.Control = cmbDayNamesAlignment
|
||||||
AnchorSideTop.Control = CbMonthNamesAlignment
|
AnchorSideTop.Control = cmbMonthNamesAlignment
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = CbDayNamesAlignment
|
AnchorSideRight.Control = cmbDayNamesAlignment
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 363
|
Left = 406
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 58
|
Top = 58
|
||||||
Width = 100
|
Width = 100
|
||||||
@ -253,24 +267,96 @@ object Form1: TForm1
|
|||||||
'taRightJustify'
|
'taRightJustify'
|
||||||
'taCenter'
|
'taCenter'
|
||||||
)
|
)
|
||||||
OnChange = CbDaysAlignmentChange
|
OnChange = cmbDaysAlignmentChange
|
||||||
|
ParentFont = False
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
end
|
end
|
||||||
object CbFlat: TCheckBox
|
object CbFlat: TCheckBox
|
||||||
AnchorSideLeft.Control = CbDayNamesAlignment
|
AnchorSideLeft.Control = lblYear
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideTop.Control = cmbMonthFormat
|
||||||
AnchorSideTop.Control = CbMonthNamesAlignment
|
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 503
|
Left = 640
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 33
|
Top = 33
|
||||||
Width = 39
|
Width = 39
|
||||||
BorderSpacing.Left = 40
|
|
||||||
BorderSpacing.Right = 16
|
BorderSpacing.Right = 16
|
||||||
Caption = 'Flat'
|
Caption = 'Flat'
|
||||||
OnChange = CbFlatChange
|
OnChange = CbFlatChange
|
||||||
|
ParentFont = False
|
||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
end
|
end
|
||||||
|
object cmbDayFormat: TComboBox
|
||||||
|
AnchorSideLeft.Control = cmbDayNamesAlignment
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = cmbDayNamesAlignment
|
||||||
|
Left = 514
|
||||||
|
Height = 23
|
||||||
|
Top = 4
|
||||||
|
Width = 100
|
||||||
|
BorderSpacing.Left = 8
|
||||||
|
ItemHeight = 15
|
||||||
|
Items.Strings = (
|
||||||
|
'dfInitial'
|
||||||
|
'dfShort'
|
||||||
|
'dfLong'
|
||||||
|
)
|
||||||
|
OnChange = cmbDayFormatChange
|
||||||
|
ParentFont = False
|
||||||
|
Style = csDropDownList
|
||||||
|
TabOrder = 8
|
||||||
|
end
|
||||||
|
object cmbMonthFormat: TComboBox
|
||||||
|
AnchorSideLeft.Control = cmbDayNamesAlignment
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = cmbMonthNamesAlignment
|
||||||
|
Left = 514
|
||||||
|
Height = 23
|
||||||
|
Top = 31
|
||||||
|
Width = 100
|
||||||
|
BorderSpacing.Left = 8
|
||||||
|
ItemHeight = 15
|
||||||
|
Items.Strings = (
|
||||||
|
'mfShort'
|
||||||
|
'mfLong'
|
||||||
|
)
|
||||||
|
OnChange = cmbMonthFormatChange
|
||||||
|
ParentFont = False
|
||||||
|
Style = csDropDownList
|
||||||
|
TabOrder = 9
|
||||||
|
end
|
||||||
|
object udYear: TUpDown
|
||||||
|
AnchorSideLeft.Control = lblYear
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = cmbDayFormat
|
||||||
|
AnchorSideBottom.Control = cmbDayFormat
|
||||||
|
AnchorSideBottom.Side = asrBottom
|
||||||
|
Left = 665
|
||||||
|
Height = 23
|
||||||
|
Top = 4
|
||||||
|
Width = 57
|
||||||
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
|
BorderSpacing.Left = 3
|
||||||
|
Max = 3000
|
||||||
|
Min = 0
|
||||||
|
OnClick = udYearClick
|
||||||
|
Orientation = udHorizontal
|
||||||
|
Position = 0
|
||||||
|
TabOrder = 10
|
||||||
|
end
|
||||||
|
object lblYear: TLabel
|
||||||
|
AnchorSideLeft.Control = cmbDayFormat
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = cmbDayFormat
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 640
|
||||||
|
Height = 15
|
||||||
|
Top = 8
|
||||||
|
Width = 22
|
||||||
|
BorderSpacing.Left = 26
|
||||||
|
Caption = 'Year'
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,17 +5,20 @@ unit main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF LINUX}clocale,{$ENDIF}
|
||||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Spin, StdCtrls, Grids,
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Spin, StdCtrls, Grids,
|
||||||
ExtCtrls, JvYearGrid;
|
ExtCtrls, ComCtrls, JvYearGrid;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TForm1 }
|
{ TMainForm }
|
||||||
|
|
||||||
TForm1 = class(TForm)
|
TMainForm = class(TForm)
|
||||||
CbDayNamesAlignment: TComboBox;
|
cmbMonthFormat: TComboBox;
|
||||||
CbMonthNamesAlignment: TComboBox;
|
cmbDayNamesAlignment: TComboBox;
|
||||||
CbDaysAlignment: TComboBox;
|
cmbDayFormat: TComboBox;
|
||||||
|
cmbMonthNamesAlignment: TComboBox;
|
||||||
|
cmbDaysAlignment: TComboBox;
|
||||||
CbFlat: TCheckBox;
|
CbFlat: TCheckBox;
|
||||||
JvYearGrid1: TJvYearGrid;
|
JvYearGrid1: TJvYearGrid;
|
||||||
EdLeftMargin: TSpinEdit;
|
EdLeftMargin: TSpinEdit;
|
||||||
@ -25,16 +28,22 @@ type
|
|||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
Label3: TLabel;
|
Label3: TLabel;
|
||||||
|
lblYear: TLabel;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
procedure CbDayNamesAlignmentChange(Sender: TObject);
|
udYear: TUpDown;
|
||||||
procedure CbDaysAlignmentChange(Sender: TObject);
|
procedure cmbDayFormatChange(Sender: TObject);
|
||||||
|
procedure cmbDayNamesAlignmentChange(Sender: TObject);
|
||||||
|
procedure cmbDaysAlignmentChange(Sender: TObject);
|
||||||
procedure CbFlatChange(Sender: TObject);
|
procedure CbFlatChange(Sender: TObject);
|
||||||
procedure CbMonthNamesAlignmentChange(Sender: TObject);
|
procedure cmbMonthFormatChange(Sender: TObject);
|
||||||
|
procedure cmbMonthNamesAlignmentChange(Sender: TObject);
|
||||||
procedure EdBottomMarginChange(Sender: TObject);
|
procedure EdBottomMarginChange(Sender: TObject);
|
||||||
procedure EdLeftMarginChange(Sender: TObject);
|
procedure EdLeftMarginChange(Sender: TObject);
|
||||||
procedure EdRightMarginChange(Sender: TObject);
|
procedure EdRightMarginChange(Sender: TObject);
|
||||||
procedure EdTopMarginChange(Sender: TObject);
|
procedure EdTopMarginChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure udYearClick(Sender: TObject; Button: TUDBtnType);
|
||||||
private
|
private
|
||||||
|
|
||||||
public
|
public
|
||||||
@ -42,72 +51,96 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
Form1: TForm1;
|
MainForm: TMainForm;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
{ TForm1 }
|
uses
|
||||||
|
DateUtils;
|
||||||
|
|
||||||
procedure TForm1.CbDayNamesAlignmentChange(Sender: TObject);
|
{ TMainForm }
|
||||||
|
|
||||||
|
procedure TMainForm.cmbDayNamesAlignmentChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.DayNamesAlignment := TAlignment(CbDayNamesAlignment.ItemIndex);
|
JvYearGrid1.DayNamesAlignment := TAlignment(cmbDayNamesAlignment.ItemIndex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.CbDaysAlignmentChange(Sender: TObject);
|
procedure TMainForm.cmbDayFormatChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.DaysAlignment := TAlignment(CbDaysAlignment.ItemIndex);
|
JvYearGrid1.DayFormat := TJvDayFormat(cmbDayFormat.ItemIndex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.CbFlatChange(Sender: TObject);
|
procedure TMainForm.cmbDaysAlignmentChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
JvYearGrid1.DaysAlignment := TAlignment(cmbDaysAlignment.ItemIndex);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.CbFlatChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.Flat := CbFlat.Checked;
|
JvYearGrid1.Flat := CbFlat.Checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.CbMonthNamesAlignmentChange(Sender: TObject);
|
procedure TMainForm.cmbMonthFormatChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.MonthNamesAlignment := TAlignment(CbMonthNamesAlignment.ItemIndex);
|
JvYearGrid1.MonthFormat := TJvMonthFormat(cmbMonthFormat.ItemIndex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.EdBottomMarginChange(Sender: TObject);
|
procedure TMainForm.cmbMonthNamesAlignmentChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
JvYearGrid1.MonthNamesAlignment := TAlignment(cmbMonthNamesAlignment.ItemIndex);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.EdBottomMarginChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.CellMargins.Bottom := EdBottomMargin.Value;
|
JvYearGrid1.CellMargins.Bottom := EdBottomMargin.Value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.EdLeftMarginChange(Sender: TObject);
|
procedure TMainForm.EdLeftMarginChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.CellMargins.Left := EdLeftMargin.Value;
|
JvYearGrid1.CellMargins.Left := EdLeftMargin.Value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.EdRightMarginChange(Sender: TObject);
|
procedure TMainForm.EdRightMarginChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.CellMargins.Right := EdRightMargin.Value;
|
JvYearGrid1.CellMargins.Right := EdRightMargin.Value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.EdTopMarginChange(Sender: TObject);
|
procedure TMainForm.EdTopMarginChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
JvYearGrid1.CellMargins.Top := EdTopMargin.Value;
|
JvYearGrid1.CellMargins.Top := EdTopMargin.Value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.FormCreate(Sender: TObject);
|
procedure TMainForm.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
JvYearGrid1.Year := YearOf(Date);
|
||||||
|
|
||||||
EdLeftMargin.Value := JvYearGrid1.CellMargins.Left;
|
EdLeftMargin.Value := JvYearGrid1.CellMargins.Left;
|
||||||
EdRightMargin.Value := JvYearGrid1.CellMargins.Right;
|
EdRightMargin.Value := JvYearGrid1.CellMargins.Right;
|
||||||
EdTopMargin.Value := JvYearGrid1.CellMargins.Top;
|
EdTopMargin.Value := JvYearGrid1.CellMargins.Top;
|
||||||
EdBottomMargin.Value := JvYearGrid1.CellMargins.Bottom;
|
EdBottomMargin.Value := JvYearGrid1.CellMargins.Bottom;
|
||||||
|
|
||||||
CbDayNamesAlignment.ItemIndex := ord(JvYearGrid1.DayNamesAlignment);
|
cmbDayNamesAlignment.ItemIndex := ord(JvYearGrid1.DayNamesAlignment);
|
||||||
CbMonthNamesAlignment.ItemIndex := ord(JvYearGrid1.MonthNamesAlignment);
|
cmbMonthNamesAlignment.ItemIndex := ord(JvYearGrid1.MonthNamesAlignment);
|
||||||
CbDaysAlignment.ItemIndex := ord(JvYearGrid1.DaysAlignment);
|
cmbDaysAlignment.ItemIndex := ord(JvYearGrid1.DaysAlignment);
|
||||||
|
cmbDayFormat.ItemIndex := ord(JvYearGrid1.DayFormat);
|
||||||
|
cmbMonthFormat.ItemIndex := ord(JvYearGrid1.MonthFormat);
|
||||||
|
|
||||||
|
udYear.Position := JvYearGrid1.Year;
|
||||||
|
|
||||||
CbFlat.Checked := JvYearGrid1.Flat;
|
CbFlat.Checked := JvYearGrid1.Flat;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
procedure TMainForm.FormShow(Sender: TObject);
|
||||||
{$IFDEF WINDOWS}
|
begin
|
||||||
GetLocaleFormatSettings(1033, FormatSettings);
|
AutoSize := true;
|
||||||
{$ENDIF}
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.udYearClick(Sender: TObject; Button: TUDBtnType);
|
||||||
|
begin
|
||||||
|
JvYearGrid1.Year := udYear.Position;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -2312,7 +2312,7 @@ resourcestring
|
|||||||
RsEnterYear = 'Enter year (1999-2050):';
|
RsEnterYear = 'Enter year (1999-2050):';
|
||||||
RsInvalidYear = 'invalid year';
|
RsInvalidYear = 'invalid year';
|
||||||
RsYear = '&Year...';
|
RsYear = '&Year...';
|
||||||
RsEdit = '&Edit';
|
RsEdit = '&Edit...';
|
||||||
RsColor = '&Color...';
|
RsColor = '&Color...';
|
||||||
RsNoColor = '&No Color';
|
RsNoColor = '&No Color';
|
||||||
RsSaveAllInfo = '&Save All Info';
|
RsSaveAllInfo = '&Save All Info';
|
||||||
|
@ -124,19 +124,24 @@ type
|
|||||||
procedure SetYearAlignment(const Value: TAlignment);
|
procedure SetYearAlignment(const Value: TAlignment);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
procedure Color1Click(Sender: TObject);
|
|
||||||
procedure Copy1Click(Sender: TObject);
|
|
||||||
procedure Cut1Click(Sender: TObject);
|
|
||||||
procedure Delete1Click(Sender: TObject);
|
|
||||||
procedure DoShowHint(var HintStr: THintString; var CanShow: Boolean;
|
procedure DoShowHint(var HintStr: THintString; var CanShow: Boolean;
|
||||||
var HintInfo: THintInfo);
|
var HintInfo: THintInfo);
|
||||||
procedure Edit1Click(Sender: TObject);
|
procedure mnuBookMarkColorClick(Sender: TObject);
|
||||||
procedure NoColor1Click(Sender: TObject);
|
procedure mnuBorderColorClick(Sender: TObject);
|
||||||
procedure Paste1Click(Sender: TObject);
|
procedure mnuClearFindClick(Sender: TObject);
|
||||||
procedure SaveAsHTML(Sender: TObject);
|
procedure mnuColorClick(Sender: TObject);
|
||||||
|
procedure mnuCopyClick(Sender: TObject);
|
||||||
|
procedure mnuCutClick(Sender: TObject);
|
||||||
|
procedure mnuDeleteClick(Sender: TObject);
|
||||||
|
procedure mnuEditClick(Sender: TObject);
|
||||||
|
procedure mnuFindClick(Sender: TObject);
|
||||||
|
procedure mnuNoColorClick(Sender: TObject);
|
||||||
|
procedure mnuPasteClick(Sender: TObject);
|
||||||
|
procedure mnuSaveAsHTML(Sender: TObject);
|
||||||
|
procedure mnuSaveFound(Sender: TObject);
|
||||||
|
procedure mnuYearClick(Sender: TObject);
|
||||||
procedure SetupGridPop(Sender: TObject);
|
procedure SetupGridPop(Sender: TObject);
|
||||||
procedure SetYearChanged(const Value: TOnYearChanged);
|
procedure SetYearChanged(const Value: TOnYearChanged);
|
||||||
procedure Year1Click(Sender: TObject);
|
|
||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
procedure MakeHTML(AList: TStringList; Border, Filter: Boolean);
|
procedure MakeHTML(AList: TStringList; Border, Filter: Boolean);
|
||||||
@ -148,13 +153,8 @@ type
|
|||||||
procedure CreatePopup;
|
procedure CreatePopup;
|
||||||
procedure Launch(AFile: string);
|
procedure Launch(AFile: string);
|
||||||
procedure SetSelectDate(const Value: TOnSelectDate);
|
procedure SetSelectDate(const Value: TOnSelectDate);
|
||||||
procedure BorderColor1Click(Sender: TObject);
|
|
||||||
procedure SetInfoChanging(const Value: TOnInfoChanging);
|
procedure SetInfoChanging(const Value: TOnInfoChanging);
|
||||||
procedure ClearBookMarks;
|
procedure ClearBookMarks;
|
||||||
procedure BookMarkColor1Click(Sender: TObject);
|
|
||||||
procedure Find1Click(Sender: TObject);
|
|
||||||
procedure ClearFind1Click(Sender: TObject);
|
|
||||||
procedure SaveFound(Sender: TObject);
|
|
||||||
function IsCurrentYear: Boolean;
|
function IsCurrentYear: Boolean;
|
||||||
|
|
||||||
procedure CellMarginsChange(Sender: TObject);
|
procedure CellMarginsChange(Sender: TObject);
|
||||||
@ -169,7 +169,8 @@ type
|
|||||||
procedure DayMonthIndexToColRow(DayIndex: Integer; MonthIndex: Integer; out ACol, ARow: Integer);
|
procedure DayMonthIndexToColRow(DayIndex: Integer; MonthIndex: Integer; out ACol, ARow: Integer);
|
||||||
|
|
||||||
protected
|
protected
|
||||||
procedure DrawTextInCell(aCol,aRow: Integer; aRect: TRect; aState: TGridDrawState); override;
|
procedure DrawColumnText(aCol, aRow: Integer; aRect: TRect; aState: TGridDrawState); override;
|
||||||
|
procedure DrawTextInCell(aCol, aRow: Integer; aRect: TRect; aState: TGridDrawState); override;
|
||||||
function SelectCell(ACol, ARow: Integer): Boolean; override;
|
function SelectCell(ACol, ARow: Integer): Boolean; override;
|
||||||
procedure DblClick; override;
|
procedure DblClick; override;
|
||||||
procedure DoPrepareCanvas(aCol,aRow:Integer; aState: TGridDrawState); override;
|
procedure DoPrepareCanvas(aCol,aRow:Integer; aState: TGridDrawState); override;
|
||||||
@ -255,8 +256,8 @@ type
|
|||||||
property OnDblClick;
|
property OnDblClick;
|
||||||
property OnClick;
|
property OnClick;
|
||||||
|
|
||||||
property DefaultColWidth: Integer read GetDefaultColWidth write SetDefaultColWidth default 16;
|
property DefaultColWidth: Integer read GetDefaultColWidth write SetDefaultColWidth default 18;
|
||||||
property DefaultRowHeight default 18; //: Integer read GetDefaultRowHeight write SetDefaultRowHeihgt default 18;
|
property DefaultRowHeight default 18;
|
||||||
|
|
||||||
property Align;
|
property Align;
|
||||||
property Anchors;
|
property Anchors;
|
||||||
@ -315,8 +316,8 @@ begin
|
|||||||
FirstRowHeight := 18;
|
FirstRowHeight := 18;
|
||||||
FirstColWidth := 70;
|
FirstColWidth := 70;
|
||||||
|
|
||||||
DefaultColWidth := 16;
|
DefaultColWidth := 18;
|
||||||
DefaultRowHeight := 18;//FFirstRowHeight;
|
DefaultRowHeight := 18;
|
||||||
|
|
||||||
ColCount := 38;
|
ColCount := 38;
|
||||||
RowCount := 13;
|
RowCount := 13;
|
||||||
@ -326,11 +327,6 @@ begin
|
|||||||
Height := 213;
|
Height := 213;
|
||||||
Flat := true;
|
Flat := true;
|
||||||
|
|
||||||
// THIS IS WRONG, VERY WRONG! (obones)
|
|
||||||
Application.ShowHint := True;
|
|
||||||
Application.OnShowHint := @DoShowHint;
|
|
||||||
Application.HintHidePause := 5000;
|
|
||||||
|
|
||||||
DecodeDate(Now, FCurrentYear, FCurrentMonth, FCurrentDay);
|
DecodeDate(Now, FCurrentYear, FCurrentMonth, FCurrentDay);
|
||||||
HTMLFontName := 'Arial';
|
HTMLFontName := 'Arial';
|
||||||
|
|
||||||
@ -412,9 +408,7 @@ begin
|
|||||||
Month := ARow;
|
Month := ARow;
|
||||||
Day := StrToInt(FYearData[ACol, ARow].DisplayText);
|
Day := StrToInt(FYearData[ACol, ARow].DisplayText);
|
||||||
ADate := EncodeDate(Year, Month, Day);
|
ADate := EncodeDate(Year, Month, Day);
|
||||||
DS := FormatDateTime('d-mmm-yyyy', ADate);
|
DS := FormatDateTime('ddd, ddddd', ADate);
|
||||||
W := DayOfWeek(ADate);
|
|
||||||
DS := FormatSettings.ShortDayNames[W] + ' ' + DS;
|
|
||||||
AList.Append('<tr>');
|
AList.Append('<tr>');
|
||||||
AList.Append('<td width=20%>' + DS + '</td>');
|
AList.Append('<td width=20%>' + DS + '</td>');
|
||||||
Infs := FYearData[ACol, ARow].InfoText;
|
Infs := FYearData[ACol, ARow].InfoText;
|
||||||
@ -427,7 +421,7 @@ begin
|
|||||||
AList.Append('</font></body></html>');
|
AList.Append('</font></body></html>');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.SaveAsHTML(Sender: TObject);
|
procedure TJvYearGrid.mnuSaveAsHTML(Sender: TObject);
|
||||||
var
|
var
|
||||||
List: TStringList;
|
List: TStringList;
|
||||||
FileName: string;
|
FileName: string;
|
||||||
@ -695,7 +689,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Copy1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuCopyClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
S: string;
|
S: string;
|
||||||
begin
|
begin
|
||||||
@ -703,7 +697,7 @@ begin
|
|||||||
Clipboard.AsText := S;
|
Clipboard.AsText := S;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Cut1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuCutClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
S: string;
|
S: string;
|
||||||
begin
|
begin
|
||||||
@ -714,7 +708,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Year1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuYearClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
S: string;
|
S: string;
|
||||||
AYear: Word;
|
AYear: Word;
|
||||||
@ -732,7 +726,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Paste1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuPasteClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
S: string;
|
S: string;
|
||||||
begin
|
begin
|
||||||
@ -741,7 +735,7 @@ begin
|
|||||||
SetCellData(Clipboard.AsText);
|
SetCellData(Clipboard.AsText);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Delete1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuDeleteClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
S: string;
|
S: string;
|
||||||
begin
|
begin
|
||||||
@ -760,7 +754,7 @@ begin
|
|||||||
G := FGridPop;
|
G := FGridPop;
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsYear;
|
M.Caption := RsYear;
|
||||||
M.OnClick := @Year1Click;
|
M.OnClick := @mnuYearClick;
|
||||||
M.Tag := 1;
|
M.Tag := 1;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
@ -768,46 +762,46 @@ begin
|
|||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsEdit;
|
M.Caption := RsEdit;
|
||||||
M.OnClick := @Edit1Click;
|
M.OnClick := @mnuEditClick;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsColor;
|
M.Caption := RsColor;
|
||||||
M.OnClick := @Color1Click;
|
M.OnClick := @mnuColorClick;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsNoColor;
|
M.Caption := RsNoColor;
|
||||||
M.OnClick := @NoColor1Click;
|
M.OnClick := @mnuNoColorClick;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := cMenuBreakCaption;
|
M.Caption := cMenuBreakCaption;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsCopyItem;
|
M.Caption := RsCopyItem;
|
||||||
M.OnClick := @Copy1Click;
|
M.OnClick := @mnuCopyClick;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsCutItem;
|
M.Caption := RsCutItem;
|
||||||
M.OnClick := @Cut1Click;
|
M.OnClick := @mnuCutClick;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsPasteItem;
|
M.Caption := RsPasteItem;
|
||||||
M.OnClick := @Paste1Click;
|
M.OnClick := @mnuPasteClick;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsDeleteItem;
|
M.Caption := RsDeleteItem;
|
||||||
M.OnClick := @Delete1Click;
|
M.OnClick := @mnuDeleteClick;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := cMenuBreakCaption;
|
M.Caption := cMenuBreakCaption;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsSaveAllInfo;
|
M.Caption := RsSaveAllInfo;
|
||||||
M.OnClick := @SaveAsHTML;
|
M.OnClick := @mnuSaveAsHTML;
|
||||||
M.Tag := 1;
|
M.Tag := 1;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsSaveFoundInfo;
|
M.Caption := RsSaveFoundInfo;
|
||||||
M.OnClick := @SaveFound;
|
M.OnClick := @mnuSaveFound;
|
||||||
M.Tag := 1;
|
M.Tag := 1;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
@ -815,12 +809,12 @@ begin
|
|||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsBorderColor;
|
M.Caption := RsBorderColor;
|
||||||
M.OnClick := @BorderColor1Click;
|
M.OnClick := @mnuBorderColorClick;
|
||||||
M.Tag := 1;
|
M.Tag := 1;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsBookMarkColor;
|
M.Caption := RsBookMarkColor;
|
||||||
M.OnClick := @BookMarkColor1Click;
|
M.OnClick := @mnuBookMarkColorClick;
|
||||||
M.Tag := 1;
|
M.Tag := 1;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
@ -828,17 +822,17 @@ begin
|
|||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsFindItem;
|
M.Caption := RsFindItem;
|
||||||
M.OnClick := @Find1Click;
|
M.OnClick := @mnuFindClick;
|
||||||
M.Tag := 1;
|
M.Tag := 1;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
M := TMenuItem.Create(G);
|
M := TMenuItem.Create(G);
|
||||||
M.Caption := RsClearFind;
|
M.Caption := RsClearFind;
|
||||||
M.OnClick := @ClearFind1Click;
|
M.OnClick := @mnuClearFindClick;
|
||||||
M.Tag := 1;
|
M.Tag := 1;
|
||||||
G.Items.Add(M);
|
G.Items.Add(M);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Edit1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuEditClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
DS: string;
|
DS: string;
|
||||||
lCol, lRow: Integer;
|
lCol, lRow: Integer;
|
||||||
@ -882,7 +876,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Color1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuColorClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
CD: TColorDialog;
|
CD: TColorDialog;
|
||||||
begin
|
begin
|
||||||
@ -901,7 +895,7 @@ begin
|
|||||||
CD.Free;
|
CD.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.NoColor1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuNoColorClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if (Col < 1) or (Row < 1) or (FYearData[Col, Row].DisplayText = '') then
|
if (Col < 1) or (Row < 1) or (FYearData[Col, Row].DisplayText = '') then
|
||||||
Exit;
|
Exit;
|
||||||
@ -1006,7 +1000,7 @@ begin
|
|||||||
OnDblClick(Self)
|
OnDblClick(Self)
|
||||||
else
|
else
|
||||||
if (Col > 0) and (Row > 0) and (FYearData[Col, Row].DisplayText <> '') then
|
if (Col > 0) and (Row > 0) and (FYearData[Col, Row].DisplayText <> '') then
|
||||||
Edit1Click(nil);
|
mnuEditClick(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.SetBorderColor(const Value: TColor);
|
procedure TJvYearGrid.SetBorderColor(const Value: TColor);
|
||||||
@ -1018,7 +1012,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.BorderColor1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuBorderColorClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
CD: TColorDialog;
|
CD: TColorDialog;
|
||||||
begin
|
begin
|
||||||
@ -1031,7 +1025,7 @@ begin
|
|||||||
CD.Free;
|
CD.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.BookMarkColor1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuBookMarkColorClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
CD: TColorDialog;
|
CD: TColorDialog;
|
||||||
begin
|
begin
|
||||||
@ -1110,7 +1104,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Find1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuFindClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
S: string;
|
S: string;
|
||||||
lCol, lRow: Integer;
|
lCol, lRow: Integer;
|
||||||
@ -1127,17 +1121,17 @@ begin
|
|||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.ClearFind1Click(Sender: TObject);
|
procedure TJvYearGrid.mnuClearFindClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
ClearBookMarks;
|
ClearBookMarks;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.Find;
|
procedure TJvYearGrid.Find;
|
||||||
begin
|
begin
|
||||||
Find1Click(nil);
|
mnuFindClick(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.SaveFound(Sender: TObject);
|
procedure TJvYearGrid.mnuSaveFound(Sender: TObject);
|
||||||
var
|
var
|
||||||
List: TStringList;
|
List: TStringList;
|
||||||
FileName: string;
|
FileName: string;
|
||||||
@ -1564,6 +1558,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TJvYearGrid.DrawColumnText(ACol,ARow: Integer; ARect: TRect;
|
||||||
|
AState: TGridDrawState);
|
||||||
|
begin
|
||||||
|
DrawTextInCell(ACol, 0, ARect, AState);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TJvYearGrid.DrawTextInCell(ACol,ARow: Integer;
|
procedure TJvYearGrid.DrawTextInCell(ACol,ARow: Integer;
|
||||||
ARect: TRect; AState: TGridDrawState);
|
ARect: TRect; AState: TGridDrawState);
|
||||||
var
|
var
|
||||||
@ -1571,6 +1571,7 @@ var
|
|||||||
S: String;
|
S: String;
|
||||||
SExt: TSize;
|
SExt: TSize;
|
||||||
textLeft: Integer;
|
textLeft: Integer;
|
||||||
|
ts: TTextStyle;
|
||||||
|
|
||||||
function GetTextLeft(Alignment: TAlignment; AWidth: Integer): Integer;
|
function GetTextLeft(Alignment: TAlignment; AWidth: Integer): Integer;
|
||||||
begin
|
begin
|
||||||
@ -1607,7 +1608,9 @@ begin
|
|||||||
if (DayIndex > 0) and (MonthIndex > 0) then
|
if (DayIndex > 0) and (MonthIndex > 0) then
|
||||||
textLeft := GetTextLeft(DaysAlignment, SExt.CX);
|
textLeft := GetTextLeft(DaysAlignment, SExt.CX);
|
||||||
|
|
||||||
TextRect(ARect, textLeft, (ARect.Top + ARect.Bottom - SExt.CY) div 2, S);
|
ts := TextStyle;
|
||||||
|
ts.Layout := tlCenter;
|
||||||
|
TextRect(ARect, textLeft, (ARect.Top + ARect.Bottom - SExt.CY) div 2, S, ts);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user