mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-27 08:33:49 +02:00
fixed retrieving TCanvas.Width/Height
git-svn-id: trunk@7181 -
This commit is contained in:
parent
c5808e7584
commit
b7d8308bd3
@ -300,11 +300,12 @@ end;
|
||||
|
||||
function TCanvas.GetHeight: integer;
|
||||
var
|
||||
w: Integer;
|
||||
p: TPoint;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
GetWindowSize(Handle,w,Result)
|
||||
else
|
||||
if HandleAllocated then begin
|
||||
GetDeviceSize(Handle,p);
|
||||
Result:=p.y;
|
||||
end else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
@ -315,11 +316,12 @@ end;
|
||||
|
||||
function TCanvas.GetWidth: integer;
|
||||
var
|
||||
h: Integer;
|
||||
p: TPoint;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
GetWindowSize(Handle,Result,h)
|
||||
else
|
||||
if HandleAllocated then begin
|
||||
GetDeviceSize(Handle,p);
|
||||
Result:=p.y;
|
||||
end else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
@ -1535,6 +1537,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.93 2005/05/18 09:12:21 mattias
|
||||
fixed retrieving TCanvas.Width/Height
|
||||
|
||||
Revision 1.92 2005/03/07 21:59:44 vincents
|
||||
changed hexstr(cardinal()) for pointers to dbgs() and other 64-bits fixes from Peter Vreman
|
||||
|
||||
|
@ -32,9 +32,9 @@ begin
|
||||
Pen.Style := psDash;
|
||||
Pen.Color:=clBlack;
|
||||
Brush.Style := bsClear;
|
||||
Rectangle(0, 0, Width - 1, Height - 1);
|
||||
Line(0,0,Width-1,Height-1);
|
||||
Line(Width-1,0,0,Height-1);
|
||||
Rectangle(0, 0, Self.Width - 1, Self.Height - 1);
|
||||
Line(0,0,Self.Width-1,Self.Height-1);
|
||||
Line(Self.Width-1,0,0,Self.Height-1);
|
||||
end;
|
||||
exit;
|
||||
end;
|
||||
|
@ -5741,7 +5741,8 @@ end;
|
||||
or a two way Rectangle Gradient, each Vertex point also supports optional
|
||||
Alpha/Transparency for more advanced Gradients.
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtkWidgetSet.GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices : Longint;
|
||||
function TGtkWidgetSet.GradientFill(DC: HDC; Vertices: PTriVertex;
|
||||
NumVertices : Longint;
|
||||
Meshes: Pointer; NumMeshes : Longint; Mode : Longint): Boolean;
|
||||
|
||||
Function DoFillTriangle : Boolean;
|
||||
@ -5867,12 +5868,14 @@ function TGtkWidgetSet.GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices :
|
||||
end;
|
||||
|
||||
const
|
||||
MeshSize : Array[Boolean] of Integer = (SizeOf(tagGradientRect), SizeOf(tagGradientTriangle));
|
||||
MeshSize: Array[Boolean] of Integer = (
|
||||
SizeOf(tagGradientRect), SizeOf(tagGradientTriangle));
|
||||
var
|
||||
I : Integer;
|
||||
begin
|
||||
//Currently Alpha blending is ignored... Ideas anyone?
|
||||
Result := (Meshes <> nil) and (NumMeshes >= 1) and (NumVertices >= 2) and (Vertices <> nil);
|
||||
Result := (Meshes <> nil) and (NumMeshes >= 1) and (NumVertices >= 2)
|
||||
and (Vertices <> nil);
|
||||
If Result and DoFillTriangle then
|
||||
Result := NumVertices >= 3;
|
||||
If Result then begin
|
||||
@ -6113,13 +6116,15 @@ end;
|
||||
|
||||
function MessageButtonClicked(Widget : PGtkWidget; data: gPointer) : GBoolean; cdecl;
|
||||
begin
|
||||
DebugLn('[MessageButtonClicked] ',dbgs(data),' ',dbgs(gtk_object_get_data(PGtkObject(Widget), 'modal_result')));
|
||||
//DebugLn('[MessageButtonClicked] ',dbgs(data),' ',dbgs(gtk_object_get_data(PGtkObject(Widget), 'modal_result')));
|
||||
if Integer(data^) = 0 then
|
||||
Integer(data^):= Integer(gtk_object_get_data(PGtkObject(Widget), 'modal_result'));
|
||||
Integer(data^):=
|
||||
Integer(gtk_object_get_data(PGtkObject(Widget), 'modal_result'));
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
function MessageBoxClosed(Widget : PGtkWidget; Event : PGdkEvent; data: gPointer) : GBoolean; cdecl;
|
||||
function MessageBoxClosed(Widget : PGtkWidget; Event : PGdkEvent;
|
||||
data: gPointer) : GBoolean; cdecl;
|
||||
var ModalResult : integer;
|
||||
begin
|
||||
{ We were requested by window manager to close }
|
||||
@ -6150,8 +6155,10 @@ var Dialog, ALabel : PGtkWidget;
|
||||
if RetValue = IDCANCEL then begin
|
||||
gtk_object_set_data(PGtkObject(Dialog), 'modal_result', Pointer(IDCANCEL));
|
||||
end;
|
||||
gtk_object_set_data(PGtkObject(AButton), 'modal_result', Pointer(PtrInt(RetValue)));
|
||||
g_signal_connect(PGtkObject(AButton), 'clicked', TGtkSignalFunc(@MessageButtonClicked), @ADialogResult);
|
||||
gtk_object_set_data(PGtkObject(AButton), 'modal_result',
|
||||
Pointer(PtrInt(RetValue)));
|
||||
g_signal_connect(PGtkObject(AButton), 'clicked',
|
||||
TGtkSignalFunc(@MessageButtonClicked), @ADialogResult);
|
||||
gtk_container_add (PGtkContainer(PGtkDialog(Dialog)^.action_area), AButton);
|
||||
end;
|
||||
|
||||
@ -6225,7 +6232,8 @@ end;
|
||||
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtkWidgetSet.MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean;
|
||||
function TGtkWidgetSet.MoveToEx(DC: HDC; X, Y: Integer;
|
||||
OldPoint: PPoint): Boolean;
|
||||
begin
|
||||
Assert(False, Format('trace:> [TGtkWidgetSet.MoveToEx] DC:0x%x, X:%d, Y:%d', [DC, X, Y]));
|
||||
Result := IsValidDC(DC);
|
||||
@ -8997,6 +9005,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.419 2005/05/18 09:12:21 mattias
|
||||
fixed retrieving TCanvas.Width/Height
|
||||
|
||||
Revision 1.418 2005/03/21 18:59:50 mattias
|
||||
gtk1 intf no longer moves a focused window to another desktop from Andrew Haines
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user