]> git.saurik.com Git - wxWidgets.git/blob - src/motif/mdi/lib/XsMoveOutline.C
Catch attempts to create a window with itself as parent.
[wxWidgets.git] / src / motif / mdi / lib / XsMoveOutline.C
1 /*
2 Copyright (C) 1996 Scott W. Sadler
3 All rights reserved.
4 */
5
6 /*
7 XsMoveOutline.C
8
9 History
10 03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
11 Created
12 */
13
14 // Includes
15
16 #include <assert.h>
17 #include "XsMoveOutline.h"
18 #include <X11/cursorfont.h>
19
20 // Static definitions
21
22 Cursor XsMoveOutline::_fleur = None;
23
24 // Constructor
25
26 XsMoveOutline::XsMoveOutline (Widget w) : XsOutline (w)
27 {
28 unsigned int mask; // Not used
29 Window root;
30 int xy;
31
32 // Create the cursor (if necessary)
33
34 if (_fleur == None)
35 _fleur = XCreateFontCursor (XtDisplay (_w), XC_fleur);
36
37 // Get the current mouse root coordinates
38
39 XQueryPointer (XtDisplay (_w), XtWindow (_w), &root, &root, &_rootX,
40 &_rootY, &xy, &xy, &mask);
41 }
42
43 // Destructor
44
45 XsMoveOutline::~XsMoveOutline ( )
46 {
47 // Empty
48 }
49
50 // _motionHandler
51
52 void XsMoveOutline::_motionHandler (XEvent *event)
53 {
54 int curX, curY;
55
56 // Get current mouse position
57
58 curX = event->xbutton.x_root;
59 curY = event->xbutton.y_root;
60
61 // Compute the new window position
62
63 _x += (curX - _rootX);
64 _y += (curY - _rootY);
65
66 // Move the window
67
68 _drawOutline (False);
69
70 // Save the new root position
71
72 _rootX = curX;
73 _rootY = curY;
74 }
75
76 // _getCursor
77
78 Cursor XsMoveOutline::_getCursor ( ) const
79 {
80 return (_fleur);
81 }
82