Mercurial > projects > dwt-linux
annotate dwt/widgets/Control.d @ 351:f1bb3949939b
Update to SWT 3.4.1
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 03 Nov 2008 23:35:30 +0100 |
parents | c0d810de7093 |
children | 4bffbf81e2d6 |
rev | line source |
---|---|
72 | 1 /******************************************************************************* |
259 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
7 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
8 * Contributors: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 * IBM Corporation - initial API and implementation |
72 | 10 * Port to the D programming language: |
11 * Frank Benoit <benoit@tionex.de> | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
12 *******************************************************************************/ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
13 module dwt.widgets.Control; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
14 |
238 | 15 import dwt.dwthelper.utils; |
16 | |
30 | 17 |
71 | 18 import dwt.DWT; |
30 | 19 //import dwt.accessibility.Accessible; |
20 import dwt.events.ControlListener; | |
21 import dwt.events.FocusListener; | |
22 import dwt.events.HelpListener; | |
23 import dwt.events.KeyListener; | |
24 import dwt.events.MouseListener; | |
25 import dwt.events.MouseMoveListener; | |
26 import dwt.events.MouseTrackListener; | |
27 import dwt.events.PaintListener; | |
28 import dwt.events.TraverseListener; | |
29 import dwt.events.DragDetectListener; | |
30 import dwt.events.MenuDetectListener; | |
31 import dwt.events.MouseWheelListener; | |
32 import dwt.graphics.Color; | |
33 import dwt.graphics.Cursor; | |
34 import dwt.graphics.Device; | |
35 import dwt.graphics.Drawable; | |
36 import dwt.graphics.Font; | |
37 import dwt.graphics.GC; | |
38 import dwt.graphics.GCData; | |
39 import dwt.graphics.Image; | |
40 import dwt.graphics.Point; | |
41 import dwt.graphics.Rectangle; | |
240 | 42 import dwt.graphics.Region; |
30 | 43 import dwt.internal.Converter; |
71 | 44 import dwt.internal.DWTEventListener; |
30 | 45 import dwt.internal.accessibility.gtk.ATK; |
46 import dwt.internal.gtk.OS; | |
47 import dwt.widgets.Composite; | |
48 import dwt.widgets.Decorations; | |
49 import dwt.widgets.Display; | |
50 import dwt.widgets.Event; | |
51 import dwt.widgets.Listener; | |
52 import dwt.widgets.Menu; | |
53 import dwt.widgets.Monitor; | |
26 | 54 import dwt.widgets.Shell; |
30 | 55 import dwt.widgets.TypedListener; |
56 import dwt.widgets.Widget; | |
54 | 57 import dwt.accessibility.Accessible; |
30 | 58 |
59 import Math = tango.math.Math; | |
46 | 60 import tango.core.Thread; |
55
93981635e709
Checked and inserted missing default switch cases.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
61 import tango.io.Stdout; |
30 | 62 |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 * Control is the abstract superclass of all windowed user interface classes. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 * <dl> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 * <dt><b>Styles:</b> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 * <dd>BORDER</dd> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 * <dt><b>Events:</b> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 * <dd>DragDetect, FocusIn, FocusOut, Help, KeyDown, KeyUp, MenuDetect, MouseDoubleClick, MouseDown, MouseEnter, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 * MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Traverse</dd> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
74 * </dl> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
75 * </p><p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
76 * Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
77 * </p><p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 * IMPORTANT: This class is intended to be subclassed <em>only</em> |
71 | 79 * within the DWT implementation. |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
80 * </p> |
351 | 81 * |
259 | 82 * @see <a href="http://www.eclipse.org/swt/snippets/#control">Control snippets</a> |
83 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> | |
84 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
85 */ |
30 | 86 public abstract class Control : Widget, Drawable { |
150
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
113
diff
changeset
|
87 |
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
113
diff
changeset
|
88 alias Widget.mnemonicHit mnemonicHit; |
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
113
diff
changeset
|
89 alias Widget.mnemonicMatch mnemonicMatch; |
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
113
diff
changeset
|
90 alias Widget.setForegroundColor setForegroundColor; |
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
113
diff
changeset
|
91 alias Widget.translateTraversal translateTraversal; |
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
113
diff
changeset
|
92 alias Widget.windowProc windowProc; |
f2e04420fd6c
reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents:
113
diff
changeset
|
93 |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
94 GtkWidget* fixedHandle; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
95 GdkWindow* redrawWindow; |
30 | 96 GdkWindow* enableWindow; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
97 int drawCount; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
98 Composite parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
99 Cursor cursor; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
100 Menu menu; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
101 Image backgroundImage; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
102 Font font; |
240 | 103 Region region; |
238 | 104 String toolTipText; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
105 Object layoutData; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
106 Accessible accessible; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
107 |
30 | 108 this () { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
109 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
111 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
112 * Constructs a new instance of this class given its parent |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
113 * and a style value describing its behavior and appearance. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
114 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
115 * The style value is either one of the style constants defined in |
71 | 116 * class <code>DWT</code> which is applicable to instances of this |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
117 * class, or must be built by <em>bitwise OR</em>'ing together |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
118 * (that is, using the <code>int</code> "|" operator) two or more |
71 | 119 * of those <code>DWT</code> style constants. The class description |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
120 * lists the style constants that are applicable to the class. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
121 * Style bits are also inherited from superclasses. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
122 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
123 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
124 * @param parent a composite control which will be the parent of the new instance (cannot be null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
125 * @param style the style of control to construct |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
126 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
127 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
128 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
129 * </ul> |
71 | 130 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
131 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
132 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
133 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
134 * |
71 | 135 * @see DWT#BORDER |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
136 * @see Widget#checkSubclass |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
137 * @see Widget#getStyle |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
138 */ |
30 | 139 public this (Composite parent, int style) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
140 super (parent, style); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
141 this.parent = parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
142 createWidget (0); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
143 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
144 |
240 | 145 Font defaultFont () { |
146 return display.getSystemFont (); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
147 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
148 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
149 override void deregister () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
150 super.deregister (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
151 if (fixedHandle !is null) display.removeWidget (fixedHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
152 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
153 if (imHandle !is null) display.removeWidget (cast(GtkWidget*)imHandle); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
154 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
155 |
30 | 156 bool drawGripper (int x, int y, int width, int height, bool vertical) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
157 auto paintHandle = paintHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
158 auto window = OS.GTK_WIDGET_WINDOW (paintHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
159 if (window is null) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
160 int orientation = vertical ? OS.GTK_ORIENTATION_HORIZONTAL : OS.GTK_ORIENTATION_VERTICAL; |
240 | 161 if ((style & DWT.MIRRORED) !is 0) x = getClientWidth () - width - x; |
30 | 162 char dummy; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
163 OS.gtk_paint_handle (OS.gtk_widget_get_style (paintHandle), window, OS.GTK_STATE_NORMAL, OS.GTK_SHADOW_OUT, null, paintHandle, &dummy, x, y, width, height, orientation); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
164 return true; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
165 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
166 |
30 | 167 void enableWidget (bool enabled) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
168 OS.gtk_widget_set_sensitive (handle, enabled); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
169 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
170 |
30 | 171 GtkWidget* enterExitHandle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
172 return eventHandle (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
173 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
174 |
30 | 175 GtkWidget* eventHandle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
176 return handle; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
177 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
178 |
30 | 179 GdkWindow* eventWindow () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
180 auto eventHandle = eventHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
181 OS.gtk_widget_realize (eventHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
182 return OS.GTK_WIDGET_WINDOW (eventHandle); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
183 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
184 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
185 void fixFocus (Control focusControl) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
186 Shell shell = getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
187 Control control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
188 while (control !is shell && (control = control.parent) !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
189 if (control.setFocus ()) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
190 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
191 shell.setSavedFocus (focusControl); |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
192 auto focusHandle_ = shell.vboxHandle; |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
193 OS.GTK_WIDGET_SET_FLAGS (focusHandle_, OS.GTK_CAN_FOCUS); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
194 OS.gtk_widget_grab_focus (focusHandle_); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
195 OS.GTK_WIDGET_UNSET_FLAGS (focusHandle_, OS.GTK_CAN_FOCUS); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
196 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
197 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
198 public void fixStyle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
199 if (fixedHandle !is null) fixStyle (fixedHandle); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
200 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
201 |
30 | 202 void fixStyle (GtkWidget* handle) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
203 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
204 * Feature in GTK. Some GTK themes apply a different background to |
71 | 205 * the contents of a GtkNotebook. However, in an DWT TabFolder, the |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
206 * children are not parented below the GtkNotebook widget, and usually |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
207 * have their own GtkFixed. The fix is to look up the correct style |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
208 * for a child of a GtkNotebook and apply its background to any GtkFixed |
71 | 209 * widgets that are direct children of an DWT TabFolder. |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
210 * |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
211 * Note that this has to be when the theme settings changes and that it |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
212 * should not override the application background. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
213 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
214 if ((state & BACKGROUND) !is 0) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
215 auto childStyle = parent.childStyle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
216 if (childStyle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
217 GdkColor color; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
218 OS.gtk_style_get_bg (childStyle, 0, &color); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
219 OS.gtk_widget_modify_bg (handle, 0, &color); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
220 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
221 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
222 |
30 | 223 GtkWidget* focusHandle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
224 return handle; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
225 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
226 |
30 | 227 GtkWidget* fontHandle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
228 return handle; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
229 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
230 |
30 | 231 bool hasFocus () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
232 return this is display.getFocusControl(); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
233 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
234 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
235 override void hookEvents () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
236 /* Connect the keyboard signals */ |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
237 auto focusHandle_ = focusHandle (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
238 int focusMask = OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK | OS.GDK_FOCUS_CHANGE_MASK; |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
239 OS.gtk_widget_add_events (focusHandle_, focusMask); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
240 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [POPUP_MENU], 0, display.closures [POPUP_MENU], false); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
241 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [SHOW_HELP], 0, display.closures [SHOW_HELP], false); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
242 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [KEY_PRESS_EVENT], 0, display.closures [KEY_PRESS_EVENT], false); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
243 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [KEY_RELEASE_EVENT], 0, display.closures [KEY_RELEASE_EVENT], false); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
244 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [FOCUS], 0, display.closures [FOCUS], false); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
245 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [FOCUS_IN_EVENT], 0, display.closures [FOCUS_IN_EVENT], false); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
246 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [FOCUS_OUT_EVENT], 0, display.closures [FOCUS_OUT_EVENT], false); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
247 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
248 /* Connect the mouse signals */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
249 auto eventHandle = eventHandle (); |
240 | 250 int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
251 OS.gtk_widget_add_events (eventHandle, eventMask); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
252 OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
253 OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
254 OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
255 OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [SCROLL_EVENT], 0, display.closures [SCROLL_EVENT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
256 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
257 /* Connect enter/exit signals */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
258 auto enterExitHandle = enterExitHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
259 int enterExitMask = OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
260 OS.gtk_widget_add_events (enterExitHandle, enterExitMask); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
261 OS.g_signal_connect_closure_by_id (enterExitHandle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
262 OS.g_signal_connect_closure_by_id (enterExitHandle, display.signalIds [LEAVE_NOTIFY_EVENT], 0, display.closures [LEAVE_NOTIFY_EVENT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
263 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
264 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
265 * Feature in GTK. Events such as mouse move are propagate up |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
266 * the widget hierarchy and are seen by the parent. This is the |
71 | 267 * correct GTK behavior but not correct for DWT. The fix is to |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
268 * hook a signal after and stop the propagation using a negative |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
269 * event number to distinguish this case. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
270 * |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
271 * The signal is hooked to the fixedHandle to catch events sent to |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
272 * lightweight widgets. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
273 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
274 auto blockHandle = fixedHandle !is null ? fixedHandle : eventHandle; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
275 OS.g_signal_connect_closure_by_id (blockHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT_INVERSE], true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
276 OS.g_signal_connect_closure_by_id (blockHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT_INVERSE], true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
277 OS.g_signal_connect_closure_by_id (blockHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT_INVERSE], true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
278 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
279 /* Connect the event_after signal for both key and mouse */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
280 OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false); |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
281 if (focusHandle_ !is eventHandle) { |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
282 OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
283 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
284 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
285 /* Connect the paint signal */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
286 auto paintHandle = paintHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
287 int paintMask = OS.GDK_EXPOSURE_MASK | OS.GDK_VISIBILITY_NOTIFY_MASK; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
288 OS.gtk_widget_add_events (paintHandle, paintMask); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
289 OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [EXPOSE_EVENT], 0, display.closures [EXPOSE_EVENT_INVERSE], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
290 OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [VISIBILITY_NOTIFY_EVENT], 0, display.closures [VISIBILITY_NOTIFY_EVENT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
291 OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [EXPOSE_EVENT], 0, display.closures [EXPOSE_EVENT], true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
292 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
293 /* Connect the Input Method signals */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
294 OS.g_signal_connect_closure_by_id (handle, display.signalIds [REALIZE], 0, display.closures [REALIZE], true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
295 OS.g_signal_connect_closure_by_id (handle, display.signalIds [UNREALIZE], 0, display.closures [UNREALIZE], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
296 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
297 if (imHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
298 OS.g_signal_connect_closure (imHandle, OS.commit.ptr, display.closures [COMMIT], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
299 OS.g_signal_connect_closure (imHandle, OS.preedit_changed.ptr, display.closures [PREEDIT_CHANGED], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
300 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
301 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
302 OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [STYLE_SET], 0, display.closures [STYLE_SET], false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
303 |
240 | 304 auto topHandle_ = topHandle (); |
305 OS.g_signal_connect_closure_by_id (topHandle_, display.signalIds [MAP], 0, display.closures [MAP], true); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
306 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
307 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
308 override int /*long*/ hoverProc (GtkWidget* widget) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
309 int x, y; |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
30
diff
changeset
|
310 int mask; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
311 OS.gdk_window_get_pointer (null, &x, &y, &mask); |
71 | 312 sendMouseEvent (DWT.MouseHover, 0, /*time*/0, x , y , false, mask ); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
313 /* Always return zero in order to cancel the hover timer */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
314 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
315 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
316 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
317 override GtkWidget* topHandle() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
318 if (fixedHandle !is null) return fixedHandle; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
319 return super.topHandle (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
320 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
321 |
30 | 322 GtkWidget* paintHandle () { |
240 | 323 auto topHandle_ = topHandle (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
324 auto paintHandle = handle; |
240 | 325 while (paintHandle !is topHandle_) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
326 if ((OS.GTK_WIDGET_FLAGS (paintHandle) & OS.GTK_NO_WINDOW) is 0) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
327 paintHandle = OS.gtk_widget_get_parent (paintHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
328 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
329 return paintHandle; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
330 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
331 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
332 override GdkWindow* paintWindow () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
333 auto paintHandle = paintHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
334 OS.gtk_widget_realize (paintHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
335 return OS.GTK_WIDGET_WINDOW (paintHandle); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
336 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
337 |
259 | 338 /** |
339 * Prints the receiver and all children. | |
351 | 340 * |
259 | 341 * @param gc the gc where the drawing occurs |
342 * @return <code>true</code> if the operation was successful and <code>false</code> otherwise | |
343 * | |
344 * @exception IllegalArgumentException <ul> | |
345 * <li>ERROR_NULL_ARGUMENT - if the gc is null</li> | |
346 * <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li> | |
347 * </ul> | |
348 * @exception DWTException <ul> | |
349 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | |
350 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | |
351 * </ul> | |
351 | 352 * |
259 | 353 * @since 3.4 |
354 */ | |
240 | 355 public bool print (GC gc) { |
356 checkWidget (); | |
357 if (gc is null) error (DWT.ERROR_NULL_ARGUMENT); | |
358 if (gc.isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT); | |
359 auto topHandle_ = topHandle (); | |
360 OS.gtk_widget_realize (topHandle_); | |
361 auto window = OS.GTK_WIDGET_WINDOW (topHandle_); | |
362 GCData data = gc.getGCData (); | |
363 OS.gdk_window_process_updates (window, cast(int)true); | |
364 printWidget (gc, data.drawable, OS.gdk_drawable_get_depth (data.drawable), 0, 0); | |
365 return true; | |
366 } | |
367 | |
368 void printWidget (GC gc, GdkDrawable* drawable, int depth, int x, int y) { | |
369 bool obscured = (state & OBSCURED) !is 0; | |
370 state &= ~OBSCURED; | |
371 auto topHandle_ = topHandle (); | |
372 auto window = OS.GTK_WIDGET_WINDOW (topHandle_); | |
373 printWindow (true, this, gc.handle, drawable, depth, window, x, y); | |
374 if (obscured) state |= OBSCURED; | |
375 } | |
376 | |
377 void printWindow (bool first, Control control, GdkGC* gc, GdkDrawable* drawable, int depth, GdkDrawable* window, int x, int y) { | |
378 if (OS.gdk_drawable_get_depth (window) !is depth) return; | |
379 GdkRectangle rect; | |
380 int width, height; | |
381 OS.gdk_drawable_get_size (window, &width, &height); | |
382 rect.width = width; | |
383 rect.height = height; | |
384 OS.gdk_window_begin_paint_rect (window, &rect); | |
385 GdkDrawable* real_drawable; | |
386 int x_offset, y_offset; | |
387 OS.gdk_window_get_internal_paint_info (window, &real_drawable, &x_offset, &y_offset); | |
388 void* userData; | |
389 OS.gdk_window_get_user_data (window, &userData); | |
390 if (userData !is null) { | |
391 GdkEventExpose* event = cast(GdkEventExpose*) OS.gdk_event_new (OS.GDK_EXPOSE); | |
392 event.type = OS.GDK_EXPOSE; | |
393 event.window = cast(GdkDrawable*)OS.g_object_ref (window); | |
394 event.area.width = rect.width; | |
395 event.area.height = rect.height; | |
396 event.region = OS.gdk_region_rectangle (&rect); | |
397 OS.gtk_widget_send_expose (userData, cast(GdkEvent*)event); | |
398 OS.gdk_event_free (cast(GdkEvent*)event); | |
399 } | |
400 int srcX = x_offset, srcY = y_offset; | |
401 int destX = x, destY = y, destWidth = width, destHeight = height; | |
402 if (!first) { | |
403 int cX, cY; | |
404 OS.gdk_window_get_position (window, &cX, &cY); | |
405 auto parentWindow = OS.gdk_window_get_parent (window); | |
406 int pW, pH; | |
407 OS.gdk_drawable_get_size (parentWindow, &pW, &pH); | |
408 srcX = x_offset - cX; | |
409 srcY = y_offset - cY; | |
410 destX = x - cX; | |
411 destY = y - cY; | |
412 destWidth = Math.min (cX + width, pW); | |
413 destHeight = Math.min (cY + height, pH); | |
414 } | |
415 OS.gdk_draw_drawable (drawable, gc, real_drawable, srcX, srcY, destX, destY, destWidth, destHeight); | |
416 OS.gdk_window_end_paint (window); | |
417 auto children = OS.gdk_window_get_children (window); | |
418 if (children !is null) { | |
419 auto windows = children; | |
420 while (windows !is null) { | |
421 auto child = cast(GdkDrawable*) OS.g_list_data (windows); | |
422 if (OS.gdk_window_is_visible (child)) { | |
423 void* data; | |
424 OS.gdk_window_get_user_data (child, &data); | |
425 if (data !is null) { | |
426 Widget widget = display.findWidget ( cast(GtkWidget*) data); | |
427 if (widget is null || widget is control) { | |
428 int x_pos, y_pos; | |
429 OS.gdk_window_get_position (child, &x_pos, &y_pos); | |
430 printWindow (false, control, gc, drawable, depth, child, x + x_pos, y + y_pos); | |
431 } | |
432 } | |
433 } | |
434 windows = OS.g_list_next (windows); | |
435 } | |
436 OS.g_list_free (children); | |
437 } | |
438 } | |
439 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
440 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
441 * Returns the preferred size of the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
442 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
443 * The <em>preferred size</em> of a control is the size that it would |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
444 * best be displayed at. The width hint and height hint arguments |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
445 * allow the caller to ask a control questions such as "Given a particular |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
446 * width, how high does the control need to be to show all of the contents?" |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
447 * To indicate that the caller does not wish to constrain a particular |
71 | 448 * dimension, the constant <code>DWT.DEFAULT</code> is passed for the hint. |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
449 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
450 * |
71 | 451 * @param wHint the width hint (can be <code>DWT.DEFAULT</code>) |
452 * @param hHint the height hint (can be <code>DWT.DEFAULT</code>) | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
453 * @return the preferred size of the control |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
454 * |
71 | 455 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
456 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
457 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
458 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
459 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
460 * @see Layout |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
461 * @see #getBorderWidth |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
462 * @see #getBounds |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
463 * @see #getSize |
30 | 464 * @see #pack(bool) |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
465 * @see "computeTrim, getClientArea for controls that implement them" |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
466 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
467 public Point computeSize (int wHint, int hHint) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
468 return computeSize (wHint, hHint, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
469 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
470 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
471 Control computeTabGroup () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
472 if (isTabGroup()) return this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
473 return parent.computeTabGroup (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
474 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
475 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
476 Control[] computeTabList() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
477 if (isTabGroup()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
478 if (getVisible() && getEnabled()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
479 return [this]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
480 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
481 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
482 return new Control[0]; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
483 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
484 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
485 Control computeTabRoot () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
486 Control[] tabList = parent._getTabList(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
487 if (tabList !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
488 int index = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
489 while (index < tabList.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
490 if (tabList [index] is this) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
491 index++; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
492 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
493 if (index is tabList.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
494 if (isTabGroup ()) return this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
495 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
496 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
497 return parent.computeTabRoot (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
498 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
499 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
500 void checkBuffered () { |
71 | 501 style |= DWT.DOUBLE_BUFFERED; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
502 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
503 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
504 void checkBackground () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
505 Shell shell = getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
506 if (this is shell) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
507 state &= ~PARENT_BACKGROUND; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
508 Composite composite = parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
509 do { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
510 int mode = composite.backgroundMode; |
71 | 511 if (mode !is DWT.INHERIT_NONE) { |
512 if (mode is DWT.INHERIT_DEFAULT) { | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
513 Control control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
514 do { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
515 if ((control.state & THEME_BACKGROUND) is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
516 return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
517 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
518 control = control.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
519 } while (control !is composite); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
520 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
521 state |= PARENT_BACKGROUND; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
522 return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
523 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
524 if (composite is shell) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
525 composite = composite.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
526 } while (true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
527 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
528 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
529 void checkBorder () { |
71 | 530 if (getBorderWidth () is 0) style &= ~DWT.BORDER; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
531 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
532 |
240 | 533 void checkMirrored () { |
534 if ((style & DWT.RIGHT_TO_LEFT) !is 0) style |= DWT.MIRRORED; | |
535 } | |
536 | |
30 | 537 GtkStyle* childStyle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
538 return parent.childStyle (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
539 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
540 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
541 override void createWidget (int index) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
542 state |= DRAG_DETECT; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
543 checkOrientation (parent); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
544 super.createWidget (index); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
545 checkBackground (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
546 if ((state & PARENT_BACKGROUND) !is 0) setBackground (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
547 checkBuffered (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
548 showWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
549 setInitialBounds (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
550 setZOrder (null, false, false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
551 setRelations (); |
240 | 552 checkMirrored (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
553 checkBorder (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
554 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
555 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
556 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
557 * Returns the preferred size of the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
558 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
559 * The <em>preferred size</em> of a control is the size that it would |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
560 * best be displayed at. The width hint and height hint arguments |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
561 * allow the caller to ask a control questions such as "Given a particular |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
562 * width, how high does the control need to be to show all of the contents?" |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
563 * To indicate that the caller does not wish to constrain a particular |
71 | 564 * dimension, the constant <code>DWT.DEFAULT</code> is passed for the hint. |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
565 * </p><p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
566 * If the changed flag is <code>true</code>, it indicates that the receiver's |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
567 * <em>contents</em> have changed, therefore any caches that a layout manager |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
568 * containing the control may have been keeping need to be flushed. When the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
569 * control is resized, the changed flag will be <code>false</code>, so layout |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
570 * manager caches can be retained. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
571 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
572 * |
71 | 573 * @param wHint the width hint (can be <code>DWT.DEFAULT</code>) |
574 * @param hHint the height hint (can be <code>DWT.DEFAULT</code>) | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
575 * @param changed <code>true</code> if the control's contents have changed, and <code>false</code> otherwise |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
576 * @return the preferred size of the control. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
577 * |
71 | 578 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
579 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
580 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
581 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
582 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
583 * @see Layout |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
584 * @see #getBorderWidth |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
585 * @see #getBounds |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
586 * @see #getSize |
30 | 587 * @see #pack(bool) |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
588 * @see "computeTrim, getClientArea for controls that implement them" |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
589 */ |
30 | 590 public Point computeSize (int wHint, int hHint, bool changed) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
591 checkWidget(); |
71 | 592 if (wHint !is DWT.DEFAULT && wHint < 0) wHint = 0; |
593 if (hHint !is DWT.DEFAULT && hHint < 0) hHint = 0; | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
594 return computeNativeSize (handle, wHint, hHint, changed); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
595 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
596 |
30 | 597 Point computeNativeSize (GtkWidget* h, int wHint, int hHint, bool changed) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
598 int width = wHint, height = hHint; |
71 | 599 if (wHint is DWT.DEFAULT && hHint is DWT.DEFAULT) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
600 GtkRequisition requisition; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
601 gtk_widget_size_request (h, &requisition); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
602 width = OS.GTK_WIDGET_REQUISITION_WIDTH (h); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
603 height = OS.GTK_WIDGET_REQUISITION_HEIGHT (h); |
71 | 604 } else if (wHint is DWT.DEFAULT || hHint is DWT.DEFAULT) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
605 int reqWidth, reqHeight; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
606 OS.gtk_widget_get_size_request (h, &reqWidth, &reqHeight); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
607 OS.gtk_widget_set_size_request (h, wHint, hHint); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
608 GtkRequisition requisition; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
609 gtk_widget_size_request (h, &requisition); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
610 OS.gtk_widget_set_size_request (h, reqWidth, reqHeight); |
71 | 611 width = wHint is DWT.DEFAULT ? requisition.width : wHint; |
612 height = hHint is DWT.DEFAULT ? requisition.height : hHint; | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
613 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
614 return new Point (width, height); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
615 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
616 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
617 void forceResize () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
618 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
619 * Force size allocation on all children of this widget's |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
620 * topHandle. Note that all calls to gtk_widget_size_allocate() |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
621 * must be preceded by a call to gtk_widget_size_request(). |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
622 */ |
240 | 623 auto topHandle_ = topHandle (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
624 GtkRequisition requisition; |
240 | 625 gtk_widget_size_request (topHandle_, &requisition); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
626 GtkAllocation allocation; |
240 | 627 allocation.x = OS.GTK_WIDGET_X (topHandle_); |
628 allocation.y = OS.GTK_WIDGET_Y (topHandle_); | |
629 allocation.width = OS.GTK_WIDGET_WIDTH (topHandle_); | |
630 allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle_); | |
631 OS.gtk_widget_size_allocate (topHandle_, &allocation); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
632 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
633 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
634 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
635 * Returns the accessible object for the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
636 * If this is the first time this object is requested, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
637 * then the object is created and returned. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
638 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
639 * @return the accessible object |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
640 * |
71 | 641 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
642 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
643 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
644 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
645 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
646 * @see Accessible#addAccessibleListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
647 * @see Accessible#addAccessibleControlListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
648 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
649 * @since 2.0 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
650 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
651 public Accessible getAccessible () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
652 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
653 if (accessible is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
654 accessible = Accessible.internal_new_Accessible (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
655 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
656 return accessible; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
657 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
658 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
659 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
660 * Returns a rectangle describing the receiver's size and location |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
661 * relative to its parent (or its display if its parent is null), |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
662 * unless the receiver is a shell. In this case, the location is |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
663 * relative to the display. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
664 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
665 * @return the receiver's bounding rectangle |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
666 * |
71 | 667 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
668 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
669 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
670 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
671 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
672 public Rectangle getBounds () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
673 checkWidget(); |
240 | 674 auto topHandle_ = topHandle (); |
675 int x = OS.GTK_WIDGET_X (topHandle_); | |
676 int y = OS.GTK_WIDGET_Y (topHandle_); | |
677 int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_); | |
678 int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_); | |
679 if ((parent.style & DWT.MIRRORED) !is 0) x = parent.getClientWidth () - width - x; | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
680 return new Rectangle (x, y, width, height); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
681 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
682 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
683 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
684 * Sets the receiver's size and location to the rectangular |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
685 * area specified by the argument. The <code>x</code> and |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
686 * <code>y</code> fields of the rectangle are relative to |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
687 * the receiver's parent (or its display if its parent is null). |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
688 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
689 * Note: Attempting to set the width or height of the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
690 * receiver to a negative number will cause that |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
691 * value to be set to zero instead. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
692 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
693 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
694 * @param rect the new bounds for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
695 * |
71 | 696 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
697 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
698 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
699 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
700 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
701 public void setBounds (Rectangle rect) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
702 checkWidget (); |
71 | 703 if (rect is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
704 setBounds (rect.x, rect.y, Math.max (0, rect.width), Math.max (0, rect.height), true, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
705 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
706 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
707 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
708 * Sets the receiver's size and location to the rectangular |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
709 * area specified by the arguments. The <code>x</code> and |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
710 * <code>y</code> arguments are relative to the receiver's |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
711 * parent (or its display if its parent is null), unless |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
712 * the receiver is a shell. In this case, the <code>x</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
713 * and <code>y</code> arguments are relative to the display. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
714 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
715 * Note: Attempting to set the width or height of the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
716 * receiver to a negative number will cause that |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
717 * value to be set to zero instead. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
718 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
719 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
720 * @param x the new x coordinate for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
721 * @param y the new y coordinate for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
722 * @param width the new width for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
723 * @param height the new height for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
724 * |
71 | 725 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
726 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
727 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
728 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
729 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
730 public void setBounds (int x, int y, int width, int height) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
731 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
732 setBounds (x, y, Math.max (0, width), Math.max (0, height), true, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
733 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
734 |
30 | 735 void markLayout (bool changed, bool all) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
736 /* Do nothing */ |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
737 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
738 |
240 | 739 override void modifyStyle (GtkWidget* handle, GtkRcStyle* style) { |
740 super.modifyStyle(handle, style); | |
741 /* | |
742 * Bug in GTK. When changing the style of a control that | |
743 * has had a region set on it, the region is lost. The | |
744 * fix is to set the region again. | |
745 */ | |
746 if (region !is null) OS.gdk_window_shape_combine_region (OS.GTK_WIDGET_WINDOW (topHandle ()), region.handle, 0, 0); | |
747 } | |
748 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
749 void moveHandle (int x, int y) { |
240 | 750 auto topHandle_ = topHandle (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
751 auto parentHandle = parent.parentingHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
752 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
753 * Feature in GTK. Calling gtk_fixed_move() to move a child causes |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
754 * the whole parent to redraw. This is a performance problem. The |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
755 * fix is temporarily make the parent not visible during the move. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
756 * |
71 | 757 * NOTE: Because every widget in DWT has an X window, the new and |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
758 * old bounds of the child are correctly redrawn. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
759 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
760 int flags = OS.GTK_WIDGET_FLAGS (parentHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
761 OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_VISIBLE); |
240 | 762 OS.gtk_fixed_move (cast(GtkFixed*)parentHandle, topHandle_, x, y); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
763 if ((flags & OS.GTK_VISIBLE) !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
764 OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_VISIBLE); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
765 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
766 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
767 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
768 void resizeHandle (int width, int height) { |
240 | 769 auto topHandle_ = topHandle (); |
770 OS.gtk_widget_set_size_request (topHandle_, width, height); | |
771 if (topHandle_ !is handle) OS.gtk_widget_set_size_request (handle, width, height); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
772 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
773 |
30 | 774 int setBounds (int x, int y, int width, int height, bool move, bool resize) { |
240 | 775 auto topHandle_ = topHandle (); |
776 bool sendMove = move; | |
777 if ((parent.style & DWT.MIRRORED) !is 0) { | |
778 int clientWidth = parent.getClientWidth (); | |
779 int oldWidth = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_); | |
780 int oldX = clientWidth - oldWidth - OS.GTK_WIDGET_X (topHandle_); | |
781 if (move) { | |
782 sendMove &= x !is oldX; | |
783 x = clientWidth - (resize ? width : oldWidth) - x; | |
784 } else { | |
785 move = true; | |
786 x = clientWidth - (resize ? width : oldWidth) - oldX; | |
787 y = OS.GTK_WIDGET_Y (topHandle_); | |
788 } | |
789 } | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
790 bool sameOrigin = true, sameExtent = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
791 if (move) { |
240 | 792 int oldX = OS.GTK_WIDGET_X (topHandle_); |
793 int oldY = OS.GTK_WIDGET_Y (topHandle_); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
794 sameOrigin = x is oldX && y is oldY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
795 if (!sameOrigin) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
796 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
797 OS.gdk_window_move (enableWindow, x, y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
798 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
799 moveHandle (x, y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
800 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
801 } |
240 | 802 int clientWidth = 0; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
803 if (resize) { |
240 | 804 int oldWidth = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_); |
805 int oldHeight = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
806 sameExtent = width is oldWidth && height is oldHeight; |
240 | 807 if (!sameExtent && (style & DWT.MIRRORED) !is 0) clientWidth = getClientWidth (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
808 if (!sameExtent && !(width is 0 && height is 0)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
809 int newWidth = Math.max (1, width); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
810 int newHeight = Math.max (1, height); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
811 if (redrawWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
812 OS.gdk_window_resize (redrawWindow, newWidth, newHeight); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
813 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
814 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
815 OS.gdk_window_resize (enableWindow, newWidth, newHeight); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
816 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
817 resizeHandle (newWidth, newHeight); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
818 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
819 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
820 if (!sameOrigin || !sameExtent) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
821 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
822 * Cause a size allocation this widget's topHandle. Note that |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
823 * all calls to gtk_widget_size_allocate() must be preceded by |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
824 * a call to gtk_widget_size_request(). |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
825 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
826 GtkRequisition requisition; |
240 | 827 gtk_widget_size_request (topHandle_, &requisition); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
828 GtkAllocation allocation; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
829 if (move) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
830 allocation.x = x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
831 allocation.y = y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
832 } else { |
240 | 833 allocation.x = OS.GTK_WIDGET_X (topHandle_); |
834 allocation.y = OS.GTK_WIDGET_Y (topHandle_); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
835 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
836 if (resize) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
837 allocation.width = width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
838 allocation.height = height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
839 } else { |
240 | 840 allocation.width = OS.GTK_WIDGET_WIDTH (topHandle_); |
841 allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle_); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
842 } |
240 | 843 OS.gtk_widget_size_allocate (topHandle_, &allocation); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
844 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
845 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
846 * Bug in GTK. Widgets cannot be sized smaller than 1x1. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
847 * The fix is to hide zero-sized widgets and show them again |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
848 * when they are resized larger. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
849 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
850 if (!sameExtent) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
851 state = (width is 0) ? state | ZERO_WIDTH : state & ~ZERO_WIDTH; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
852 state = (height is 0) ? state | ZERO_HEIGHT : state & ~ZERO_HEIGHT; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
853 if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
854 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
855 OS.gdk_window_hide (enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
856 } |
240 | 857 OS.gtk_widget_hide (topHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
858 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
859 if ((state & HIDDEN) is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
860 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
861 OS.gdk_window_show_unraised (enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
862 } |
240 | 863 OS.gtk_widget_show (topHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
864 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
865 } |
240 | 866 if ((style & DWT.MIRRORED) !is 0) moveChildren (clientWidth); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
867 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
868 int result = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
869 if (move && !sameOrigin) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
870 Control control = findBackgroundControl (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
871 if (control !is null && control.backgroundImage !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
872 if (isVisible ()) redrawWidget (0, 0, 0, 0, true, true, true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
873 } |
240 | 874 if (sendMove) sendEvent (DWT.Move); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
875 result |= MOVED; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
876 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
877 if (resize && !sameExtent) { |
71 | 878 sendEvent (DWT.Resize); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
879 result |= RESIZED; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
880 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
881 return result; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
882 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
883 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
884 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
885 * Returns a point describing the receiver's location relative |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
886 * to its parent (or its display if its parent is null), unless |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
887 * the receiver is a shell. In this case, the point is |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
888 * relative to the display. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
889 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
890 * @return the receiver's location |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
891 * |
71 | 892 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
893 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
894 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
895 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
896 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
897 public Point getLocation () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
898 checkWidget(); |
240 | 899 auto topHandle_ = topHandle (); |
900 int x = OS.GTK_WIDGET_X (topHandle_); | |
901 int y = OS.GTK_WIDGET_Y (topHandle_); | |
902 if ((parent.style & DWT.MIRRORED) !is 0) { | |
903 int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_); | |
904 x = parent.getClientWidth () - width - x; | |
905 } | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
906 return new Point (x, y); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
907 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
908 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
909 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
910 * Sets the receiver's location to the point specified by |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
911 * the arguments which are relative to the receiver's |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
912 * parent (or its display if its parent is null), unless |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
913 * the receiver is a shell. In this case, the point is |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
914 * relative to the display. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
915 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
916 * @param location the new location for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
917 * |
71 | 918 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
919 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
920 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
921 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
922 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
923 public void setLocation (Point location) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
924 checkWidget (); |
71 | 925 if (location is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
926 setBounds (location.x, location.y, 0, 0, true, false); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
927 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
928 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
929 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
930 * Sets the receiver's location to the point specified by |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
931 * the arguments which are relative to the receiver's |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
932 * parent (or its display if its parent is null), unless |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
933 * the receiver is a shell. In this case, the point is |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
934 * relative to the display. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
935 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
936 * @param x the new x coordinate for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
937 * @param y the new y coordinate for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
938 * |
71 | 939 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
940 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
941 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
942 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
943 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
944 public void setLocation(int x, int y) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
945 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
946 setBounds (x, y, 0, 0, true, false); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
947 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
948 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
949 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
950 * Returns a point describing the receiver's size. The |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
951 * x coordinate of the result is the width of the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
952 * The y coordinate of the result is the height of the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
953 * receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
954 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
955 * @return the receiver's size |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
956 * |
71 | 957 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
958 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
959 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
960 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
961 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
962 public Point getSize () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
963 checkWidget(); |
240 | 964 auto topHandle_ = topHandle (); |
965 int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_); | |
966 int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
967 return new Point (width, height); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
968 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
969 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
970 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
971 * Sets the receiver's size to the point specified by the argument. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
972 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
973 * Note: Attempting to set the width or height of the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
974 * receiver to a negative number will cause them to be |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
975 * set to zero instead. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
976 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
977 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
978 * @param size the new size for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
979 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
980 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
981 * <li>ERROR_NULL_ARGUMENT - if the point is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
982 * </ul> |
71 | 983 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
984 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
985 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
986 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
987 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
988 public void setSize (Point size) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
989 checkWidget (); |
71 | 990 if (size is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
991 setBounds (0, 0, Math.max (0, size.x), Math.max (0, size.y), false, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
992 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
993 |
259 | 994 /** |
995 * Sets the shape of the control to the region specified | |
996 * by the argument. When the argument is null, the | |
997 * default shape of the control is restored. | |
998 * | |
999 * @param region the region that defines the shape of the control (or null) | |
1000 * | |
1001 * @exception IllegalArgumentException <ul> | |
1002 * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li> | |
351 | 1003 * </ul> |
259 | 1004 * @exception DWTException <ul> |
1005 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | |
1006 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | |
1007 * </ul> | |
1008 * | |
1009 * @since 3.4 | |
1010 */ | |
240 | 1011 public void setRegion (Region region) { |
1012 checkWidget (); | |
1013 if (region !is null && region.isDisposed()) error (DWT.ERROR_INVALID_ARGUMENT); | |
1014 auto window = OS.GTK_WIDGET_WINDOW (topHandle ()); | |
1015 auto shape_region = (region is null) ? null : region.handle; | |
1016 OS.gdk_window_shape_combine_region (window, shape_region, 0, 0); | |
1017 this.region = region; | |
1018 } | |
1019 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1020 void setRelations () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1021 auto parentHandle = parent.parentingHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1022 auto list = OS.gtk_container_get_children (cast(GtkContainer*)parentHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1023 if (list is null) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1024 int count = OS.g_list_length (list); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1025 if (count > 1) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1026 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1027 * the receiver is the last item in the list, so its predecessor will |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1028 * be the second-last item in the list |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1029 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1030 auto handle = cast(GtkWidget*) OS.g_list_nth_data (list, count - 2); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1031 if (handle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1032 Widget widget = display.getWidget (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1033 if (widget !is null && widget !is this) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1034 if (auto sibling = cast(Control)widget ) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1035 sibling.addRelation (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1036 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1037 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1038 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1039 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1040 OS.g_list_free (list); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1041 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1042 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1043 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1044 * Sets the receiver's size to the point specified by the arguments. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1045 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1046 * Note: Attempting to set the width or height of the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1047 * receiver to a negative number will cause that |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1048 * value to be set to zero instead. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1049 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1050 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1051 * @param width the new width for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1052 * @param height the new height for the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1053 * |
71 | 1054 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1055 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1056 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1057 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1058 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1059 public void setSize (int width, int height) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1060 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1061 setBounds (0, 0, Math.max (0, width), Math.max (0, height), false, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1062 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1063 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1064 /* |
30 | 1065 * Answers a bool indicating whether a Label that precedes the receiver in |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1066 * a layout should be read by screen readers as the recevier's label. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1067 */ |
30 | 1068 bool isDescribedByLabel () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1069 return true; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1070 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1071 |
240 | 1072 bool isFocusHandle (GtkWidget* widget) { |
1073 return widget is focusHandle (); | |
1074 } | |
1075 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1076 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1077 * Moves the receiver above the specified control in the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1078 * drawing order. If the argument is null, then the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1079 * is moved to the top of the drawing order. The control at |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1080 * the top of the drawing order will not be covered by other |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1081 * controls even if they occupy intersecting areas. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1082 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1083 * @param control the sibling control (or null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1084 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1085 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1086 * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1087 * </ul> |
71 | 1088 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1089 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1090 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1091 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1092 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1093 * @see Control#moveBelow |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1094 * @see Composite#getChildren |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1095 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1096 public void moveAbove (Control control) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1097 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1098 if (control !is null) { |
71 | 1099 if (control.isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1100 if (parent !is control.parent) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1101 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1102 setZOrder (control, true, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1103 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1104 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1105 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1106 * Moves the receiver below the specified control in the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1107 * drawing order. If the argument is null, then the receiver |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1108 * is moved to the bottom of the drawing order. The control at |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1109 * the bottom of the drawing order will be covered by all other |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1110 * controls which occupy intersecting areas. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1111 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1112 * @param control the sibling control (or null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1113 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1114 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1115 * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1116 * </ul> |
71 | 1117 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1118 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1119 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1120 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1121 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1122 * @see Control#moveAbove |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1123 * @see Composite#getChildren |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1124 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1125 public void moveBelow (Control control) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1126 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1127 if (control !is null) { |
71 | 1128 if (control.isDisposed ()) error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1129 if (parent !is control.parent) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1130 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1131 setZOrder (control, false, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1132 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1133 |
240 | 1134 void moveChildren (int oldWidth) { |
1135 } | |
1136 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1137 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1138 * Causes the receiver to be resized to its preferred size. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1139 * For a composite, this involves computing the preferred size |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1140 * from its layout, if there is one. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1141 * |
71 | 1142 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1143 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1144 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1145 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1146 * |
30 | 1147 * @see #computeSize(int, int, bool) |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1148 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1149 public void pack () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1150 pack (true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1151 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1152 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1153 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1154 * Causes the receiver to be resized to its preferred size. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1155 * For a composite, this involves computing the preferred size |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1156 * from its layout, if there is one. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1157 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1158 * If the changed flag is <code>true</code>, it indicates that the receiver's |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1159 * <em>contents</em> have changed, therefore any caches that a layout manager |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1160 * containing the control may have been keeping need to be flushed. When the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1161 * control is resized, the changed flag will be <code>false</code>, so layout |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1162 * manager caches can be retained. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1163 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1164 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1165 * @param changed whether or not the receiver's contents have changed |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1166 * |
71 | 1167 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1168 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1169 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1170 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1171 * |
30 | 1172 * @see #computeSize(int, int, bool) |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1173 */ |
30 | 1174 public void pack (bool changed) { |
71 | 1175 setSize (computeSize (DWT.DEFAULT, DWT.DEFAULT, changed)); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1176 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1177 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1178 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1179 * Sets the layout data associated with the receiver to the argument. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1180 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1181 * @param layoutData the new layout data for the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1182 * |
71 | 1183 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1184 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1185 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1186 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1187 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1188 public void setLayoutData (Object layoutData) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1189 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1190 this.layoutData = layoutData; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1191 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1192 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1193 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1194 * Returns a point which is the result of converting the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1195 * argument, which is specified in display relative coordinates, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1196 * to coordinates relative to the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1197 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1198 * @param x the x coordinate to be translated |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1199 * @param y the y coordinate to be translated |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1200 * @return the translated coordinates |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1201 * |
71 | 1202 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1203 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1204 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1205 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1206 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1207 * @since 2.1 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1208 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1209 public Point toControl (int x, int y) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1210 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1211 auto window = eventWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1212 int origin_x, origin_y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1213 OS.gdk_window_get_origin (window, &origin_x, &origin_y); |
240 | 1214 x -= origin_x ; |
1215 y -= origin_y ; | |
1216 if ((style & DWT.MIRRORED) !is 0) x = getClientWidth () - x; | |
1217 return new Point (x, y); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1218 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1219 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1220 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1221 * Returns a point which is the result of converting the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1222 * argument, which is specified in display relative coordinates, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1223 * to coordinates relative to the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1224 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1225 * @param point the point to be translated (must not be null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1226 * @return the translated coordinates |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1227 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1228 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1229 * <li>ERROR_NULL_ARGUMENT - if the point is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1230 * </ul> |
71 | 1231 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1232 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1233 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1234 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1235 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1236 public Point toControl (Point point) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1237 checkWidget (); |
71 | 1238 if (point is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1239 return toControl (point.x, point.y); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1240 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1241 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1242 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1243 * Returns a point which is the result of converting the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1244 * argument, which is specified in coordinates relative to |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1245 * the receiver, to display relative coordinates. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1246 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1247 * @param x the x coordinate to be translated |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1248 * @param y the y coordinate to be translated |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1249 * @return the translated coordinates |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1250 * |
71 | 1251 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1252 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1253 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1254 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1255 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1256 * @since 2.1 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1257 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1258 public Point toDisplay (int x, int y) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1259 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1260 auto window = eventWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1261 int origin_x, origin_y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1262 OS.gdk_window_get_origin (window, &origin_x, &origin_y); |
240 | 1263 if ((style & DWT.MIRRORED) !is 0) x = getClientWidth () - x; |
1264 x += origin_x ; | |
1265 y += origin_y ; | |
1266 return new Point (x, y); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1267 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1268 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1269 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1270 * Returns a point which is the result of converting the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1271 * argument, which is specified in coordinates relative to |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1272 * the receiver, to display relative coordinates. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1273 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1274 * @param point the point to be translated (must not be null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1275 * @return the translated coordinates |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1276 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1277 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1278 * <li>ERROR_NULL_ARGUMENT - if the point is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1279 * </ul> |
71 | 1280 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1281 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1282 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1283 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1284 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1285 public Point toDisplay (Point point) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1286 checkWidget(); |
71 | 1287 if (point is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1288 return toDisplay (point.x, point.y); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1289 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1290 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1291 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1292 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1293 * be notified when the control is moved or resized, by sending |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1294 * it one of the messages defined in the <code>ControlListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1295 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1296 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1297 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1298 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1299 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1300 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1301 * </ul> |
71 | 1302 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1303 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1304 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1305 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1306 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1307 * @see ControlListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1308 * @see #removeControlListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1309 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1310 public void addControlListener(ControlListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1311 checkWidget(); |
71 | 1312 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1313 TypedListener typedListener = new TypedListener (listener); |
71 | 1314 addListener (DWT.Resize,typedListener); |
1315 addListener (DWT.Move,typedListener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1316 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1317 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1318 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1319 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1320 * be notified when a drag gesture occurs, by sending it |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1321 * one of the messages defined in the <code>DragDetectListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1322 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1323 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1324 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1325 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1326 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1327 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1328 * </ul> |
71 | 1329 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1330 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1331 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1332 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1333 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1334 * @see DragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1335 * @see #removeDragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1336 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1337 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1338 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1339 public void addDragDetectListener (DragDetectListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1340 checkWidget (); |
71 | 1341 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1342 TypedListener typedListener = new TypedListener (listener); |
71 | 1343 addListener (DWT.DragDetect,typedListener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1344 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1345 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1346 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1347 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1348 * be notified when the control gains or loses focus, by sending |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1349 * it one of the messages defined in the <code>FocusListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1350 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1351 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1352 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1353 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1354 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1355 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1356 * </ul> |
71 | 1357 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1358 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1359 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1360 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1361 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1362 * @see FocusListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1363 * @see #removeFocusListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1364 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1365 public void addFocusListener(FocusListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1366 checkWidget(); |
71 | 1367 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1368 TypedListener typedListener = new TypedListener (listener); |
71 | 1369 addListener(DWT.FocusIn,typedListener); |
1370 addListener(DWT.FocusOut,typedListener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1371 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1372 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1373 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1374 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1375 * be notified when help events are generated for the control, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1376 * by sending it one of the messages defined in the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1377 * <code>HelpListener</code> interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1378 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1379 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1380 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1381 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1382 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1383 * </ul> |
71 | 1384 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1385 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1386 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1387 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1388 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1389 * @see HelpListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1390 * @see #removeHelpListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1391 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1392 public void addHelpListener (HelpListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1393 checkWidget(); |
71 | 1394 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1395 TypedListener typedListener = new TypedListener (listener); |
71 | 1396 addListener (DWT.Help, typedListener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1397 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1398 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1399 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1400 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1401 * be notified when keys are pressed and released on the system keyboard, by sending |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1402 * it one of the messages defined in the <code>KeyListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1403 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1404 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1405 * When a key listener is added to a control, the control |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1406 * will take part in widget traversal. By default, all |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1407 * traversal keys (such as the tab key and so on) are |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1408 * delivered to the control. In order for a control to take |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1409 * part in traversal, it should listen for traversal events. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1410 * Otherwise, the user can traverse into a control but not |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1411 * out. Note that native controls such as table and tree |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1412 * implement key traversal in the operating system. It is |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1413 * not necessary to add traversal listeners for these controls, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1414 * unless you want to override the default traversal. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1415 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1416 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1417 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1418 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1419 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1420 * </ul> |
71 | 1421 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1422 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1423 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1424 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1425 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1426 * @see KeyListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1427 * @see #removeKeyListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1428 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1429 public void addKeyListener(KeyListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1430 checkWidget(); |
71 | 1431 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1432 TypedListener typedListener = new TypedListener (listener); |
71 | 1433 addListener(DWT.KeyUp,typedListener); |
1434 addListener(DWT.KeyDown,typedListener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1435 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1436 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1437 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1438 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1439 * be notified when the platform-specific context menu trigger |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1440 * has occurred, by sending it one of the messages defined in |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1441 * the <code>MenuDetectListener</code> interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1442 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1443 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1444 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1445 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1446 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1447 * </ul> |
71 | 1448 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1449 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1450 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1451 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1452 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1453 * @see MenuDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1454 * @see #removeMenuDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1455 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1456 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1457 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1458 public void addMenuDetectListener (MenuDetectListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1459 checkWidget (); |
71 | 1460 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1461 TypedListener typedListener = new TypedListener (listener); |
71 | 1462 addListener (DWT.MenuDetect, typedListener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1463 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1464 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1465 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1466 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1467 * be notified when mouse buttons are pressed and released, by sending |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1468 * it one of the messages defined in the <code>MouseListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1469 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1470 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1471 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1472 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1473 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1474 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1475 * </ul> |
71 | 1476 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1477 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1478 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1479 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1480 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1481 * @see MouseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1482 * @see #removeMouseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1483 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1484 public void addMouseListener(MouseListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1485 checkWidget(); |
71 | 1486 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1487 TypedListener typedListener = new TypedListener (listener); |
71 | 1488 addListener(DWT.MouseDown,typedListener); |
1489 addListener(DWT.MouseUp,typedListener); | |
1490 addListener(DWT.MouseDoubleClick,typedListener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1491 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1492 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1493 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1494 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1495 * be notified when the mouse moves, by sending it one of the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1496 * messages defined in the <code>MouseMoveListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1497 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1498 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1499 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1500 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1501 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1502 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1503 * </ul> |
71 | 1504 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1505 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1506 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1507 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1508 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1509 * @see MouseMoveListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1510 * @see #removeMouseMoveListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1511 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1512 public void addMouseMoveListener(MouseMoveListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1513 checkWidget(); |
71 | 1514 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1515 TypedListener typedListener = new TypedListener (listener); |
71 | 1516 addListener(DWT.MouseMove,typedListener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1517 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1518 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1519 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1520 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1521 * be notified when the mouse passes or hovers over controls, by sending |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1522 * it one of the messages defined in the <code>MouseTrackListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1523 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1524 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1525 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1526 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1527 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1528 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1529 * </ul> |
71 | 1530 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1531 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1532 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1533 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1534 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1535 * @see MouseTrackListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1536 * @see #removeMouseTrackListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1537 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1538 public void addMouseTrackListener (MouseTrackListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1539 checkWidget(); |
71 | 1540 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1541 TypedListener typedListener = new TypedListener (listener); |
71 | 1542 addListener (DWT.MouseEnter,typedListener); |
1543 addListener (DWT.MouseExit,typedListener); | |
1544 addListener (DWT.MouseHover,typedListener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1545 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1546 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1547 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1548 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1549 * be notified when the mouse wheel is scrolled, by sending |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1550 * it one of the messages defined in the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1551 * <code>MouseWheelListener</code> interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1552 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1553 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1554 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1555 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1556 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1557 * </ul> |
71 | 1558 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1559 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1560 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1561 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1562 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1563 * @see MouseWheelListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1564 * @see #removeMouseWheelListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1565 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1566 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1567 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1568 public void addMouseWheelListener (MouseWheelListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1569 checkWidget (); |
71 | 1570 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1571 TypedListener typedListener = new TypedListener (listener); |
71 | 1572 addListener (DWT.MouseWheel, typedListener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1573 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1574 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1575 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1576 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1577 * be notified when the receiver needs to be painted, by sending it |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1578 * one of the messages defined in the <code>PaintListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1579 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1580 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1581 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1582 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1583 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1584 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1585 * </ul> |
71 | 1586 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1587 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1588 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1589 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1590 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1591 * @see PaintListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1592 * @see #removePaintListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1593 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1594 public void addPaintListener(PaintListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1595 checkWidget(); |
71 | 1596 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1597 TypedListener typedListener = new TypedListener (listener); |
71 | 1598 addListener(DWT.Paint,typedListener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1599 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1600 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1601 void addRelation (Control control) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1602 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1603 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1604 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1605 * Adds the listener to the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1606 * be notified when traversal events occur, by sending it |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1607 * one of the messages defined in the <code>TraverseListener</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1608 * interface. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1609 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1610 * @param listener the listener which should be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1611 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1612 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1613 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1614 * </ul> |
71 | 1615 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1616 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1617 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1618 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1619 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1620 * @see TraverseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1621 * @see #removeTraverseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1622 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1623 public void addTraverseListener (TraverseListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1624 checkWidget(); |
71 | 1625 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1626 TypedListener typedListener = new TypedListener (listener); |
71 | 1627 addListener (DWT.Traverse,typedListener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1628 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1629 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1630 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1631 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1632 * be notified when the control is moved or resized. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1633 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1634 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1635 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1636 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1637 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1638 * </ul> |
71 | 1639 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1640 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1641 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1642 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1643 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1644 * @see ControlListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1645 * @see #addControlListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1646 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1647 public void removeControlListener (ControlListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1648 checkWidget(); |
71 | 1649 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1650 if (eventTable is null) return; |
71 | 1651 eventTable.unhook (DWT.Move, listener); |
1652 eventTable.unhook (DWT.Resize, listener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1653 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1654 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1655 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1656 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1657 * be notified when a drag gesture occurs. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1658 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1659 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1660 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1661 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1662 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1663 * </ul> |
71 | 1664 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1665 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1666 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1667 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1668 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1669 * @see DragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1670 * @see #addDragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1671 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1672 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1673 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1674 public void removeDragDetectListener(DragDetectListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1675 checkWidget (); |
71 | 1676 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1677 if (eventTable is null) return; |
71 | 1678 eventTable.unhook (DWT.DragDetect, listener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1679 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1680 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1681 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1682 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1683 * be notified when the control gains or loses focus. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1684 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1685 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1686 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1687 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1688 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1689 * </ul> |
71 | 1690 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1691 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1692 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1693 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1694 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1695 * @see FocusListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1696 * @see #addFocusListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1697 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1698 public void removeFocusListener(FocusListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1699 checkWidget(); |
71 | 1700 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1701 if (eventTable is null) return; |
71 | 1702 eventTable.unhook (DWT.FocusIn, listener); |
1703 eventTable.unhook (DWT.FocusOut, listener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1704 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1705 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1706 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1707 * be notified when the help events are generated for the control. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1708 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1709 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1710 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1711 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1712 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1713 * </ul> |
71 | 1714 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1715 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1716 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1717 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1718 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1719 * @see HelpListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1720 * @see #addHelpListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1721 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1722 public void removeHelpListener (HelpListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1723 checkWidget(); |
71 | 1724 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1725 if (eventTable is null) return; |
71 | 1726 eventTable.unhook (DWT.Help, listener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1727 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1728 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1729 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1730 * be notified when keys are pressed and released on the system keyboard. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1731 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1732 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1733 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1734 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1735 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1736 * </ul> |
71 | 1737 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1738 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1739 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1740 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1741 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1742 * @see KeyListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1743 * @see #addKeyListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1744 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1745 public void removeKeyListener(KeyListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1746 checkWidget(); |
71 | 1747 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1748 if (eventTable is null) return; |
71 | 1749 eventTable.unhook (DWT.KeyUp, listener); |
1750 eventTable.unhook (DWT.KeyDown, listener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1751 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1752 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1753 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1754 * be notified when the platform-specific context menu trigger has |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1755 * occurred. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1756 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1757 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1758 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1759 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1760 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1761 * </ul> |
71 | 1762 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1763 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1764 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1765 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1766 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1767 * @see MenuDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1768 * @see #addMenuDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1769 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1770 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1771 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1772 public void removeMenuDetectListener (MenuDetectListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1773 checkWidget (); |
71 | 1774 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1775 if (eventTable is null) return; |
71 | 1776 eventTable.unhook (DWT.MenuDetect, listener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1777 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1778 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1779 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1780 * be notified when mouse buttons are pressed and released. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1781 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1782 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1783 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1784 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1785 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1786 * </ul> |
71 | 1787 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1788 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1789 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1790 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1791 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1792 * @see MouseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1793 * @see #addMouseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1794 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1795 public void removeMouseListener (MouseListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1796 checkWidget(); |
71 | 1797 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1798 if (eventTable is null) return; |
71 | 1799 eventTable.unhook (DWT.MouseDown, listener); |
1800 eventTable.unhook (DWT.MouseUp, listener); | |
1801 eventTable.unhook (DWT.MouseDoubleClick, listener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1802 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1803 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1804 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1805 * be notified when the mouse moves. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1806 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1807 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1808 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1809 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1810 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1811 * </ul> |
71 | 1812 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1813 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1814 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1815 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1816 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1817 * @see MouseMoveListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1818 * @see #addMouseMoveListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1819 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1820 public void removeMouseMoveListener(MouseMoveListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1821 checkWidget(); |
71 | 1822 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1823 if (eventTable is null) return; |
71 | 1824 eventTable.unhook (DWT.MouseMove, listener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1825 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1826 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1827 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1828 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1829 * be notified when the mouse passes or hovers over controls. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1830 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1831 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1832 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1833 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1834 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1835 * </ul> |
71 | 1836 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1837 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1838 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1839 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1840 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1841 * @see MouseTrackListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1842 * @see #addMouseTrackListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1843 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1844 public void removeMouseTrackListener(MouseTrackListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1845 checkWidget(); |
71 | 1846 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1847 if (eventTable is null) return; |
71 | 1848 eventTable.unhook (DWT.MouseEnter, listener); |
1849 eventTable.unhook (DWT.MouseExit, listener); | |
1850 eventTable.unhook (DWT.MouseHover, listener); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1851 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1852 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1853 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1854 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1855 * be notified when the mouse wheel is scrolled. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1856 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1857 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1858 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1859 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1860 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1861 * </ul> |
71 | 1862 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1863 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1864 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1865 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1866 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1867 * @see MouseWheelListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1868 * @see #addMouseWheelListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1869 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1870 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1871 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1872 public void removeMouseWheelListener (MouseWheelListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1873 checkWidget (); |
71 | 1874 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1875 if (eventTable is null) return; |
71 | 1876 eventTable.unhook (DWT.MouseWheel, listener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1877 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1878 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1879 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1880 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1881 * be notified when the receiver needs to be painted. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1882 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1883 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1884 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1885 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1886 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1887 * </ul> |
71 | 1888 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1889 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1890 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1891 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1892 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1893 * @see PaintListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1894 * @see #addPaintListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1895 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1896 public void removePaintListener(PaintListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1897 checkWidget(); |
71 | 1898 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1899 if (eventTable is null) return; |
71 | 1900 eventTable.unhook(DWT.Paint, listener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1901 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1902 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1903 /* |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1904 * Remove "Labelled by" relations from the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1905 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1906 void removeRelation () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1907 if (!isDescribedByLabel ()) return; /* there will not be any */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1908 auto accessible = OS.gtk_widget_get_accessible (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1909 if (accessible is null) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1910 auto set = ATK.atk_object_ref_relation_set (accessible); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1911 int count = ATK.atk_relation_set_get_n_relations (set); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1912 for (int i = 0; i < count; i++) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1913 auto relation = ATK.atk_relation_set_get_relation (set, 0); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1914 ATK.atk_relation_set_remove (set, relation); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1915 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1916 OS.g_object_unref (set); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1917 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1918 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1919 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1920 * Removes the listener from the collection of listeners who will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1921 * be notified when traversal events occur. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1922 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1923 * @param listener the listener which should no longer be notified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1924 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1925 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1926 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1927 * </ul> |
71 | 1928 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1929 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1930 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1931 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1932 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1933 * @see TraverseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1934 * @see #addTraverseListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1935 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1936 public void removeTraverseListener(TraverseListener listener) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1937 checkWidget (); |
71 | 1938 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1939 if (eventTable is null) return; |
71 | 1940 eventTable.unhook (DWT.Traverse, listener); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1941 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1942 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1943 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1944 * Detects a drag and drop gesture. This method is used |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1945 * to detect a drag gesture when called from within a mouse |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1946 * down listener. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1947 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1948 * <p>By default, a drag is detected when the gesture |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1949 * occurs anywhere within the client area of a control. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1950 * Some controls, such as tables and trees, override this |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1951 * behavior. In addition to the operating system specific |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1952 * drag gesture, they require the mouse to be inside an |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1953 * item. Custom widget writers can use <code>setDragDetect</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1954 * to disable the default detection, listen for mouse down, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1955 * and then call <code>dragDetect()</code> from within the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1956 * listener to conditionally detect a drag. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1957 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1958 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1959 * @param event the mouse down event |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1960 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1961 * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1962 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1963 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1964 * <li>ERROR_NULL_ARGUMENT when the event is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1965 * </ul> |
71 | 1966 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1967 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1968 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1969 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1970 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1971 * @see DragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1972 * @see #addDragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1973 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1974 * @see #getDragDetect |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1975 * @see #setDragDetect |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1976 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1977 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1978 */ |
30 | 1979 public bool dragDetect (Event event) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1980 checkWidget (); |
71 | 1981 if (event is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
1982 return dragDetect (event.button, event.count, event.stateMask, event.x, event.y); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1983 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1984 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1985 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1986 * Detects a drag and drop gesture. This method is used |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1987 * to detect a drag gesture when called from within a mouse |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1988 * down listener. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1989 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1990 * <p>By default, a drag is detected when the gesture |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1991 * occurs anywhere within the client area of a control. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1992 * Some controls, such as tables and trees, override this |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1993 * behavior. In addition to the operating system specific |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1994 * drag gesture, they require the mouse to be inside an |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1995 * item. Custom widget writers can use <code>setDragDetect</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1996 * to disable the default detection, listen for mouse down, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1997 * and then call <code>dragDetect()</code> from within the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1998 * listener to conditionally detect a drag. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1999 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2000 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2001 * @param event the mouse down event |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2002 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2003 * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2004 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2005 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2006 * <li>ERROR_NULL_ARGUMENT when the event is null</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2007 * </ul> |
71 | 2008 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2009 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2010 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2011 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2012 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2013 * @see DragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2014 * @see #addDragDetectListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2015 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2016 * @see #getDragDetect |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2017 * @see #setDragDetect |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2018 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2019 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2020 */ |
30 | 2021 public bool dragDetect (MouseEvent event) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2022 checkWidget (); |
71 | 2023 if (event is null) error (DWT.ERROR_NULL_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2024 return dragDetect (event.button, event.count, event.stateMask, event.x, event.y); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2025 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2026 |
30 | 2027 bool dragDetect (int button, int count, int stateMask, int x, int y) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2028 if (button !is 1 || count !is 1) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2029 if (!dragDetect (x, y, false, null)) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2030 return sendDragEvent (button, stateMask, x, y, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2031 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2032 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2033 bool dragDetect (int x, int y, bool filter, bool* consume) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2034 bool quit = false, dragging = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2035 while (!quit) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2036 GdkEvent* eventPtr; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2037 while (true) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2038 eventPtr = OS.gdk_event_get (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2039 if (eventPtr !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2040 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2041 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2042 try {Thread.sleep(0.050);} catch (Exception ex) {} |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2043 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2044 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2045 switch (cast(int)OS.GDK_EVENT_TYPE (eventPtr)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2046 case OS.GDK_MOTION_NOTIFY: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2047 GdkEventMotion* gdkMotionEvent = cast(GdkEventMotion*)eventPtr; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2048 if ((gdkMotionEvent.state & OS.GDK_BUTTON1_MASK) !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2049 if (OS.gtk_drag_check_threshold (handle, x, y, cast(int) gdkMotionEvent.x, cast(int) gdkMotionEvent.y)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2050 dragging = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2051 quit = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2052 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2053 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2054 quit = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2055 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2056 int newX, newY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2057 OS.gdk_window_get_pointer (gdkMotionEvent.window, &newX, &newY, null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2058 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2059 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2060 case OS.GDK_KEY_PRESS: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2061 case OS.GDK_KEY_RELEASE: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2062 GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2063 if (gdkEvent.keyval is OS.GDK_Escape) quit = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2064 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2065 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2066 case OS.GDK_BUTTON_RELEASE: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2067 case OS.GDK_BUTTON_PRESS: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2068 case OS.GDK_2BUTTON_PRESS: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2069 case OS.GDK_3BUTTON_PRESS: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2070 OS.gdk_event_put (eventPtr); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2071 quit = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2072 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2073 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2074 default: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2075 OS.gtk_main_do_event (eventPtr); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2076 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2077 OS.gdk_event_free (eventPtr); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2078 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2079 return dragging; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2080 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2081 |
30 | 2082 bool filterKey (int keyval, GdkEventKey* event) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2083 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2084 if (imHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2085 return cast(bool)OS.gtk_im_context_filter_keypress (imHandle, event); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2086 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2087 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2088 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2089 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2090 Control findBackgroundControl () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2091 if ((state & BACKGROUND) !is 0 || backgroundImage !is null) return this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2092 return (state & PARENT_BACKGROUND) !is 0 ? parent.findBackgroundControl () : null; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2093 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2094 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2095 Menu [] findMenus (Control control) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2096 if (menu !is null && this !is control) return [menu]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2097 return new Menu [0]; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2098 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2099 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2100 void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2101 oldShell.fixShell (newShell, this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2102 oldDecorations.fixDecorations (newDecorations, this, menus); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2103 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2104 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2105 override int /*long*/ fixedMapProc (GtkWidget* widget) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2106 OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2107 auto widgetList = OS.gtk_container_get_children (cast(GtkContainer*)widget); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2108 if (widgetList !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2109 auto widgets = widgetList; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2110 while (widgets !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2111 auto child = cast(GtkWidget*)OS.g_list_data (widgets); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2112 if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.GTK_WIDGET_MAPPED (child)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2113 OS.gtk_widget_map (child); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2114 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2115 widgets = cast(GList*)OS.g_list_next (widgets); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2116 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2117 OS.g_list_free (widgetList); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2118 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2119 if ((OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_NO_WINDOW) is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2120 OS.gdk_window_show_unraised (OS.GTK_WIDGET_WINDOW (widget)); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2121 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2122 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2123 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2124 |
240 | 2125 void fixModal(GtkWidget* group, GtkWidget* modalGroup) { |
2126 } | |
2127 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2128 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2129 * Forces the receiver to have the <em>keyboard focus</em>, causing |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2130 * all keyboard events to be delivered to it. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2131 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2132 * @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2133 * |
71 | 2134 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2135 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2136 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2137 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2138 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2139 * @see #setFocus |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2140 */ |
30 | 2141 public bool forceFocus () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2142 checkWidget(); |
71 | 2143 if (display.focusEvent is DWT.FocusOut) return false; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2144 Shell shell = getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2145 shell.setSavedFocus (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2146 if (!isEnabled () || !isVisible ()) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2147 shell.bringToTop (false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2148 return forceFocus (focusHandle ()); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2149 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2150 |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2151 bool forceFocus (GtkWidget* focusHandle_) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2152 /* When the control is zero sized it must be realized */ |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2153 OS.gtk_widget_realize (focusHandle_); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2154 OS.gtk_widget_grab_focus (focusHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2155 Shell shell = getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2156 auto shellHandle = shell.shellHandle; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2157 auto handle = OS.gtk_window_get_focus (cast(GtkWindow*)shellHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2158 while (handle !is null) { |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2159 if (handle is focusHandle_) return true; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2160 Widget widget = display.getWidget (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2161 if (widget !is null && (null !is cast(Control)widget)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2162 return widget is this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2163 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2164 handle = OS.gtk_widget_get_parent (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2165 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2166 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2167 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2168 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2169 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2170 * Returns the receiver's background color. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2171 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2172 * @return the background color |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2173 * |
71 | 2174 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2175 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2176 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2177 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2178 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2179 public Color getBackground () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2180 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2181 Control control = findBackgroundControl (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2182 if (control is null) control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2183 return Color.gtk_new (display, control.getBackgroundColor ()); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2184 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2185 |
30 | 2186 GdkColor* getBackgroundColor () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2187 return getBgColor (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2188 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2189 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2190 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2191 * Returns the receiver's background image. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2192 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2193 * @return the background image |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2194 * |
71 | 2195 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2196 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2197 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2198 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2199 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2200 * @since 3.2 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2201 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2202 public Image getBackgroundImage () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2203 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2204 Control control = findBackgroundControl (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2205 if (control is null) control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2206 return control.backgroundImage; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2207 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2208 |
30 | 2209 GdkColor* getBgColor () { |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2210 auto fontHandle_ = fontHandle (); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2211 OS.gtk_widget_realize (fontHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2212 GdkColor* color = new GdkColor (); |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2213 OS.gtk_style_get_bg (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2214 return color; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2215 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2216 |
30 | 2217 GdkColor* getBaseColor () { |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2218 auto fontHandle_ = fontHandle (); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2219 OS.gtk_widget_realize (fontHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2220 GdkColor* color = new GdkColor (); |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2221 OS.gtk_style_get_base (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2222 return color; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2223 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2224 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2225 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2226 * Returns the receiver's border width. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2227 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2228 * @return the border width |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2229 * |
71 | 2230 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2231 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2232 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2233 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2234 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2235 public int getBorderWidth () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2236 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2237 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2238 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2239 |
240 | 2240 int getClientWidth () { |
2241 return 0; | |
2242 } | |
2243 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2244 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2245 * Returns the receiver's cursor, or null if it has not been set. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2246 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2247 * When the mouse pointer passes over a control its appearance |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2248 * is changed to match the control's cursor. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2249 * </p> |
259 | 2250 * |
2251 * @return the receiver's cursor or <code>null</code> | |
2252 * | |
71 | 2253 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2254 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2255 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2256 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2257 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2258 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2259 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2260 public Cursor getCursor () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2261 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2262 return cursor; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2263 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2264 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2265 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2266 * Returns <code>true</code> if the receiver is detecting |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2267 * drag gestures, and <code>false</code> otherwise. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2268 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2269 * @return the receiver's drag detect state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2270 * |
71 | 2271 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2272 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2273 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2274 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2275 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2276 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2277 */ |
30 | 2278 public bool getDragDetect () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2279 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2280 return (state & DRAG_DETECT) !is 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2281 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2282 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2283 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2284 * Returns <code>true</code> if the receiver is enabled, and |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2285 * <code>false</code> otherwise. A disabled control is typically |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2286 * not selectable from the user interface and draws with an |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2287 * inactive or "grayed" look. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2288 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2289 * @return the receiver's enabled state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2290 * |
71 | 2291 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2292 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2293 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2294 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2295 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2296 * @see #isEnabled |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2297 */ |
30 | 2298 public bool getEnabled () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2299 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2300 return (state & DISABLED) is 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2301 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2302 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2303 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2304 * Returns the font that the receiver will use to paint textual information. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2305 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2306 * @return the receiver's font |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2307 * |
71 | 2308 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2309 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2310 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2311 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2312 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2313 public Font getFont () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2314 checkWidget(); |
240 | 2315 return font !is null ? font : defaultFont (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2316 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2317 |
30 | 2318 PangoFontDescription* getFontDescription () { |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2319 auto fontHandle_ = fontHandle (); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2320 OS.gtk_widget_realize (fontHandle_); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2321 return OS.gtk_style_get_font_desc (OS.gtk_widget_get_style (fontHandle_)); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2322 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2323 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2324 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2325 * Returns the foreground color that the receiver will use to draw. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2326 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2327 * @return the receiver's foreground color |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2328 * |
71 | 2329 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2330 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2331 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2332 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2333 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2334 public Color getForeground () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2335 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2336 return Color.gtk_new (display, getForegroundColor ()); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2337 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2338 |
30 | 2339 GdkColor* getForegroundColor () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2340 return getFgColor (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2341 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2342 |
30 | 2343 GdkColor* getFgColor () { |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2344 auto fontHandle_ = fontHandle (); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2345 OS.gtk_widget_realize (fontHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2346 GdkColor* color = new GdkColor (); |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2347 OS.gtk_style_get_fg (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2348 return color; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2349 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2350 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2351 Point getIMCaretPos () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2352 return new Point (0, 0); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2353 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2354 |
30 | 2355 GdkColor* getTextColor () { |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2356 auto fontHandle_ = fontHandle (); |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2357 OS.gtk_widget_realize (fontHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2358 GdkColor* color = new GdkColor (); |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2359 OS.gtk_style_get_text (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2360 return color; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2361 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2362 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2363 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2364 * Returns layout data which is associated with the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2365 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2366 * @return the receiver's layout data |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2367 * |
71 | 2368 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2369 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2370 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2371 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2372 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2373 public Object getLayoutData () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2374 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2375 return layoutData; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2376 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2377 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2378 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2379 * Returns the receiver's pop up menu if it has one, or null |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2380 * if it does not. All controls may optionally have a pop up |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2381 * menu that is displayed when the user requests one for |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2382 * the control. The sequence of key strokes, button presses |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2383 * and/or button releases that are used to request a pop up |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2384 * menu is platform specific. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2385 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2386 * @return the receiver's menu |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2387 * |
71 | 2388 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2389 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2390 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2391 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2392 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2393 public Menu getMenu () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2394 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2395 return menu; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2396 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2397 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2398 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2399 * Returns the receiver's monitor. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2400 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2401 * @return the receiver's monitor |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2402 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2403 * @since 3.0 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2404 */ |
30 | 2405 public dwt.widgets.Monitor.Monitor getMonitor () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2406 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2407 dwt.widgets.Monitor.Monitor monitor = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2408 auto screen = OS.gdk_screen_get_default (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2409 if (screen !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2410 int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, paintWindow ()); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2411 GdkRectangle dest; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2412 OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, &dest); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2413 monitor = new dwt.widgets.Monitor.Monitor (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2414 monitor.handle = monitorNumber; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2415 monitor.x = dest.x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2416 monitor.y = dest.y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2417 monitor.width = dest.width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2418 monitor.height = dest.height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2419 Rectangle workArea = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2420 if (monitorNumber is 0) workArea = display.getWorkArea (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2421 if (workArea !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2422 monitor.clientX = workArea.x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2423 monitor.clientY = workArea.y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2424 monitor.clientWidth = workArea.width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2425 monitor.clientHeight = workArea.height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2426 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2427 monitor.clientX = monitor.x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2428 monitor.clientY = monitor.y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2429 monitor.clientWidth = monitor.width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2430 monitor.clientHeight = monitor.height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2431 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2432 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2433 monitor = display.getPrimaryMonitor (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2434 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2435 return monitor; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2436 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2437 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2438 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2439 * Returns the receiver's parent, which must be a <code>Composite</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2440 * or null when the receiver is a shell that was created with null or |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2441 * a display for a parent. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2442 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2443 * @return the receiver's parent |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2444 * |
71 | 2445 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2446 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2447 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2448 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2449 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2450 public Composite getParent () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2451 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2452 return parent; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2453 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2454 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2455 Control [] getPath () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2456 int count = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2457 Shell shell = getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2458 Control control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2459 while (control !is shell) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2460 count++; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2461 control = control.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2462 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2463 control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2464 Control [] result = new Control [count]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2465 while (control !is shell) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2466 result [--count] = control; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2467 control = control.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2468 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2469 return result; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2470 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2471 |
351 | 2472 /** |
259 | 2473 * Returns the region that defines the shape of the control, |
2474 * or null if the control has the default shape. | |
2475 * | |
2476 * @return the region that defines the shape of the shell (or null) | |
351 | 2477 * |
259 | 2478 * @exception DWTException <ul> |
2479 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | |
2480 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | |
2481 * </ul> | |
2482 * | |
2483 * @since 3.4 | |
2484 */ | |
240 | 2485 public Region getRegion () { |
2486 checkWidget (); | |
2487 return region; | |
2488 } | |
2489 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2490 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2491 * Returns the receiver's shell. For all controls other than |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2492 * shells, this simply returns the control's nearest ancestor |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2493 * shell. Shells return themselves, even if they are children |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2494 * of other shells. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2495 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2496 * @return the receiver's shell |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2497 * |
71 | 2498 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2499 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2500 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2501 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2502 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2503 * @see #getParent |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2504 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2505 public Shell getShell() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2506 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2507 return _getShell(); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2508 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2509 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2510 Shell _getShell() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2511 return parent._getShell(); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2512 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2513 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2514 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2515 * Returns the receiver's tool tip text, or null if it has |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2516 * not been set. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2517 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2518 * @return the receiver's tool tip text |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2519 * |
71 | 2520 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2521 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2522 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2523 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2524 */ |
238 | 2525 public String getToolTipText () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2526 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2527 return toolTipText; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2528 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2529 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2530 * Returns <code>true</code> if the receiver is visible, and |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2531 * <code>false</code> otherwise. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2532 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2533 * If one of the receiver's ancestors is not visible or some |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2534 * other condition makes the receiver not visible, this method |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2535 * may still indicate that it is considered visible even though |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2536 * it may not actually be showing. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2537 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2538 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2539 * @return the receiver's visibility state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2540 * |
71 | 2541 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2542 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2543 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2544 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2545 */ |
30 | 2546 public bool getVisible () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2547 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2548 return (state & HIDDEN) is 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2549 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2550 |
351 | 2551 override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) { |
2552 return gtk_button_press_event (widget, event, true); | |
2553 } | |
2554 | |
2555 int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent, bool sendMouseDown) { | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2556 if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) return 0; |
240 | 2557 |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2558 /* |
71 | 2559 * When a shell is created with DWT.ON_TOP and DWT.NO_FOCUS, |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2560 * do not activate the shell when the user clicks on the |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2561 * the client area or on the border or a control within the |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2562 * shell that does not take focus. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2563 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2564 Shell shell = _getShell (); |
71 | 2565 if (((shell.style & DWT.ON_TOP) !is 0) && (((shell.style & DWT.NO_FOCUS) is 0) || ((style & DWT.NO_FOCUS) is 0))) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2566 shell.forceActive(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2567 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2568 int /*long*/ result = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2569 if (gdkEvent.type is OS.GDK_BUTTON_PRESS) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2570 display.clickCount = 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2571 auto nextEvent = OS.gdk_event_peek (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2572 if (nextEvent !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2573 int eventType = OS.GDK_EVENT_TYPE (nextEvent); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2574 if (eventType is OS.GDK_2BUTTON_PRESS) display.clickCount = 2; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2575 if (eventType is OS.GDK_3BUTTON_PRESS) display.clickCount = 3; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2576 OS.gdk_event_free (nextEvent); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2577 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2578 bool dragging = false; |
71 | 2579 if ((state & DRAG_DETECT) !is 0 && hooks (DWT.DragDetect)) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2580 if (gdkEvent.button is 1) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2581 bool consume = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2582 if (dragDetect (cast(int) gdkEvent.x, cast(int) gdkEvent.y, true, &consume)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2583 dragging = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2584 if (consume ) result = 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2585 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2586 if (isDisposed ()) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2587 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2588 } |
351 | 2589 if (sendMouseDown && !sendMouseEvent (DWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2590 result = 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2591 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2592 if (isDisposed ()) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2593 if (dragging) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2594 sendDragEvent (gdkEvent.button, gdkEvent.state, cast(int) gdkEvent.x, cast(int) gdkEvent.y, false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2595 if (isDisposed ()) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2596 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2597 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2598 * Pop up the context menu in the button press event for widgets |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2599 * that have default operating system menus in order to stop the |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2600 * operating system from displaying the menu if necessary. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2601 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2602 if ((state & MENU) !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2603 if (gdkEvent.button is 3) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2604 if (showMenu (cast(int)gdkEvent.x_root, cast(int)gdkEvent.y_root)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2605 result = 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2606 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2607 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2608 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2609 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2610 display.clickCount = 2; |
71 | 2611 result = sendMouseEvent (DWT.MouseDoubleClick, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2612 if (isDisposed ()) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2613 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2614 if (!shell.isDisposed ()) shell.setActiveControl (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2615 return result; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2616 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2617 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2618 override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2619 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2620 * Feature in GTK. When button 4, 5, 6, or 7 is released, GTK |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2621 * does not deliver a corresponding GTK event. Button 6 and 7 |
71 | 2622 * are mapped to buttons 4 and 5 in DWT. The fix is to change |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2623 * the button number of the event to a negative number so that |
71 | 2624 * it gets dispatched by GTK. DWT has been modified to look |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2625 * for negative button numbers. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2626 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2627 int button = gdkEvent.button; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2628 switch (button) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2629 case -6: button = 4; break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2630 case -7: button = 5; break; |
54 | 2631 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2632 } |
71 | 2633 return sendMouseEvent (DWT.MouseUp, button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2634 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2635 |
37 | 2636 override int /*long*/ gtk_commit (GtkIMContext* imcontext, char* text) { |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2637 char [] chars = fromStringz( text ); |
30 | 2638 if (chars.length is 0) return 0; |
71 | 2639 sendIMKeyEvent (DWT.KeyDown, null, chars); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2640 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2641 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2642 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2643 override int /*long*/ gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* gdkEvent) { |
240 | 2644 if (OS.GTK_VERSION >= OS.buildVERSION (2, 12, 0)) { |
2645 /* | |
2646 * Feature in GTK. Children of a shell will inherit and display the shell's | |
2647 * tooltip if they do not have a tooltip of their own. The fix is to use the | |
2648 * new tooltip API in GTK 2.12 to null the shell's tooltip when the control | |
2649 * being entered does not have any tooltip text set. | |
2650 */ | |
2651 char* buffer = null; | |
2652 if (toolTipText !is null && toolTipText.length !is 0) { | |
2653 char [] chars = fixMnemonic (toolTipText, false); | |
255
5a30aa9820f3
removed tango.stdc.stringz imports and allow null for arrays and string arguments.
Frank Benoit <benoit@tionex.de>
parents:
240
diff
changeset
|
2654 buffer = toStringz(chars); |
240 | 2655 } |
2656 auto toolHandle = getShell().handle; | |
2657 OS.gtk_widget_set_tooltip_text (toolHandle, buffer); | |
2658 } | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2659 if (display.currentControl is this) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2660 if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2661 if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2662 if (display.currentControl !is null && !display.currentControl.isDisposed ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2663 display.removeMouseHoverTimeout (display.currentControl.handle); |
71 | 2664 display.currentControl.sendMouseEvent (DWT.MouseExit, 0, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2665 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2666 if (!isDisposed ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2667 display.currentControl = this; |
71 | 2668 return sendMouseEvent (DWT.MouseEnter, 0, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2669 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2670 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2671 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2672 |
37 | 2673 override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2674 switch (cast(int)gdkEvent.type) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2675 case OS.GDK_BUTTON_PRESS: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2676 if (widget !is eventHandle ()) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2677 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2678 * Pop up the context menu in the event_after signal to allow |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2679 * the widget to process the button press. This allows widgets |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2680 * such as GtkTreeView to select items before a menu is shown. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2681 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2682 if ((state & MENU) is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2683 GdkEventButton* gdkEventButton = cast(GdkEventButton*)gdkEvent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2684 if (gdkEventButton.button is 3) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2685 showMenu (cast(int) gdkEventButton.x_root, cast(int) gdkEventButton.y_root); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2686 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2687 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2688 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2689 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2690 case OS.GDK_FOCUS_CHANGE: { |
240 | 2691 if (!isFocusHandle (widget)) break; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2692 GdkEventFocus* gdkEventFocus = cast(GdkEventFocus*)gdkEvent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2693 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2694 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2695 * Feature in GTK. The GTK combo box popup under some window managers |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2696 * is implemented as a GTK_MENU. When it pops up, it causes the combo |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2697 * box to lose focus when focus is received for the menu. The |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2698 * fix is to check the current grab handle and see if it is a GTK_MENU |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2699 * and ignore the focus event when the menu is both shown and hidden. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2700 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2701 Display display = this.display; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2702 if (gdkEventFocus.in_ !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2703 if (display.ignoreFocus) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2704 display.ignoreFocus = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2705 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2706 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2707 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2708 display.ignoreFocus = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2709 auto grabHandle = OS.gtk_grab_get_current (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2710 if (grabHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2711 if (OS.G_OBJECT_TYPE ( cast(GTypeInstance*)grabHandle) is OS.GTK_TYPE_MENU ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2712 display.ignoreFocus = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2713 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2714 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2715 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2716 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2717 |
71 | 2718 sendFocusEvent (gdkEventFocus.in_ !is 0 ? DWT.FocusIn : DWT.FocusOut); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2719 break; |
54 | 2720 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2721 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2722 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2723 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2724 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2725 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2726 override int /*long*/ gtk_expose_event (GtkWidget* widget, GdkEventExpose* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2727 if ((state & OBSCURED) !is 0) return 0; |
71 | 2728 if (!hooks (DWT.Paint) && !filters (DWT.Paint)) return 0; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2729 Event event = new Event (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2730 event.count = gdkEvent.count; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2731 event.x = gdkEvent.area.x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2732 event.y = gdkEvent.area.y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2733 event.width = gdkEvent.area.width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2734 event.height = gdkEvent.area.height; |
240 | 2735 if ((style & DWT.MIRRORED) !is 0) event.x = getClientWidth () - event.width - event.x; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2736 GCData data = new GCData (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2737 data.damageRgn = gdkEvent.region; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2738 GC gc = event.gc = GC.gtk_new (this, data); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2739 OS.gdk_gc_set_clip_region (gc.handle, gdkEvent.region); |
71 | 2740 sendEvent (DWT.Paint, event); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2741 gc.dispose (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2742 event.gc = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2743 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2744 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2745 |
38 | 2746 override int /*long*/ gtk_focus (GtkWidget* widget, int directionType) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2747 /* Stop GTK traversal for every widget */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2748 return 1; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2749 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2750 |
37 | 2751 override int /*long*/ gtk_focus_in_event (GtkWidget* widget, GdkEventFocus* event) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2752 // widget could be disposed at this point |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2753 if (handle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2754 Control oldControl = display.imControl; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2755 if (oldControl !is this) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2756 if (oldControl !is null && !oldControl.isDisposed ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2757 auto oldIMHandle = oldControl.imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2758 if (oldIMHandle !is null) OS.gtk_im_context_reset (oldIMHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2759 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2760 } |
71 | 2761 if (hooks (DWT.KeyDown) || hooks (DWT.KeyUp)) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2762 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2763 if (imHandle !is null) OS.gtk_im_context_focus_in (imHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2764 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2765 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2766 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2767 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2768 |
37 | 2769 override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2770 // widget could be disposed at this point |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2771 if (handle !is null) { |
71 | 2772 if (hooks (DWT.KeyDown) || hooks (DWT.KeyUp)) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2773 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2774 if (imHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2775 OS.gtk_im_context_focus_out (imHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2776 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2777 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2778 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2779 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2780 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2781 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2782 override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2783 if (!hasFocus ()) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2784 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2785 if (translateMnemonic (gdkEvent.keyval, gdkEvent)) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2786 // widget could be disposed at this point |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2787 if (isDisposed ()) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2788 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2789 if (filterKey (gdkEvent.keyval, gdkEvent)) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2790 // widget could be disposed at this point |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2791 if (isDisposed ()) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2792 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2793 if (translateTraversal (gdkEvent)) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2794 // widget could be disposed at this point |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2795 if (isDisposed ()) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2796 return super.gtk_key_press_event (widget, gdkEvent); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2797 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2798 |
37 | 2799 override int /*long*/ gtk_key_release_event (GtkWidget* widget, GdkEventKey* event) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2800 if (!hasFocus ()) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2801 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2802 if (imHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2803 if (OS.gtk_im_context_filter_keypress (imHandle, event)) return 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2804 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2805 return super.gtk_key_release_event (widget, event); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2806 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2807 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2808 override int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2809 if (display.currentControl !is this) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2810 display.removeMouseHoverTimeout (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2811 int result = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2812 if (sendLeaveNotify () || display.getCursorControl () is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2813 if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2814 if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0; |
71 | 2815 result = sendMouseEvent (DWT.MouseExit, 0, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2816 display.currentControl = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2817 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2818 return result; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2819 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2820 |
37 | 2821 override int /*long*/ gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2822 int result = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2823 auto eventPtr = OS.gtk_get_current_event (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2824 if (eventPtr !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2825 GdkEventKey* keyEvent = cast(GdkEventKey*)eventPtr; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2826 if (keyEvent.type is OS.GDK_KEY_PRESS) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2827 Control focusControl = display.getFocusControl (); |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2828 auto focusHandle_ = focusControl !is null ? focusControl.focusHandle () : null; |
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2829 if (focusHandle_ !is null) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2830 display.mnemonicControl = this; |
158
de2578a843a7
Tango update to rev 3158, TracedException>Exception, fromUtf8z>fromStringz,Fix Bug in MenuItem Thanx to nascent for the report.
Frank Benoit <benoit@tionex.de>
parents:
152
diff
changeset
|
2831 OS.gtk_widget_event (focusHandle_, eventPtr); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2832 display.mnemonicControl = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2833 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2834 result = 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2835 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2836 OS.gdk_event_free (eventPtr); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2837 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2838 return result; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2839 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2840 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2841 override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* gdkEvent) { |
71 | 2842 if (this is display.currentControl && (hooks (DWT.MouseHover) || filters (DWT.MouseHover))) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2843 display.addMouseHoverTimeout (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2844 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2845 double x = gdkEvent.x_root, y = gdkEvent.y_root; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2846 int state = gdkEvent.state; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2847 if (gdkEvent.is_hint !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2848 int pointer_x, pointer_y; |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
30
diff
changeset
|
2849 int mask; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2850 auto window = eventWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2851 OS.gdk_window_get_pointer (window, &pointer_x, &pointer_y, &mask); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2852 x = pointer_x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2853 y = pointer_y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2854 state = mask; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2855 } |
71 | 2856 int result = sendMouseEvent (DWT.MouseMove, 0, gdkEvent.time, x, y, gdkEvent.is_hint !is 0, state) ? 0 : 1; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2857 return result; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2858 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2859 |
37 | 2860 override int /*long*/ gtk_popup_menu (GtkWidget* widget) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2861 if (!hasFocus()) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2862 int x, y ; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2863 OS.gdk_window_get_pointer (null, &x, &y, null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2864 return showMenu (x, y) ? 1 : 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2865 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2866 |
37 | 2867 override int /*long*/ gtk_preedit_changed (GtkIMContext* imcontext) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2868 display.showIMWindow (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2869 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2870 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2871 |
37 | 2872 override int /*long*/ gtk_realize (GtkWidget* widget) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2873 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2874 if (imHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2875 auto window = OS.GTK_WIDGET_WINDOW (paintHandle ()); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2876 OS.gtk_im_context_set_client_window (imHandle, window); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2877 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2878 if (backgroundImage !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2879 auto window = OS.GTK_WIDGET_WINDOW (paintHandle ()); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2880 if (window !is null) OS.gdk_window_set_back_pixmap (window, cast(GdkPixmap*)backgroundImage.pixmap, false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2881 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2882 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2883 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2884 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2885 override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2886 switch (cast(int)gdkEvent.direction) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2887 case OS.GDK_SCROLL_UP: |
71 | 2888 return sendMouseEvent (DWT.MouseWheel, 0, 3, DWT.SCROLL_LINE, true, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2889 case OS.GDK_SCROLL_DOWN: |
71 | 2890 return sendMouseEvent (DWT.MouseWheel, 0, -3, DWT.SCROLL_LINE, true, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2891 case OS.GDK_SCROLL_LEFT: |
71 | 2892 return sendMouseEvent (DWT.MouseDown, 4, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2893 case OS.GDK_SCROLL_RIGHT: |
71 | 2894 return sendMouseEvent (DWT.MouseDown, 5, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1; |
54 | 2895 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2896 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2897 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2898 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2899 |
37 | 2900 override int /*long*/ gtk_show_help (GtkWidget* widget, int /*long*/ helpType) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2901 if (!hasFocus ()) return 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2902 return sendHelpEvent (helpType) ? 1 : 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2903 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2904 |
37 | 2905 override int /*long*/ gtk_style_set (GtkWidget* widget, int /*long*/ previousStyle) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2906 if (backgroundImage !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2907 setBackgroundPixmap (backgroundImage.pixmap); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2908 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2909 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2910 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2911 |
37 | 2912 override int /*long*/ gtk_unrealize (GtkWidget* widget) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2913 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2914 if (imHandle !is null) OS.gtk_im_context_set_client_window (imHandle, null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2915 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2916 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2917 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
2918 override int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, GdkEventVisibility* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2919 auto paintWindow = paintWindow(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2920 auto window = gdkEvent.window; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2921 if (window is paintWindow) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2922 if (gdkEvent.state is OS.GDK_VISIBILITY_FULLY_OBSCURED) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2923 state |= OBSCURED; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2924 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2925 if ((state & OBSCURED) !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2926 int width, height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2927 OS.gdk_drawable_get_size (cast(GdkDrawable*)window, &width, &height); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2928 GdkRectangle rect; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2929 rect.width = width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2930 rect.height = height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2931 OS.gdk_window_invalidate_rect (window, &rect, false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2932 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2933 state &= ~OBSCURED; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2934 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2935 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2936 return 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2937 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2938 |
37 | 2939 /*no override*/ void gtk_widget_size_request (GtkWidget* widget, GtkRequisition* requisition) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2940 OS.gtk_widget_size_request (widget, requisition); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2941 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2942 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2943 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2944 * Invokes platform specific functionality to allocate a new GC handle. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2945 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2946 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2947 * API for <code>Control</code>. It is marked public only so that it |
71 | 2948 * can be shared within the packages provided by DWT. It is not |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2949 * available on all platforms, and should never be called from |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2950 * application code. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2951 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2952 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2953 * @param data the platform specific GC data |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2954 * @return the platform specific GC handle |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2955 */ |
30 | 2956 public GdkGC* internal_new_GC (GCData data) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2957 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2958 auto window = paintWindow (); |
71 | 2959 if (window is null) DWT.error (DWT.ERROR_NO_HANDLES); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2960 auto gdkGC = OS.gdk_gc_new (cast(GdkDrawable*)window); |
71 | 2961 if (gdkGC is null) error (DWT.ERROR_NO_HANDLES); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2962 if (data !is null) { |
71 | 2963 int mask = DWT.LEFT_TO_RIGHT | DWT.RIGHT_TO_LEFT; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2964 if ((data.style & mask) is 0) { |
71 | 2965 data.style |= style & (mask | DWT.MIRRORED); |
240 | 2966 } else { |
2967 if ((data.style & DWT.RIGHT_TO_LEFT) !is 0) { | |
2968 data.style |= DWT.MIRRORED; | |
2969 } | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2970 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2971 data.drawable = cast(GdkDrawable*)window; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2972 data.device = display; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2973 data.foreground = getForegroundColor (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2974 Control control = findBackgroundControl (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2975 if (control is null) control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2976 data.background = control.getBackgroundColor (); |
240 | 2977 data.font = font !is null ? font : defaultFont (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2978 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2979 return gdkGC; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2980 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2981 |
30 | 2982 GtkIMContext* imHandle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
2983 return null; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2984 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2985 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2986 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2987 * Invokes platform specific functionality to dispose a GC handle. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2988 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2989 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2990 * API for <code>Control</code>. It is marked public only so that it |
71 | 2991 * can be shared within the packages provided by DWT. It is not |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2992 * available on all platforms, and should never be called from |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2993 * application code. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2994 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2995 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2996 * @param hDC the platform specific GC handle |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2997 * @param data the platform specific GC data |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2998 */ |
30 | 2999 public void internal_dispose_GC (GdkGC* gdkGC, GCData data) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3000 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3001 OS.g_object_unref (gdkGC); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3002 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3003 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3004 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3005 * Returns <code>true</code> if the underlying operating |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3006 * system supports this reparenting, otherwise <code>false</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3007 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3008 * @return <code>true</code> if the widget can be reparented, otherwise <code>false</code> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3009 * |
71 | 3010 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3011 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3012 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3013 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3014 */ |
30 | 3015 public bool isReparentable () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3016 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3017 return true; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3018 } |
30 | 3019 bool isShowing () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3020 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3021 * This is not complete. Need to check if the |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3022 * widget is obscurred by a parent or sibling. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3023 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3024 if (!isVisible ()) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3025 Control control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3026 while (control !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3027 Point size = control.getSize (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3028 if (size.x is 0 || size.y is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3029 return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3030 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3031 control = control.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3032 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3033 return true; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3034 } |
30 | 3035 bool isTabGroup () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3036 Control [] tabList = parent._getTabList (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3037 if (tabList !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3038 for (int i=0; i<tabList.length; i++) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3039 if (tabList [i] is this) return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3040 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3041 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3042 int code = traversalCode (0, null); |
71 | 3043 if ((code & (DWT.TRAVERSE_ARROW_PREVIOUS | DWT.TRAVERSE_ARROW_NEXT)) !is 0) return false; |
3044 return (code & (DWT.TRAVERSE_TAB_PREVIOUS | DWT.TRAVERSE_TAB_NEXT)) !is 0; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3045 } |
30 | 3046 bool isTabItem () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3047 Control [] tabList = parent._getTabList (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3048 if (tabList !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3049 for (int i=0; i<tabList.length; i++) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3050 if (tabList [i] is this) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3051 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3052 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3053 int code = traversalCode (0, null); |
71 | 3054 return (code & (DWT.TRAVERSE_ARROW_PREVIOUS | DWT.TRAVERSE_ARROW_NEXT)) !is 0; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3055 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3056 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3057 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3058 * Returns <code>true</code> if the receiver is enabled and all |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3059 * ancestors up to and including the receiver's nearest ancestor |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3060 * shell are enabled. Otherwise, <code>false</code> is returned. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3061 * A disabled control is typically not selectable from the user |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3062 * interface and draws with an inactive or "grayed" look. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3063 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3064 * @return the receiver's enabled state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3065 * |
71 | 3066 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3067 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3068 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3069 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3070 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3071 * @see #getEnabled |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3072 */ |
30 | 3073 public bool isEnabled () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3074 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3075 return getEnabled () && parent.isEnabled (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3076 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3077 |
30 | 3078 bool isFocusAncestor (Control control) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3079 while (control !is null && control !is this && !( null !is cast(Shell)control )) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3080 control = control.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3081 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3082 return control is this; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3083 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3084 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3085 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3086 * Returns <code>true</code> if the receiver has the user-interface |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3087 * focus, and <code>false</code> otherwise. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3088 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3089 * @return the receiver's focus state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3090 * |
71 | 3091 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3092 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3093 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3094 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3095 */ |
30 | 3096 public bool isFocusControl () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3097 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3098 Control focusControl = display.focusControl; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3099 if (focusControl !is null && !focusControl.isDisposed ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3100 return this is focusControl; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3101 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3102 return hasFocus (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3103 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3104 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3105 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3106 * Returns <code>true</code> if the receiver is visible and all |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3107 * ancestors up to and including the receiver's nearest ancestor |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3108 * shell are visible. Otherwise, <code>false</code> is returned. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3109 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3110 * @return the receiver's visibility state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3111 * |
71 | 3112 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3113 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3114 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3115 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3116 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3117 * @see #getVisible |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3118 */ |
30 | 3119 public bool isVisible () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3120 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3121 return getVisible () && parent.isVisible (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3122 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3123 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3124 Decorations menuShell () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3125 return parent.menuShell (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3126 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3127 |
152
17f8449522fd
overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents:
150
diff
changeset
|
3128 bool mnemonicHit (wchar key) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3129 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3130 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3131 |
152
17f8449522fd
overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents:
150
diff
changeset
|
3132 bool mnemonicMatch (wchar key) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3133 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3134 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3135 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3136 override void register () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3137 super.register (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3138 if (fixedHandle !is null) display.addWidget (fixedHandle, this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3139 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3140 if (imHandle !is null) display.addWidget (cast(GtkWidget*)imHandle, this); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3141 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3142 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3143 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3144 * Causes the entire bounds of the receiver to be marked |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3145 * as needing to be redrawn. The next time a paint request |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3146 * is processed, the control will be completely painted, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3147 * including the background. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3148 * |
71 | 3149 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3150 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3151 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3152 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3153 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3154 * @see #update() |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3155 * @see PaintListener |
71 | 3156 * @see DWT#Paint |
3157 * @see DWT#NO_BACKGROUND | |
3158 * @see DWT#NO_REDRAW_RESIZE | |
3159 * @see DWT#NO_MERGE_PAINTS | |
3160 * @see DWT#DOUBLE_BUFFERED | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3161 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3162 public void redraw () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3163 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3164 redraw (false); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3165 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3166 |
30 | 3167 void redraw (bool all) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3168 // checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3169 if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3170 redrawWidget (0, 0, 0, 0, true, all, false); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3171 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3172 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3173 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3174 * Causes the rectangular area of the receiver specified by |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3175 * the arguments to be marked as needing to be redrawn. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3176 * The next time a paint request is processed, that area of |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3177 * the receiver will be painted, including the background. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3178 * If the <code>all</code> flag is <code>true</code>, any |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3179 * children of the receiver which intersect with the specified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3180 * area will also paint their intersecting areas. If the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3181 * <code>all</code> flag is <code>false</code>, the children |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3182 * will not be painted. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3183 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3184 * @param x the x coordinate of the area to draw |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3185 * @param y the y coordinate of the area to draw |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3186 * @param width the width of the area to draw |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3187 * @param height the height of the area to draw |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3188 * @param all <code>true</code> if children should redraw, and <code>false</code> otherwise |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3189 * |
71 | 3190 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3191 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3192 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3193 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3194 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3195 * @see #update() |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3196 * @see PaintListener |
71 | 3197 * @see DWT#Paint |
3198 * @see DWT#NO_BACKGROUND | |
3199 * @see DWT#NO_REDRAW_RESIZE | |
3200 * @see DWT#NO_MERGE_PAINTS | |
3201 * @see DWT#DOUBLE_BUFFERED | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3202 */ |
30 | 3203 public void redraw (int x, int y, int width, int height, bool all) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3204 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3205 if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return; |
240 | 3206 if ((style & DWT.MIRRORED) !is 0) x = getClientWidth () - width - x; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3207 redrawWidget (x, y, width, height, false, all, false); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3208 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3209 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3210 void redrawChildren () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3211 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3212 |
30 | 3213 void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3214 if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3215 auto window = paintWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3216 GdkRectangle rect; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3217 if (redrawAll) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3218 int w, h; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3219 OS.gdk_drawable_get_size (cast(GdkDrawable*)window, &w, &h); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3220 rect.width = w; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3221 rect.height = h; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3222 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3223 rect.x = x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3224 rect.y = y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3225 rect.width = width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3226 rect.height = height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3227 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3228 OS.gdk_window_invalidate_rect (window, &rect, all); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3229 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3230 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3231 override void release (bool destroy) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3232 Control next = null, previous = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3233 if (destroy && parent !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3234 Control[] children = parent._getChildren (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3235 int index = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3236 while (index < children.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3237 if (children [index] is this) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3238 index++; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3239 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3240 if (0 < index && (index + 1) < children.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3241 next = children [index + 1]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3242 previous = children [index - 1]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3243 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3244 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3245 super.release (destroy); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3246 if (destroy) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3247 if (previous !is null) previous.addRelation (next); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3248 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3249 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3250 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3251 override void releaseHandle () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3252 super.releaseHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3253 fixedHandle = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3254 parent = null; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3255 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3256 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3257 override void releaseParent () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3258 parent.removeControl (this); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3259 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3260 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3261 override void releaseWidget () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3262 super.releaseWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3263 if (display.currentControl is this) display.currentControl = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3264 display.removeMouseHoverTimeout (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3265 auto imHandle = imHandle (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3266 if (imHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3267 OS.gtk_im_context_reset (imHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3268 OS.gtk_im_context_set_client_window (imHandle, null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3269 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3270 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3271 OS.gdk_window_set_user_data (enableWindow, null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3272 OS.gdk_window_destroy (enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3273 enableWindow = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3274 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3275 redrawWindow = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3276 if (menu !is null && !menu.isDisposed ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3277 menu.dispose (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3278 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3279 menu = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3280 cursor = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3281 toolTipText = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3282 layoutData = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3283 accessible = null; |
240 | 3284 region = null; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3285 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3286 |
30 | 3287 bool sendDragEvent (int button, int stateMask, int x, int y, bool isStateMask) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3288 Event event = new Event (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3289 event.button = button; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3290 event.x = x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3291 event.y = y; |
240 | 3292 if ((style & DWT.MIRRORED) !is 0) event.x = getClientWidth () - event.x; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3293 if (isStateMask) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3294 event.stateMask = stateMask; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3295 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3296 setInputState (event, stateMask); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3297 } |
71 | 3298 postEvent (DWT.DragDetect, event); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3299 if (isDisposed ()) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3300 return event.doit; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3301 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3302 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3303 void sendFocusEvent (int type) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3304 Shell shell = _getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3305 Display display = this.display; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3306 display.focusControl = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3307 display.focusEvent = type; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3308 sendEvent (type); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3309 display.focusControl = null; |
71 | 3310 display.focusEvent = DWT.None; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3311 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3312 * It is possible that the shell may be |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3313 * disposed at this point. If this happens |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3314 * don't send the activate and deactivate |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3315 * events. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3316 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3317 if (!shell.isDisposed ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3318 switch (type) { |
71 | 3319 case DWT.FocusIn: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3320 shell.setActiveControl (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3321 break; |
71 | 3322 case DWT.FocusOut: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3323 if (shell !is display.activeShell) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3324 shell.setActiveControl (null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3325 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3326 break; |
54 | 3327 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3328 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3329 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3330 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3331 |
30 | 3332 bool sendHelpEvent (int /*long*/ helpType) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3333 Control control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3334 while (control !is null) { |
71 | 3335 if (control.hooks (DWT.Help)) { |
3336 control.postEvent (DWT.Help); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3337 return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3338 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3339 control = control.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3340 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3341 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3342 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3343 |
30 | 3344 bool sendLeaveNotify() { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3345 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3346 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3347 |
30 | 3348 bool sendMouseEvent (int type, int button, int time, double x, double y, bool is_hint, int state) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3349 return sendMouseEvent (type, button, 0, 0, false, time, x, y, is_hint, state); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3350 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3351 |
30 | 3352 bool sendMouseEvent (int type, int button, int count, int detail, bool send, int time, double x, double y, bool is_hint, int state) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3353 if (!hooks (type) && !filters (type)) return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3354 Event event = new Event (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3355 event.time = time; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3356 event.button = button; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3357 event.detail = detail; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3358 event.count = count; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3359 if (is_hint) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3360 event.x = cast(int)x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3361 event.y = cast(int)y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3362 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3363 auto window = eventWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3364 int origin_x, origin_y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3365 OS.gdk_window_get_origin (window, &origin_x, &origin_y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3366 event.x = cast(int)x - origin_x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3367 event.y = cast(int)y - origin_y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3368 } |
240 | 3369 if ((style & DWT.MIRRORED) !is 0) event.x = getClientWidth () - event.x; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3370 setInputState (event, state); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3371 if (send) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3372 sendEvent (type, event); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3373 if (isDisposed ()) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3374 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3375 postEvent (type, event); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3376 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3377 return event.doit; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3378 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3379 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3380 void setBackground () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3381 if ((state & PARENT_BACKGROUND) !is 0 && (state & BACKGROUND) is 0 && backgroundImage is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3382 setParentBackground (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3383 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3384 setWidgetBackground (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3385 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3386 redrawWidget (0, 0, 0, 0, true, false, false); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3387 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3388 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3389 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3390 * Sets the receiver's background color to the color specified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3391 * by the argument, or to the default system color for the control |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3392 * if the argument is null. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3393 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3394 * Note: This operation is a hint and may be overridden by the platform. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3395 * For example, on Windows the background of a Button cannot be changed. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3396 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3397 * @param color the new color (or null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3398 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3399 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3400 * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3401 * </ul> |
71 | 3402 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3403 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3404 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3405 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3406 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3407 public void setBackground (Color color) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3408 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3409 if (((state & BACKGROUND) is 0) && color is null) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3410 GdkColor* gdkColor = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3411 if (color !is null) { |
71 | 3412 if (color.isDisposed ()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3413 gdkColor = color.handle; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3414 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3415 bool set = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3416 if (gdkColor is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3417 auto style = OS.gtk_widget_get_modifier_style (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3418 set = (OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL) & OS.GTK_RC_BG) !is 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3419 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3420 GdkColor* oldColor = getBackgroundColor (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3421 set = oldColor.pixel !is gdkColor.pixel; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3422 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3423 if (set) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3424 if (color is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3425 state &= ~BACKGROUND; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3426 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3427 state |= BACKGROUND; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3428 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3429 setBackgroundColor (gdkColor); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3430 redrawChildren (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3431 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3432 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3433 |
30 | 3434 void setBackgroundColor (GtkWidget* handle, GdkColor* color) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3435 int index = OS.GTK_STATE_NORMAL; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3436 auto style = OS.gtk_widget_get_modifier_style (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3437 auto ptr = OS.gtk_rc_style_get_bg_pixmap_name (style, index); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3438 if (ptr !is null) OS.g_free (ptr); |
238 | 3439 String name = color is null ? "<parent>" : "<none>" ; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3440 ptr = cast(char*)OS.g_malloc (name.length+1); |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3441 ptr[ 0 .. name.length ] = name; |
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3442 ptr[ name.length ] = '\0'; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3443 OS.gtk_rc_style_set_bg_pixmap_name (style, index, ptr); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3444 OS.gtk_rc_style_set_bg (style, index, color); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3445 int flags = OS.gtk_rc_style_get_color_flags (style, index); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3446 flags = (color is null) ? flags & ~OS.GTK_RC_BG : flags | OS.GTK_RC_BG; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3447 OS.gtk_rc_style_set_color_flags (style, index, flags); |
240 | 3448 modifyStyle (handle, style); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3449 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3450 |
30 | 3451 void setBackgroundColor (GdkColor* color) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3452 setBackgroundColor (handle, color); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3453 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3454 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3455 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3456 * Sets the receiver's background image to the image specified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3457 * by the argument, or to the default system color for the control |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3458 * if the argument is null. The background image is tiled to fill |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3459 * the available space. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3460 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3461 * Note: This operation is a hint and may be overridden by the platform. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3462 * For example, on Windows the background of a Button cannot be changed. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3463 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3464 * @param image the new image (or null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3465 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3466 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3467 * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3468 * <li>ERROR_INVALID_ARGUMENT - if the argument is not a bitmap</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3469 * </ul> |
71 | 3470 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3471 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3472 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3473 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3474 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3475 * @since 3.2 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3476 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3477 public void setBackgroundImage (Image image) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3478 checkWidget (); |
71 | 3479 if (image !is null && image.isDisposed ()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3480 if (image is backgroundImage) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3481 this.backgroundImage = image; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3482 if (backgroundImage !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3483 setBackgroundPixmap (backgroundImage.pixmap); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3484 redrawWidget (0, 0, 0, 0, true, false, false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3485 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3486 setWidgetBackground (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3487 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3488 redrawChildren (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3489 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3490 |
30 | 3491 void setBackgroundPixmap (GdkDrawable* pixmap) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3492 auto window = OS.GTK_WIDGET_WINDOW (paintHandle ()); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3493 if (window !is null) OS.gdk_window_set_back_pixmap (window, cast(GdkPixmap*)backgroundImage.pixmap, false); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3494 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3495 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3496 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3497 * If the argument is <code>true</code>, causes the receiver to have |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3498 * all mouse events delivered to it until the method is called with |
259 | 3499 * <code>false</code> as the argument. Note that on some platforms, |
3500 * a mouse button must currently be down for capture to be assigned. | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3501 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3502 * @param capture <code>true</code> to capture the mouse, and <code>false</code> to release it |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3503 * |
71 | 3504 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3505 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3506 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3507 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3508 */ |
30 | 3509 public void setCapture (bool capture) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3510 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3511 /* FIXME !!!!! */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3512 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3513 if (capture) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3514 OS.gtk_widget_grab_focus (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3515 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3516 OS.gtk_widget_grab_default (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3517 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3518 */ |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3519 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3520 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3521 * Sets the receiver's cursor to the cursor specified by the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3522 * argument, or to the default cursor for that kind of control |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3523 * if the argument is null. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3524 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3525 * When the mouse pointer passes over a control its appearance |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3526 * is changed to match the control's cursor. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3527 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3528 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3529 * @param cursor the new cursor (or null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3530 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3531 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3532 * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3533 * </ul> |
71 | 3534 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3535 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3536 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3537 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3538 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3539 public void setCursor (Cursor cursor) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3540 checkWidget(); |
71 | 3541 if (cursor !is null && cursor.isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3542 this.cursor = cursor; |
113
1401263f71b0
renamed setCursor(Gtk..) to gtk_setCursor, so the public interface do not need a cast for passing null
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
3543 gtk_setCursor (cursor !is null ? cursor.handle : null); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3544 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3545 |
113
1401263f71b0
renamed setCursor(Gtk..) to gtk_setCursor, so the public interface do not need a cast for passing null
Frank Benoit <benoit@tionex.de>
parents:
72
diff
changeset
|
3546 void gtk_setCursor (GdkCursor* cursor) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3547 auto window = eventWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3548 if (window !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3549 OS.gdk_window_set_cursor (window, cursor); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3550 if (!OS.GDK_WINDOWING_X11 ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3551 OS.gdk_flush (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3552 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3553 auto xDisplay = OS.GDK_DISPLAY (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3554 OS.XFlush (xDisplay); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3555 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3556 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3557 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3558 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3559 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3560 * Sets the receiver's drag detect state. If the argument is |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3561 * <code>true</code>, the receiver will detect drag gestures, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3562 * otherwise these gestures will be ignored. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3563 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3564 * @param dragDetect the new drag detect state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3565 * |
71 | 3566 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3567 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3568 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3569 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3570 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3571 * @since 3.3 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3572 */ |
30 | 3573 public void setDragDetect (bool dragDetect) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3574 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3575 if (dragDetect) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3576 state |= DRAG_DETECT; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3577 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3578 state &= ~DRAG_DETECT; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3579 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3580 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3581 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3582 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3583 * Enables the receiver if the argument is <code>true</code>, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3584 * and disables it otherwise. A disabled control is typically |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3585 * not selectable from the user interface and draws with an |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3586 * inactive or "grayed" look. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3587 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3588 * @param enabled the new enabled state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3589 * |
71 | 3590 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3591 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3592 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3593 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3594 */ |
30 | 3595 public void setEnabled (bool enabled) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3596 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3597 if (((state & DISABLED) is 0) is enabled) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3598 Control control = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3599 bool fixFocus_ = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3600 if (!enabled) { |
71 | 3601 if (display.focusEvent !is DWT.FocusOut) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3602 control = display.getFocusControl (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3603 fixFocus_ = isFocusAncestor (control); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3604 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3605 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3606 if (enabled) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3607 state &= ~DISABLED; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3608 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3609 state |= DISABLED; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3610 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3611 enableWidget (enabled); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3612 if (isDisposed ()) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3613 if (enabled) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3614 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3615 OS.gdk_window_set_user_data (enableWindow, null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3616 OS.gdk_window_destroy (enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3617 enableWindow = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3618 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3619 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3620 OS.gtk_widget_realize (handle); |
240 | 3621 auto parentHandle = parent.eventHandle (); |
3622 auto window = parent.eventWindow(); | |
259 | 3623 auto topHandle_ = topHandle (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3624 GdkWindowAttr attributes; |
259 | 3625 attributes.x = OS.GTK_WIDGET_X (topHandle_); |
3626 attributes.y = OS.GTK_WIDGET_Y (topHandle_); | |
3627 attributes.width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_); | |
3628 attributes.height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3629 attributes.event_mask = (0xFFFFFFFF & ~OS.ExposureMask); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3630 attributes.wclass = OS.GDK_INPUT_ONLY; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3631 attributes.window_type = OS.GDK_WINDOW_CHILD; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3632 enableWindow = OS.gdk_window_new (window, &attributes, OS.GDK_WA_X | OS.GDK_WA_Y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3633 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3634 OS.gdk_window_set_user_data (enableWindow, parentHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3635 if (!OS.GDK_WINDOWING_X11 ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3636 OS.gdk_window_raise (enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3637 } else { |
240 | 3638 auto topWindow = OS.GTK_WIDGET_WINDOW (topHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3639 auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (cast(GdkDrawable*)topWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3640 auto xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3641 int xScreen = OS.XDefaultScreen (xDisplay); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3642 int flags = OS.CWStackMode | OS.CWSibling; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3643 XWindowChanges changes; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3644 changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)topWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3645 changes.stack_mode = OS.Above; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3646 OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3647 } |
240 | 3648 if (OS.GTK_WIDGET_VISIBLE (topHandle_)) OS.gdk_window_show_unraised (enableWindow); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3649 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3650 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3651 if (fixFocus_) fixFocus (control); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3652 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3653 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3654 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3655 * Causes the receiver to have the <em>keyboard focus</em>, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3656 * such that all keyboard events will be delivered to it. Focus |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3657 * reassignment will respect applicable platform constraints. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3658 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3659 * @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3660 * |
71 | 3661 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3662 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3663 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3664 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3665 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3666 * @see #forceFocus |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3667 */ |
30 | 3668 public bool setFocus () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3669 checkWidget(); |
71 | 3670 if ((style & DWT.NO_FOCUS) !is 0) return false; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3671 return forceFocus (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3672 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3673 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3674 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3675 * Sets the font that the receiver will use to paint textual information |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3676 * to the font specified by the argument, or to the default font for that |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3677 * kind of control if the argument is null. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3678 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3679 * @param font the new font (or null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3680 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3681 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3682 * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3683 * </ul> |
71 | 3684 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3685 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3686 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3687 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3688 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3689 public void setFont (Font font) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3690 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3691 if (((state & FONT) is 0) && font is null) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3692 this.font = font; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3693 PangoFontDescription* fontDesc; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3694 if (font is null) { |
240 | 3695 fontDesc = defaultFont ().handle; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3696 } else { |
71 | 3697 if (font.isDisposed ()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3698 fontDesc = font.handle; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3699 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3700 if (font is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3701 state &= ~FONT; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3702 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3703 state |= FONT; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3704 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3705 setFontDescription (fontDesc); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3706 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3707 |
30 | 3708 void setFontDescription (PangoFontDescription* font) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3709 OS.gtk_widget_modify_font (handle, font); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3710 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3711 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3712 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3713 * Sets the receiver's foreground color to the color specified |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3714 * by the argument, or to the default system color for the control |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3715 * if the argument is null. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3716 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3717 * Note: This operation is a hint and may be overridden by the platform. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3718 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3719 * @param color the new color (or null) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3720 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3721 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3722 * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3723 * </ul> |
71 | 3724 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3725 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3726 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3727 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3728 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3729 public void setForeground (Color color) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3730 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3731 if (((state & FOREGROUND) is 0) && color is null) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3732 GdkColor* gdkColor = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3733 if (color !is null) { |
71 | 3734 if (color.isDisposed ()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3735 gdkColor = color.handle; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3736 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3737 bool set = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3738 if (gdkColor is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3739 auto style = OS.gtk_widget_get_modifier_style (handle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3740 set = (OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL) & OS.GTK_RC_FG) !is 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3741 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3742 GdkColor* oldColor = getForegroundColor (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3743 set = oldColor.pixel !is gdkColor.pixel; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3744 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3745 if (set) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3746 if (color is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3747 state &= ~FOREGROUND; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3748 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3749 state |= FOREGROUND; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3750 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3751 setForegroundColor (gdkColor); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3752 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3753 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3754 |
30 | 3755 void setForegroundColor (GdkColor* color) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3756 setForegroundColor (handle, color); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3757 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3758 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3759 void setInitialBounds () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3760 if ((state & ZERO_WIDTH) !is 0 && (state & ZERO_HEIGHT) !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3761 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3762 * Feature in GTK. On creation, each widget's allocation is |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3763 * initialized to a position of (-1, -1) until the widget is |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3764 * first sized. The fix is to set the value to (0, 0) as |
71 | 3765 * expected by DWT. |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3766 */ |
240 | 3767 auto topHandle_ = topHandle (); |
3768 if ((parent.style & DWT.MIRRORED) !is 0) { | |
3769 OS.GTK_WIDGET_SET_X (topHandle_, parent.getClientWidth ()); | |
3770 } else { | |
3771 OS.GTK_WIDGET_SET_X (topHandle_, 0); | |
3772 } | |
3773 OS.GTK_WIDGET_SET_Y (topHandle_, 0); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3774 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3775 resizeHandle (1, 1); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3776 forceResize (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3777 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3778 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3779 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3780 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3781 * Sets the receiver's pop up menu to the argument. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3782 * All controls may optionally have a pop up |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3783 * menu that is displayed when the user requests one for |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3784 * the control. The sequence of key strokes, button presses |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3785 * and/or button releases that are used to request a pop up |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3786 * menu is platform specific. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3787 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3788 * Note: Disposing of a control that has a pop up menu will |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3789 * dispose of the menu. To avoid this behavior, set the |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3790 * menu to null before the control is disposed. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3791 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3792 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3793 * @param menu the new pop up menu |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3794 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3795 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3796 * <li>ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3797 * <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3798 * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3799 * </ul> |
71 | 3800 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3801 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3802 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3803 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3804 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3805 public void setMenu (Menu menu) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3806 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3807 if (menu !is null) { |
71 | 3808 if ((menu.style & DWT.POP_UP) is 0) { |
3809 error (DWT.ERROR_MENU_NOT_POP_UP); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3810 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3811 if (menu.parent !is menuShell ()) { |
71 | 3812 error (DWT.ERROR_INVALID_PARENT); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3813 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3814 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3815 this.menu = menu; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3816 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3817 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
3818 override void setOrientation () { |
71 | 3819 if ((style & DWT.RIGHT_TO_LEFT) !is 0) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3820 if (handle !is null) OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3821 if (fixedHandle !is null) OS.gtk_widget_set_direction (fixedHandle, OS.GTK_TEXT_DIR_RTL); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3822 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3823 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3824 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3825 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3826 * Changes the parent of the widget to be the one provided if |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3827 * the underlying operating system supports this feature. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3828 * Returns <code>true</code> if the parent is successfully changed. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3829 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3830 * @param parent the new parent for the control. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3831 * @return <code>true</code> if the parent is changed and <code>false</code> otherwise. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3832 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3833 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3834 * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3835 * <li>ERROR_NULL_ARGUMENT - if the parent is <code>null</code></li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3836 * </ul> |
71 | 3837 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3838 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3839 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3840 * </ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3841 */ |
30 | 3842 public bool setParent (Composite parent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3843 checkWidget (); |
71 | 3844 if (parent is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); |
3845 if (parent.isDisposed()) DWT.error (DWT.ERROR_INVALID_ARGUMENT); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3846 if (this.parent is parent) return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3847 if (!isReparentable ()) return false; |
240 | 3848 auto topHandle_ = topHandle (); |
3849 int x = OS.GTK_WIDGET_X (topHandle_); | |
3850 int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_); | |
3851 if ((this.parent.style & DWT.MIRRORED) !is 0) { | |
3852 x = this.parent.getClientWidth () - width - x; | |
3853 } | |
3854 if ((parent.style & DWT.MIRRORED) !is 0) { | |
3855 x = parent.getClientWidth () - width - x; | |
3856 } | |
3857 int y = OS.GTK_WIDGET_Y (topHandle_); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3858 releaseParent (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3859 Shell newShell = parent.getShell (), oldShell = getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3860 Decorations newDecorations = parent.menuShell (), oldDecorations = menuShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3861 Menu [] menus = oldShell.findMenus (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3862 if (oldShell !is newShell || oldDecorations !is newDecorations) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3863 fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3864 newDecorations.fixAccelGroup (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3865 oldDecorations.fixAccelGroup (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3866 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3867 auto newParent = parent.parentingHandle(); |
240 | 3868 OS.gtk_widget_reparent (topHandle_, newParent); |
3869 OS.gtk_fixed_move (cast(GtkFixed*)newParent, topHandle_, x, y); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3870 this.parent = parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3871 setZOrder (null, false, true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3872 return true; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3873 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3874 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3875 void setParentBackground () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3876 setBackgroundColor (handle, null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3877 if (fixedHandle !is null) setBackgroundColor (fixedHandle, null); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3878 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3879 |
30 | 3880 void setParentWindow (GtkWidget* widget) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3881 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3882 |
30 | 3883 bool setRadioSelection (bool value) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3884 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3885 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3886 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3887 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3888 * If the argument is <code>false</code>, causes subsequent drawing |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3889 * operations in the receiver to be ignored. No drawing of any kind |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3890 * can occur in the receiver until the flag is set to true. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3891 * Graphics operations that occurred while the flag was |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3892 * <code>false</code> are lost. When the flag is set to <code>true</code>, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3893 * the entire widget is marked as needing to be redrawn. Nested calls |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3894 * to this method are stacked. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3895 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3896 * Note: This operation is a hint and may not be supported on some |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3897 * platforms or for some widgets. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3898 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3899 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3900 * @param redraw the new redraw state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3901 * |
71 | 3902 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3903 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3904 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3905 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3906 * |
30 | 3907 * @see #redraw(int, int, int, int, bool) |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3908 * @see #update() |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3909 */ |
30 | 3910 public void setRedraw (bool redraw) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3911 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3912 if (redraw) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3913 if (--drawCount is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3914 if (redrawWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3915 auto window = paintWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3916 /* Explicitly hiding the window avoids flicker on GTK+ >= 2.6 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3917 OS.gdk_window_hide (redrawWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3918 OS.gdk_window_destroy (redrawWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3919 OS.gdk_window_set_events (window, OS.gtk_widget_get_events (paintHandle ())); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3920 redrawWindow = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3921 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3922 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3923 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3924 if (drawCount++ is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3925 if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) !is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3926 auto window = paintWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3927 Rectangle rect = getBounds (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3928 GdkWindowAttr attributes; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3929 attributes.width = rect.width; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3930 attributes.height = rect.height; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3931 attributes.event_mask = OS.GDK_EXPOSURE_MASK; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3932 attributes.window_type = OS.GDK_WINDOW_CHILD; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3933 redrawWindow = OS.gdk_window_new (window, &attributes, 0); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3934 if (redrawWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3935 int mouseMask = OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK | |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3936 OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK | |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3937 OS.GDK_POINTER_MOTION_MASK | OS.GDK_POINTER_MOTION_HINT_MASK | |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3938 OS.GDK_BUTTON_MOTION_MASK | OS.GDK_BUTTON1_MOTION_MASK | |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3939 OS.GDK_BUTTON2_MOTION_MASK | OS.GDK_BUTTON3_MOTION_MASK; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3940 OS.gdk_window_set_events (window, OS.gdk_window_get_events (window) & ~mouseMask); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3941 OS.gdk_window_set_back_pixmap (redrawWindow, null, false); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3942 OS.gdk_window_show (redrawWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3943 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3944 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3945 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3946 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3947 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3948 |
30 | 3949 bool setTabGroupFocus (bool next) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3950 return setTabItemFocus (next); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3951 } |
30 | 3952 bool setTabItemFocus (bool next) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3953 if (!isShowing ()) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3954 return forceFocus (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3955 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3956 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3957 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3958 * Sets the receiver's tool tip text to the argument, which |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3959 * may be null indicating that no tool tip text should be shown. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3960 * |
30 | 3961 * @param str the new tool tip text (or null) |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3962 * |
71 | 3963 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3964 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3965 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3966 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3967 */ |
238 | 3968 public void setToolTipText (String str) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3969 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3970 setToolTipText (_getShell (), str); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
3971 toolTipText = str; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3972 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3973 |
238 | 3974 void setToolTipText (Shell shell, String newString) { |
240 | 3975 if (OS.GTK_VERSION >= OS.buildVERSION (2, 12, 0)) { |
3976 /* | |
3977 * Feature in GTK. In order to prevent children widgets | |
3978 * from inheriting their parent's tooltip, the tooltip is | |
3979 * a set on a shell only. In order to force the shell tooltip | |
3980 * to update when a new tip string is set, the existing string | |
3981 * in the tooltip is set to null, followed by running a query. | |
3982 * The real tip text can then be set. | |
3983 * | |
3984 * Note that this will only run if the control for which the | |
3985 * tooltip is being set is the current control (i.e. the control | |
3986 * under the pointer). | |
3987 */ | |
3988 if (display.currentControl is this) { | |
3989 shell.setToolTipText (shell.handle, eventHandle (), newString); | |
3990 } | |
3991 } else { | |
3992 shell.setToolTipText (eventHandle (), newString); | |
3993 } | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3994 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3995 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3996 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3997 * Marks the receiver as visible if the argument is <code>true</code>, |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3998 * and marks it invisible otherwise. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3999 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4000 * If one of the receiver's ancestors is not visible or some |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4001 * other condition makes the receiver not visible, marking |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4002 * it visible may not actually cause it to be displayed. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4003 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4004 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4005 * @param visible the new visibility state |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4006 * |
71 | 4007 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4008 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4009 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4010 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4011 */ |
30 | 4012 public void setVisible (bool visible) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4013 checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4014 if (((state & HIDDEN) is 0) is visible) return; |
240 | 4015 auto topHandle_ = topHandle(); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4016 if (visible) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4017 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4018 * It is possible (but unlikely), that application |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4019 * code could have disposed the widget in the show |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4020 * event. If this happens, just return. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4021 */ |
71 | 4022 sendEvent (DWT.Show); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4023 if (isDisposed ()) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4024 state &= ~HIDDEN; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4025 if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4026 if (enableWindow !is null) OS.gdk_window_show_unraised (enableWindow); |
240 | 4027 OS.gtk_widget_show (topHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4028 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4029 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4030 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4031 * Bug in GTK. Invoking gtk_widget_hide() on a widget that has |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4032 * focus causes a focus_out_event to be sent. If the client disposes |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4033 * the widget inside the event, GTK GP's. The fix is to reassign focus |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4034 * before hiding the widget. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4035 * |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4036 * NOTE: In order to stop the same widget from taking focus, |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4037 * temporarily clear and set the GTK_VISIBLE flag. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4038 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4039 Control control = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4040 bool fixFocus_ = false; |
71 | 4041 if (display.focusEvent !is DWT.FocusOut) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4042 control = display.getFocusControl (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4043 fixFocus_ = isFocusAncestor (control); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4044 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4045 state |= HIDDEN; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4046 if (fixFocus_) { |
240 | 4047 OS.GTK_WIDGET_UNSET_FLAGS (topHandle_, OS.GTK_VISIBLE); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4048 fixFocus (control); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4049 if (isDisposed ()) return; |
240 | 4050 OS.GTK_WIDGET_SET_FLAGS (topHandle_, OS.GTK_VISIBLE); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4051 } |
240 | 4052 OS.gtk_widget_hide (topHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4053 if (isDisposed ()) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4054 if (enableWindow !is null) OS.gdk_window_hide (enableWindow); |
71 | 4055 sendEvent (DWT.Hide); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4056 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4057 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4058 |
30 | 4059 void setZOrder (Control sibling, bool above, bool fixRelations) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4060 setZOrder (sibling, above, fixRelations, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4061 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4062 |
30 | 4063 void setZOrder (Control sibling, bool above, bool fixRelations, bool fixChildren) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4064 int index = 0, siblingIndex = 0, oldNextIndex = -1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4065 Control[] children = null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4066 if (fixRelations) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4067 /* determine the receiver's and sibling's indexes in the parent */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4068 children = parent._getChildren (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4069 while (index < children.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4070 if (children [index] is this) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4071 index++; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4072 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4073 if (sibling !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4074 while (siblingIndex < children.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4075 if (children [siblingIndex] is sibling) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4076 siblingIndex++; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4077 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4078 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4079 /* remove "Labelled by" relationships that will no longer be valid */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4080 removeRelation (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4081 if (index + 1 < children.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4082 oldNextIndex = index + 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4083 children [oldNextIndex].removeRelation (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4084 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4085 if (sibling !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4086 if (above) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4087 sibling.removeRelation (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4088 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4089 if (siblingIndex + 1 < children.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4090 children [siblingIndex + 1].removeRelation (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4091 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4092 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4093 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4094 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4095 |
240 | 4096 auto topHandle_ = topHandle (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4097 auto siblingHandle = sibling !is null ? sibling.topHandle () : null; |
240 | 4098 auto window = OS.GTK_WIDGET_WINDOW (topHandle_); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4099 if (window !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4100 GdkWindow* siblingWindow; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4101 if (sibling !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4102 if (above && sibling.enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4103 siblingWindow = enableWindow; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4104 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4105 siblingWindow = OS.GTK_WIDGET_WINDOW (siblingHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4106 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4107 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4108 auto redrawWindow = fixChildren ? parent.redrawWindow : null; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4109 if (!OS.GDK_WINDOWING_X11 () || (siblingWindow is null && (!above || redrawWindow is null))) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4110 if (above) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4111 OS.gdk_window_raise (window); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4112 if (redrawWindow !is null) OS.gdk_window_raise (redrawWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4113 if (enableWindow !is null) OS.gdk_window_raise (enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4114 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4115 if (enableWindow !is null) OS.gdk_window_lower (enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4116 OS.gdk_window_lower (window); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4117 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4118 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4119 XWindowChanges changes; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4120 changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)(siblingWindow !is null ? siblingWindow : redrawWindow)); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4121 changes.stack_mode = above ? OS.Above : OS.Below; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4122 if (redrawWindow !is null && siblingWindow is null) changes.stack_mode = OS.Below; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4123 auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (cast(GdkDrawable*)window); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4124 auto xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)window); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4125 int xScreen = OS.XDefaultScreen (xDisplay); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4126 int flags = OS.CWStackMode | OS.CWSibling; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4127 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4128 * Feature in X. If the receiver is a top level, XConfigureWindow () |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4129 * will fail (with a BadMatch error) for top level shells because top |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4130 * level shells are reparented by the window manager and do not share |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4131 * the same X window parent. This is the correct behavior but it is |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4132 * unexpected. The fix is to use XReconfigureWMWindow () instead. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4133 * When the receiver is not a top level shell, XReconfigureWMWindow () |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4134 * behaves the same as XConfigureWindow (). |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4135 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4136 OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4137 if (enableWindow !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4138 changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)window); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4139 changes.stack_mode = OS.Above; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4140 xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4141 OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4142 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4143 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4144 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4145 if (fixChildren) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4146 if (above) { |
240 | 4147 parent.moveAbove (topHandle_, siblingHandle); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4148 } else { |
240 | 4149 parent.moveBelow (topHandle_, siblingHandle); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4150 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4151 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4152 /* Make sure that the parent internal windows are on the bottom of the stack */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4153 if (!above && fixChildren) parent.fixZOrder (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4154 |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4155 if (fixRelations) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4156 /* determine the receiver's new index in the parent */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4157 if (sibling !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4158 if (above) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4159 index = siblingIndex - (index < siblingIndex ? 1 : 0); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4160 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4161 index = siblingIndex + (siblingIndex < index ? 1 : 0); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4162 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4163 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4164 if (above) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4165 index = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4166 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4167 index = children.length - 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4168 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4169 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4170 |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4171 /* add new "Labelled by" relations as needed */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4172 children = parent._getChildren (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4173 if (0 < index) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4174 children [index - 1].addRelation (this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4175 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4176 if (index + 1 < children.length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4177 addRelation (children [index + 1]); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4178 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4179 if (oldNextIndex !is -1) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4180 if (oldNextIndex <= index) oldNextIndex--; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4181 /* the last two conditions below ensure that duplicate relations are not hooked */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4182 if (0 < oldNextIndex && oldNextIndex !is index && oldNextIndex !is index + 1) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4183 children [oldNextIndex - 1].addRelation (children [oldNextIndex]); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4184 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4185 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4186 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4187 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4188 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4189 void setWidgetBackground () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4190 if (fixedHandle !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4191 auto style = OS.gtk_widget_get_modifier_style (fixedHandle); |
240 | 4192 modifyStyle (fixedHandle, style); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4193 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4194 auto style = OS.gtk_widget_get_modifier_style (handle); |
240 | 4195 modifyStyle (handle, style); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4196 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4197 |
30 | 4198 bool showMenu (int x, int y) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4199 Event event = new Event (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4200 event.x = x; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4201 event.y = y; |
71 | 4202 sendEvent (DWT.MenuDetect, event); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4203 if (event.doit) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4204 if (menu !is null && !menu.isDisposed ()) { |
71 | 4205 bool hooksKeys = hooks (DWT.KeyDown) || hooks (DWT.KeyUp); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4206 menu.createIMMenu (hooksKeys ? imHandle() : null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4207 if (event.x !is x || event.y !is y) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4208 menu.setLocation (event.x, event.y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4209 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4210 menu.setVisible (true); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4211 return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4212 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4213 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4214 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4215 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4216 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4217 void showWidget () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4218 // Comment this line to disable zero-sized widgets |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4219 state |= ZERO_WIDTH | ZERO_HEIGHT; |
240 | 4220 auto topHandle_ = topHandle (); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4221 auto parentHandle = parent.parentingHandle (); |
240 | 4222 parent.setParentWindow (topHandle_); |
4223 OS.gtk_container_add (cast(GtkContainer*)parentHandle, topHandle_); | |
4224 if (handle !is null && handle !is topHandle_) OS.gtk_widget_show (handle); | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4225 if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4226 if (fixedHandle !is null) OS.gtk_widget_show (fixedHandle); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4227 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4228 if (fixedHandle !is null) fixStyle (fixedHandle); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4229 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4230 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4231 void sort (int [] items) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4232 /* Shell Sort from K&R, pg 108 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4233 int length = items.length; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4234 for (int gap=length/2; gap>0; gap/=2) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4235 for (int i=gap; i<length; i++) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4236 for (int j=i-gap; j>=0; j-=gap) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4237 if (items [j] <= items [j + gap]) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4238 int swap = items [j]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4239 items [j] = items [j + gap]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4240 items [j + gap] = swap; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4241 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4242 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4243 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4244 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4245 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4246 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4247 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4248 * Based on the argument, perform one of the expected platform |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4249 * traversal action. The argument should be one of the constants: |
71 | 4250 * <code>DWT.TRAVERSE_ESCAPE</code>, <code>DWT.TRAVERSE_RETURN</code>, |
4251 * <code>DWT.TRAVERSE_TAB_NEXT</code>, <code>DWT.TRAVERSE_TAB_PREVIOUS</code>, | |
4252 * <code>DWT.TRAVERSE_ARROW_NEXT</code> and <code>DWT.TRAVERSE_ARROW_PREVIOUS</code>. | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4253 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4254 * @param traversal the type of traversal |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4255 * @return true if the traversal succeeded |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4256 * |
71 | 4257 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4258 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4259 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4260 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4261 */ |
30 | 4262 public bool traverse (int traversal) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4263 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4264 Event event = new Event (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4265 event.doit = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4266 event.detail = traversal; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4267 return traverse (event); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4268 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4269 |
30 | 4270 bool translateMnemonic (Event event, Control control) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4271 if (control is this) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4272 if (!isVisible () || !isEnabled ()) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4273 event.doit = this is display.mnemonicControl || mnemonicMatch (event.character); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4274 return traverse (event); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4275 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4276 |
30 | 4277 bool translateMnemonic (int keyval, GdkEventKey* gdkEvent) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4278 int key = OS.gdk_keyval_to_unicode (keyval); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4279 if (key < 0x20) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4280 if (gdkEvent.state is 0) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4281 int code = traversalCode (keyval, gdkEvent); |
71 | 4282 if ((code & DWT.TRAVERSE_MNEMONIC) is 0) return false; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4283 } else { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4284 Shell shell = _getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4285 int mask = OS.GDK_CONTROL_MASK | OS.GDK_SHIFT_MASK | OS.GDK_MOD1_MASK; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4286 if ((gdkEvent.state & mask) !is OS.gtk_window_get_mnemonic_modifier (cast(GtkWindow*)shell.shellHandle)) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4287 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4288 Decorations shell = menuShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4289 if (shell.isVisible () && shell.isEnabled ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4290 Event event = new Event (); |
71 | 4291 event.detail = DWT.TRAVERSE_MNEMONIC; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4292 if (setKeyState (event, gdkEvent)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4293 return translateMnemonic (event, null) || shell.translateMnemonic (event, this); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4294 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4295 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4296 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4297 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4298 |
30 | 4299 bool translateTraversal (GdkEventKey* keyEvent) { |
71 | 4300 int detail = DWT.TRAVERSE_NONE; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4301 int key = keyEvent.keyval; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4302 int code = traversalCode (key, keyEvent); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4303 bool all = false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4304 switch (key) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4305 case OS.GDK_Escape: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4306 all = true; |
71 | 4307 detail = DWT.TRAVERSE_ESCAPE; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4308 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4309 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4310 case OS.GDK_KP_Enter: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4311 case OS.GDK_Return: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4312 all = true; |
71 | 4313 detail = DWT.TRAVERSE_RETURN; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4314 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4315 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4316 case OS.GDK_ISO_Left_Tab: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4317 case OS.GDK_Tab: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4318 bool next = (keyEvent.state & OS.GDK_SHIFT_MASK) is 0; |
71 | 4319 detail = next ? DWT.TRAVERSE_TAB_NEXT : DWT.TRAVERSE_TAB_PREVIOUS; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4320 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4321 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4322 case OS.GDK_Up: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4323 case OS.GDK_Left: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4324 case OS.GDK_Down: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4325 case OS.GDK_Right: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4326 bool next = key is OS.GDK_Down || key is OS.GDK_Right; |
240 | 4327 if (parent !is null && (parent.style & DWT.MIRRORED) !is 0) { |
4328 if (key is OS.GDK_Left || key is OS.GDK_Right) next = !next; | |
4329 } | |
71 | 4330 detail = next ? DWT.TRAVERSE_ARROW_NEXT : DWT.TRAVERSE_ARROW_PREVIOUS; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4331 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4332 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4333 case OS.GDK_Page_Up: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4334 case OS.GDK_Page_Down: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4335 all = true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4336 if ((keyEvent.state & OS.GDK_CONTROL_MASK) is 0) return false; |
71 | 4337 detail = key is OS.GDK_Page_Down ? DWT.TRAVERSE_PAGE_NEXT : DWT.TRAVERSE_PAGE_PREVIOUS; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4338 break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4339 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4340 default: |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4341 return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4342 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4343 Event event = new Event (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4344 event.doit = (code & detail) !is 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4345 event.detail = detail; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4346 event.time = keyEvent.time; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4347 if (!setKeyState (event, keyEvent)) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4348 Shell shell = getShell (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4349 Control control = this; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4350 do { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4351 if (control.traverse (event)) return true; |
71 | 4352 if (!event.doit && control.hooks (DWT.Traverse)) return false; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4353 if (control is shell) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4354 control = control.parent; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4355 } while (all && control !is null); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4356 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4357 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4358 |
30 | 4359 int traversalCode (int key, GdkEventKey* event) { |
71 | 4360 int code = DWT.TRAVERSE_RETURN | DWT.TRAVERSE_TAB_NEXT | DWT.TRAVERSE_TAB_PREVIOUS | DWT.TRAVERSE_PAGE_NEXT | DWT.TRAVERSE_PAGE_PREVIOUS; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4361 Shell shell = getShell (); |
71 | 4362 if (shell.parent !is null) code |= DWT.TRAVERSE_ESCAPE; |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4363 return code; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4364 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4365 |
30 | 4366 bool traverse (Event event) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4367 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4368 * It is possible (but unlikely), that application |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4369 * code could have disposed the widget in the traverse |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4370 * event. If this happens, return true to stop further |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4371 * event processing. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4372 */ |
71 | 4373 sendEvent (DWT.Traverse, event); |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4374 if (isDisposed ()) return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4375 if (!event.doit) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4376 switch (event.detail) { |
71 | 4377 case DWT.TRAVERSE_NONE: return true; |
4378 case DWT.TRAVERSE_ESCAPE: return traverseEscape (); | |
4379 case DWT.TRAVERSE_RETURN: return traverseReturn (); | |
4380 case DWT.TRAVERSE_TAB_NEXT: return traverseGroup (true); | |
4381 case DWT.TRAVERSE_TAB_PREVIOUS: return traverseGroup (false); | |
4382 case DWT.TRAVERSE_ARROW_NEXT: return traverseItem (true); | |
4383 case DWT.TRAVERSE_ARROW_PREVIOUS: return traverseItem (false); | |
4384 case DWT.TRAVERSE_MNEMONIC: return traverseMnemonic (event.character); | |
4385 case DWT.TRAVERSE_PAGE_NEXT: return traversePage (true); | |
4386 case DWT.TRAVERSE_PAGE_PREVIOUS: return traversePage (false); | |
54 | 4387 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4388 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4389 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4390 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4391 |
30 | 4392 bool traverseEscape () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4393 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4394 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4395 |
30 | 4396 bool traverseGroup (bool next) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4397 Control root = computeTabRoot (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4398 Control group = computeTabGroup (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4399 Control [] list = root.computeTabList (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4400 int length = list.length; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4401 int index = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4402 while (index < length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4403 if (list [index] is group) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4404 index++; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4405 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4406 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4407 * It is possible (but unlikely), that application |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4408 * code could have disposed the widget in focus in |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4409 * or out events. Ensure that a disposed widget is |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4410 * not accessed. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4411 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4412 if (index is length) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4413 int start = index, offset = (next) ? 1 : -1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4414 while ((index = ((index + offset + length) % length)) !is start) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4415 Control control = list [index]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4416 if (!control.isDisposed () && control.setTabGroupFocus (next)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4417 return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4418 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4419 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4420 if (group.isDisposed ()) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4421 return group.setTabGroupFocus (next); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4422 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4423 |
30 | 4424 bool traverseItem (bool next) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4425 Control [] children = parent._getChildren (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4426 int length = children.length; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4427 int index = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4428 while (index < length) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4429 if (children [index] is this) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4430 index++; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4431 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4432 /* |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4433 * It is possible (but unlikely), that application |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4434 * code could have disposed the widget in focus in |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4435 * or out events. Ensure that a disposed widget is |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4436 * not accessed. |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4437 */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4438 if (index is length) return false; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4439 int start = index, offset = (next) ? 1 : -1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4440 while ((index = (index + offset + length) % length) !is start) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4441 Control child = children [index]; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4442 if (!child.isDisposed () && child.isTabItem ()) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4443 if (child.setTabItemFocus (next)) return true; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4444 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4445 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4446 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4447 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4448 |
30 | 4449 bool traverseReturn () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4450 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4451 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4452 |
30 | 4453 bool traversePage (bool next) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4454 return false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4455 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4456 |
30 | 4457 bool traverseMnemonic (char key) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4458 return mnemonicHit (key); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4459 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4460 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4461 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4462 * Forces all outstanding paint requests for the widget |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4463 * to be processed before this method returns. If there |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4464 * are no outstanding paint request, this method does |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4465 * nothing. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4466 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4467 * Note: This method does not cause a redraw. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4468 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4469 * |
71 | 4470 * @exception DWTException <ul> |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4471 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4472 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4473 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4474 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4475 * @see #redraw() |
30 | 4476 * @see #redraw(int, int, int, int, bool) |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4477 * @see PaintListener |
71 | 4478 * @see DWT#Paint |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4479 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4480 public void update () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4481 checkWidget (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4482 update (false, true); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4483 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4484 |
30 | 4485 void update (bool all, bool flush) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4486 // checkWidget(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4487 if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4488 if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4489 auto window = paintWindow (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4490 if (flush) display.flushExposes (window, all); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4491 OS.gdk_window_process_updates (window, all); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4492 OS.gdk_flush (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4493 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4494 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4495 void updateBackgroundMode () { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4496 int oldState = state & PARENT_BACKGROUND; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4497 checkBackground (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4498 if (oldState !is (state & PARENT_BACKGROUND)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4499 setBackground (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4500 } |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4501 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4502 |
30 | 4503 void updateLayout (bool all) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4504 /* Do nothing */ |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4505 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4506 |
58
a5c274fa5af9
extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents:
55
diff
changeset
|
4507 override int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4508 switch (cast(int)/*64*/user_data) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4509 case EXPOSE_EVENT_INVERSE: { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4510 if ((OS.GTK_VERSION < OS.buildVERSION (2, 8, 0)) && ((state & OBSCURED) is 0)) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4511 Control control = findBackgroundControl (); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4512 if (control !is null && control.backgroundImage !is null) { |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4513 GdkEventExpose* gdkEvent = cast(GdkEventExpose*)arg0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4514 auto paintWindow = paintWindow(); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4515 auto window = gdkEvent.window; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4516 if (window !is paintWindow) break; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4517 auto gdkGC = OS.gdk_gc_new (cast(GdkDrawable*)window); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4518 OS.gdk_gc_set_clip_region (gdkGC, gdkEvent.region); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4519 int dest_x, dest_y; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4520 OS.gtk_widget_translate_coordinates (paintHandle (), control.paintHandle (), 0, 0, &dest_x, &dest_y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4521 OS.gdk_gc_set_fill (gdkGC, OS.GDK_TILED); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4522 OS.gdk_gc_set_ts_origin (gdkGC, -dest_x, -dest_y); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4523 OS.gdk_gc_set_tile (gdkGC, cast(GdkPixmap*)control.backgroundImage.pixmap); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4524 OS.gdk_draw_rectangle (cast(GdkDrawable*)window, gdkGC, 1, gdkEvent.area.x, gdkEvent.area.y, gdkEvent.area.width, gdkEvent.area.height); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4525 OS.g_object_unref (gdkGC); |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4526 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4527 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4528 break; |
54 | 4529 default: |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4530 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4531 } |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
58
diff
changeset
|
4532 return super.windowProc (handle, arg0, user_data); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4533 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4534 } |