procedure TMainForm.FormShow(Sender: TObject);
var
ResName : String;
begin
GotoDatePicker.Date := Date;
// GotoDatePicker.Date := EncodeDate(2002, 1, 1);
TimeIncCombo.ItemIndex := 1;
ModeCombo.ItemIndex := 0;
DaysCombo.ItemIndex := 6;
With SchedulesQuery do
try
Open;
First;
While not EOF do
Begin
ResName := SchedulesQuery.FieldByName('SchedName').AsString;
ResourceCombo.Items.Add(ResName);
VisibleResources.ResourcesCheckList.Items.Add(ResName);
Next;
End;
Close;
except
on E:EDBEngineError do
begin
ShowMessageFmt('%s:'#13#10'Try moving the database to a shorter path.',[E.Message]);
Application.Terminate;
Exit;
end;
end;
ResourceCombo.ItemIndex := 0;
VisibleResources.ResourcesCheckList.Checked[0] := True;
TFDays.Template.CompNames.Add(VisibleResources.ResourcesCheckList.Items[0]);
ResourceComboChange(nil);
DaysComboChange(nil);
ModeComboChange(nil);
//GotoDatePicker.Date := EncodeDate(2002, 1, 1);
GotoDatePickerChange(nil);
TimeIncComboChange(nil);
end;
(*------------------------------------------------------*)
procedure TMainForm.GotoDatePickerChange(Sender: TObject);
begin
TFDays.GotoDate(GotoDatePicker.Date);
TFWeeks.DisplayDate := GotoDatePicker.Date;
TFMonths.DisplayDate := GotoDatePicker.Date;
end;
|