mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-20 19:48:13 +02:00
+ Implemented GetCursorPos
git-svn-id: trunk@4432 -
This commit is contained in:
parent
726f0b2afa
commit
7664a81732
@ -406,7 +406,7 @@ end;
|
|||||||
|
|
||||||
Function GetCursorPos(var lpPoint:TPoint): Boolean;
|
Function GetCursorPos(var lpPoint:TPoint): Boolean;
|
||||||
Begin
|
Begin
|
||||||
Result := InterfaceObject.GetCaretPos(lpPoint);
|
Result := InterfaceObject.GetCursorPos(lpPoint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetCharABCWidths(DC: HDC; p2, p3: UINT; const ABCStructs): Boolean;
|
function GetCharABCWidths(DC: HDC; p2, p3: UINT; const ABCStructs): Boolean;
|
||||||
@ -1660,6 +1660,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.93 2003/07/29 00:28:42 marc
|
||||||
|
+ Implemented GetCursorPos
|
||||||
|
|
||||||
Revision 1.92 2003/07/07 13:19:08 mattias
|
Revision 1.92 2003/07/07 13:19:08 mattias
|
||||||
added raw image examples
|
added raw image examples
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ uses
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
glib, gdk, gtk, {$Ifndef NoGdkPixbufLib}gdkpixbuf,{$EndIf}
|
glib, gdk, gtk, {$Ifndef NoGdkPixbufLib}gdkpixbuf,{$EndIf}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
xlib,
|
||||||
SysUtils, LMessages, Classes, Controls, Forms, LCLStrConsts,
|
SysUtils, LMessages, Classes, Controls, Forms, LCLStrConsts,
|
||||||
VclGlobals, LCLProc, LCLLinux, LCLType, gtkDef, DynHashArray, LazQueue,
|
VclGlobals, LCLProc, LCLLinux, LCLType, gtkDef, DynHashArray, LazQueue,
|
||||||
GraphType, GraphMath;
|
GraphType, GraphMath;
|
||||||
@ -349,6 +350,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.136 2003/07/29 00:28:43 marc
|
||||||
|
+ Implemented GetCursorPos
|
||||||
|
|
||||||
Revision 1.135 2003/07/06 17:53:34 mattias
|
Revision 1.135 2003/07/06 17:53:34 mattias
|
||||||
updated polish localization
|
updated polish localization
|
||||||
|
|
||||||
|
@ -3308,12 +3308,15 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Function TGTKObject.GetActiveWindow : HWND;
|
Function TGTKObject.GetActiveWindow : HWND;
|
||||||
var
|
var
|
||||||
List: PGList;
|
TopList, List: PGList;
|
||||||
Widget: PGTKWidget;
|
Widget: PGTKWidget;
|
||||||
Window: PGTKWindow;
|
Window: PGTKWindow;
|
||||||
begin
|
begin
|
||||||
List := gdk_window_get_toplevels;
|
// Default to 0
|
||||||
|
Result := 0;
|
||||||
|
|
||||||
|
TopList := gdk_window_get_toplevels;
|
||||||
|
List := TopList;
|
||||||
while List <> nil do
|
while List <> nil do
|
||||||
begin
|
begin
|
||||||
if (List^.Data <> nil)
|
if (List^.Data <> nil)
|
||||||
@ -3326,15 +3329,14 @@ begin
|
|||||||
if (Widget <> nil) and gtk_widget_has_focus(Widget)
|
if (Widget <> nil) and gtk_widget_has_focus(Widget)
|
||||||
then begin
|
then begin
|
||||||
Result := HWND(GetMainWidget(PGtkWidget(Window)));
|
Result := HWND(GetMainWidget(PGtkWidget(Window)));
|
||||||
Exit;
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
list := g_list_next(list);
|
list := g_list_next(list);
|
||||||
end;
|
end;
|
||||||
|
if TopList <> nil
|
||||||
// If we are here we didn't find anything
|
then g_list_free(TopList);
|
||||||
Result := 0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -3365,9 +3367,8 @@ end;
|
|||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: GetCaretPos
|
Function: GetCaretPos
|
||||||
Params: none
|
Params: lpPoint: The caretposition
|
||||||
Returns: Nothing
|
Returns: True if succesful
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TgtkObject.GetCaretPos(var lpPoint: TPoint): Boolean;
|
function TgtkObject.GetCaretPos(var lpPoint: TPoint): Boolean;
|
||||||
@ -3739,6 +3740,44 @@ begin
|
|||||||
+b(rsgtkOptionClass);
|
+b(rsgtkOptionClass);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Function: GetCursorPos
|
||||||
|
Params: lpPoint: The cursorposition
|
||||||
|
Returns: True if succesful
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function TgtkObject.GetCursorPos(var lpPoint: TPoint ): Boolean;
|
||||||
|
var
|
||||||
|
root, child: pointer;
|
||||||
|
winx, winy: Integer;
|
||||||
|
xmask: Cardinal;
|
||||||
|
TopList, List: PGList;
|
||||||
|
begin
|
||||||
|
// TODO: GTK2 native implementation with gdk_display_get_pointer
|
||||||
|
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
TopList := gdk_window_get_toplevels;
|
||||||
|
List := TopList;
|
||||||
|
while List <> nil do
|
||||||
|
begin
|
||||||
|
if (List^.Data <> nil)
|
||||||
|
and gdk_window_is_visible(List^.Data)
|
||||||
|
then begin
|
||||||
|
XQueryPointer(gdk_window_xdisplay(List^.Data),
|
||||||
|
gdk_window_xwindow(List^.Data),
|
||||||
|
@root, @child, @lpPoint.X, @lpPoint.Y, @winx, @winy, @xmask);
|
||||||
|
|
||||||
|
Result := True;
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
List := g_list_next(List);
|
||||||
|
end;
|
||||||
|
|
||||||
|
if TopList <> nil
|
||||||
|
then g_list_free(TopList);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: GetDC
|
Function: GetDC
|
||||||
Params: none
|
Params: none
|
||||||
@ -3892,12 +3931,15 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TgtkObject.GetFocus: HWND;
|
function TgtkObject.GetFocus: HWND;
|
||||||
var
|
var
|
||||||
List: PGList;
|
TopList, List: PGList;
|
||||||
Widget: PGTKWidget;
|
Widget: PGTKWidget;
|
||||||
Window: PGTKWindow;
|
Window: PGTKWindow;
|
||||||
begin
|
begin
|
||||||
List := gdk_window_get_toplevels;
|
// Default to 0
|
||||||
|
Result := 0;
|
||||||
|
|
||||||
|
TopList := gdk_window_get_toplevels;
|
||||||
|
List := TopList;
|
||||||
while List <> nil do
|
while List <> nil do
|
||||||
begin
|
begin
|
||||||
if (List^.Data <> nil)
|
if (List^.Data <> nil)
|
||||||
@ -3910,15 +3952,15 @@ begin
|
|||||||
if (Widget <> nil) and gtk_widget_has_focus(Widget)
|
if (Widget <> nil) and gtk_widget_has_focus(Widget)
|
||||||
then begin
|
then begin
|
||||||
Result := HWND(GetMainWidget(Widget));
|
Result := HWND(GetMainWidget(Widget));
|
||||||
Exit;
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
list := g_list_next(list);
|
list := g_list_next(list);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// If we are here we didn't find anything
|
if TopList <> nil
|
||||||
Result := 0;
|
then g_list_free(TopList);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -8707,6 +8749,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.265 2003/07/29 00:28:43 marc
|
||||||
|
+ Implemented GetCursorPos
|
||||||
|
|
||||||
Revision 1.264 2003/07/21 23:43:32 marc
|
Revision 1.264 2003/07/21 23:43:32 marc
|
||||||
* Fixed radiogroup menuitems
|
* Fixed radiogroup menuitems
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ Function GetClientRect(handle : HWND; var ARect : TRect) : Boolean; override;
|
|||||||
Function GetClipBox(DC : hDC; lpRect : PRect) : Longint; override;
|
Function GetClipBox(DC : hDC; lpRect : PRect) : Longint; override;
|
||||||
Function GetClipRGN(DC : hDC; RGN : hRGN) : Longint; override;
|
Function GetClipRGN(DC : hDC; RGN : hRGN) : Longint; override;
|
||||||
Function GetCmdLineParamDescForInterface: string; override;
|
Function GetCmdLineParamDescForInterface: string; override;
|
||||||
|
function GetCursorPos(var lpPoint: TPoint): Boolean; override;
|
||||||
function GetDC(hWnd: HWND): HDC; override;
|
function GetDC(hWnd: HWND): HDC; override;
|
||||||
function GetDeviceCaps(DC: HDC; Index: Integer): Integer; Override;
|
function GetDeviceCaps(DC: HDC; Index: Integer): Integer; Override;
|
||||||
function GetDeviceRawImageDescription(DC: HDC; Desc: PRawImageDescription): boolean; override;
|
function GetDeviceRawImageDescription(DC: HDC; Desc: PRawImageDescription): boolean; override;
|
||||||
@ -211,6 +212,9 @@ Procedure DeleteCriticalSection(var CritSection: TCriticalSection); Override;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.74 2003/07/29 00:28:43 marc
|
||||||
|
+ Implemented GetCursorPos
|
||||||
|
|
||||||
Revision 1.73 2003/07/06 20:40:34 mattias
|
Revision 1.73 2003/07/06 20:40:34 mattias
|
||||||
TWinControl.WmSize/Move now updates interface messages smarter
|
TWinControl.WmSize/Move now updates interface messages smarter
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user