diff --git a/components/tvplanit/examples/demo/demomain.lfm b/components/tvplanit/examples/demo/demomain.lfm index aaa675be1..bad49263a 100644 --- a/components/tvplanit/examples/demo/demomain.lfm +++ b/components/tvplanit/examples/demo/demomain.lfm @@ -690,8 +690,8 @@ object MainForm: TMainForm DataStore = VpBufDSDataStore1 LocalizationFile = '../../source/vplocalize.xml' Printer.BottomMargin = 5 - Printer.DayStart = h_07 - Printer.DayEnd = h_18 + Printer.DayStart = h_02 + Printer.DayEnd = h_16 Printer.Granularity = gr60Min Printer.LeftMargin = 5 Printer.MarginUnits = imPercent diff --git a/components/tvplanit/examples/demo/demomain.pas b/components/tvplanit/examples/demo/demomain.pas index c6a7d0e84..08d739f5e 100644 --- a/components/tvplanit/examples/demo/demomain.pas +++ b/components/tvplanit/examples/demo/demomain.pas @@ -182,7 +182,7 @@ begin 'ca' : Result := $0403; // Catalan 'cs' : Result := $0405; // Czech 'de' : Result := $0407; // German - 'en' : Result := $0409; // English (US) + 'en' : Result := $0409; // English (US) 'es' : Result := $040A; // Spanisch 'fi' : Result := $040B; // Finnish 'fr' : Result := $040C; // French @@ -190,7 +190,7 @@ begin 'hu' : Result := $040E; // Hungarian 'it' : Result := $0410; // Italian 'jp' : Result := $0411; // Japanese - 'nl' : Result := $0413; // Netherlands + 'nl' : Result := $0413; // Netherlands (Dutch) 'pl' : Result := $0415; // Polish 'pt' : Result := $0816; // Portuguese (Portugal) 'ru' : Result := $0419; // Russian @@ -367,9 +367,15 @@ begin t1 := StartOfTheWeek(now); t2 := t1 + 7 - VpDayView1.NumDays mod 7; // + 7; fmt.DayInc := VpDayView1.NumDays; - VpControlLink1.Printer.Granularity := VpDayView1.Granularity; - VpControlLink1.Printer.DayStart := h_08; //VpDayView1.DefaultTopHour; - VpControlLink1.Printer.DayEnd := h_17; + + + // wp: !!!!!!!!!!!!!!!!!!!!!!!!!!!! bring back in !!!!!!!!!!!!! + +// VpControlLink1.Printer.Granularity := VpDayView1.Granularity; +// VpControlLink1.Printer.DayStart := h_08; //VpDayView1.DefaultTopHour; +// VpControlLink1.Printer.DayEnd := h_17; + + end; 1: begin // current week in WeekView t1 := StartOfTheWeek(now); @@ -447,6 +453,7 @@ begin 'he': po.Add('he - Hebrew'); 'hu': po.Add('hu - magyar'); 'it': po.Add('it - Italian'); + 'nl': po.Add('nl - Dutch'); 'ru': po.Add('ru - русский'); end; end; diff --git a/components/tvplanit/source/vpbaseds.pas b/components/tvplanit/source/vpbaseds.pas index 0aff12fe9..2af7dae9a 100644 --- a/components/tvplanit/source/vpbaseds.pas +++ b/components/tvplanit/source/vpbaseds.pas @@ -359,7 +359,6 @@ type FLocalizationFile : string; FDefaultCountry : string; FCityStateZipFormat: String; - FScreenOutput : Boolean; protected{private} DependentList: TList; procedure Attach (Sender : TComponent); @@ -380,7 +379,6 @@ type procedure TriggerOnPageEnd (Sender: TObject; PageNum: Integer; ADate: TDateTime; LastPage: Boolean); procedure TriggerOnPageStart (Sender: TObject; PageNum: Integer; ADate: TDateTime); property Localization : TVpLocalization read FLocalization write FLocalization; - property ScreenOutput: Boolean read FScreenOutput write FScreenOutput; published property CityStateZipFormat: String read FCityStateZipFormat write SetCityStateZipFormat; // Use symbols @CITY, @STATE, @ZIP to define the order of these strings @@ -1201,7 +1199,6 @@ var I: Integer; begin inherited; - FScreenOutput := true; DependentList := TList.Create; diff --git a/components/tvplanit/source/vpdayviewpainter.pas b/components/tvplanit/source/vpdayviewpainter.pas index 54a8cf035..4e54e47b1 100644 --- a/components/tvplanit/source/vpdayviewpainter.pas +++ b/components/tvplanit/source/vpdayviewpainter.pas @@ -1554,6 +1554,8 @@ end; procedure TVpDayViewPainter.RenderToCanvas(ARenderIn: TRect; AAngle: TVpRotationAngle; AScale: Extended; ARenderDate: TDateTime; AStartLine, AStopLine: Integer; AUseGran: TVpGranularity; ADisplayOnly: Boolean); +{wp: DisplayOnly is poorly-named. It is false during screen output in the form, + it is true during printing and in print preview } var tmpRect: TRect; begin @@ -1562,15 +1564,12 @@ begin // Make sure to use only the date part ARenderDate := trunc(ARenderDate); - // Here begins the original routine... InitColors; SavePenBrush; InitPenBrush; SetMeasurements; - if StartLine < 0 then - StartLine := FDayView.TopLine; { if DisplayOnly then ScrollBarOffset := 2 @@ -1579,9 +1578,22 @@ begin } - if (FDayView.VisibleLines < FDayView.LineCount) and FDayView.ControlLink.ScreenOutput then - ScrollbarOffset := 14 else - ScrollbarOffset := 0; + ScrollbarOffset := 0; + with TVpDayViewOpener(FDayView) do + if ADisplayOnly then begin + // use printer settings + SetTimeIntervals(ControlLink.Printer.Granularity); + TopLine := StartLine; + StartLine := TopLine; + end else + begin + // use screen settings + SetTimeIntervals(Granularity); + if StartLine < 0 then + StartLine := FDayView.TopLine; + if VisibleLines < LineCount then + ScrollbarOffset := 14; + end; Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom); try diff --git a/components/tvplanit/source/vpprtprv.pas b/components/tvplanit/source/vpprtprv.pas index 3eb831483..86122c91b 100644 --- a/components/tvplanit/source/vpprtprv.pas +++ b/components/tvplanit/source/vpprtprv.pas @@ -706,7 +706,7 @@ begin PPageInfo.Contact := 0; PPageInfo.Task := 0; PPageInfo.LastPage := False; - FPageInfo.Add (PPageInfo); + FPageInfo.Add(PPageInfo); i := 0; end; diff --git a/components/tvplanit/source/vpprtprvdlg.pas b/components/tvplanit/source/vpprtprvdlg.pas index 0d080139f..a002211bb 100644 --- a/components/tvplanit/source/vpprtprvdlg.pas +++ b/components/tvplanit/source/vpprtprvdlg.pas @@ -222,13 +222,10 @@ end; function TVpPrintPreviewDialog.Execute: Boolean; var EditForm: TfrmPrintPreview; - scr: Boolean; begin Result := False; - scr := ControlLink.ScreenOutput; Application.CreateForm(TfrmPrintPreview, EditForm); try - ControlLink.ScreenOutput := false; DoFormPlacement(EditForm); EditForm.WindowState := WindowState; EditForm.VpPrintPreview1.ControlLink := ControlLink; @@ -253,7 +250,6 @@ begin end; end; finally - ControlLink.ScreenOutput := scr; EditForm.Release; end; end;