You've already forked lazarus-ccr
jvcllaz: In JvTimeFrame demo, add "new user" button.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7137 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,7 @@ type
|
|||||||
|
|
||||||
TMainForm = class(TForm)
|
TMainForm = class(TForm)
|
||||||
JvTFAlarm1: TJvTFAlarm;
|
JvTFAlarm1: TJvTFAlarm;
|
||||||
|
NewSchedButton: TBitBtn;
|
||||||
TodayButton: TSpeedButton;
|
TodayButton: TSpeedButton;
|
||||||
WeeksCombo: TComboBox;
|
WeeksCombo: TComboBox;
|
||||||
StrokeImages: TImageList;
|
StrokeImages: TImageList;
|
||||||
@ -95,6 +96,7 @@ type
|
|||||||
var SnoozeMins: Integer; var Dismiss: Boolean);
|
var SnoozeMins: Integer; var Dismiss: Boolean);
|
||||||
|
|
||||||
procedure ModeComboChange(Sender: TObject);
|
procedure ModeComboChange(Sender: TObject);
|
||||||
|
procedure NewSchedButtonClick(Sender: TObject);
|
||||||
procedure PageControl1Change(Sender: TObject);
|
procedure PageControl1Change(Sender: TObject);
|
||||||
procedure SettingsButtonClick(Sender: TObject);
|
procedure SettingsButtonClick(Sender: TObject);
|
||||||
procedure TodayButtonClick(Sender: TObject);
|
procedure TodayButtonClick(Sender: TObject);
|
||||||
@ -189,6 +191,7 @@ begin
|
|||||||
ViewSchedsButton.Images := images[IconSet];
|
ViewSchedsButton.Images := images[IconSet];
|
||||||
HideSchedButton.Images := images[IconSet];
|
HideSchedButton.Images := images[IconSet];
|
||||||
ShareButton.Images := images[IconSet];
|
ShareButton.Images := images[IconSet];
|
||||||
|
NewSchedButton.Images := images[IconSet];
|
||||||
utfScheduleManager1.StateImages := images[IconSet];
|
utfScheduleManager1.StateImages := images[IconSet];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -303,15 +306,18 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.ModeComboChange(Sender: TObject);
|
procedure TMainForm.ModeComboChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
ResourceCombo.Visible := ModeCombo.ItemIndex = 0;
|
||||||
|
DaysCombo.Visible := (ModeCombo.ItemIndex = 0) and (PageControl1.ActivePage = pgDays);
|
||||||
|
WeeksCombo.Visible := (ModeCombo.ItemIndex = 0) and (PageControl1.ActivePage = pgWeeks);
|
||||||
|
|
||||||
|
NewSchedButton.Visible := ModeCombo.ItemIndex = 1;
|
||||||
|
ViewSchedsButton.Visible := ModeCombo.ItemIndex = 1;
|
||||||
|
HideSchedButton.Visible := ModeCombo.ItemIndex = 1;
|
||||||
|
ShareButton.Visible := ModeCombo.ItemIndex = 1;
|
||||||
|
|
||||||
If ModeCombo.ItemIndex = 0 Then
|
If ModeCombo.ItemIndex = 0 Then
|
||||||
// Single mode
|
// Single mode
|
||||||
Begin
|
Begin
|
||||||
// display the appropriate tool bar controls
|
|
||||||
ViewSchedsButton.Visible := False;
|
|
||||||
HideSchedButton.Visible := False;
|
|
||||||
ShareButton.Visible := False;
|
|
||||||
ResourceCombo.Visible := True;
|
|
||||||
DaysCombo.Visible := True;
|
|
||||||
// synchronize the date
|
// synchronize the date
|
||||||
JvTFDays1.Template.LinearStartDate := GotoDatePicker.Date;
|
JvTFDays1.Template.LinearStartDate := GotoDatePicker.Date;
|
||||||
// "activate" the Linear template
|
// "activate" the Linear template
|
||||||
@ -322,12 +328,6 @@ begin
|
|||||||
Else
|
Else
|
||||||
// Group mode
|
// Group mode
|
||||||
Begin
|
Begin
|
||||||
// display the appropriate tool bar controls
|
|
||||||
ViewSchedsButton.Visible := True;
|
|
||||||
HideSchedButton.Visible := True;
|
|
||||||
ShareButton.Visible := True;
|
|
||||||
ResourceCombo.Visible := False;
|
|
||||||
DaysCombo.Visible := False;
|
|
||||||
// synchronize the date
|
// synchronize the date
|
||||||
JvTFDays1.Template.CompDate := GotoDatePicker.Date;
|
JvTFDays1.Template.CompDate := GotoDatePicker.Date;
|
||||||
// "activate" the Comparative template
|
// "activate" the Comparative template
|
||||||
@ -497,6 +497,20 @@ begin
|
|||||||
ApptEdit.ShowModal;
|
ApptEdit.ShowModal;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.NewSchedButtonClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
s: String;
|
||||||
|
n: Integer;
|
||||||
|
begin
|
||||||
|
s := InputBox('Add User', 'User name', '');
|
||||||
|
if s <> '' then begin
|
||||||
|
ResourceCombo.Items.Add(s);
|
||||||
|
n := VisibleResources.ResourcesCheckList.Items.Add(s);
|
||||||
|
Share.ResourcesCheckList.Items.Add(s);
|
||||||
|
VisibleResources.ResourcesCheckList.Checked[n] := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.EditApptButtonClick(Sender: TObject);
|
procedure TMainForm.EditApptButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
If Assigned(JvTFDays1.SelAppt) Then
|
If Assigned(JvTFDays1.SelAppt) Then
|
||||||
@ -506,9 +520,8 @@ begin
|
|||||||
ApptEdit.Appt := JvTFDays1.SelAppt;
|
ApptEdit.Appt := JvTFDays1.SelAppt;
|
||||||
ApptEdit.ShowModal;
|
ApptEdit.ShowModal;
|
||||||
End
|
End
|
||||||
Else
|
else
|
||||||
MessageDlg('Please select an appointment to edit.', mtInformation,
|
MessageDlg('Please select an appointment to edit.', mtInformation, [mbOK], 0);
|
||||||
[mbOK], 0);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.DeleteApptButtonClick(Sender: TObject);
|
procedure TMainForm.DeleteApptButtonClick(Sender: TObject);
|
||||||
@ -660,10 +673,12 @@ begin
|
|||||||
|
|
||||||
// Initialize the resource related controls
|
// Initialize the resource related controls
|
||||||
ResourceCombo.ItemIndex := 0;
|
ResourceCombo.ItemIndex := 0;
|
||||||
|
if VisibleResources.ResourcesCheckList.Items.Count > 0 then begin
|
||||||
VisibleResources.ResourcesCheckList.Checked[0] := True;
|
VisibleResources.ResourcesCheckList.Checked[0] := True;
|
||||||
|
|
||||||
// Initialize the comparative template
|
// Initialize the comparative template
|
||||||
JvTFDays1.Template.CompNames.Add(VisibleResources.ResourcesCheckList.Items[0]);
|
JvTFDays1.Template.CompNames.Add(VisibleResources.ResourcesCheckList.Items[0]);
|
||||||
|
end;
|
||||||
|
|
||||||
// Now run the events to synchronize JvTFDays, etc.
|
// Now run the events to synchronize JvTFDays, etc.
|
||||||
ResourceComboChange(nil);
|
ResourceComboChange(nil);
|
||||||
|
Reference in New Issue
Block a user