tvplanit: Fix PrintPreviewDlg not updating when a new format item is selected.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4904 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-03 15:42:06 +00:00
parent 99b58efb54
commit 5bc136ef28
4 changed files with 14 additions and 7 deletions

View File

@ -170,14 +170,15 @@ end;
procedure TVpPrintFormatComboBox.Change; procedure TVpPrintFormatComboBox.Change;
var var
NewFormat : Integer; NewFormat : Integer;
begin begin
if not Assigned (FControlLink) then if not Assigned (FControlLink) then
Exit; Exit;
NewFormat := FControlLink.Printer.Find (Text); NewFormat := FControlLink.Printer.Find(Text);
if NewFormat >= 0 then if NewFormat >= 0 then
FControlLink.Printer.CurFormat := NewFormat; FControlLink.Printer.CurFormat := NewFormat;
inherited;
end; end;
function TVpPrintFormatComboBox.GetAbout: string; function TVpPrintFormatComboBox.GetAbout: string;

View File

@ -411,11 +411,9 @@ begin
if not Assigned (FControlLink.Printer) then if not Assigned (FControlLink.Printer) then
Exit; Exit;
// if FCurrentFormat <> FControlLink.Printer.CurFormat then begin ClearPageData;
ClearPageData; GeneratePageImage;
GeneratePageImage; Invalidate;
Invalidate;
// end;
end; end;
procedure TVpPrintPreview.GeneratePageImage; procedure TVpPrintPreview.GeneratePageImage;

View File

@ -50,6 +50,7 @@ object frmPrintPreview: TfrmPrintPreview
ItemHeight = 15 ItemHeight = 15
Sorted = True Sorted = True
TabOrder = 1 TabOrder = 1
OnChange = VpPrintFormatComboBox1Change
end end
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 1 Left = 1

View File

@ -98,6 +98,7 @@ type
procedure actCancelExecute(Sender: TObject); procedure actCancelExecute(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure VpPrintFormatComboBox1Change(Sender: TObject);
private private
procedure SetCaptions; procedure SetCaptions;
@ -191,6 +192,12 @@ begin
actCancel.Hint := RSPrintPrvCancelHint; actCancel.Hint := RSPrintPrvCancelHint;
end; end;
procedure TfrmPrintPreview.VpPrintFormatComboBox1Change(Sender: TObject);
begin
VpPrintPreview1.ForceUpdate;
VpPrintPreview1.FirstPage;
end;
procedure TfrmPrintPreview.OKBtnClick(Sender: TObject); procedure TfrmPrintPreview.OKBtnClick(Sender: TObject);
begin begin