summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-08-08 23:56:32 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-08-08 23:56:32 +0000
commit7c683a4453a56e2b27a9d9a450e5078cb3d243c8 (patch)
tree545b9bbabe396367caedb03ed70f3140fe5bcf08 /src/corelib/x11
parentd1b3f4809d58376b3180afd8b25533e743ff9dcf (diff)
downloadfpGUI-7c683a4453a56e2b27a9d9a450e5078cb3d243c8.tar.xz
* Mouse Cursor support has been added (GDI is untested).
* TfpgEdit and TfpgMemo now change the mouse cursor correctly. * The prototypes/fpgui2/tests/edittest project show the mouse cursor in action. A GUI example project will be created soon to show all available cursors.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/gfx_x11.pas30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas
index 85d580cc..55362421 100644
--- a/src/corelib/x11/gfx_x11.pas
+++ b/src/corelib/x11/gfx_x11.pas
@@ -139,6 +139,7 @@ type
procedure DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); override;
function DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; override;
procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override;
+ procedure DoSetMouseCursor; override;
property WinHandle: TfpgWinHandle read FWinHandle;
public
constructor Create(AOwner: TComponent); override;
@@ -195,7 +196,8 @@ uses
gui_form, // remove this!!!!!
xatom,
gfx_utf8utils,
- _netlayer;
+ _netlayer,
+ cursorfont;
var
xapplication: TfpgApplication;
@@ -1102,6 +1104,32 @@ begin
XMoveResizeWindow(xapplication.display, FWinHandle, aleft, atop, w, h);
end;
+procedure TfpgWindowImpl.DoSetMouseCursor;
+var
+ xc: TCursor;
+ shape: integer;
+begin
+ if not HasHandle then
+ Exit; //==>
+
+ case FMouseCursor of
+ mcSizeEW: shape := XC_sb_h_double_arrow;
+ mcSizeNS: shape := XC_sb_v_double_arrow;
+ mcIBeam: shape := XC_xterm;
+ mcSizeNWSE: shape := XC_sizing;
+ mcSizeNESW: shape := XC_sizing; // ????
+ mcMove: shape := XC_center_ptr; // ????
+ mcCross: shape := XC_crosshair;
+ mcHourGlass: shape := XC_watch;
+ else
+ shape := XC_left_ptr; //XC_arrow;
+ end;
+
+ xc := XCreateFontCursor(xapplication.Display, shape);
+ XDefineCursor(xapplication.Display, FWinHandle, xc);
+ XFreeCursor(xapplication.Display, xc);
+end;
+
procedure TfpgWindowImpl.DoSetWindowTitle(const atitle: string);
var
//s: string;