You've already forked lazarus-ccr
tvplanit: Define initial control size by GetControlClassDefaultSize. New icons in PrintPreview dialog. Consistent 3D look of TVpPrintPreview.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8469 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -39,7 +39,7 @@ uses
|
||||
Windows, Messages,
|
||||
{$ENDIF}
|
||||
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
|
||||
Buttons, Printers, ComCtrls, ActnList,
|
||||
Buttons, Printers, ComCtrls, ActnList, ImgList,
|
||||
{$IFDEF VERSION6} Variants, {$ENDIF}
|
||||
VpMisc, VpBase, VpData, VpPrtPrv, VpSR, VpBaseDS, VpDlg,
|
||||
VpPrtFmtCBox;
|
||||
@ -74,7 +74,6 @@ type
|
||||
actLastPage: TAction;
|
||||
actCancel: TAction;
|
||||
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure OKBtnClick (Sender : TObject);
|
||||
procedure cboxZoomChange(Sender: TObject);
|
||||
procedure actPrintExecute(Sender: TObject);
|
||||
@ -85,11 +84,13 @@ type
|
||||
procedure actMainUpdate(Action: TBasicAction; var Handled: Boolean);
|
||||
procedure actCancelExecute(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure VpPrintFormatComboBox1Change(Sender: TObject);
|
||||
|
||||
private
|
||||
FDrawingStyle: TVpDrawingStyle;
|
||||
procedure PopulateImageList;
|
||||
procedure SetCaptions;
|
||||
procedure SetDrawingStyle(AValue: TVpDrawingStyle);
|
||||
|
||||
@ -171,10 +172,35 @@ procedure TfrmPrintPreview.FormCreate(Sender: TObject);
|
||||
begin
|
||||
ReturnCode := rtAbandon;
|
||||
SetCaptions;
|
||||
PopulateImageList;
|
||||
Toolbar1.ButtonHeight := ScaleY(Toolbar1.ButtonHeight, DesignTimeDPI);
|
||||
Toolbar1.ButtonWidth := Toolbar1.ButtonHeight;
|
||||
end;
|
||||
|
||||
procedure TfrmPrintPreview.PopulateImageList;
|
||||
const
|
||||
RES_NAMES: array[0..5] of string = (
|
||||
'VpPrint', 'VpFirst', 'VpLArrow', 'VpRArrow', 'VpLast', 'VpCancel'
|
||||
);
|
||||
var
|
||||
bmp16, bmp24, bmp32: TCustomBitmap;
|
||||
i: Integer;
|
||||
begin
|
||||
imMain.RegisterResolutions([16, 24, 32]);
|
||||
imMain.Scaled := true;
|
||||
|
||||
for i := 0 to High(RES_NAMES) do
|
||||
begin
|
||||
bmp16 := CreateBitmapFromResourceName(HINSTANCE, RES_NAMES[i]+'16');
|
||||
bmp24 := CreateBitmapFromResourceName(HINSTANCE, RES_NAMES[i]+'24');
|
||||
bmp32 := CreateBitmapFromResourceName(HINSTANCE, RES_NAMES[i]+'32');
|
||||
imMain.AddMultipleResolutions([bmp16, bmp24, bmp32]);
|
||||
bmp32.Free;
|
||||
bmp24.Free;
|
||||
bmp16.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmPrintPreview.SetCaptions;
|
||||
begin
|
||||
Self.Caption := RSDlgPrintPreview;
|
||||
@ -239,6 +265,7 @@ begin
|
||||
EditForm := TfrmPrintPreview.Create(Application);
|
||||
try
|
||||
DoFormPlacement(EditForm);
|
||||
|
||||
EditForm.WindowState := WindowState;
|
||||
EditForm.VpPrintPreview1.ControlLink := ControlLink;
|
||||
EditForm.VpPrintFormatComboBox1.ControlLink := ControlLink;
|
||||
|
Reference in New Issue
Block a user