mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-21 18:09:24 +01:00
fixed TCustomImage.DoAutoSize fixing uninitialized vars
git-svn-id: trunk@5202 -
This commit is contained in:
parent
8bedd8b74f
commit
bccd8739a1
130
lcl/controls.pp
130
lcl/controls.pp
@ -931,8 +931,8 @@ type
|
|||||||
FCompStyle: Byte; // enables (valid) use of 'IN' operator
|
FCompStyle: Byte; // enables (valid) use of 'IN' operator
|
||||||
Function PerformTab(ForwardTab: boolean): Boolean; Virtual;
|
Function PerformTab(ForwardTab: boolean): Boolean; Virtual;
|
||||||
// use overload to simulate default
|
// use overload to simulate default
|
||||||
procedure BeginDrag(Immediate: Boolean; Threshold: Integer); //overload;
|
procedure BeginDrag(Immediate: Boolean; Threshold: Integer);
|
||||||
procedure BeginDrag(Immediate: Boolean); //overload;
|
procedure BeginDrag(Immediate: Boolean);
|
||||||
procedure BringToFront;
|
procedure BringToFront;
|
||||||
function ColorIsStored: boolean; virtual;
|
function ColorIsStored: boolean; virtual;
|
||||||
constructor Create(AOwner: TComponent);override;
|
constructor Create(AOwner: TComponent);override;
|
||||||
@ -1663,6 +1663,7 @@ function CNSendMessage(LM_Message: integer; Sender: TObject; data: pointer) : in
|
|||||||
Function FindDragTarget(const Pos: TPoint; AllowDisabled: Boolean): TControl;
|
Function FindDragTarget(const Pos: TPoint; AllowDisabled: Boolean): TControl;
|
||||||
Function FindLCLWindow(const ScreenPos : TPoint) : TWinControl;
|
Function FindLCLWindow(const ScreenPos : TPoint) : TWinControl;
|
||||||
Function FindControl(Handle: hwnd): TWinControl;
|
Function FindControl(Handle: hwnd): TWinControl;
|
||||||
|
Function FindOwnerControl(Handle: hwnd): TWinControl;
|
||||||
function FindLCLControl(const ScreenPos: TPoint) : TControl;
|
function FindLCLControl(const ScreenPos: TPoint) : TControl;
|
||||||
|
|
||||||
function SendAppMessage(Msg: Cardinal; WParam: WParam; LParam: LParam): Longint;
|
function SendAppMessage(Msg: Cardinal; WParam: WParam; LParam: LParam): Longint;
|
||||||
@ -1718,9 +1719,13 @@ begin
|
|||||||
Result := SendMsgToInterface(LM_Message, Sender, Data);
|
Result := SendMsgToInterface(LM_Message, Sender, Data);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------
|
||||||
{ FindControl }
|
FindControl
|
||||||
{------------------------------------------------------------------------------}
|
|
||||||
|
Returns the TWinControl owning the Handle. Handle can also be a child handle,
|
||||||
|
and does not need to be the Handle property of the Result.
|
||||||
|
IMPORTANT: So, in most cases: Result.Handle <> Handle in the params.
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
function FindControl(Handle: hwnd): TWinControl;
|
function FindControl(Handle: hwnd): TWinControl;
|
||||||
begin
|
begin
|
||||||
if Handle <> 0
|
if Handle <> 0
|
||||||
@ -1728,6 +1733,16 @@ begin
|
|||||||
else Result := nil;
|
else Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function FindOwnerControl(Handle: hwnd): TWinControl;
|
||||||
|
begin
|
||||||
|
While Handle<>0 do begin
|
||||||
|
Result:=FindControl(Handle);
|
||||||
|
if Result<>nil then exit;
|
||||||
|
Handle:=GetParent(Handle);
|
||||||
|
end;
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function FindLCLControl(const ScreenPos: TPoint) : TControl;
|
function FindLCLControl(const ScreenPos: TPoint) : TControl;
|
||||||
var
|
var
|
||||||
AWinControl: TWinControl;
|
AWinControl: TWinControl;
|
||||||
@ -1763,12 +1778,12 @@ begin
|
|||||||
MoveWindowOrgEx(dc,X,Y);
|
MoveWindowOrgEx(dc,X,Y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function DoControlMsg(handle:hwnd; var Message) : Boolean;
|
function DoControlMsg(Handle: hwnd; var Message) : Boolean;
|
||||||
var
|
var
|
||||||
Control : TWinControl;
|
Control : TWinControl;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
Control := FindControl(handle);
|
Control := FindOwnerControl(Handle);
|
||||||
if Control <> nil then
|
if Control <> nil then
|
||||||
with TLMessage(Message) do
|
with TLMessage(Message) do
|
||||||
Begin
|
Begin
|
||||||
@ -1778,20 +1793,39 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{-------------------------------------------------------------------------------
|
||||||
|
procedure ClearDragObject;
|
||||||
|
|
||||||
|
Set the global variable DragObject to nil.
|
||||||
|
If DragObjectAutoFree is set, then the DragObject was auto created by the LCL
|
||||||
|
and is freed here.
|
||||||
|
-------------------------------------------------------------------------------}
|
||||||
|
procedure ClearDragObject;
|
||||||
|
begin
|
||||||
|
if DragObjectAutoFree then begin
|
||||||
|
DragObjectAutoFree:=false;
|
||||||
|
FreeThenNil(DragObject);
|
||||||
|
end else
|
||||||
|
DragObject := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
Procedure DragInit(aDragObject: TDragObject; Immediate: Boolean;
|
Procedure DragInit(aDragObject: TDragObject; Immediate: Boolean;
|
||||||
Threshold: Integer);
|
Threshold: Integer);
|
||||||
|
|
||||||
|
Set the global variable DragObject.
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
Procedure DragInit(aDragObject: TDragObject; Immediate: Boolean;
|
Procedure DragInit(aDragObject: TDragObject; Immediate: Boolean;
|
||||||
Threshold: Integer);
|
Threshold: Integer);
|
||||||
Begin
|
Begin
|
||||||
|
if DragObject<>ADragObject then
|
||||||
|
ClearDragObject;
|
||||||
DragObject := ADragObject;
|
DragObject := ADragObject;
|
||||||
DragObject.DragTarget := nil;
|
DragObject.DragTarget := nil;
|
||||||
GetCursorPos(DragStartPos);
|
GetCursorPos(DragStartPos);
|
||||||
DragObject.DragPos := DragStartPos;
|
DragObject.DragPos := DragStartPos;
|
||||||
DragCapture := DragObject.Capture;
|
DragCapture := DragObject.Capture;
|
||||||
DragThreshold := Threshold;
|
DragThreshold := Threshold;
|
||||||
//save the cursor yet
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
@ -1803,20 +1837,20 @@ var
|
|||||||
DragObject: TDragObject;
|
DragObject: TDragObject;
|
||||||
ok: boolean;
|
ok: boolean;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
|
writeln('DragInitControl ',Control.Name,':',Control.ClassName,' Immediate=',Immediate);
|
||||||
|
{$ENDIF}
|
||||||
|
ClearDragObject;
|
||||||
DragControl := Control;
|
DragControl := Control;
|
||||||
ok:=false;
|
ok:=false;
|
||||||
try
|
try
|
||||||
DragObject := nil;
|
if Control.fDragKind = dkDrag then begin
|
||||||
DragObjectAutoFree := False;
|
|
||||||
if Control.fDragKind = dkDrag then
|
|
||||||
begin
|
|
||||||
// initialize the DragControl. Note: This can change the DragControl
|
// initialize the DragControl. Note: This can change the DragControl
|
||||||
Control.DoStartDrag(DragObject);
|
Control.DoStartDrag(DragObject);
|
||||||
// check if initialization was successful
|
// check if initialization was successful
|
||||||
if DragControl = nil then Exit;
|
if DragControl = nil then Exit;
|
||||||
// initialize DragObject, if not already done
|
// initialize DragObject, if not already done
|
||||||
if DragObject = nil then
|
if DragObject = nil then Begin
|
||||||
Begin
|
|
||||||
DragObject := TDragControlObject.Create(Control);
|
DragObject := TDragControlObject.Create(Control);
|
||||||
DragObjectAutoFree := True;
|
DragObjectAutoFree := True;
|
||||||
End;
|
End;
|
||||||
@ -1826,19 +1860,26 @@ begin
|
|||||||
DragInit(DragObject,Immediate,Threshold);
|
DragInit(DragObject,Immediate,Threshold);
|
||||||
ok:=true;
|
ok:=true;
|
||||||
finally
|
finally
|
||||||
if not ok then
|
if not ok then begin
|
||||||
DragControl := nil;
|
DragControl := nil;
|
||||||
|
ClearDragObject;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
Procedure DragTo(P : TPoint);
|
Procedure DragTo(const P : TPoint);
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
Procedure DragTo(P : TPoint);
|
Procedure DragTo(const P: TPoint);
|
||||||
Begin
|
Begin
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
|
writeln('DragTo P=',P.X,',',P.Y);
|
||||||
|
{$ENDIF}
|
||||||
if (ActiveDrag = dopNone)
|
if (ActiveDrag = dopNone)
|
||||||
and (Abs(DragStartPos.X - P.X) < DragThreshold)
|
and (Abs(DragStartPos.X - P.X) < DragThreshold)
|
||||||
and (Abs(DragStartPos.Y - P.Y) > DragThreshold) then
|
and (Abs(DragStartPos.Y - P.Y) < DragThreshold) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|
||||||
@ -1849,9 +1890,6 @@ Function DragMessage(Handle: HWND; Msg: TDragMessage; Source: TDragObject;
|
|||||||
var
|
var
|
||||||
DragRec : TDragRec;
|
DragRec : TDragRec;
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:******');
|
|
||||||
Assert(False, 'Trace:DragMessage');
|
|
||||||
|
|
||||||
Result := 0;
|
Result := 0;
|
||||||
if Handle <> 0 then Begin
|
if Handle <> 0 then Begin
|
||||||
DragRec.Pos := Pos;
|
DragRec.Pos := Pos;
|
||||||
@ -1862,19 +1900,33 @@ Begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------------------------------
|
||||||
|
Procedure DragDone(Drop : Boolean);
|
||||||
|
|
||||||
|
Ends the current dragging operation.
|
||||||
|
Invokes DragMessage,
|
||||||
|
Frees the DragObject if autocreated by the LCL,
|
||||||
|
Finish: DragSave.Finished
|
||||||
|
-------------------------------------------------------------------------------}
|
||||||
Procedure DragDone(Drop : Boolean);
|
Procedure DragDone(Drop : Boolean);
|
||||||
var
|
var
|
||||||
Accepted : Boolean;
|
Accepted : Boolean;
|
||||||
DragSave : TDragObject;
|
DragSave : TDragObject;
|
||||||
DragMsg : TDragMEssage;
|
DragMsg : TDragMEssage;
|
||||||
TargetPos : TPoint;
|
TargetPos : TPoint;
|
||||||
|
DragSaveAutoFree: Boolean;
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:*************************');
|
{$IFDEF VerboseDrag}
|
||||||
Assert(False, 'Trace:*********DRAGDONE********');
|
writeln('DragDone Drop=',Drop);
|
||||||
|
{$ENDIF}
|
||||||
Accepted:=false;
|
Accepted:=false;
|
||||||
if (DragObject = nil) or (DragObject.Cancelling) then Exit;
|
if (DragObject = nil) or DragObject.Cancelling then Exit;
|
||||||
|
|
||||||
|
// take over the DragObject
|
||||||
|
// (to prevent auto destruction during the next operations)
|
||||||
DragSave := DragObject;
|
DragSave := DragObject;
|
||||||
|
DragSaveAutoFree:=DragObjectAutoFree;
|
||||||
|
DragObjectAutoFree:=false;
|
||||||
try
|
try
|
||||||
DragObject.Cancelling := True;
|
DragObject.Cancelling := True;
|
||||||
DragObject.ReleaseCapture(DragCapture);
|
DragObject.ReleaseCapture(DragCapture);
|
||||||
@ -1882,26 +1934,27 @@ Begin
|
|||||||
if DragObject.DragTarget <> nil then
|
if DragObject.DragTarget <> nil then
|
||||||
Begin
|
Begin
|
||||||
dragMsg := dmDragDrop;
|
dragMsg := dmDragDrop;
|
||||||
if not Accepted then
|
if not Accepted then begin
|
||||||
begin
|
|
||||||
DragMsg := dmDragCancel;
|
DragMsg := dmDragCancel;
|
||||||
DragSave.FDragPos.X := 0;
|
DragSave.FDragPos.X := 0;
|
||||||
DragSave.FDragPos.Y := 0;
|
DragSave.FDragPos.Y := 0;
|
||||||
TargetPos.X := 0;
|
TargetPos.X := 0;
|
||||||
TargetPos.Y := 0;
|
TargetPos.Y := 0;
|
||||||
end;
|
end;
|
||||||
|
// this can change DragObject
|
||||||
DragMessage(DragSave.DragHandle,DragMsg,DragSave,
|
DragMessage(DragSave.DragHandle,DragMsg,DragSave,
|
||||||
DragSave.DragTarget,DragSave.DragPos);
|
DragSave.DragTarget,DragSave.DragPos);
|
||||||
end;
|
end;
|
||||||
DragSave.Cancelling := False;
|
DragSave.Cancelling := False;
|
||||||
DragSave.Finished(TObject(DragSave.DragTarget),TargetPos.X,TargetPos.Y,Accepted);
|
DragSave.Finished(TObject(DragSave.DragTarget),TargetPos.X,TargetPos.Y,Accepted);
|
||||||
DragSave := nil;
|
|
||||||
finally
|
finally
|
||||||
DragControl := nil;
|
DragControl := nil;
|
||||||
end;
|
if DragSaveAutoFree then begin
|
||||||
|
if DragSave=DragObject then
|
||||||
DragObject:=nil;
|
DragObject:=nil;
|
||||||
if DragObjectAutoFree then DragSave.Free;
|
DragSave.Free;
|
||||||
DragObjectAutoFree := False;
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -1915,15 +1968,7 @@ var
|
|||||||
Handle : HWND;
|
Handle : HWND;
|
||||||
begin
|
begin
|
||||||
Handle := WindowFromPoint(ScreenPos);
|
Handle := WindowFromPoint(ScreenPos);
|
||||||
Result := nil;
|
Result := FindOwnerControl(Handle);
|
||||||
while Handle <> 0 do
|
|
||||||
begin
|
|
||||||
Result := FindControl(Handle);
|
|
||||||
if Result <> nil then begin
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
Handle := GetParent(Handle);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -1961,7 +2006,7 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function GetCaptureControl: TControl;
|
function GetCaptureControl: TControl;
|
||||||
begin
|
begin
|
||||||
Result := FindControl(GetCapture);
|
Result := FindOwnerControl(GetCapture);
|
||||||
if (Result <> nil)
|
if (Result <> nil)
|
||||||
and (CaptureControl <> nil)
|
and (CaptureControl <> nil)
|
||||||
and (CaptureControl.Parent = Result)
|
and (CaptureControl.Parent = Result)
|
||||||
@ -2312,6 +2357,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.176 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.175 2004/02/13 15:49:54 mattias
|
Revision 1.175 2004/02/13 15:49:54 mattias
|
||||||
started advanced LCL auto sizing
|
started advanced LCL auto sizing
|
||||||
|
|
||||||
|
|||||||
@ -858,6 +858,7 @@ var
|
|||||||
IntfImg: TLazIntfImage;
|
IntfImg: TLazIntfImage;
|
||||||
ImgWriter: TFPCustomImageWriter;
|
ImgWriter: TFPCustomImageWriter;
|
||||||
begin
|
begin
|
||||||
|
writeln('WriteStreamWithFPImage Self=',HexStr(Cardinal(Self),8),' ',Width,',',Height,' Using SaveStream=',(FImage.SaveStream<>nil) and (FImage.SaveStream.Size>0));
|
||||||
if (FImage.SaveStream<>nil) and (FImage.SaveStream.Size>0) then begin
|
if (FImage.SaveStream<>nil) and (FImage.SaveStream.Size>0) then begin
|
||||||
DoWriteOriginal;
|
DoWriteOriginal;
|
||||||
exit;
|
exit;
|
||||||
@ -1058,6 +1059,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.65 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.64 2004/02/11 11:40:18 mattias
|
Revision 1.64 2004/02/11 11:40:18 mattias
|
||||||
fixes for compilation under fpc 1.0.10
|
fixes for compilation under fpc 1.0.10
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,8 @@ end;
|
|||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TControl.BeginDrag
|
Method: TControl.BeginDrag
|
||||||
Params: Immediate: Drag behaviour
|
Params: Immediate: Drag behaviour
|
||||||
Threshold: default -1, distance to move before dragging starts
|
Threshold: distance to move before dragging starts
|
||||||
|
-1 uses the default value of Mouse.DragThreshold
|
||||||
Returns: Nothing
|
Returns: Nothing
|
||||||
|
|
||||||
Starts the dragging of a control. If the Immediate flag is set, dragging
|
Starts the dragging of a control. If the Immediate flag is set, dragging
|
||||||
@ -331,7 +332,19 @@ end;
|
|||||||
store bounds in private variables
|
store bounds in private variables
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
procedure TControl.DoSetBounds(ALeft, ATop, AWidth, AHeight : integer);
|
procedure TControl.DoSetBounds(ALeft, ATop, AWidth, AHeight : integer);
|
||||||
|
|
||||||
|
procedure BoundsOutOfBounds;
|
||||||
begin
|
begin
|
||||||
|
writeln('TControl.DoSetBounds ',Name,':',ClassName,
|
||||||
|
' Old=',Left,',',Top,',',Width,',',Height,
|
||||||
|
' New=',aLeft,',',aTop,',',aWidth,',',aHeight,
|
||||||
|
'');
|
||||||
|
RaiseGDBException('TControl.DoSetBounds '+Name+':'+ClassName+' Invalid bounds');
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if (AWidth>100000) or (AHeight>100000) then
|
||||||
|
BoundsOutOfBounds;
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
if csDesigning in ComponentState then
|
if csDesigning in ComponentState then
|
||||||
writeln('TControl.DoSetBounds ',Name,':',ClassName,
|
writeln('TControl.DoSetBounds ',Name,':',ClassName,
|
||||||
@ -969,6 +982,9 @@ var
|
|||||||
S: TObject;
|
S: TObject;
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
Begin
|
Begin
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
|
writeln('TControl.DoDragMsg DragMsg.DragMessage=',ord(DragMsg.DragMessage));
|
||||||
|
{$ENDIF}
|
||||||
S := DragMsg.Dragrec^.Source;
|
S := DragMsg.Dragrec^.Source;
|
||||||
Accepts := True;
|
Accepts := True;
|
||||||
P:=ScreenToClient(DragMsg.Dragrec^.pos);
|
P:=ScreenToClient(DragMsg.Dragrec^.pos);
|
||||||
@ -980,7 +996,10 @@ Begin
|
|||||||
dmDragLeave: DragOver(S,P.X,P.Y,dsDragLeave,Accepts);
|
dmDragLeave: DragOver(S,P.X,P.Y,dsDragLeave,Accepts);
|
||||||
dmDragMove : DragOver(S,P.X,P.Y,dsDragMove,Accepts);
|
dmDragMove : DragOver(S,P.X,P.Y,dsDragMove,Accepts);
|
||||||
end;
|
end;
|
||||||
DragMsg.Result := ord(Accepts);
|
if Accepts then
|
||||||
|
DragMsg.Result := 1
|
||||||
|
else
|
||||||
|
DragMsg.Result := 0;
|
||||||
end;
|
end;
|
||||||
end; //case
|
end; //case
|
||||||
end;
|
end;
|
||||||
@ -989,15 +1008,14 @@ end;
|
|||||||
{ TControl.DragOver
|
{ TControl.DragOver
|
||||||
}
|
}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
Procedure TControl.DragOver(Source: TObject; X,Y : Integer; State : TDragState; var Accept:Boolean);
|
Procedure TControl.DragOver(Source: TObject; X,Y : Integer; State: TDragState;
|
||||||
|
var Accept:Boolean);
|
||||||
begin
|
begin
|
||||||
Accept := False;
|
Accept := False;
|
||||||
if Assigned(FOnDragOver)
|
if Assigned(FOnDragOver) then begin
|
||||||
then begin
|
|
||||||
Accept := True;
|
Accept := True;
|
||||||
//Do something else yet....
|
FOnDragOver(Self,Source,X,Y,State,Accept);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -2753,6 +2771,9 @@ end;
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.169 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.168 2004/02/13 15:49:54 mattias
|
Revision 1.168 2004/02/13 15:49:54 mattias
|
||||||
started advanced LCL auto sizing
|
started advanced LCL auto sizing
|
||||||
|
|
||||||
|
|||||||
@ -51,15 +51,32 @@ var
|
|||||||
ModifyHeight : Boolean;
|
ModifyHeight : Boolean;
|
||||||
NewWidth: Integer;
|
NewWidth: Integer;
|
||||||
NewHeight: Integer;
|
NewHeight: Integer;
|
||||||
|
|
||||||
|
procedure OutOfBounds;
|
||||||
|
begin
|
||||||
|
writeln('TCustomImage.DoAutoSize NewWidth=',NewWidth,
|
||||||
|
' NewHeight=',NewHeight,
|
||||||
|
' ModifyWidth=',ModifyWidth,
|
||||||
|
' Picture.Width=',Picture.Width,
|
||||||
|
' ModifyHeight=',ModifyHeight,
|
||||||
|
' Picture.Height=',Picture.Height,
|
||||||
|
'');
|
||||||
|
RaiseGDBException('');
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If AutoSize and not AutoSizing then begin
|
If AutoSize and not AutoSizing then begin
|
||||||
AutoSizing := True;
|
AutoSizing := True;
|
||||||
ModifyWidth := Align in [alLeft,alRight,alNone];
|
ModifyWidth := Align in [alLeft,alRight,alNone];
|
||||||
ModifyHeight := Align in [alTop,alBottom,alNone];
|
ModifyHeight := Align in [alTop,alBottom,alNone];
|
||||||
|
NewWidth:=Width;
|
||||||
|
NewHeight:=Height;
|
||||||
If ModifyWidth and (Picture.Width > 0) then
|
If ModifyWidth and (Picture.Width > 0) then
|
||||||
NewWidth := Max(Picture.Width, Constraints.MinWidth);
|
NewWidth := Max(Picture.Width, Constraints.MinWidth);
|
||||||
If ModifyHeight and (Picture.Height > 0) then
|
If ModifyHeight and (Picture.Height > 0) then
|
||||||
NewHeight := Max(Picture.Height, Constraints.MinHeight);
|
NewHeight := Max(Picture.Height, Constraints.MinHeight);
|
||||||
|
if (NewWidth>100000) or (NewHeight>100000) then
|
||||||
|
OutOfBounds;
|
||||||
if (NewWidth<>Width) or (NewHeight<>Height) then begin
|
if (NewWidth<>Width) or (NewHeight<>Height) then begin
|
||||||
SetBounds(Left,Top,NewWidth,NewHeight);
|
SetBounds(Left,Top,NewWidth,NewHeight);
|
||||||
PictureChanged(Self);
|
PictureChanged(Self);
|
||||||
|
|||||||
@ -229,6 +229,11 @@ begin
|
|||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TInterfaceBase.GetControlConstraints(Constraints: TObject): boolean;
|
||||||
|
begin
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
function TInterfaceBase.GetDeviceRawImageDescription(DC: HDC;
|
function TInterfaceBase.GetDeviceRawImageDescription(DC: HDC;
|
||||||
Desc: PRawImageDescription): boolean;
|
Desc: PRawImageDescription): boolean;
|
||||||
begin
|
begin
|
||||||
@ -242,11 +247,6 @@ begin
|
|||||||
Result := false;
|
Result := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TInterfaceBase.GetControlConstraints(Constraints: TObject): boolean;
|
|
||||||
begin
|
|
||||||
Result:=true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TInterfaceBase.GetDCOriginRelativeToWindow(PaintDC: HDC;
|
function TInterfaceBase.GetDCOriginRelativeToWindow(PaintDC: HDC;
|
||||||
WindowHandle: HWND; var OriginDiff: TPoint): boolean;
|
WindowHandle: HWND; var OriginDiff: TPoint): boolean;
|
||||||
begin
|
begin
|
||||||
@ -260,6 +260,13 @@ begin
|
|||||||
Result:=GetDC(WindowHandle);
|
Result:=GetDC(WindowHandle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TInterfaceBase.GetLCLOwnerObject(Handle: HWnd): TObject;
|
||||||
|
begin
|
||||||
|
if Handle <> 0
|
||||||
|
then Result := TObject(GetProp(Handle,'WinControl'))
|
||||||
|
else Result := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TInterfaceBase.GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer;
|
function TInterfaceBase.GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer;
|
||||||
begin
|
begin
|
||||||
Result := -1;
|
Result := -1;
|
||||||
@ -606,6 +613,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.17 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.16 2004/02/03 08:54:09 mattias
|
Revision 1.16 2004/02/03 08:54:09 mattias
|
||||||
Frame3D rect now var again
|
Frame3D rect now var again
|
||||||
|
|
||||||
|
|||||||
@ -1089,7 +1089,7 @@ var
|
|||||||
CombineResult: Integer;
|
CombineResult: Integer;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (ARect.Left>=ARect.Right) or (ARect.Top>ARect.Bottom)
|
if (ARect.Left>=ARect.Right) or (ARect.Top>=ARect.Bottom)
|
||||||
or not DCClipRegionValid(DC)
|
or not DCClipRegionValid(DC)
|
||||||
then exit;
|
then exit;
|
||||||
ClipRGN:=CreateEmptyRegion;
|
ClipRGN:=CreateEmptyRegion;
|
||||||
@ -1398,6 +1398,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.6 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.5 2004/02/10 00:05:03 mattias
|
Revision 1.5 2004/02/10 00:05:03 mattias
|
||||||
TSpeedButton now uses MaskBlt
|
TSpeedButton now uses MaskBlt
|
||||||
|
|
||||||
|
|||||||
@ -194,6 +194,11 @@ begin
|
|||||||
Result := InterfaceObject.GetDeviceSize(DC,p);
|
Result := InterfaceObject.GetDeviceSize(DC,p);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetLCLOwnerObject(Handle: HWnd): TObject;
|
||||||
|
begin
|
||||||
|
Result := InterfaceObject.GetLCLOwnerObject(Handle);
|
||||||
|
end;
|
||||||
|
|
||||||
function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer;
|
function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer;
|
||||||
begin
|
begin
|
||||||
Result := InterfaceObject.GetListBoxIndexAtY(ListBox, y);
|
Result := InterfaceObject.GetListBoxIndexAtY(ListBox, y);
|
||||||
@ -506,6 +511,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.15 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.14 2004/02/03 08:54:09 mattias
|
Revision 1.14 2004/02/03 08:54:09 mattias
|
||||||
Frame3D rect now var again
|
Frame3D rect now var again
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,7 @@ function CreateRegionCopy(SrcRGN: hRGN): hRGN; {$IFDEF IF_BASE_MEMBER}virtual;{$
|
|||||||
|
|
||||||
function DCClipRegionValid(DC: HDC): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function DCClipRegionValid(DC: HDC): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
|
||||||
|
function GetAcceleratorString(const AVKey: Byte; const AShiftState: TShiftState): String; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetBitmapRawImageDescription(Bitmap: HBITMAP; Desc: PRawImageDescription): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetBitmapRawImageDescription(Bitmap: HBITMAP; Desc: PRawImageDescription): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetCaretRespondToFocus(handle: HWND; var ShowHideOnFocus: boolean): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetCaretRespondToFocus(handle: HWND; var ShowHideOnFocus: boolean): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetClientBounds(handle : HWND; var ARect: TRect) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetClientBounds(handle : HWND; var ARect: TRect) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
@ -65,6 +66,7 @@ function GetDCOriginRelativeToWindow(PaintDC: HDC; WindowHandle: HWND; var Origi
|
|||||||
function GetDesignerDC(WindowHandle: HWND): HDC; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetDesignerDC(WindowHandle: HWND): HDC; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetDeviceRawImageDescription(DC: HDC; Desc: PRawImageDescription): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetDeviceRawImageDescription(DC: HDC; Desc: PRawImageDescription): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetDeviceSize(DC: HDC; var p: TPoint): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetDeviceSize(DC: HDC; var p: TPoint): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
function GetLCLOwnerObject(Handle: HWnd): TObject; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetListBoxItemRect(ListBox: TComponent; Index: integer; var ARect: TRect): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetListBoxItemRect(ListBox: TComponent; Index: integer; var ARect: TRect): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetNotebookTabIndexAtPos(Handle: HWND; const ClientPos: TPoint): integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetNotebookTabIndexAtPos(Handle: HWND; const ClientPos: TPoint): integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
@ -77,8 +79,6 @@ function GetWindowRelativePosition(Handle : hwnd; var Left, Top: integer): boole
|
|||||||
function Frame(DC: HDC; const ARect: TRect): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function Frame(DC: HDC; const ARect: TRect): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TGraphicsBevelCut): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TGraphicsBevelCut): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
|
||||||
function GetAcceleratorString(const AVKey: Byte; const AShiftState: TShiftState): String; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
|
||||||
|
|
||||||
function InvalidateFrame(aHandle : HWND; ARect : pRect; bErase : Boolean; BorderWidth: integer) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function InvalidateFrame(aHandle : HWND; ARect : pRect; bErase : Boolean; BorderWidth: integer) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
|
||||||
function LoadStockPixmap(StockID: longint) : HBitmap; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function LoadStockPixmap(StockID: longint) : HBitmap; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
@ -148,6 +148,9 @@ procedure RaiseLastOSError;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.15 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.14 2004/02/03 08:54:09 mattias
|
Revision 1.14 2004/02/03 08:54:09 mattias
|
||||||
Frame3D rect now var again
|
Frame3D rect now var again
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ begin
|
|||||||
// focus the next button to the left or right
|
// focus the next button to the left or right
|
||||||
|
|
||||||
// search old focused button
|
// search old focused button
|
||||||
OldFocusControl:=FindControl(LCLIntf.GetFocus);
|
OldFocusControl:=FindOwnerControl(LCLIntf.GetFocus);
|
||||||
if (OldFocusControl=nil) or (GetParentForm(OldFocusControl)<>Self)
|
if (OldFocusControl=nil) or (GetParentForm(OldFocusControl)<>Self)
|
||||||
or (not (OldFocusControl is TButton)) then
|
or (not (OldFocusControl is TButton)) then
|
||||||
begin
|
begin
|
||||||
@ -377,6 +377,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.11 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.10 2003/10/16 16:43:57 ajgenius
|
Revision 1.10 2003/10/16 16:43:57 ajgenius
|
||||||
fix opaque brush
|
fix opaque brush
|
||||||
|
|
||||||
|
|||||||
@ -4024,33 +4024,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomTreeView.DoStartDrag(var DragObject: TDragObject);
|
procedure TCustomTreeView.DoStartDrag(var DragObject: TDragObject);
|
||||||
{var
|
var
|
||||||
ImageHandle: HImageList;
|
P: TPoint;
|
||||||
DragNode: TTreeNode;
|
|
||||||
P: TPoint;}
|
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
|
writeln('TCustomTreeView.DoStartDrag A ');
|
||||||
|
{$ENDIF}
|
||||||
inherited DoStartDrag(DragObject);
|
inherited DoStartDrag(DragObject);
|
||||||
{DragNode := FDragNode;
|
|
||||||
FLastDropTarget := nil;
|
FLastDropTarget := nil;
|
||||||
FDragNode := nil;
|
if FDragNode = nil then begin
|
||||||
if DragNode = nil then begin
|
|
||||||
GetCursorPos(P);
|
GetCursorPos(P);
|
||||||
with ScreenToClient(P) do DragNode := GetNodeAt(X, Y);
|
with ScreenToClient(P) do FDragNode := GetNodeAt(X, Y);
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
|
if FDragNode<>nil then
|
||||||
|
writeln('TCustomTreeView.DoStartDrag DragNode=',FDragNode.Text)
|
||||||
|
else
|
||||||
|
writeln('TCustomTreeView.DoStartDrag DragNode=nil');
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
if DragNode <> nil then begin
|
|
||||||
// ToDo: implement Drag&Drop
|
|
||||||
ImageHandle := 0; TreeView_CreateDragImage(Handle, DragNode.ItemId);
|
|
||||||
if ImageHandle <> 0 then
|
|
||||||
with FDragImage do
|
|
||||||
begin
|
|
||||||
Handle := ImageHandle;
|
|
||||||
SetDragImage(0, 2, 2);
|
|
||||||
end;
|
|
||||||
end;}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomTreeView.DoEndDrag(Target: TObject; X, Y: Integer);
|
procedure TCustomTreeView.DoEndDrag(Target: TObject; X, Y: Integer);
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
|
writeln('TCustomTreeView.DoEndDrag A ');
|
||||||
|
{$ENDIF}
|
||||||
inherited DoEndDrag(Target, X, Y);
|
inherited DoEndDrag(Target, X, Y);
|
||||||
FLastDropTarget := nil;
|
FLastDropTarget := nil;
|
||||||
end;
|
end;
|
||||||
@ -4060,7 +4058,9 @@ var
|
|||||||
P: TPoint;
|
P: TPoint;
|
||||||
begin
|
begin
|
||||||
inherited CMDrag(AMessage);
|
inherited CMDrag(AMessage);
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
writeln('TCustomTreeView.CMDrag ',ord(AMessage.DragMessage));
|
writeln('TCustomTreeView.CMDrag ',ord(AMessage.DragMessage));
|
||||||
|
{$ENDIF}
|
||||||
with AMessage, DragRec^ do
|
with AMessage, DragRec^ do
|
||||||
case DragMessage of
|
case DragMessage of
|
||||||
dmDragMove:
|
dmDragMove:
|
||||||
@ -4085,7 +4085,9 @@ var
|
|||||||
Node: TTreeNode;
|
Node: TTreeNode;
|
||||||
begin
|
begin
|
||||||
Node := GetNodeAt(X, Y);
|
Node := GetNodeAt(X, Y);
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
writeln('TCustomTreeView.DoDragOver ',Node<>nil,' ',Node <> DropTarget,' ',Node = FLastDropTarget);
|
writeln('TCustomTreeView.DoDragOver ',Node<>nil,' ',Node <> DropTarget,' ',Node = FLastDropTarget);
|
||||||
|
{$ENDIF}
|
||||||
if (Node <> nil)
|
if (Node <> nil)
|
||||||
and ((Node <> DropTarget) or (Node = FLastDropTarget)) then
|
and ((Node <> DropTarget) or (Node = FLastDropTarget)) then
|
||||||
begin
|
begin
|
||||||
@ -4609,6 +4611,10 @@ begin
|
|||||||
CursorNode.Expanded:=not CursorNode.Expanded;
|
CursorNode.Expanded:=not CursorNode.Expanded;
|
||||||
end else if x>=CursorNode.DisplayTextLeft then begin
|
end else if x>=CursorNode.DisplayTextLeft then begin
|
||||||
// mousedown occured in text -> select node and begin drag operation
|
// mousedown occured in text -> select node and begin drag operation
|
||||||
|
{$IFDEF VerboseDrag}
|
||||||
|
writeln('TCustomTreeView.MouseDown In Text ',Name,':',ClassName,' MouseCapture=',MouseCapture);
|
||||||
|
{$ENDIF}
|
||||||
|
if MouseCapture then
|
||||||
Include(FStates,tvsMouseCapture);
|
Include(FStates,tvsMouseCapture);
|
||||||
if not (tvoAllowMultiselect in Options) then begin
|
if not (tvoAllowMultiselect in Options) then begin
|
||||||
Selected:=CursorNode;
|
Selected:=CursorNode;
|
||||||
@ -4626,7 +4632,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
bStartDrag := true;
|
bStartDrag := tvsMouseCapture in FStates;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if (bStartDrag) then begin
|
if (bStartDrag) then begin
|
||||||
@ -4636,18 +4642,13 @@ begin
|
|||||||
FDragNode:=CursorNode;
|
FDragNode:=CursorNode;
|
||||||
Include(fStates,tvsWaitForDragging);
|
Include(fStates,tvsWaitForDragging);
|
||||||
end;
|
end;
|
||||||
if Button=mbMiddle then begin
|
|
||||||
// insert primary selection text
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
//LCLLinux.SetFocus(Handle);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomTreeView.MouseMove(Shift: TShiftState; X, Y: Integer);
|
procedure TCustomTreeView.MouseMove(Shift: TShiftState; X, Y: Integer);
|
||||||
begin
|
begin
|
||||||
inherited MouseMove(Shift, x, y);
|
inherited MouseMove(Shift, x, y);
|
||||||
if {MouseCapture and} (tvsWaitForDragging in fStates) then begin
|
if (tvsWaitForDragging in fStates) then begin
|
||||||
if (Abs(fMouseDownX - X) >= GetSystemMetrics(SM_CXDRAG))
|
if (Abs(fMouseDownX - X) >= GetSystemMetrics(SM_CXDRAG))
|
||||||
or (Abs(fMouseDownY - Y) >= GetSystemMetrics(SM_CYDRAG))
|
or (Abs(fMouseDownY - Y) >= GetSystemMetrics(SM_CYDRAG))
|
||||||
then begin
|
then begin
|
||||||
|
|||||||
@ -96,6 +96,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
function TGTKObject.GetLCLOwnerObject(Handle: HWnd): TObject;
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function TGTKObject.GetLCLOwnerObject(Handle: HWnd): TObject;
|
||||||
|
begin
|
||||||
|
if Handle<>0 then
|
||||||
|
Result:=GetNearestLCLObject(PGtkWidget(Handle))
|
||||||
|
else
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: GetListBoxIndexAtY
|
Function: GetListBoxIndexAtY
|
||||||
Params: ListBox:
|
Params: ListBox:
|
||||||
@ -395,6 +407,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.15 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.14 2004/02/02 15:46:19 mattias
|
Revision 1.14 2004/02/02 15:46:19 mattias
|
||||||
implemented basic TSplitter, still many ToDos
|
implemented basic TSplitter, still many ToDos
|
||||||
|
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
//##apiwiz##sps## // Do not remove
|
//##apiwiz##sps## // Do not remove
|
||||||
function GetAcceleratorString(const AVKey: Byte; const AShiftState: TShiftState): String; override;
|
function GetAcceleratorString(const AVKey: Byte; const AShiftState: TShiftState): String; override;
|
||||||
function GetControlConstraints(Constraints: TObject): boolean; override;
|
function GetControlConstraints(Constraints: TObject): boolean; override;
|
||||||
|
function GetLCLOwnerObject(Handle: HWnd): TObject; override;
|
||||||
function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer; override;
|
function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer; override;
|
||||||
function GetListBoxItemRect(ListBox: TComponent; Index: integer; var ARect: TRect): boolean; override;
|
function GetListBoxItemRect(ListBox: TComponent; Index: integer; var ARect: TRect): boolean; override;
|
||||||
|
|
||||||
@ -47,6 +48,9 @@ procedure StatusBarUpdate(StatusBar: TObject); override;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.12 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.11 2004/02/02 15:46:19 mattias
|
Revision 1.11 2004/02/02 15:46:19 mattias
|
||||||
implemented basic TSplitter, still many ToDos
|
implemented basic TSplitter, still many ToDos
|
||||||
|
|
||||||
|
|||||||
@ -8191,7 +8191,7 @@ function TgtkObject.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
|||||||
end;
|
end;
|
||||||
if (OldListItem=AfterListItem) or (OldListItem^.next=AfterListItem) then
|
if (OldListItem=AfterListItem) or (OldListItem^.next=AfterListItem) then
|
||||||
exit;
|
exit;
|
||||||
writeln('TgtkObject.SetWindowPos Moving GList entry');
|
//writeln('TgtkObject.SetWindowPos Moving GList entry');
|
||||||
|
|
||||||
// reorder
|
// reorder
|
||||||
// This trick does not work properly
|
// This trick does not work properly
|
||||||
@ -8206,7 +8206,7 @@ function TgtkObject.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
|||||||
|
|
||||||
procedure SetZOrderOnLayoutWidget(Widget, LayoutWidget: PGtkWidget);
|
procedure SetZOrderOnLayoutWidget(Widget, LayoutWidget: PGtkWidget);
|
||||||
begin
|
begin
|
||||||
writeln('ToDO: SetZOrderOnLayoutWidget');
|
//writeln('ToDO: SetZOrderOnLayoutWidget');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -8214,12 +8214,12 @@ var
|
|||||||
FixedWidget: PGtkWidget;
|
FixedWidget: PGtkWidget;
|
||||||
begin
|
begin
|
||||||
Widget:=PGtkWidget(hWnd);
|
Widget:=PGtkWidget(hWnd);
|
||||||
writeln('[TgtkObject.SetWindowPos] ',GetWidgetDebugReport(Widget),
|
{writeln('[TgtkObject.SetWindowPos] ',GetWidgetDebugReport(Widget),
|
||||||
' Top=',hWndInsertAfter=HWND_TOP,
|
' Top=',hWndInsertAfter=HWND_TOP,
|
||||||
' SWP_NOZORDER=',(SWP_NOZORDER and uFlags)<>0,
|
' SWP_NOZORDER=',(SWP_NOZORDER and uFlags)<>0,
|
||||||
' SWP_NOSIZE=',(SWP_NOSIZE and uFlags)<>0,
|
' SWP_NOSIZE=',(SWP_NOSIZE and uFlags)<>0,
|
||||||
' SWP_NOMOVE=',(SWP_NOMOVE and uFlags)<>0,
|
' SWP_NOMOVE=',(SWP_NOMOVE and uFlags)<>0,
|
||||||
'');
|
'');}
|
||||||
if GtkWidgetIsA(Widget,GTK_TYPE_WINDOW) then begin
|
if GtkWidgetIsA(Widget,GTK_TYPE_WINDOW) then begin
|
||||||
{ case hWndInsertAfter of
|
{ case hWndInsertAfter of
|
||||||
HWND_BOTTOM: ; //gdk_window_lower(Widget^.Window);
|
HWND_BOTTOM: ; //gdk_window_lower(Widget^.Window);
|
||||||
@ -8231,7 +8231,7 @@ begin
|
|||||||
FixedWidget:=Widget^.Parent;
|
FixedWidget:=Widget^.Parent;
|
||||||
if FixedWidget=nil then exit;
|
if FixedWidget=nil then exit;
|
||||||
|
|
||||||
writeln('TgtkObject.SetWindowPos ZOrdering .. on ',GetWidgetDebugReport(FixedWidget));
|
//writeln('TgtkObject.SetWindowPos ZOrdering .. on ',GetWidgetDebugReport(FixedWidget));
|
||||||
if GtkWidgetIsA(FixedWidget,GTK_Fixed_Get_Type) then begin
|
if GtkWidgetIsA(FixedWidget,GTK_Fixed_Get_Type) then begin
|
||||||
// parent's client area is a gtk_fixed widget
|
// parent's client area is a gtk_fixed widget
|
||||||
SetZOrderOnFixedWidget(Widget,FixedWidget);
|
SetZOrderOnFixedWidget(Widget,FixedWidget);
|
||||||
@ -8743,6 +8743,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.330 2004/02/17 00:32:25 mattias
|
||||||
|
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||||
|
|
||||||
Revision 1.329 2004/02/13 15:49:54 mattias
|
Revision 1.329 2004/02/13 15:49:54 mattias
|
||||||
started advanced LCL auto sizing
|
started advanced LCL auto sizing
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user