annotate dwt/widgets/Control.d @ 238:380bad9f6852

reverted char[] to String
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:42:55 +0200
parents de2578a843a7
children ce446666f5a2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
5899e0b43e5d porting notice
Frank Benoit <benoit@tionex.de>
parents: 71
diff changeset
1 /*******************************************************************************
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2 * Copyright (c) 2000, 2007 IBM Corporation and others.
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
5899e0b43e5d porting notice
Frank Benoit <benoit@tionex.de>
parents: 71
diff changeset
10 * Port to the D programming language:
5899e0b43e5d porting notice
Frank Benoit <benoit@tionex.de>
parents: 71
diff changeset
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
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 158
diff changeset
15 import dwt.dwthelper.utils;
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 158
diff changeset
16
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
17
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
18 import dwt.DWT;
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
19 //import dwt.accessibility.Accessible;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
20 import dwt.events.ControlListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
21 import dwt.events.FocusListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
22 import dwt.events.HelpListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
23 import dwt.events.KeyListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
24 import dwt.events.MouseListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
25 import dwt.events.MouseMoveListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
26 import dwt.events.MouseTrackListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
27 import dwt.events.PaintListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
28 import dwt.events.TraverseListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
29 import dwt.events.DragDetectListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
30 import dwt.events.MenuDetectListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
31 import dwt.events.MouseWheelListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
32 import dwt.graphics.Color;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
33 import dwt.graphics.Cursor;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
34 import dwt.graphics.Device;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
35 import dwt.graphics.Drawable;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
36 import dwt.graphics.Font;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
37 import dwt.graphics.GC;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
38 import dwt.graphics.GCData;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
39 import dwt.graphics.Image;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
40 import dwt.graphics.Point;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
41 import dwt.graphics.Rectangle;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
42 import dwt.internal.Converter;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
43 import dwt.internal.DWTEventListener;
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
44 import dwt.internal.accessibility.gtk.ATK;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
45 import dwt.internal.gtk.OS;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
46 import dwt.widgets.Composite;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
47 import dwt.widgets.Decorations;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
48 import dwt.widgets.Display;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
49 import dwt.widgets.Event;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
50 import dwt.widgets.Listener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
51 import dwt.widgets.Menu;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
52 import dwt.widgets.Monitor;
26
09f5459a5014 Display in work
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
53 import dwt.widgets.Shell;
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
54 import dwt.widgets.TypedListener;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
55 import dwt.widgets.Widget;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 46
diff changeset
56 import dwt.accessibility.Accessible;
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
57
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
58 import Math = tango.math.Math;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
59 import tango.stdc.stringz;
46
8015c460f713 Synchronizer
Frank Benoit <benoit@tionex.de>
parents: 44
diff changeset
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
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
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
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
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>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
82 public abstract class Control : Widget, Drawable {
150
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
83
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
84 alias Widget.mnemonicHit mnemonicHit;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
85 alias Widget.mnemonicMatch mnemonicMatch;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
86 alias Widget.setForegroundColor setForegroundColor;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
87 alias Widget.translateTraversal translateTraversal;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
88 alias Widget.windowProc windowProc;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
89
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
90 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
91 GdkWindow* redrawWindow;
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
92 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
93 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
94 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
95 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
96 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
97 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
98 Font font;
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 158
diff changeset
99 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
100 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
101 Accessible accessible;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
103 this () {
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 * 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
108 * 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
109 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 * The style value is either one of the style constants defined in
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
111 * 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
112 * 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
113 * (that is, using the <code>int</code> "|" operator) two or more
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
114 * 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
115 * 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
116 * 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
117 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 * @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
120 * @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
121 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 * <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
124 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
125 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 * <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
127 * <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
128 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
130 * @see DWT#BORDER
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131 * @see Widget#checkSubclass
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 * @see Widget#getStyle
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
134 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
135 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
136 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
137 createWidget (0);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
138 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
139
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
140 PangoFontDescription* 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
141 return display.getSystemFont ().handle;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
142 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
143
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
144 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
145 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
146 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
147 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
148 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
149 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
150
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
151 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
152 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
153 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
154 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
155 int orientation = vertical ? OS.GTK_ORIENTATION_HORIZONTAL : OS.GTK_ORIENTATION_VERTICAL;
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
156 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
157 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
158 return true;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
159 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
160
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
161 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
162 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
163 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
164
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
165 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
166 return eventHandle ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
167 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
168
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
169 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
170 return handle;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
171 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
172
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
173 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
174 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
175 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
176 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
177 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
178
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
179 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
180 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
181 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
182 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
183 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
184 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
185 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
186 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
187 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
188 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
189 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
190 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
191
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
192 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
193 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
194 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
195
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
196 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
197 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
198 * Feature in GTK. Some GTK themes apply a different background to
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
199 * 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
200 * 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
201 * 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
202 * for a child of a GtkNotebook and apply its background to any GtkFixed
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
203 * 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
204 *
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
205 * 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
206 * 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
207 */
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 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
209 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
210 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
211 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
212 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
213 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
214 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
215 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
216
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
217 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
218 return handle;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
219 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
220
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
221 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
222 return handle;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
223 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
224
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
225 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
226 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
227 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
228
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
229 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
230 /* 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
231 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
232 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
233 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
234 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
235 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
236 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
237 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
238 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
239 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
240 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
241
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
242 /* 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
243 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
244 int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_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
245 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
246 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
247 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
248 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
249 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
250 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
251
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 /* 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
253 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
254 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
255 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
256 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
257 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
258
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 /*
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 * 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
261 * the widget hierarchy and are seen by the parent. This is the
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
262 * 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
263 * 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
264 * 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
265 *
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 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
267 * 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
268 */
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 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
270 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
271 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
272 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
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 /* 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
275 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
276 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
277 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
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
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 /* 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
281 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
282 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
283 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
284 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
285 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
286 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
287
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 /* 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
289 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
290 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
291 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
292 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
293 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
294 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
295 }
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
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 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
298
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 auto topHandle = topHandle ();
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 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
301 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
302
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
303 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
304 int x, y;
33
27324bbbac70 changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents: 30
diff changeset
305 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
306 OS.gdk_window_get_pointer (null, &x, &y, &mask);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
307 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
308 /* 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
309 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
310 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
311
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
312 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
313 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
314 return super.topHandle ();
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
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
317 GtkWidget* paintHandle () {
59
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 auto topHandle = topHandle ();
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 auto paintHandle = 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
320 while (paintHandle !is topHandle) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
321 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
322 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
323 }
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 return paintHandle;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
325 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
326
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
327 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
328 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
329 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
330 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
331 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
332
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
333 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
334 * 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
335 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
336 * 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
337 * 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
338 * 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
339 * 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
340 * To indicate that the caller does not wish to constrain a particular
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
341 * 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
342 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
343 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
344 * @param wHint the width hint (can be <code>DWT.DEFAULT</code>)
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
345 * @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
346 * @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
347 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
348 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
349 * <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
350 * <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
351 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
352 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
353 * @see Layout
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
354 * @see #getBorderWidth
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
355 * @see #getBounds
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
356 * @see #getSize
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
357 * @see #pack(bool)
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
358 * @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
359 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
360 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
361 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
362 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
363
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
364 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
365 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
366 return parent.computeTabGroup ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
367 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
368
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
369 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
370 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
371 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
372 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
373 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
374 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
375 return new Control[0];
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
376 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
377
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
378 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
379 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
380 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
381 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
382 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
383 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
384 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
385 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
386 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
387 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
388 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
389 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
390 return parent.computeTabRoot ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
391 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
392
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
393 void checkBuffered () {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
394 style |= DWT.DOUBLE_BUFFERED;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
395 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
396
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
397 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
398 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
399 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
400 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
401 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
402 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
403 int mode = composite.backgroundMode;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
404 if (mode !is DWT.INHERIT_NONE) {
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
405 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
406 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
407 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
408 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
409 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
410 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
411 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
412 } 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
413 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
414 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
415 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
416 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
417 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
418 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
419 } while (true);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
420 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
421
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
422 void checkBorder () {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
423 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
424 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
425
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
426 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
427 return parent.childStyle ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
428 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
429
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
430 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
431 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
432 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
433 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
434 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
435 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
436 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
437 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
438 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
439 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
440 setRelations ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
441 checkBorder ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
442 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
443
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
444 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
445 * 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
446 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
447 * 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
448 * 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
449 * 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
450 * 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
451 * To indicate that the caller does not wish to constrain a particular
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
452 * 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
453 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
454 * 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
455 * <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
456 * 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
457 * 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
458 * manager caches can be retained.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
459 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
460 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
461 * @param wHint the width hint (can be <code>DWT.DEFAULT</code>)
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
462 * @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
463 * @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
464 * @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
465 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
466 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
467 * <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
468 * <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
469 * </ul>
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 * @see Layout
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
472 * @see #getBorderWidth
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
473 * @see #getBounds
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
474 * @see #getSize
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
475 * @see #pack(bool)
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
476 * @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
477 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
478 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
479 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
480 if (wHint !is DWT.DEFAULT && wHint < 0) wHint = 0;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
481 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
482 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
483 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
484
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
485 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
486 int width = wHint, height = hHint;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
487 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
488 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
489 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
490 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
491 height = OS.GTK_WIDGET_REQUISITION_HEIGHT (h);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
492 } 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
493 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
494 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
495 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
496 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
497 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
498 OS.gtk_widget_set_size_request (h, reqWidth, reqHeight);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
499 width = wHint is DWT.DEFAULT ? requisition.width : wHint;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
500 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
501 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
502 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
503 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
504
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
505 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
506 /*
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 * 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
508 * 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
509 * 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
510 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
511 auto topHandle = topHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
512 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
513 gtk_widget_size_request (topHandle, &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
514 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
515 allocation.x = OS.GTK_WIDGET_X (topHandle);
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 allocation.y = OS.GTK_WIDGET_Y (topHandle);
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 allocation.width = OS.GTK_WIDGET_WIDTH (topHandle);
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 allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle);
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 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
520 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
521
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
522 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
523 * 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
524 * 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
525 * 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
526 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
527 * @return the accessible object
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
528 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
529 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
530 * <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
531 * <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
532 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
533 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
534 * @see Accessible#addAccessibleListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
535 * @see Accessible#addAccessibleControlListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
536 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
537 * @since 2.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
538 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
539 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
540 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
541 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
542 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
543 }
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 return accessible;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
545 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
546
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
547 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
548 * 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
549 * 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
550 * 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
551 * relative to the display.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
552 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
553 * @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
554 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
555 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
556 * <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
557 * <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
558 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
559 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
560 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
561 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
562 auto topHandle = topHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
563 int x = OS.GTK_WIDGET_X (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
564 int y = OS.GTK_WIDGET_Y (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
565 int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
566 int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
567 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
568 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
569
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
570 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
571 * 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
572 * 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
573 * <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
574 * 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
575 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
576 * 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
577 * 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
578 * 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
579 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
580 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
581 * @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
582 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
583 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
584 * <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
585 * <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
586 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
587 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
588 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
589 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
590 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
591 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
592 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
593
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
594 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
595 * 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
596 * 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
597 * <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
598 * 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
599 * 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
600 * 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
601 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
602 * 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
603 * 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
604 * 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
605 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
606 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
607 * @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
608 * @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
609 * @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
610 * @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
611 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
612 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
613 * <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
614 * <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
615 * </ul>
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 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
618 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
619 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
620 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
621
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
622 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
623 /* Do nothing */
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
624 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
625
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
626 void moveHandle (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
627 auto topHandle = topHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
628 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
629 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
630 * 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
631 * 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
632 * 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
633 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
634 * 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
635 * 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
636 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
637 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
638 OS.GTK_WIDGET_UNSET_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
639 OS.gtk_fixed_move (cast(GtkFixed*)parentHandle, topHandle, 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
640 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
641 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
642 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
643 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
644
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
645 void resizeHandle (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
646 auto topHandle = topHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
647 OS.gtk_widget_set_size_request (topHandle, 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
648 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
649 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
650
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
651 int setBounds (int x, int y, int width, int height, bool move, bool 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
652 auto topHandle = topHandle ();
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 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
654 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
655 int oldX = OS.GTK_WIDGET_X (topHandle);
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 int oldY = OS.GTK_WIDGET_Y (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
657 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
658 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
659 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
660 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
661 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
662 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
663 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
664 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
665 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
666 int oldWidth = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
667 int oldHeight = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
668 sameExtent = width is oldWidth && height is oldHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
669 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
670 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
671 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
672 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
673 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
674 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
675 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
676 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
677 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
678 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
679 }
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
681 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
682 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
683 * 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
684 * 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
685 * 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
686 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
687 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
688 gtk_widget_size_request (topHandle, &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
689 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
690 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
691 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
692 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
693 } 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
694 allocation.x = OS.GTK_WIDGET_X (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
695 allocation.y = OS.GTK_WIDGET_Y (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
696 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
697 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
698 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
699 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
700 } 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
701 allocation.width = OS.GTK_WIDGET_WIDTH (topHandle);
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 allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
703 }
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 OS.gtk_widget_size_allocate (topHandle, &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
705 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
706 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
707 * 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
708 * 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
709 * 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
710 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
711 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
712 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
713 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
714 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
715 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
716 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
717 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
718 OS.gtk_widget_hide (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
719 } 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
720 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
721 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
722 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
723 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
724 OS.gtk_widget_show (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
725 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
726 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
727 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
728 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
729 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
730 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
731 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
732 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
733 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
734 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
735 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
736 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
737 if (resize && !sameExtent) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
738 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
739 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
740 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
741 return result;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
742 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
743
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
744 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
745 * 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
746 * 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
747 * 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
748 * relative to the display.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
749 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
750 * @return the receiver's location
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
751 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
752 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
753 * <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
754 * <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
755 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
756 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
757 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
758 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
759 auto topHandle = topHandle ();
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 x = OS.GTK_WIDGET_X (topHandle);
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 int y = OS.GTK_WIDGET_Y (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
762 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
763 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
764
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
765 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
766 * 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
767 * 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
768 * 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
769 * 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
770 * relative to the display.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
771 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
772 * @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
773 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
774 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
775 * <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
776 * <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
777 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
778 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
779 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
780 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
781 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
782 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
783 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
784
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
785 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
786 * 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
787 * 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
788 * 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
789 * 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
790 * relative to the display.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
791 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
792 * @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
793 * @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
794 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
795 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
796 * <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
797 * <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
798 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
799 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
800 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
801 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
802 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
803 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
804
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
805 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
806 * 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
807 * 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
808 * 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
809 * receiver.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
810 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
811 * @return the receiver's size
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
812 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
813 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
814 * <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
815 * <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
816 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
817 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
818 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
819 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
820 auto topHandle = topHandle ();
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 int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle);
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 int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle);
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 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
824 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
825
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
826 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
827 * 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
828 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
829 * 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
830 * 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
831 * set to zero instead.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
832 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
833 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
834 * @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
835 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
836 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
837 * <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
838 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
839 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
840 * <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
841 * <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
842 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
843 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
844 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
845 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
846 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
847 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
848 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
849
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
850 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
851 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
852 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
853 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
854 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
855 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
856 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
857 * 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
858 * 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
859 */
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 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
861 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
862 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
863 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
864 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
865 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
866 }
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 }
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 }
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 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
871 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
872
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
873 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
874 * 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
875 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
876 * 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
877 * 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
878 * 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
879 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
880 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
881 * @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
882 * @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
883 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
884 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
885 * <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
886 * <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
887 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
888 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
889 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
890 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
891 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
892 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
893
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
894 /*
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
895 * 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
896 * 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
897 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
898 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
899 return true;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
900 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
901
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
902 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
903 * 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
904 * 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
905 * 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
906 * 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
907 * 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
908 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
909 * @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
910 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
911 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
912 * <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
913 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
914 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
915 * <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
916 * <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
917 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
918 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
919 * @see Control#moveBelow
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
920 * @see Composite#getChildren
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
921 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
922 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
923 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
924 if (control !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
925 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
926 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
927 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
928 setZOrder (control, true, true);
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
931 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
932 * 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
933 * 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
934 * 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
935 * 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
936 * controls which occupy intersecting areas.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
937 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
938 * @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
939 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
940 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
941 * <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
942 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
943 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
944 * <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
945 * <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
946 * </ul>
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 * @see Control#moveAbove
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
949 * @see Composite#getChildren
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
950 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
951 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
952 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
953 if (control !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
954 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
955 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
956 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
957 setZOrder (control, false, true);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
958 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
959
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
960 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
961 * 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
962 * 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
963 * 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
964 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
965 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
966 * <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
967 * <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
968 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
969 *
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
970 * @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
971 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
972 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
973 pack (true);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
974 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
975
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
976 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
977 * 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
978 * 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
979 * 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
980 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
981 * 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
982 * <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
983 * 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
984 * 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
985 * manager caches can be retained.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
986 * </p>
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 * @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
989 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
990 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
991 * <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
992 * <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
993 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
994 *
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
995 * @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
996 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
997 public void pack (bool changed) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
998 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
999 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1000
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1001 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1002 * 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
1003 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1004 * @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
1005 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1006 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1007 * <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
1008 * <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
1009 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1010 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1011 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
1012 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
1013 this.layoutData = layoutData;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1014 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1015
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1016 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1017 * 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
1018 * 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
1019 * 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
1020 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1021 * @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
1022 * @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
1023 * @return the translated coordinates
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1024 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1025 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1026 * <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
1027 * <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
1028 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1029 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1030 * @since 2.1
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1031 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1032 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
1033 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
1034 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
1035 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
1036 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
1037 return new Point (x - origin_x , y - origin_y );
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1038 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1039
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1040 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1041 * 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
1042 * 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
1043 * 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
1044 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1045 * @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
1046 * @return the translated coordinates
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1047 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1048 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1049 * <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
1050 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1051 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1052 * <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
1053 * <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
1054 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1055 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1056 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
1057 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1058 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
1059 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
1060 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1061
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 * 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
1064 * 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
1065 * 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
1066 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1067 * @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
1068 * @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
1069 * @return the translated coordinates
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1070 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1071 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1072 * <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
1073 * <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
1074 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1075 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1076 * @since 2.1
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1077 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1078 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
1079 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
1080 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
1081 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
1082 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
1083 return new Point (origin_x + x, origin_y + y);
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1086 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1087 * 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
1088 * 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
1089 * 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
1090 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1091 * @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
1092 * @return the translated coordinates
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1093 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1094 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1095 * <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
1096 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1097 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1098 * <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
1099 * <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
1100 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1101 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1102 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
1103 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1104 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
1105 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
1106 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1107
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1108 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1109 * 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
1110 * 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
1111 * 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
1112 * interface.
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 * @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
1115 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1116 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1117 * <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
1118 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1119 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1120 * <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
1121 * <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
1122 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1123 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1124 * @see ControlListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1125 * @see #removeControlListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1126 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1127 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
1128 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1129 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
1130 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1131 addListener (DWT.Resize,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1132 addListener (DWT.Move,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1133 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1134
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1135 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1136 * 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
1137 * 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
1138 * 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
1139 * interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1140 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1141 * @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
1142 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1143 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1144 * <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
1145 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1146 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1147 * <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
1148 * <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
1149 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1150 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1151 * @see DragDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1152 * @see #removeDragDetectListener
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 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1155 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1156 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
1157 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1158 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
1159 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1160 addListener (DWT.DragDetect,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1161 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1162
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1163 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1164 * 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
1165 * 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
1166 * 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
1167 * interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1168 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1169 * @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
1170 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1171 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1172 * <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
1173 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1174 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1175 * <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
1176 * <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
1177 * </ul>
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 * @see FocusListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1180 * @see #removeFocusListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1181 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1182 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
1183 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1184 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
1185 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1186 addListener(DWT.FocusIn,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1187 addListener(DWT.FocusOut,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1188 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1189
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1190 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1191 * 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
1192 * 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
1193 * 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
1194 * <code>HelpListener</code> interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1195 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1196 * @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
1197 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1198 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1199 * <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
1200 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1201 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1202 * <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
1203 * <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
1204 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1205 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1206 * @see HelpListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1207 * @see #removeHelpListener
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 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
1210 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1211 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
1212 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1213 addListener (DWT.Help, typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1214 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1215
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1216 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1217 * 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
1218 * 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
1219 * 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
1220 * interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1221 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1222 * 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
1223 * 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
1224 * 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
1225 * 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
1226 * 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
1227 * 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
1228 * 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
1229 * 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
1230 * 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
1231 * 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
1232 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1233 * @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
1234 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1235 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1236 * <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
1237 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1238 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1239 * <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
1240 * <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
1241 * </ul>
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 * @see KeyListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1244 * @see #removeKeyListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1245 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1246 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
1247 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1248 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
1249 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1250 addListener(DWT.KeyUp,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1251 addListener(DWT.KeyDown,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1252 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1253
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1254 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1255 * 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
1256 * 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
1257 * 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
1258 * the <code>MenuDetectListener</code> interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1259 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1260 * @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
1261 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1262 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1263 * <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
1264 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1265 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1266 * <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
1267 * <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
1268 * </ul>
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 * @see MenuDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1271 * @see #removeMenuDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1272 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1273 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1274 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1275 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
1276 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1277 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
1278 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1279 addListener (DWT.MenuDetect, typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1280 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1281
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1282 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1283 * 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
1284 * 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
1285 * 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
1286 * interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1287 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1288 * @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
1289 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1290 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1291 * <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
1292 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1293 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1294 * <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
1295 * <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
1296 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1297 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1298 * @see MouseListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1299 * @see #removeMouseListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1300 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1301 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
1302 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1303 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
1304 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1305 addListener(DWT.MouseDown,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1306 addListener(DWT.MouseUp,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1307 addListener(DWT.MouseDoubleClick,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1308 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1311 * 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
1312 * 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
1313 * 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
1314 * interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1315 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1316 * @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
1317 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1318 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1319 * <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
1320 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1321 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1322 * <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
1323 * <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
1324 * </ul>
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 * @see MouseMoveListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1327 * @see #removeMouseMoveListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1328 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1329 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
1330 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1331 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
1332 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1333 addListener(DWT.MouseMove,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1334 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1335
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 * 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
1338 * 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
1339 * 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
1340 * interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1341 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1342 * @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
1343 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1344 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1345 * <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
1346 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1347 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1348 * <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
1349 * <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
1350 * </ul>
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 * @see MouseTrackListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1353 * @see #removeMouseTrackListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1354 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1355 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
1356 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1357 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
1358 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1359 addListener (DWT.MouseEnter,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1360 addListener (DWT.MouseExit,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1361 addListener (DWT.MouseHover,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1362 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1363
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 * 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
1366 * 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
1367 * 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
1368 * <code>MouseWheelListener</code> interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1369 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1370 * @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
1371 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1372 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1373 * <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
1374 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1375 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1376 * <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
1377 * <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
1378 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1379 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1380 * @see MouseWheelListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1381 * @see #removeMouseWheelListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1382 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1383 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1384 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1385 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
1386 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1387 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
1388 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1389 addListener (DWT.MouseWheel, typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1390 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1393 * 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
1394 * 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
1395 * 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
1396 * interface.
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 * @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
1399 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1400 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1401 * <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
1402 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1403 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1404 * <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
1405 * <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
1406 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1407 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1408 * @see PaintListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1409 * @see #removePaintListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1410 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1411 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
1412 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1413 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
1414 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1415 addListener(DWT.Paint,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1416 }
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 void addRelation (Control control) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1419 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1420
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1421 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1422 * 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
1423 * 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
1424 * 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
1425 * interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1426 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1427 * @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
1428 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1429 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1430 * <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
1431 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1432 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1433 * <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
1434 * <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
1435 * </ul>
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 * @see TraverseListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1438 * @see #removeTraverseListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1439 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1440 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
1441 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1442 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
1443 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1444 addListener (DWT.Traverse,typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1445 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1446
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1447 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1448 * 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
1449 * 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
1450 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1451 * @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
1452 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1453 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1454 * <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
1455 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1456 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1457 * <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
1458 * <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
1459 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1460 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1461 * @see ControlListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1462 * @see #addControlListener
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 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
1465 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1466 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
1467 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1468 eventTable.unhook (DWT.Move, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1469 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
1470 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1471
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 * 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
1474 * 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
1475 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1476 * @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
1477 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1478 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1479 * <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
1480 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1481 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1482 * <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
1483 * <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
1484 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1485 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1486 * @see DragDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1487 * @see #addDragDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1488 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1489 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1490 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1491 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
1492 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1493 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
1494 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1495 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
1496 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1497
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 * 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
1500 * 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
1501 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1502 * @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
1503 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1504 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1505 * <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
1506 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1507 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1508 * <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
1509 * <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
1510 * </ul>
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 * @see FocusListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1513 * @see #addFocusListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1514 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1515 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
1516 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1517 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
1518 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1519 eventTable.unhook (DWT.FocusIn, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1520 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
1521 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1522 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1523 * 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
1524 * 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
1525 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1526 * @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
1527 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1528 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1529 * <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
1530 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1531 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1532 * <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
1533 * <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
1534 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1535 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1536 * @see HelpListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1537 * @see #addHelpListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1538 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1539 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
1540 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1541 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
1542 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1543 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
1544 }
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 * 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
1547 * 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
1548 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1549 * @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
1550 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1551 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1552 * <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
1553 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1554 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1555 * <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
1556 * <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
1557 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1558 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1559 * @see KeyListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1560 * @see #addKeyListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1561 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1562 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
1563 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1564 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
1565 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1566 eventTable.unhook (DWT.KeyUp, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1567 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
1568 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1569 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1570 * 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
1571 * 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
1572 * occurred.
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 * @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
1575 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1576 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1577 * <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
1578 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1579 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1580 * <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
1581 * <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
1582 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1583 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1584 * @see MenuDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1585 * @see #addMenuDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1586 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1587 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1588 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1589 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
1590 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1591 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
1592 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1593 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
1594 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1595 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1596 * 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
1597 * 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
1598 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1599 * @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
1600 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1601 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1602 * <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
1603 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1604 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1605 * <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
1606 * <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
1607 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1608 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1609 * @see MouseListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1610 * @see #addMouseListener
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 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
1613 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1614 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
1615 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1616 eventTable.unhook (DWT.MouseDown, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1617 eventTable.unhook (DWT.MouseUp, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1618 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
1619 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1620 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1621 * 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
1622 * 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
1623 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1624 * @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
1625 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1626 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1627 * <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
1628 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1629 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1630 * <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
1631 * <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
1632 * </ul>
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 * @see MouseMoveListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1635 * @see #addMouseMoveListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1636 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1637 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
1638 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1639 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
1640 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1641 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
1642 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1645 * 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
1646 * 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
1647 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1648 * @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
1649 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1650 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1651 * <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
1652 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1653 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1654 * <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
1655 * <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
1656 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1657 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1658 * @see MouseTrackListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1659 * @see #addMouseTrackListener
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 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
1662 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1663 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
1664 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1665 eventTable.unhook (DWT.MouseEnter, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1666 eventTable.unhook (DWT.MouseExit, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1667 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
1668 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1669
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1670 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1671 * 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
1672 * 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
1673 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1674 * @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
1675 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1676 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1677 * <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
1678 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1679 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1680 * <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
1681 * <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
1682 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1683 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1684 * @see MouseWheelListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1685 * @see #addMouseWheelListener
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 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1688 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1689 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
1690 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1691 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
1692 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1693 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
1694 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1695
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1696 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1697 * 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
1698 * 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
1699 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1700 * @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
1701 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1702 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1703 * <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
1704 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1705 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1706 * <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
1707 * <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
1708 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1709 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1710 * @see PaintListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1711 * @see #addPaintListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1712 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1713 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
1714 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1715 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
1716 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1717 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
1718 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1719
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1720 /*
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1721 * 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
1722 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1723 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
1724 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
1725 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
1726 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
1727 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
1728 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
1729 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
1730 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
1731 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
1732 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1733 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
1734 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1735
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1736 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1737 * 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
1738 * 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
1739 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1740 * @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
1741 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1742 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1743 * <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
1744 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1745 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1746 * <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
1747 * <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
1748 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1749 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1750 * @see TraverseListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1751 * @see #addTraverseListener
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 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
1754 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1755 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
1756 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1757 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
1758 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1759
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1760 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1761 * 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
1762 * 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
1763 * down listener.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1764 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1765 * <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
1766 * 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
1767 * 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
1768 * 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
1769 * 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
1770 * 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
1771 * 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
1772 * 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
1773 * 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
1774 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1775 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1776 * @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
1777 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1778 * @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
1779 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1780 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1781 * <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
1782 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1783 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1784 * <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
1785 * <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
1786 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1787 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1788 * @see DragDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1789 * @see #addDragDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1790 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1791 * @see #getDragDetect
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1792 * @see #setDragDetect
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1793 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1794 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1795 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
1796 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
1797 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1798 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
1799 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
1800 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1801
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 * 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
1804 * 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
1805 * down listener.
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 * <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
1808 * 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
1809 * 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
1810 * 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
1811 * 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
1812 * 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
1813 * 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
1814 * 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
1815 * 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
1816 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1817 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1818 * @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
1819 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1820 * @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
1821 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1822 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1823 * <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
1824 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1825 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1826 * <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
1827 * <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
1828 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1829 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1830 * @see DragDetectListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1831 * @see #addDragDetectListener
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 * @see #getDragDetect
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1834 * @see #setDragDetect
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1835 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1836 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1837 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
1838 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
1839 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1840 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
1841 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
1842 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1843
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
1844 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
1845 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
1846 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
1847 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
1848 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1849
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
1850 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
1851 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
1852 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
1853 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
1854 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
1855 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
1856 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
1857 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
1858 } 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
1859 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
1860 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1861 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1862 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
1863 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
1864 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
1865 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
1866 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
1867 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
1868 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
1869 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1870 } 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
1871 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
1872 }
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 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
1874 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
1875 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
1876 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1877 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
1878 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
1879 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
1880 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
1881 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
1882 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1883 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
1884 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
1885 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
1886 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
1887 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
1888 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
1889 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
1890 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1891 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
1892 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
1893 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1894 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
1895 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1896 return dragging;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1897 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1898
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
1899 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
1900 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
1901 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
1902 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
1903 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1904 return false;
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1907 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
1908 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
1909 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
1910 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1911
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1912 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
1913 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
1914 return new Menu [0];
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1915 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1916
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1917 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
1918 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
1919 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
1920 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1921
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
1922 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
1923 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
1924 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
1925 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
1926 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
1927 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
1928 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
1929 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
1930 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
1931 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1932 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
1933 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1934 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
1935 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1936 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
1937 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
1938 }
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 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1940 }
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 * 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
1944 * 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
1945 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1946 * @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
1947 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1948 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1949 * <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
1950 * <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
1951 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1952 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1953 * @see #setFocus
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1954 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
1955 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
1956 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1957 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
1958 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
1959 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
1960 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
1961 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
1962 return forceFocus (focusHandle ());
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1963 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1964
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
1965 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
1966 /* 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
1967 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
1968 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
1969 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
1970 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
1971 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
1972 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
1973 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
1974 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
1975 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
1976 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
1977 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1978 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
1979 }
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 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1981 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1982
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 * 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
1985 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1986 * @return the background color
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1987 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
1988 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1989 * <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
1990 * <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
1991 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1992 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1993 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
1994 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
1995 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
1996 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
1997 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
1998 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1999
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2000 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
2001 return getBgColor ();
25
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
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 * 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
2006 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2007 * @return the background image
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2008 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2009 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2010 * <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
2011 * <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
2012 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2013 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2014 * @since 3.2
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 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
2017 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
2018 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
2019 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
2020 return control.backgroundImage;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2021 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2022
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2023 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
2024 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
2025 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
2026 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
2027 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
2028 return color;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2029 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2030
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2031 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
2032 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
2033 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
2034 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
2035 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
2036 return color;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2037 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2038
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2039 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2040 * 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
2041 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2042 * @return the border width
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2043 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2044 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2045 * <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
2046 * <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
2047 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2048 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2049 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
2050 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
2051 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2052 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2053
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2054 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2055 * 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
2056 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2057 * 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
2058 * 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
2059 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2060 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2061 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2062 * <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
2063 * <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
2064 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2065 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2066 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2067 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2068 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
2069 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
2070 return cursor;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2071 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2072
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2073 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2074 * 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
2075 * 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
2076 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2077 * @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
2078 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2079 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2080 * <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
2081 * <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
2082 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2083 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2084 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2085 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2086 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
2087 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
2088 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
2089 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2090
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2091 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2092 * 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
2093 * <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
2094 * 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
2095 * inactive or "grayed" look.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2096 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2097 * @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
2098 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2099 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2100 * <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
2101 * <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
2102 * </ul>
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 * @see #isEnabled
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2105 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2106 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
2107 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
2108 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
2109 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2110
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2111 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2112 * 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
2113 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2114 * @return the receiver's font
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2115 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2116 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2117 * <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
2118 * <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
2119 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2120 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2121 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
2122 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
2123 if (font !is null) return 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
2124 return Font.gtk_new (display, defaultFont ());
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2125 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2126
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2127 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
2128 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
2129 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
2130 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
2131 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2132
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2133 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2134 * 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
2135 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2136 * @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
2137 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2138 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2139 * <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
2140 * <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
2141 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2142 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2143 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
2144 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
2145 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
2146 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2147
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2148 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
2149 return getFgColor ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2150 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2151
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2152 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
2153 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
2154 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
2155 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
2156 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
2157 return color;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2158 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2159
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2160 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
2161 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
2162 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2163
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2164 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
2165 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
2166 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
2167 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
2168 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
2169 return color;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2170 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2173 * 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
2174 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2175 * @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
2176 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2177 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2178 * <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
2179 * <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
2180 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2181 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2182 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
2183 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
2184 return layoutData;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2185 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2186
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2187 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2188 * 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
2189 * 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
2190 * 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
2191 * 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
2192 * 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
2193 * menu is platform specific.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2194 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2195 * @return the receiver's menu
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2196 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2197 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2198 * <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
2199 * <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
2200 * </ul>
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 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
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 return menu;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2205 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2206
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 * Returns the receiver's monitor.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2209 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2210 * @return the receiver's monitor
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2211 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2212 * @since 3.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2213 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2214 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
2215 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
2216 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
2217 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
2218 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
2219 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
2220 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
2221 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
2222 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
2223 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
2224 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
2225 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
2226 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
2227 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
2228 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
2229 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
2230 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
2231 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
2232 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
2233 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
2234 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
2235 } 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
2236 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
2237 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
2238 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
2239 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
2240 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2241 } 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
2242 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
2243 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2244 return monitor;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2245 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2246
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2247 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2248 * 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
2249 * 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
2250 * a display for a parent.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2251 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2252 * @return the receiver's parent
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2253 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2254 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2255 * <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
2256 * <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
2257 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2258 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2259 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
2260 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
2261 return parent;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2262 }
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 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
2265 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
2266 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
2267 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
2268 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
2269 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
2270 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
2271 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2272 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
2273 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
2274 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
2275 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
2276 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
2277 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2278 return result;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2279 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2280
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 * 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
2283 * 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
2284 * 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
2285 * of other shells.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2286 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2287 * @return the receiver's shell
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2288 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2289 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2290 * <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
2291 * <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
2292 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2293 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2294 * @see #getParent
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 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
2297 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
2298 return _getShell();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2299 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2300
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2301 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
2302 return parent._getShell();
25
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
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 * 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
2307 * not been set.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2308 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2309 * @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
2310 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2311 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2312 * <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
2313 * <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
2314 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2315 */
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 158
diff changeset
2316 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
2317 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
2318 return toolTipText;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2319 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2320 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2321 * 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
2322 * <code>false</code> otherwise.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2323 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2324 * 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
2325 * 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
2326 * 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
2327 * 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
2328 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2329 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2330 * @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
2331 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2332 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2333 * <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
2334 * <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
2335 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2336 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2337 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
2338 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
2339 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
2340 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2341
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2342 override int /*long*/ gtk_button_press_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
2343 if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) 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
2344 /*
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2345 * 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
2346 * 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
2347 * 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
2348 * 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
2349 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2350 Shell shell = _getShell ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2351 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
2352 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
2353 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2354 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
2355 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
2356 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
2357 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
2358 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
2359 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
2360 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
2361 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
2362 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
2363 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2364 bool dragging = false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2365 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
2366 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
2367 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
2368 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
2369 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
2370 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
2371 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2372 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
2373 }
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 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2375 if (!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
2376 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
2377 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2378 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
2379 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
2380 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
2381 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
2382 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2383 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2384 * 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
2385 * 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
2386 * 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
2387 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2388 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
2389 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
2390 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
2391 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
2392 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2393 }
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 }
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 } 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
2396 display.clickCount = 2;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2397 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
2398 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
2399 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2400 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
2401 return result;
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2404 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
2405 /*
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 * 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
2407 * does not deliver a corresponding GTK event. Button 6 and 7
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2408 * 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
2409 * the button number of the event to a negative number so that
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2410 * 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
2411 * 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
2412 */
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 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
2414 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
2415 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
2416 case -7: button = 5; break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 46
diff changeset
2417 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
2418 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2419 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
2420 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2421
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2422 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
2423 char [] chars = fromStringz( text );
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2424 if (chars.length is 0) return 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2425 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
2426 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2427 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2428
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2429 override int /*long*/ gtk_enter_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
2430 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
2431 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
2432 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
2433 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
2434 display.removeMouseHoverTimeout (display.currentControl.handle);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2435 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
2436 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2437 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
2438 display.currentControl = this;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2439 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
2440 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2441 return 0;
25
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
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2444 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
2445 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
2446 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
2447 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
2448 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2449 * 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
2450 * 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
2451 * 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
2452 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2453 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
2454 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
2455 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
2456 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
2457 }
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 }
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 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
2460 }
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 case OS.GDK_FOCUS_CHANGE: {
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 if (widget !is focusHandle ()) 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
2463 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
2464
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 /*
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 * 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
2467 * 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
2468 * 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
2469 * 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
2470 * 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
2471 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2472 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
2473 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
2474 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
2475 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
2476 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
2477 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2478 } 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
2479 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
2480 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
2481 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
2482 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
2483 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
2484 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
2485 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2486 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2487 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2488
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2489 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
2490 break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 46
diff changeset
2491 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
2492 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2493 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2494 return 0;
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2497 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
2498 if ((state & OBSCURED) !is 0) return 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2499 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
2500 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
2501 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
2502 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
2503 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
2504 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
2505 event.height = 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
2506 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
2507 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
2508 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
2509 OS.gdk_gc_set_clip_region (gc.handle, gdkEvent.region);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2510 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
2511 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
2512 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
2513 return 0;
25
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
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 37
diff changeset
2516 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
2517 /* 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
2518 return 1;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2519 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2520
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2521 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
2522 // 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
2523 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
2524 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
2525 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
2526 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
2527 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
2528 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
2529 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2530 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2531 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
2532 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
2533 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
2534 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2535 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2536 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2537 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2538
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2539 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
2540 // 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
2541 if (handle !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2542 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
2543 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
2544 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
2545 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
2546 }
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 }
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2549 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2550 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2551
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2552 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
2553 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
2554
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2555 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
2556 // 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
2557 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
2558
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2559 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
2560 // 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
2561 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
2562
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 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
2564 // 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
2565 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
2566 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
2567 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2568
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2569 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
2570 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
2571 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
2572 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
2573 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
2574 }
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 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
2576 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2577
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2578 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
2579 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
2580 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
2581 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
2582 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
2583 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
2584 if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2585 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
2586 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
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 return result;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2589 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2590
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2591 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
2592 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
2593 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
2594 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
2595 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
2596 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
2597 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
2598 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
2599 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
2600 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
2601 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
2602 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
2603 }
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 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
2605 }
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 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
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 return result;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2609 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2610
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2611 override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* gdkEvent) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2612 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
2613 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
2614 }
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 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
2616 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
2617 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
2618 int pointer_x, pointer_y;
33
27324bbbac70 changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents: 30
diff changeset
2619 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
2620 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
2621 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
2622 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
2623 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
2624 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
2625 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2626 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
2627 return result;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2628 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2629
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2630 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
2631 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
2632 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
2633 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
2634 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
2635 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2636
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2637 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
2638 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
2639 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2640 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2641
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2642 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
2643 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
2644 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
2645 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
2646 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
2647 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2648 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
2649 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
2650 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
2651 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2652 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2653 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2654
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2655 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
2656 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
2657 case OS.GDK_SCROLL_UP:
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2658 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
2659 case OS.GDK_SCROLL_DOWN:
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2660 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
2661 case OS.GDK_SCROLL_LEFT:
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2662 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
2663 case OS.GDK_SCROLL_RIGHT:
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2664 return sendMouseEvent (DWT.MouseDown, 5, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 46
diff changeset
2665 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
2666 }
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 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2668 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2669
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2670 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
2671 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
2672 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
2673 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2674
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2675 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
2676 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
2677 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
2678 }
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 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2680 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2681
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2682 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
2683 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
2684 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
2685 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2686 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2687
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2688 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
2689 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
2690 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
2691 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
2692 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
2693 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
2694 } 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
2695 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
2696 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
2697 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
2698 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
2699 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
2700 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
2701 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
2702 }
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 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
2704 }
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 }
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 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2707 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2708
37
c86fc3d50cfa Decorations
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
2709 /*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
2710 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
2711 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2712
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2713 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2714 * 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
2715 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2716 * <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
2717 * API for <code>Control</code>. It is marked public only so that it
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2718 * 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
2719 * 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
2720 * application code.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2721 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2722 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2723 * @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
2724 * @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
2725 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2726 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
2727 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
2728 auto window = paintWindow ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2729 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
2730 auto gdkGC = OS.gdk_gc_new (cast(GdkDrawable*)window);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2731 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
2732 if (data !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2733 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
2734 if ((data.style & mask) is 0) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2735 data.style |= style & (mask | DWT.MIRRORED);
59
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 }
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.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
2738 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
2739 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
2740 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
2741 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
2742 data.background = control.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
2743 data.font = font !is null ? font.handle : defaultFont ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2744 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2745 return gdkGC;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2746 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2747
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2748 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
2749 return null;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2750 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2751
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2752 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2753 * 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
2754 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2755 * <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
2756 * API for <code>Control</code>. It is marked public only so that it
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2757 * 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
2758 * 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
2759 * application code.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2760 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2761 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2762 * @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
2763 * @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
2764 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2765 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
2766 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
2767 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
2768 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2769
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2770 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2771 * 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
2772 * 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
2773 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2774 * @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
2775 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2776 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2777 * <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
2778 * <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
2779 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2780 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2781 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
2782 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
2783 return true;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2784 }
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2785 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
2786 /*
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 * 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
2788 * 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
2789 */
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 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
2791 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
2792 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
2793 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
2794 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
2795 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
2796 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2797 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
2798 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2799 return true;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2800 }
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2801 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
2802 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
2803 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
2804 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
2805 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
2806 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2807 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2808 int code = traversalCode (0, null);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2809 if ((code & (DWT.TRAVERSE_ARROW_PREVIOUS | DWT.TRAVERSE_ARROW_NEXT)) !is 0) return false;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2810 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
2811 }
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2812 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
2813 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
2814 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
2815 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
2816 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
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2819 int code = traversalCode (0, null);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2820 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
2821 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2822
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2823 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2824 * 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
2825 * 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
2826 * 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
2827 * 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
2828 * 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
2829 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2830 * @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
2831 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2832 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2833 * <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
2834 * <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
2835 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2836 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2837 * @see #getEnabled
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2838 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2839 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
2840 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
2841 return getEnabled () && parent.isEnabled ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2842 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2843
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2844 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
2845 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
2846 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
2847 }
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 return control is this;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2849 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2850
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2851 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2852 * 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
2853 * 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
2854 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2855 * @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
2856 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2857 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2858 * <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
2859 * <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
2860 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2861 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2862 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
2863 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
2864 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
2865 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
2866 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
2867 }
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 return hasFocus ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2869 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2872 * 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
2873 * 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
2874 * 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
2875 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2876 * @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
2877 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2878 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2879 * <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
2880 * <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
2881 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2882 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2883 * @see #getVisible
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2884 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2885 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
2886 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
2887 return getVisible () && parent.isVisible ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2888 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2889
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2890 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
2891 return parent.menuShell ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2892 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2893
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
2894 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
2895 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2896 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2897
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
2898 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
2899 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2900 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2901
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2902 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
2903 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
2904 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
2905 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
2906 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
2907 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2908
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2909 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2910 * 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
2911 * 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
2912 * 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
2913 * including the background.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2914 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2915 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2916 * <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
2917 * <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
2918 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2919 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2920 * @see #update()
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2921 * @see PaintListener
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2922 * @see DWT#Paint
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2923 * @see DWT#NO_BACKGROUND
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2924 * @see DWT#NO_REDRAW_RESIZE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2925 * @see DWT#NO_MERGE_PAINTS
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2926 * @see DWT#DOUBLE_BUFFERED
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2927 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2928 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
2929 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
2930 redraw (false);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2931 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2932
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2933 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
2934 // 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
2935 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
2936 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
2937 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2938
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2939 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2940 * 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
2941 * 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
2942 * 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
2943 * 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
2944 * 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
2945 * 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
2946 * 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
2947 * <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
2948 * will not be painted.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2949 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2950 * @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
2951 * @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
2952 * @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
2953 * @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
2954 * @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
2955 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2956 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2957 * <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
2958 * <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
2959 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2960 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2961 * @see #update()
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2962 * @see PaintListener
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2963 * @see DWT#Paint
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2964 * @see DWT#NO_BACKGROUND
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2965 * @see DWT#NO_REDRAW_RESIZE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2966 * @see DWT#NO_MERGE_PAINTS
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
2967 * @see DWT#DOUBLE_BUFFERED
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2968 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2969 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
2970 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
2971 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
2972 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
2973 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2974
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2975 void redrawChildren () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2976 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2977
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
2978 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
2979 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
2980 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
2981 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
2982 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
2983 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
2984 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
2985 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
2986 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
2987 } 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
2988 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
2989 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
2990 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
2991 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
2992 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
2993 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
2994 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2995
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
2996 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
2997 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
2998 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
2999 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
3000 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
3001 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
3002 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
3003 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
3004 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3005 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
3006 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
3007 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
3008 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3009 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3010 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
3011 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
3012 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
3013 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3014 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3015
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
3016 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
3017 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
3018 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
3019 parent = null;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3020 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3021
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
3022 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
3023 parent.removeControl (this);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3024 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3025
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
3026 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
3027 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
3028 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
3029 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
3030 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
3031 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
3032 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
3033 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
3034 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3035 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
3036 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
3037 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
3038 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
3039 }
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 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
3041 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
3042 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
3043 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3044 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
3045 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
3046 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
3047 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
3048 accessible = null;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3049 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3050
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3051 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
3052 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
3053 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
3054 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
3055 event.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
3056 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
3057 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
3058 } 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
3059 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
3060 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3061 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
3062 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
3063 return event.doit;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3064 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3065
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3066 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
3067 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
3068 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
3069 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
3070 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
3071 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
3072 display.focusControl = null;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3073 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
3074 /*
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 * 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
3076 * 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
3077 * 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
3078 * 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
3079 */
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 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
3081 switch (type) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3082 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
3083 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
3084 break;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3085 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
3086 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
3087 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
3088 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3089 break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 46
diff changeset
3090 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
3091 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3092 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3093 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3094
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3095 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
3096 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
3097 while (control !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3098 if (control.hooks (DWT.Help)) {
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3099 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
3100 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
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 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
3103 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3104 return false;
25
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
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3107 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
3108 return false;
25
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
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3111 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
3112 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
3113 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3114
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3115 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
3116 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
3117 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
3118 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
3119 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
3120 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
3121 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
3122 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
3123 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
3124 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
3125 } 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
3126 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
3127 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
3128 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
3129 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
3130 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
3131 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3132 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
3133 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
3134 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
3135 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
3136 } 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
3137 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
3138 }
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 return event.doit;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3140 }
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 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
3143 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
3144 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
3145 } 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
3146 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
3147 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3148 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
3149 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3150
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3151 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3152 * 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
3153 * 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
3154 * if the argument is null.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3155 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3156 * 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
3157 * 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
3158 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3159 * @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
3160 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3161 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3162 * <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
3163 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3164 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3165 * <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
3166 * <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
3167 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3168 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3169 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
3170 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
3171 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
3172 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
3173 if (color !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3174 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
3175 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
3176 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3177 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
3178 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
3179 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
3180 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
3181 } 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
3182 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
3183 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
3184 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3185 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
3186 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
3187 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
3188 } 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
3189 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
3190 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3191 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
3192 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
3193 }
25
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
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3196 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
3197 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
3198 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
3199 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
3200 if (ptr !is null) OS.g_free (ptr);
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 158
diff changeset
3201 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
3202 ptr = cast(char*)OS.g_malloc (name.length+1);
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
3203 ptr[ 0 .. name.length ] = name;
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
3204 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
3205 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
3206 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
3207 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
3208 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
3209 OS.gtk_rc_style_set_color_flags (style, index, flags);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3210 OS.gtk_widget_modify_style (handle, style);
25
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
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3213 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
3214 setBackgroundColor (handle, color);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3215 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3216
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3217 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3218 * 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
3219 * 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
3220 * 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
3221 * the available space.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3222 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3223 * 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
3224 * 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
3225 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3226 * @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
3227 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3228 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3229 * <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
3230 * <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
3231 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3232 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3233 * <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
3234 * <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
3235 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3236 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3237 * @since 3.2
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3238 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3239 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
3240 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3241 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
3242 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
3243 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
3244 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
3245 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
3246 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
3247 } 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
3248 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
3249 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3250 redrawChildren ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3251 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3252
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3253 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
3254 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
3255 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
3256 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3257
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3258 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3259 * 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
3260 * all mouse events delivered to it until the method is called with
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3261 * <code>false</code> as the argument.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3262 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3263 * @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
3264 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3265 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3266 * <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
3267 * <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
3268 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3269 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3270 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
3271 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
3272 /* 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
3273 /*
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 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
3275 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
3276 } 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
3277 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
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 */
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3280 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3281 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3282 * 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
3283 * 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
3284 * if the argument is null.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3285 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3286 * 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
3287 * 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
3288 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3289 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3290 * @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
3291 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3292 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3293 * <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
3294 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3295 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3296 * <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
3297 * <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
3298 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3299 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3300 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
3301 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3302 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
3303 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
3304 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
3305 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3306
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
3307 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
3308 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
3309 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
3310 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
3311 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
3312 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
3313 } 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
3314 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
3315 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
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 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3318 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3319
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3320 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3321 * 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
3322 * <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
3323 * 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
3324 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3325 * @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
3326 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3327 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3328 * <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
3329 * <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
3330 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3331 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3332 * @since 3.3
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3333 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3334 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
3335 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
3336 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
3337 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
3338 } 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
3339 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
3340 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3341 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3344 * 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
3345 * 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
3346 * 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
3347 * inactive or "grayed" look.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3348 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3349 * @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
3350 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3351 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3352 * <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
3353 * <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
3354 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3355 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3356 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
3357 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
3358 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
3359 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
3360 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
3361 if (!enabled) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3362 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
3363 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
3364 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
3365 }
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 }
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 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
3368 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
3369 } 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
3370 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
3371 }
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 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
3373 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
3374 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
3375 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
3376 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
3377 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
3378 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
3379 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3380 } 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
3381 OS.gtk_widget_realize (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
3382 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
3383 auto window = OS.GTK_WIDGET_WINDOW (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
3384 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
3385 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
3386 attributes.x = rect.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
3387 attributes.y = rect.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
3388 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
3389 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
3390 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
3391 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
3392 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
3393 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
3394 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
3395 auto topHandle = topHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3396 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
3397 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
3398 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
3399 } 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
3400 auto topWindow = OS.GTK_WIDGET_WINDOW (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3401 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
3402 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
3403 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
3404 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
3405 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
3406 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
3407 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
3408 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
3409 }
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 if (OS.GTK_WIDGET_VISIBLE (topHandle)) 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
3411 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3412 }
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 if (fixFocus_) fixFocus (control);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3414 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3415
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3416 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3417 * 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
3418 * 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
3419 * 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
3420 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3421 * @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
3422 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3423 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3424 * <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
3425 * <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
3426 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3427 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3428 * @see #forceFocus
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3429 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3430 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
3431 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3432 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
3433 return forceFocus ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3434 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3435
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3436 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3437 * 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
3438 * 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
3439 * 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
3440 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3441 * @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
3442 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3443 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3444 * <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
3445 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3446 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3447 * <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
3448 * <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
3449 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3450 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3451 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
3452 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
3453 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
3454 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
3455 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
3456 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
3457 fontDesc = defaultFont ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3458 } else {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3459 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
3460 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
3461 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3462 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
3463 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
3464 } 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
3465 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
3466 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3467 setFontDescription (fontDesc);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3468 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3469
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3470 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
3471 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
3472 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3473
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 * 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
3476 * 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
3477 * if the argument is null.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3478 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3479 * 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
3480 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3481 * @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
3482 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3483 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3484 * <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
3485 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3486 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3487 * <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
3488 * <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
3489 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3490 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3491 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
3492 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
3493 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
3494 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
3495 if (color !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3496 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
3497 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
3498 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3499 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
3500 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
3501 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
3502 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
3503 } 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
3504 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
3505 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
3506 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3507 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
3508 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
3509 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
3510 } 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
3511 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
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 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
3514 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3515 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3516
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3517 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
3518 setForegroundColor (handle, color);
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 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
3522 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
3523 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3524 * 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
3525 * 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
3526 * first sized. The fix is to set the value to (0, 0) as
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3527 * 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
3528 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3529 auto topHandle = topHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3530 OS.GTK_WIDGET_SET_X (topHandle, 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
3531 OS.GTK_WIDGET_SET_Y (topHandle, 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
3532 } 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
3533 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
3534 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
3535 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3536 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3537
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 * 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
3540 * 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
3541 * 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
3542 * 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
3543 * 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
3544 * menu is platform specific.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3545 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3546 * 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
3547 * 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
3548 * 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
3549 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3550 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3551 * @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
3552 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3553 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3554 * <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
3555 * <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
3556 * <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
3557 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3558 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3559 * <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
3560 * <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
3561 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3562 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3563 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
3564 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
3565 if (menu !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3566 if ((menu.style & DWT.POP_UP) is 0) {
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3567 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
3568 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3569 if (menu.parent !is menuShell ()) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3570 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
3571 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3572 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3573 this.menu = menu;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3574 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3575
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
3576 override void setOrientation () {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3577 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
3578 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
3579 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
3580 }
25
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3584 * 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
3585 * 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
3586 * 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
3587 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3588 * @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
3589 * @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
3590 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3591 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3592 * <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
3593 * <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
3594 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3595 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3596 * <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
3597 * <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
3598 * </ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3599 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3600 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
3601 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3602 if (parent is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3603 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
3604 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
3605 if (!isReparentable ()) 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
3606 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
3607 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
3608 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
3609 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
3610 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
3611 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
3612 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
3613 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
3614 }
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 auto topHandle = topHandle ();
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 auto newParent = 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
3617 int x = OS.GTK_WIDGET_X (topHandle);
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 int y = OS.GTK_WIDGET_Y (topHandle);
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 OS.gtk_widget_reparent (topHandle, newParent);
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_fixed_move (cast(GtkFixed*)newParent, topHandle, 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
3621 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
3622 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
3623 return true;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3624 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3625
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3626 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
3627 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
3628 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
3629 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3630
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3631 void setParentWindow (GtkWidget* widget) {
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3632 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3633
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3634 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
3635 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3636 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3637
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3638 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3639 * 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
3640 * 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
3641 * 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
3642 * 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
3643 * <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
3644 * 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
3645 * to this method are stacked.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3646 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3647 * 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
3648 * platforms or for some widgets.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3649 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3650 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3651 * @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
3652 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3653 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3654 * <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
3655 * <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
3656 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3657 *
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3658 * @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
3659 * @see #update()
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3660 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3661 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
3662 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
3663 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
3664 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
3665 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
3666 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
3667 /* 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
3668 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
3669 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
3670 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
3671 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
3672 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3673 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3674 } 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
3675 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
3676 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
3677 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
3678 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
3679 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
3680 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
3681 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
3682 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
3683 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
3684 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
3685 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
3686 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
3687 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
3688 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
3689 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
3690 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
3691 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
3692 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
3693 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
3694 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3695 }
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3697 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3698 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3699
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3700 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
3701 return setTabItemFocus (next);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3702 }
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3703 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
3704 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
3705 return forceFocus ();
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3708 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3709 * 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
3710 * 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
3711 *
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3712 * @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
3713 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3714 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3715 * <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
3716 * <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
3717 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3718 */
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 158
diff changeset
3719 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
3720 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
3721 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
3722 toolTipText = str;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3723 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3724
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 158
diff changeset
3725 void setToolTipText (Shell shell, String newString) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3726 shell.setToolTipText (eventHandle (), newString);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3727 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3730 * 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
3731 * and marks it invisible otherwise.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3732 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3733 * 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
3734 * 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
3735 * 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
3736 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3737 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3738 * @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
3739 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3740 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3741 * <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
3742 * <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
3743 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3744 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3745 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
3746 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
3747 if (((state & HIDDEN) is 0) is visible) 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
3748 auto topHandle = topHandle();
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 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
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 * 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
3752 * 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
3753 * 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
3754 */
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3755 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
3756 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
3757 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
3758 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
3759 if (enableWindow !is null) 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
3760 OS.gtk_widget_show (topHandle);
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 } 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
3763 /*
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 * 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
3765 * 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
3766 * 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
3767 * 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
3768 *
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3769 * 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
3770 * 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
3771 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3772 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
3773 bool fixFocus_ = false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3774 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
3775 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
3776 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
3777 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3778 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
3779 if (fixFocus_) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3780 OS.GTK_WIDGET_UNSET_FLAGS (topHandle, 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
3781 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
3782 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
3783 OS.GTK_WIDGET_SET_FLAGS (topHandle, 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
3784 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3785 OS.gtk_widget_hide (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3786 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
3787 if (enableWindow !is null) OS.gdk_window_hide (enableWindow);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3788 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
3789 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3790 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3791
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3792 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
3793 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
3794 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3795
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3796 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
3797 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
3798 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
3799 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
3800 /* 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
3801 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
3802 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
3803 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
3804 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
3805 }
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 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
3807 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
3808 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
3809 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
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3812 /* 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
3813 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
3814 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
3815 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
3816 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
3817 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3818 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
3819 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
3820 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
3821 } 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
3822 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
3823 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
3824 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3825 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3826 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3827 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3828
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3829 auto topHandle = topHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3830 auto siblingHandle = sibling !is null ? sibling.topHandle () : 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
3831 auto window = OS.GTK_WIDGET_WINDOW (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3832 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
3833 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
3834 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
3835 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
3836 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
3837 } 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
3838 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
3839 }
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3841 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
3842 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
3843 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
3844 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
3845 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
3846 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
3847 } 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
3848 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
3849 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
3850 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3851 } 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
3852 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
3853 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
3854 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
3855 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
3856 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
3857 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
3858 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
3859 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
3860 /*
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 * 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
3862 * 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
3863 * 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
3864 * 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
3865 * 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
3866 * 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
3867 * 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
3868 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3869 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
3870 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
3871 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
3872 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
3873 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
3874 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
3875 }
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 }
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3878 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
3879 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
3880 parent.moveAbove (topHandle, 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
3881 } 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
3882 parent.moveBelow (topHandle, 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
3883 }
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3885 /* 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
3886 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
3887
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3888 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
3889 /* 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
3890 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
3891 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
3892 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
3893 } 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
3894 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
3895 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3896 } 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
3897 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
3898 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
3899 } 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
3900 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
3901 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3902 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3903
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3904 /* 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
3905 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
3906 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
3907 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
3908 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3909 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
3910 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
3911 }
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 (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
3913 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
3914 /* 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
3915 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
3916 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
3917 }
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 }
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 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3920 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3921
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3922 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
3923 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
3924 auto style = OS.gtk_widget_get_modifier_style (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
3925 OS.gtk_widget_modify_style (fixedHandle, 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
3926 }
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 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
3928 OS.gtk_widget_modify_style (handle, style);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3929 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3930
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3931 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
3932 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
3933 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
3934 event.y = y;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3935 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
3936 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
3937 if (menu !is null && !menu.isDisposed ()) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3938 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
3939 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
3940 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
3941 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
3942 }
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 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
3944 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
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3947 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3948 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3949
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3950 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
3951 // 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
3952 state |= ZERO_WIDTH | 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
3953 auto topHandle = topHandle ();
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 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
3955 parent.setParentWindow (topHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3956 OS.gtk_container_add (cast(GtkContainer*)parentHandle, topHandle);
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
3957 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
3958 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
3959 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
3960 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3961 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
3962 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3963
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3964 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
3965 /* 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
3966 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
3967 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
3968 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
3969 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
3970 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
3971 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
3972 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
3973 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
3974 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3975 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3976 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
3977 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3978 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3979
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3980 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3981 * 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
3982 * traversal action. The argument should be one of the constants:
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3983 * <code>DWT.TRAVERSE_ESCAPE</code>, <code>DWT.TRAVERSE_RETURN</code>,
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3984 * <code>DWT.TRAVERSE_TAB_NEXT</code>, <code>DWT.TRAVERSE_TAB_PREVIOUS</code>,
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3985 * <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
3986 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3987 * @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
3988 * @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
3989 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
3990 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3991 * <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
3992 * <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
3993 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3994 */
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
3995 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
3996 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
3997 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
3998 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
3999 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
4000 return traverse (event);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4001 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4002
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4003 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
4004 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
4005 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
4006 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
4007 return traverse (event);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4008 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4009
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4010 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
4011 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
4012 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
4013 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
4014 int code = traversalCode (keyval, gdkEvent);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4015 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
4016 } 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
4017 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
4018 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
4019 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
4020 }
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 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
4022 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
4023 Event event = new Event ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4024 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
4025 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
4026 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
4027 }
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 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4030 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4031
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4032 bool translateTraversal (GdkEventKey* keyEvent) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4033 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
4034 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
4035 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
4036 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
4037 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
4038 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
4039 all = true;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4040 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
4041 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
4042 }
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 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
4044 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
4045 all = true;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4046 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
4047 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
4048 }
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 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
4050 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
4051 bool next = (keyEvent.state & OS.GDK_SHIFT_MASK) is 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4052 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
4053 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
4054 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4055 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
4056 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
4057 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
4058 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
4059 bool next = key is OS.GDK_Down || key is OS.GDK_Right;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4060 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
4061 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
4062 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4063 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
4064 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
4065 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
4066 if ((keyEvent.state & OS.GDK_CONTROL_MASK) is 0) return false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4067 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
4068 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
4069 }
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 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
4071 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
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 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
4074 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
4075 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
4076 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
4077 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
4078 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
4079 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
4080 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
4081 if (control.traverse (event)) return true;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4082 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
4083 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
4084 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
4085 } 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
4086 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4087 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4088
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4089 int traversalCode (int key, GdkEventKey* event) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4090 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
4091 Shell shell = getShell ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4092 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
4093 return code;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4094 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4095
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4096 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
4097 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4098 * 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
4099 * 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
4100 * 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
4101 * 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
4102 */
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4103 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
4104 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
4105 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
4106 switch (event.detail) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4107 case DWT.TRAVERSE_NONE: return true;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4108 case DWT.TRAVERSE_ESCAPE: return traverseEscape ();
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4109 case DWT.TRAVERSE_RETURN: return traverseReturn ();
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4110 case DWT.TRAVERSE_TAB_NEXT: return traverseGroup (true);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4111 case DWT.TRAVERSE_TAB_PREVIOUS: return traverseGroup (false);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4112 case DWT.TRAVERSE_ARROW_NEXT: return traverseItem (true);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4113 case DWT.TRAVERSE_ARROW_PREVIOUS: return traverseItem (false);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4114 case DWT.TRAVERSE_MNEMONIC: return traverseMnemonic (event.character);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4115 case DWT.TRAVERSE_PAGE_NEXT: return traversePage (true);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4116 case DWT.TRAVERSE_PAGE_PREVIOUS: return traversePage (false);
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 46
diff changeset
4117 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
4118 }
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 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4120 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4121
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4122 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
4123 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4124 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4125
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4126 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
4127 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
4128 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
4129 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
4130 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
4131 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
4132 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
4133 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
4134 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
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 /*
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 * 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
4138 * 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
4139 * 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
4140 * 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
4141 */
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 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
4143 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
4144 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
4145 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
4146 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
4147 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
4148 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4149 }
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 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
4151 return group.setTabGroupFocus (next);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4152 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4153
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4154 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
4155 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
4156 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
4157 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
4158 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
4159 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
4160 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
4161 }
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 * 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
4164 * 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
4165 * 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
4166 * 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
4167 */
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 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
4169 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
4170 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
4171 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
4172 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
4173 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
4174 }
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 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4177 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4178
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4179 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
4180 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4181 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4182
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4183 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
4184 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4185 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4186
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4187 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
4188 return mnemonicHit (key);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4189 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4190
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4191 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4192 * 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
4193 * 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
4194 * 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
4195 * nothing.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4196 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4197 * 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
4198 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4199 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4200 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4201 * <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
4202 * <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
4203 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4204 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4205 * @see #redraw()
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4206 * @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
4207 * @see PaintListener
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
4208 * @see DWT#Paint
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4209 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4210 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
4211 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
4212 update (false, true);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4213 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4214
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4215 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
4216 // 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
4217 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
4218 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
4219 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
4220 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
4221 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
4222 OS.gdk_flush ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4223 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4224
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4225 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
4226 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
4227 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
4228 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
4229 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
4230 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4231 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4232
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
4233 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
4234 /* Do nothing */
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4235 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4236
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 55
diff changeset
4237 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
4238 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
4239 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
4240 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
4241 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
4242 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
4243 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
4244 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
4245 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
4246 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
4247 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
4248 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
4249 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
4250 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
4251 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
4252 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
4253 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
4254 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
4255 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
4256 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4257 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4258 break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 46
diff changeset
4259 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
4260 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4261 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
4262 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
4263 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4264 }