You've already forked lazarus-ccr
jvcllaz: Add second iconset for JvTimeFramework demo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7128 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -44,7 +44,7 @@ type
|
||||
|
||||
TMainForm = class(TForm)
|
||||
WeeksCombo: TComboBox;
|
||||
ImageList: TImageList;
|
||||
StrokeImages: TImageList;
|
||||
JvTFDaysPrinter1: TJvTFDaysPrinter;
|
||||
IconsProvidedLabel: TLabel;
|
||||
IconsLink: TLabel;
|
||||
@ -52,7 +52,7 @@ type
|
||||
SettingsButton: TBitBtn;
|
||||
PrintDialog: TPrintDialog;
|
||||
utfScheduleManager1: TJvTFScheduleManager;
|
||||
StateImageList: TImageList;
|
||||
ColoredImages: TImageList;
|
||||
NeedApptsQuery: TSQLQuery;
|
||||
ApptSchedulesQuery: TSQLQuery;
|
||||
GetApptQuery: TSQLQuery;
|
||||
@ -86,7 +86,6 @@ type
|
||||
dbUTF: TSQLite3Connection;
|
||||
SQLTransaction: TSQLTransaction;
|
||||
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure IconsLinkClick(Sender: TObject);
|
||||
procedure IconsLinkMouseEnter(Sender: TObject);
|
||||
procedure IconsLinkMouseLeave(Sender: TObject);
|
||||
@ -129,6 +128,7 @@ type
|
||||
procedure utfScheduleManager1RefreshAppt(Sender: TObject; Appt: TJvTFAppt);
|
||||
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
|
||||
procedure PrintButtonClick(Sender: TObject);
|
||||
@ -156,6 +156,8 @@ uses
|
||||
{$R *.lfm}
|
||||
|
||||
procedure TMainForm.ApplySettings;
|
||||
var
|
||||
images: Array[0..1] of TImageList;
|
||||
begin
|
||||
with GlobalSettings do begin
|
||||
JvTFDays1.FancyRowHdrAttr.Hr2400 := Hr2400;
|
||||
@ -168,6 +170,20 @@ begin
|
||||
JvTFDays1.PrimeTime.StartTime := PrimeTimeStart;
|
||||
JvTFDays1.PrimeTime.EndTime := PrimeTimeEnd;
|
||||
JvTFDays1.PrimeTime.Color := PrimeTimeColor;
|
||||
|
||||
images[0] := ColoredImages;
|
||||
images[1] := StrokeImages;
|
||||
PrevDateButton.Images := images[IconSet];
|
||||
NextDateButton.Images := images[IconSet];
|
||||
NewApptButton.Images := images[IconSet];
|
||||
EditApptButton.Images := images[IconSet];
|
||||
DeleteApptButton.Images := images[IconSet];
|
||||
PrintButton.Images := images[IconSet];
|
||||
SettingsButton.Images := images[IconSet];
|
||||
ViewSchedsButton.Images := images[IconSet];
|
||||
HideSchedButton.Images := images[IconSet];
|
||||
ShareButton.Images := images[IconSet];
|
||||
utfScheduleManager1.StateImages := images[IconSet];
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -775,6 +791,62 @@ procedure TMainForm.FormCreate(Sender: TObject);
|
||||
var
|
||||
fn: String;
|
||||
begin
|
||||
with DefaultFormatSettings do begin
|
||||
CurrencyFormat := 1;
|
||||
NegCurrFormat := 5;
|
||||
ThousandSeparator := ',';
|
||||
DecimalSeparator := '.';
|
||||
CurrencyDecimals := 2;
|
||||
DateSeparator := '-';
|
||||
TimeSeparator := ':';
|
||||
ListSeparator := ',';
|
||||
CurrencyString := '$';
|
||||
ShortDateFormat := 'd/m/y';
|
||||
LongDateFormat := 'dd" "mmmm" "yyyy';
|
||||
TimeAMString := 'AM';
|
||||
TimePMString := 'PM';
|
||||
ShortTimeFormat := 'hh:nn';
|
||||
LongTimeFormat := 'hh:nn:ss';
|
||||
ShortMonthNames[1] := 'Jan';
|
||||
ShortMonthNames[2] := 'Feb';
|
||||
ShortMonthNames[3] := 'Mar';
|
||||
ShortMonthNames[4] := 'Apr';
|
||||
ShortMonthNames[5] := 'May';
|
||||
ShortMonthNames[6] := 'Jun';
|
||||
ShortMonthNames[7] := 'Jul';
|
||||
ShortMonthNames[8] := 'Aug';
|
||||
ShortMonthNames[9] := 'Sep';
|
||||
ShortMonthNames[10] := 'Oct';
|
||||
ShortMonthNames[11] := 'Nov';
|
||||
ShortMonthNames[12] := 'Dec';
|
||||
LongMonthNames[1] := 'January';
|
||||
LongMonthNames[2] := 'February';
|
||||
LongMonthNames[3] := 'March';
|
||||
LongMonthNames[4] := 'April';
|
||||
LongMonthNames[5] := 'May';
|
||||
LongMonthNames[6] := 'June';
|
||||
LongMonthNames[7] := 'July';
|
||||
LongMonthNames[8] := 'August';
|
||||
LongMonthNames[9] := 'September';
|
||||
LongMonthNames[10] := 'October';
|
||||
LongMonthNames[11] := 'November';
|
||||
LongMonthNames[12] := 'December';
|
||||
ShortDayNames[1] := 'Sun';
|
||||
ShortDayNames[2] := 'Mon';
|
||||
ShortDayNames[3] := 'Tue';
|
||||
ShortDayNames[4] := 'Wed';
|
||||
ShortDayNames[5] := 'Thu';
|
||||
ShortDayNames[6] := 'Fri';
|
||||
ShortDayNames[7] := 'Sat';
|
||||
LongDayNames[1] := 'Sunday';
|
||||
LongDayNames[2] := 'Monday';
|
||||
LongDayNames[3] := 'Tuesday';
|
||||
LongDayNames[4] := 'Wednesday';
|
||||
LongDayNames[5] := 'Thursday';
|
||||
LongDayNames[6] := 'Friday';
|
||||
LongDayNames[7] := 'Saturday';
|
||||
end;
|
||||
|
||||
fn := Application.Location + 'data.sqlite';
|
||||
dbUTF.DatabaseName := fn;
|
||||
dbUTF.Connected := FileExists(fn);
|
||||
@ -804,6 +876,7 @@ begin
|
||||
GlobalSettings.PrimeTimeStart := ini.ReadTime('Settings', 'PrimeTimeStart', GlobalSettings.PrimeTimeStart);
|
||||
GlobalSettings.PrimeTimeEnd := ini.ReadTime('Settings', 'PrimeTimeEnd', GlobalSettings.PrimeTimeEnd);
|
||||
GlobalSettings.PrimeTimeColor := TColor(ini.ReadInteger('Settings', 'PrimeTimeColor', Integer(GlobalSettings.PrimeTimeColor)));
|
||||
GlobalSettings.IconSet := ini.ReadInteger('Settings', 'IconSet', GlobalSettings.IconSet);
|
||||
ApplySettings;
|
||||
finally
|
||||
ini.Free;
|
||||
@ -828,6 +901,7 @@ begin
|
||||
ini.WriteTime('Settings', 'PrimeTimeStart', GlobalSettings.PrimeTimeStart);
|
||||
ini.WriteTime('Settings', 'PrimeTimeEnd', GlobalSettings.PrimeTimeEnd);
|
||||
ini.WriteInteger('Settings', 'PrimeTimeColor', GlobalSettings.PrimeTimeColor);
|
||||
ini.WriteInteger('Settings', 'IconSet', GlobalSettings.IconSet);
|
||||
finally
|
||||
ini.Free;
|
||||
end;
|
||||
|
@ -3,7 +3,8 @@ object SettingsForm: TSettingsForm
|
||||
Height = 299
|
||||
Top = 283
|
||||
Width = 403
|
||||
Caption = 'SettingsForm'
|
||||
AutoSize = True
|
||||
Caption = 'Settings'
|
||||
ClientHeight = 299
|
||||
ClientWidth = 403
|
||||
OnClose = FormClose
|
||||
@ -16,6 +17,7 @@ object SettingsForm: TSettingsForm
|
||||
Height = 34
|
||||
Top = 259
|
||||
Width = 391
|
||||
BorderSpacing.Top = 4
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.DefaultCaption = True
|
||||
OKButton.OnClick = OKButtonClick
|
||||
@ -30,12 +32,12 @@ object SettingsForm: TSettingsForm
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 253
|
||||
Height = 249
|
||||
Top = 0
|
||||
Width = 403
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 253
|
||||
ClientHeight = 249
|
||||
ClientWidth = 403
|
||||
TabOrder = 1
|
||||
object Bevel1: TBevel
|
||||
@ -90,6 +92,7 @@ object SettingsForm: TSettingsForm
|
||||
Top = 39
|
||||
Width = 88
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Left = 36
|
||||
Caption = 'First day of week'
|
||||
FocusControl = cbFirstDayOfWeek
|
||||
ParentColor = False
|
||||
@ -176,6 +179,7 @@ object SettingsForm: TSettingsForm
|
||||
Top = 75
|
||||
Width = 104
|
||||
BorderSpacing.Left = 4
|
||||
BorderSpacing.Right = 36
|
||||
BorderWidth = 2
|
||||
ButtonColorAutoSize = False
|
||||
ButtonColorSize = 16
|
||||
@ -183,5 +187,53 @@ object SettingsForm: TSettingsForm
|
||||
Caption = 'Prime time'
|
||||
Margin = 4
|
||||
end
|
||||
object Bevel2: TBevel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
AnchorSideTop.Control = edPrimeTimeEnd
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 8
|
||||
Height = 3
|
||||
Top = 120
|
||||
Width = 387
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
Shape = bsTopLine
|
||||
end
|
||||
object cbIconSet: TComboBox
|
||||
AnchorSideLeft.Control = edPrimeTimeEnd
|
||||
AnchorSideRight.Control = cbTimeFormat
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 132
|
||||
Height = 23
|
||||
Top = 128
|
||||
Width = 124
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Color'
|
||||
'Stroke style'
|
||||
)
|
||||
Style = csDropDownList
|
||||
TabOrder = 4
|
||||
Text = 'Color'
|
||||
end
|
||||
object lblIconSet: TLabel
|
||||
AnchorSideTop.Control = cbIconSet
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = lblTimeFormat
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 83
|
||||
Height = 15
|
||||
Top = 132
|
||||
Width = 41
|
||||
Anchors = [akTop, akRight]
|
||||
Caption = 'Icon set'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -15,6 +15,7 @@ type
|
||||
PrimeTimeStart: TTime;
|
||||
PrimeTimeEnd: TTime;
|
||||
PrimeTimeColor: TColor;
|
||||
IconSet: Integer;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -24,6 +25,7 @@ var
|
||||
PrimeTimeStart: 8 * ONE_HOUR;
|
||||
PrimeTimeEnd: 17 * ONE_HOUR;
|
||||
PrimeTimeColor: $00C4FFFF;
|
||||
IconSet: 0
|
||||
);
|
||||
|
||||
type
|
||||
@ -31,10 +33,13 @@ type
|
||||
|
||||
TSettingsForm = class(TForm)
|
||||
Bevel1: TBevel;
|
||||
Bevel2: TBevel;
|
||||
ButtonPanel1: TButtonPanel;
|
||||
cbTimeFormat: TComboBox;
|
||||
cbFirstDayOfWeek: TComboBox;
|
||||
clbPrimeTimeColor: TColorButton;
|
||||
cbIconSet: TComboBox;
|
||||
lblIconSet: TLabel;
|
||||
lblPrimeTimeStart: TLabel;
|
||||
lblPrimeTimeEnd: TLabel;
|
||||
lblFirstDayOfWeek: TLabel;
|
||||
@ -67,6 +72,7 @@ begin
|
||||
GlobalSettings.PrimeTimeStart := frac(edPrimeTimeStart.Time);
|
||||
GlobalSettings.PrimeTimeEnd := frac(edPrimeTimeEnd.Time);
|
||||
GlobalSettings.PrimeTimeColor := clbPrimeTimeColor.ButtonColor;
|
||||
GlobalSettings.IconSet := cbIconSet.ItemIndex;
|
||||
end;
|
||||
|
||||
procedure TSettingsForm.SettingsToControls;
|
||||
@ -77,6 +83,7 @@ begin
|
||||
edPrimeTimeStart.Time := GlobalSettings.PrimeTimeStart;
|
||||
edPrimeTimeEnd.Time := GlobalSettings.PrimeTimeEnd;
|
||||
clbPrimeTimeColor.ButtonColor := GlobalSettings.PrimeTimeColor;
|
||||
cbIconSet.ItemIndex := GlobalSettings.IconSet;
|
||||
end;
|
||||
|
||||
procedure TSettingsForm.FormClose(Sender: TObject;
|
||||
|
Reference in New Issue
Block a user