load image dlg is now sized dynamic

git-svn-id: trunk@5121 -
This commit is contained in:
mattias 2004-01-29 22:43:16 +00:00
parent a3296990d5
commit 8dbbb91c8c

View File

@ -156,6 +156,7 @@ var
{Form For Picture/Graphic Property Editor} {Form For Picture/Graphic Property Editor}
type type
TGraphicPropertyEditorForm = class(TForm) TGraphicPropertyEditorForm = class(TForm)
procedure GraphicPropertyEditorFormResize(Sender: TObject);
private private
FModified: boolean; FModified: boolean;
procedure SetModified(const AValue: boolean); procedure SetModified(const AValue: boolean);
@ -196,13 +197,6 @@ begin
HEIGHT := 419; HEIGHT := 419;
WIDTH := 403; WIDTH := 403;
With CONSTRAINTS do begin
MAXHEIGHT := Height;
MAXWIDTH := Width;
MINHEIGHT := Height;
MINWIDTH := Width;
end;
Opendlg := TOPENDIALOG.Create(Self); Opendlg := TOPENDIALOG.Create(Self);
With Opendlg do begin With Opendlg do begin
OPTIONS := [ofextensiondifferent, ofpathmustexist, offilemustexist, ofenablesizing]; OPTIONS := [ofextensiondifferent, ofpathmustexist, offilemustexist, ofenablesizing];
@ -224,42 +218,23 @@ begin
SPACING := 3; SPACING := 3;
MODALRESULT := mrOK; MODALRESULT := mrOK;
CAPTION := '&OK'; CAPTION := '&OK';
LEFT := 325;
HEIGHT := 29;
TOP := 8;
WIDTH := 72;
Show;
end; end;
ScrollBox := TScrollBox.Create(Self); ScrollBox := TScrollBox.Create(Self);
With ScrollBox do begin With ScrollBox do begin
Parent := Self; Parent := Self;
LEFT := 8;
HEIGHT := 365;
TOP := 8;
WIDTH := 310;
AutoSize := False; AutoSize := False;
Color := clWhite; Color := clWhite;
AutoScroll := True; AutoScroll := True;
Show;
end; end;
Preview := TIMAGE.Create(ScrollBox); Preview := TIMAGE.Create(ScrollBox);
With Preview do begin With Preview do begin
Parent := ScrollBox; Parent := ScrollBox;
LEFT := 0; AutoSize:=true;
HEIGHT := 356;
TOP := 0;
WIDTH := 302;
With CONSTRAINTS do begin
MINHEIGHT := Height;
MINWIDTH := Width;
end;
AutoSize := True;
Transparent := True; Transparent := True;
Center := True; Center := True;
Stretch := False; Stretch := False;
Show;
end; end;
CANCELBTN := TBITBTN.Create(Self); CANCELBTN := TBITBTN.Create(Self);
@ -269,11 +244,6 @@ begin
SPACING := 3; SPACING := 3;
MODALRESULT := mrCancel; MODALRESULT := mrCancel;
CAPTION := '&Cancel'; CAPTION := '&Cancel';
LEFT := 325;
HEIGHT := 30;
TOP := 48;
WIDTH := 72;
Show;
end; end;
LoadBTN := TBUTTON.Create(Self); LoadBTN := TBUTTON.Create(Self);
@ -281,11 +251,6 @@ begin
Parent := Self; Parent := Self;
CAPTION := '&Load'; CAPTION := '&Load';
ONCLICK := @LoadBTNCLICK; ONCLICK := @LoadBTNCLICK;
LEFT := 8;
HEIGHT := 29;
TOP := 384;
WIDTH := 82;
Show;
end; end;
SaveBTN := TBUTTON.Create(Self); SaveBTN := TBUTTON.Create(Self);
@ -294,11 +259,6 @@ begin
ENABLED := False; ENABLED := False;
CAPTION := '&Save'; CAPTION := '&Save';
ONCLICK := @SaveBTNCLICK; ONCLICK := @SaveBTNCLICK;
LEFT := 123;
HEIGHT := 29;
TOP := 384;
WIDTH := 76;
Show;
end; end;
ClearBTN := TBUTTON.Create(Self); ClearBTN := TBUTTON.Create(Self);
@ -306,11 +266,44 @@ begin
Parent := Self; Parent := Self;
CAPTION := 'C&lear'; CAPTION := 'C&lear';
ONCLICK := @ClearBTNCLICK; ONCLICK := @ClearBTNCLICK;
LEFT := 236; end;
HEIGHT := 29;
TOP := 384; OnResize:=@GraphicPropertyEditorFormResize;
WIDTH := 82; OnResize(Self);
Show; end;
procedure TGraphicPropertyEditorForm.GraphicPropertyEditorFormResize(
Sender: TObject);
var
x: Integer;
y: Integer;
w: Integer;
begin
with ScrollBox do begin
SetBounds(8,8,Parent.ClientWidth-108,Parent.ClientHeight-43);
end;
with OKBTN do begin
SetBounds(Parent.ClientWidth-95,10,90,Height);
end;
with CANCELBTN do begin
SetBounds(OKBTN.Left,OKBTN.Top+OKBTN.Height+10,OKBTN.Width,Height);
end;
x:=5;
y:=ClientHeight-30;
w:=(ClientWidth-20) div 3;
with LoadBTN do begin
SetBounds(x,y,w,Height);
inc(x,w+5);
end;
with SaveBTN do begin
SetBounds(x,y,w,Height);
inc(x,w+5);
end;
with ClearBTN do begin
SetBounds(x,y,w,Height);
inc(x,w+5);
end; end;
end; end;