LCL: gtk2: dropfiles for sub forms

git-svn-id: trunk@45559 -
This commit is contained in:
mattias 2014-06-16 22:24:44 +00:00
parent 3b62c88f2c
commit debddcec44
3 changed files with 25 additions and 12 deletions

View File

@ -2193,6 +2193,7 @@ type
procedure EraseBackground(DC: HDC); virtual;
function IntfUTF8KeyPress(var UTF8Key: TUTF8Char;
RepeatCount: integer; SystemKey: boolean): boolean; virtual;
function IntfGetDropFilesTarget: TWinControl; virtual;
procedure PaintTo(DC: HDC; X, Y: Integer); virtual; overload;
procedure PaintTo(ACanvas: TCanvas; X, Y: Integer); overload;
procedure SetShape(AShape: TBitmap); overload;

View File

@ -4094,7 +4094,7 @@ end;
{------------------------------------------------------------------------------
TWinControl SetBorderWidth
------------------------------------------------------------------------------}
procedure TWinControl.SetBorderWidth(value : TBorderWidth);
procedure TWinControl.SetBorderWidth(Value: TBorderWidth);
begin
if FBorderWidth = Value then exit;
FBorderWidth := Value;
@ -4411,7 +4411,7 @@ end;
{------------------------------------------------------------------------------
TWinControl FindChildControl
------------------------------------------------------------------------------}
function TWinControl.FindChildControl(const ControlName: string): TControl;
function TWinControl.FindChildControl(const ControlName: String): TControl;
var
I: Integer;
begin
@ -4475,8 +4475,8 @@ end;
{------------------------------------------------------------------------------}
{ TWinControl FindNextControl }
{------------------------------------------------------------------------------}
function TWinControl.FindNextControl(CurrentControl: TWinControl;
GoForward, CheckTabStop, CheckParent: boolean): TWinControl;
function TWinControl.FindNextControl(CurrentControl: TWinControl; GoForward,
CheckTabStop, CheckParent: Boolean): TWinControl;
var
List: TFPList;
Next: TWinControl;
@ -4960,6 +4960,17 @@ begin
end;
end;
function TWinControl.IntfGetDropFilesTarget: TWinControl;
begin
Result:=Self;
repeat
Result:=GetFirstParentForm(Result);
if Result=nil then exit;
if TCustomForm(Result).AllowDropFiles then exit;
Result:=Result.Parent;
until Result=nil;
end;
procedure TWinControl.PaintTo(DC: HDC; X, Y: Integer);
begin
if HandleAllocated then
@ -5585,7 +5596,7 @@ end;
{------------------------------------------------------------------------------
TWinControl KeyDown
------------------------------------------------------------------------------}
procedure TWinControl.KeyDown(var Key: Word; shift : TShiftState);
procedure TWinControl.KeyDown(var Key: Word; Shift: TShiftState);
begin
if Assigned(FOnKeyDown) then FOnKeyDown(Self, Key, Shift);
end;
@ -6386,7 +6397,7 @@ end;
Params: NewHandle
Returns: Nothing
-------------------------------------------------------------------------------}
procedure TWincontrol.SetHandle(NewHandle: HWND);
procedure TWinControl.SetHandle(NewHandle: HWND);
begin
//if (NewHandle=0) and (AnsiCompareText(ClassName,'TPAGE')=0) then
// RaiseGDBException('TWincontrol.SetHandle');
@ -6420,7 +6431,7 @@ end;
{------------------------------------------------------------------------------
TWinControl CreateParented
------------------------------------------------------------------------------}
constructor TWinControl.CreateParented(AParentWindow: hwnd);
constructor TWinControl.CreateParented(AParentWindow: HWND);
begin
FParentWindow := AParentWindow;
Create(nil);
@ -6429,7 +6440,8 @@ end;
{------------------------------------------------------------------------------
TWinControl CreateParentedControl
------------------------------------------------------------------------------}
class function TWinControl.CreateParentedControl(AParentWindow: hwnd): TWinControl;
class function TWinControl.CreateParentedControl(AParentWindow: HWND
): TWinControl;
begin
Result := CreateParented(AParentWindow);
end;
@ -7134,7 +7146,7 @@ end;
event handler.
------------------------------------------------------------------------------}
procedure TWInControl.WMNotify(var Message: TLMNotify);
procedure TWinControl.WMNotify(var Message: TLMNotify);
begin
if not DoControlMsg(Message.NMHdr^.hwndfrom, Message) then
inherited;
@ -7877,7 +7889,7 @@ begin
end;
end;
function TWinControl.DoUnDockClientMsg(NewTarget, Client: TControl): boolean;
function TWinControl.DoUndockClientMsg(NewTarget, Client: TControl): boolean;
begin
Result := True;
{$IFDEF VerboseDocking}
@ -8127,7 +8139,7 @@ end;
Get the devicecontext for this WinControl.
------------------------------------------------------------------------------}
function TWinControl.GetDeviceContext(var WindowHandle: HWnd): HDC;
function TWinControl.GetDeviceContext(var WindowHandle: HWND): HDC;
begin
Result := GetDC(Handle);
//DebugLn('[TWinControl.GetDeviceContext] ',ClassName,' DC=',DbgS(Result,8),' Handle=',DbgS(FHandle));

View File

@ -3529,7 +3529,7 @@ begin
begin
Form := nil;
if (TObject(Data) is TWinControl) then
Form := (TObject(Data) as TWinControl).GetTopParent;
Form := (TObject(Data) as TWinControl).IntfGetDropFilesTarget;
if Form is TCustomForm then
(Form as TCustomForm).IntfDropFiles(Files)