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

reverted char[] to String
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:42:55 +0200
parents 17f8449522fd
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.Shell;
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: 152
diff changeset
15 import dwt.dwthelper.utils;
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 152
diff changeset
16
30
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
17 import dwt.widgets.Composite;
5e5d1c9cffdb ATK, Control
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
18 import dwt.widgets.Control;
33
27324bbbac70 changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents: 30
diff changeset
19 import dwt.internal.c.gtk;
26
09f5459a5014 Display in work
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
20
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
21 import dwt.DWT;
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
22 import dwt.internal.gtk.OS;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
23 import dwt.events.ShellListener;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
24 import dwt.graphics.Cursor;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
25 import dwt.graphics.Image;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
26 import dwt.graphics.Point;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
27 import dwt.graphics.Rectangle;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
28 import dwt.graphics.Region;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
29 import dwt.internal.Converter;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
30 import dwt.internal.DWTEventListener;
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
31 import dwt.widgets.Composite;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
32 import dwt.widgets.Control;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
33 import dwt.widgets.Decorations;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
34 import dwt.widgets.Display;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
35 import dwt.widgets.Event;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
36 import dwt.widgets.EventTable;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
37 import dwt.widgets.Layout;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
38 import dwt.widgets.Listener;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
39 import dwt.widgets.Menu;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
40 import dwt.widgets.Monitor;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
41 import dwt.widgets.TypedListener;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
42 import dwt.widgets.Widget;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
44 import Unicode = tango.text.Unicode;
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
45 import tango.stdc.stringz;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 * Instances of this class represent the "windows"
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 * which the desktop or "window manager" is managing.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50 * Instances that do not have a parent (that is, they
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 * are built using the constructor, which takes a
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52 * <code>Display</code> as the argument) are described
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 * as <em>top level</em> shells. Instances that do have
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 * a parent are described as <em>secondary</em> or
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55 * <em>dialog</em> shells.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
57 * Instances are always displayed in one of the maximized,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 * minimized or normal states:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59 * <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
60 * <li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 * When an instance is marked as <em>maximized</em>, the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62 * window manager will typically resize it to fill the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63 * entire visible area of the display, and the instance
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 * is usually put in a state where it can not be resized
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65 * (even if it has style <code>RESIZE</code>) until it is
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 * no longer maximized.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 * </li><li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68 * When an instance is in the <em>normal</em> state (neither
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 * maximized or minimized), its appearance is controlled by
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
70 * the style constants which were specified when it was created
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
71 * and the restrictions of the window manager (see below).
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
72 * </li><li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
73 * When an instance has been marked as <em>minimized</em>,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
74 * its contents (client area) will usually not be visible,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
75 * and depending on the window manager, it may be
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
76 * "iconified" (that is, replaced on the desktop by a small
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
77 * simplified representation of itself), relocated to a
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78 * distinguished area of the screen, or hidden. Combinations
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79 * of these changes are also possible.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 * </li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83 * The <em>modality</em> of an instance may be specified using
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84 * style bits. The modality style bits are used to determine
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
85 * whether input is blocked for other shells on the display.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
86 * The <code>PRIMARY_MODAL</code> style allows an instance to block
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
87 * input to its parent. The <code>APPLICATION_MODAL</code> style
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
88 * allows an instance to block input to every other shell in the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89 * display. The <code>SYSTEM_MODAL</code> style allows an instance
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 * to block input to all shells, including shells belonging to
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
91 * different applications.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
92 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
93 * Note: The styles supported by this class are treated
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
94 * as <em>HINT</em>s, since the window manager for the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
95 * desktop on which the instance is visible has ultimate
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
96 * control over the appearance and behavior of decorations
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
97 * and modality. For example, some window managers only
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
98 * support resizable windows and will always assume the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
99 * RESIZE style, even if it is not set. In addition, if a
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
100 * modality style is not supported, it is "upgraded" to a
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
101 * more restrictive modality style that is supported. For
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102 * example, if <code>PRIMARY_MODAL</code> is not supported,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
103 * it would be upgraded to <code>APPLICATION_MODAL</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 * A modality style may also be "downgraded" to a less
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105 * restrictive style. For example, most operating systems
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 * no longer support <code>SYSTEM_MODAL</code> because
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 * it can freeze up the desktop, so this is typically
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
108 * downgraded to <code>APPLICATION_MODAL</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109 * <dl>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 * <dt><b>Styles:</b></dt>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
111 * <dd>BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL</dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
112 * <dd>APPLICATION_MODAL, MODELESS, PRIMARY_MODAL, SYSTEM_MODAL</dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
113 * <dt><b>Events:</b></dt>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 * <dd>Activate, Close, Deactivate, Deiconify, Iconify</dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
115 * </dl>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
116 * Class <code>DWT</code> provides two "convenience constants"
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
117 * for the most commonly required style combinations:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 * <dl>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 * <dt><code>SHELL_TRIM</code></dt>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
120 * <dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
121 * the result of combining the constants which are required
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 * to produce a typical application top level shell: (that
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 * </dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
125 * <dt><code>DIALOG_TRIM</code></dt>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 * <dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127 * the result of combining the constants which are required
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128 * to produce a typical application dialog shell: (that
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 * is, <code>TITLE | CLOSE | BORDER</code>)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130 * </dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131 * </dl>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
134 * Note: Only one of the styles APPLICATION_MODAL, MODELESS,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
135 * PRIMARY_MODAL and SYSTEM_MODAL may be specified.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
136 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
137 * IMPORTANT: This class is not intended to be subclassed.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
138 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
139 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
140 * @see Decorations
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
141 * @see DWT
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
142 */
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
143 public class Shell : Decorations {
150
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
144
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
145 alias Decorations.createHandle createHandle;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
146 alias Decorations.fixStyle fixStyle;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
147 alias Decorations.setBounds setBounds;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
148 alias Decorations.setCursor setCursor;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
149 alias Decorations.setToolTipText setToolTipText;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
150 alias Decorations.setZOrder setZOrder;
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
151
59
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 GtkWidget* shellHandle, tooltipsHandle, tooltipWindow;
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 bool mapped, moved, resized, opened;
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 int oldX, oldY, oldWidth, 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
155 int minWidth, minHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
156 Control lastActive;
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 Region region;
42
787b5413b0ce accessibility package
Frank Benoit <benoit@tionex.de>
parents: 40
diff changeset
158 CallbackData filterProcCallbackData;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
159 CallbackData sizeAllocateProcCallbackData;
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
160 CallbackData sizeRequestProcCallbackData;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
161
59
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 static final int MAXIMUM_TRIM = 128;
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
165 * Constructs a new instance of this class. This is equivalent
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
166 * to calling <code>Shell((Display) null)</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
167 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
168 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
169 * <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
170 * <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
171 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
172 */
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
173 public this () {
59
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 this (cast(Display) null);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
175 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
176 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
177 * Constructs a new instance of this class given only the style
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
178 * value describing its behavior and appearance. This is equivalent
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
179 * to calling <code>Shell((Display) null, style)</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
180 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
181 * The style value is either one of the style constants defined in
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
182 * 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
183 * 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
184 * (that is, using the <code>int</code> "|" operator) two or more
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
185 * 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
186 * 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
187 * 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
188 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
189 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
190 * @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
191 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
192 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
193 * <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
194 * <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
195 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
196 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
197 * @see DWT#BORDER
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
198 * @see DWT#CLOSE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
199 * @see DWT#MIN
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
200 * @see DWT#MAX
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
201 * @see DWT#RESIZE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
202 * @see DWT#TITLE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
203 * @see DWT#NO_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
204 * @see DWT#SHELL_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
205 * @see DWT#DIALOG_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
206 * @see DWT#MODELESS
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
207 * @see DWT#PRIMARY_MODAL
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
208 * @see DWT#APPLICATION_MODAL
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
209 * @see DWT#SYSTEM_MODAL
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
210 */
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
211 public this (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
212 this (cast(Display) null, style);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
213 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
214
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 * Constructs a new instance of this class given only the display
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
217 * to create it on. It is created with style <code>DWT.SHELL_TRIM</code>.
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
218 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
219 * Note: Currently, null can be passed in for the display argument.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
220 * This has the effect of creating the shell on the currently active
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
221 * display if there is one. If there is no current display, the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
222 * shell is created on a "default" display. <b>Passing in null as
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
223 * the display argument is not considered to be good coding style,
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
224 * and may not be supported in a future release of DWT.</b>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
225 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
226 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
227 * @param display the display to create the shell on
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
228 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
229 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
230 * <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
231 * <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
232 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
233 */
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
234 public this (Display display) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
235 this (display, DWT.SHELL_TRIM);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
236 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
237 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
238 * Constructs a new instance of this class given the display
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
239 * to create it on and a style value describing its behavior
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
240 * and appearance.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
241 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
242 * The style value is either one of the style constants defined in
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
243 * 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
244 * 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
245 * (that is, using the <code>int</code> "|" operator) two or more
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
246 * 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
247 * 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
248 * 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
249 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
250 * Note: Currently, null can be passed in for the display argument.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
251 * This has the effect of creating the shell on the currently active
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
252 * display if there is one. If there is no current display, the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
253 * shell is created on a "default" display. <b>Passing in null as
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
254 * the display argument is not considered to be good coding style,
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
255 * and may not be supported in a future release of DWT.</b>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
256 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
257 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
258 * @param display the display to create the shell on
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
259 * @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
260 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
261 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
262 * <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
263 * <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
264 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
265 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
266 * @see DWT#BORDER
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
267 * @see DWT#CLOSE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
268 * @see DWT#MIN
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
269 * @see DWT#MAX
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
270 * @see DWT#RESIZE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
271 * @see DWT#TITLE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
272 * @see DWT#NO_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
273 * @see DWT#SHELL_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
274 * @see DWT#DIALOG_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
275 * @see DWT#MODELESS
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
276 * @see DWT#PRIMARY_MODAL
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
277 * @see DWT#APPLICATION_MODAL
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
278 * @see DWT#SYSTEM_MODAL
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
279 */
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
280 public this (Display display, 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
281 this (display, null, style, null, false);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
282 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
283
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
284 this (Display display, Shell parent, int style, GtkWidget* handle, bool embedded) {
59
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 super ();
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 checkSubclass ();
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 if (display is null) display = Display.getCurrent ();
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 if (display is null) display = Display.getDefault ();
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 if (!display.isValidThread ()) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
290 error (DWT.ERROR_THREAD_INVALID_ACCESS);
59
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 }
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 (parent !is null && parent.isDisposed ()) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
293 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
294 }
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 this.style = checkStyle (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
296 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
297 this.display = 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
298 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
299 if (embedded) {
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 this.handle = 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
301 } 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
302 shellHandle = 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
303 state |= FOREIGN_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
304 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
305 }
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 createWidget (0);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
307 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
308
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
309 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
310 * Constructs a new instance of this class given only its
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
311 * parent. It is created with style <code>DWT.DIALOG_TRIM</code>.
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
312 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
313 * Note: Currently, null can be passed in for the parent.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
314 * This has the effect of creating the shell on the currently active
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
315 * display if there is one. If there is no current display, the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
316 * shell is created on a "default" display. <b>Passing in null as
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
317 * the parent is not considered to be good coding style,
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
318 * and may not be supported in a future release of DWT.</b>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
319 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
320 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
321 * @param parent a shell which will be the parent of the new instance
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
322 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
323 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
324 * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
325 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
326 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
327 * <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
328 * <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
329 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
330 */
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
331 public this (Shell parent) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
332 this (parent, DWT.DIALOG_TRIM);
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
335 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
336 * 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
337 * 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
338 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
339 * The style value is either one of the style constants defined in
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
340 * 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
341 * 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
342 * (that is, using the <code>int</code> "|" operator) two or more
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
343 * 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
344 * 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
345 * 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
346 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
347 * Note: Currently, null can be passed in for the parent.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
348 * This has the effect of creating the shell on the currently active
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
349 * display if there is one. If there is no current display, the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
350 * shell is created on a "default" display. <b>Passing in null as
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
351 * the parent is not considered to be good coding style,
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
352 * and may not be supported in a future release of DWT.</b>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
353 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
354 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
355 * @param parent a shell which will be the parent of the new instance
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
356 * @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
357 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
358 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
359 * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
360 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
361 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
362 * <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
363 * <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
364 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
365 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
366 * @see DWT#BORDER
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
367 * @see DWT#CLOSE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
368 * @see DWT#MIN
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
369 * @see DWT#MAX
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
370 * @see DWT#RESIZE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
371 * @see DWT#TITLE
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
372 * @see DWT#NO_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
373 * @see DWT#SHELL_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
374 * @see DWT#DIALOG_TRIM
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
375 * @see DWT#ON_TOP
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
376 * @see DWT#TOOL
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
377 * @see DWT#MODELESS
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
378 * @see DWT#PRIMARY_MODAL
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
379 * @see DWT#APPLICATION_MODAL
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
380 * @see DWT#SYSTEM_MODAL
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
381 */
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
382 public this (Shell 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
383 this (parent !is null ? parent.display : null, parent, style, null, false);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
384 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
385
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
386 public static Shell gtk_new (Display display, GtkWidget* handle) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
387 return new Shell (display, null, DWT.NO_TRIM, handle, true);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
388 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
389
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
390 public static Shell internal_new (Display display, GtkWidget* handle) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
391 return new Shell (display, null, DWT.NO_TRIM, handle, false);
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
394 static int checkStyle (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
395 style = Decorations.checkStyle (style);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
396 if ((style & DWT.ON_TOP) !is 0) style &= ~DWT.SHELL_TRIM;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
397 int mask = DWT.SYSTEM_MODAL | DWT.APPLICATION_MODAL | DWT.PRIMARY_MODAL;
59
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 int bits = style & ~mask;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
399 if ((style & DWT.SYSTEM_MODAL) !is 0) return bits | DWT.SYSTEM_MODAL;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
400 if ((style & DWT.APPLICATION_MODAL) !is 0) return bits | DWT.APPLICATION_MODAL;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
401 if ((style & DWT.PRIMARY_MODAL) !is 0) return bits | DWT.PRIMARY_MODAL;
59
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 return bits;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
403 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
404
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
405 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
406 * 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
407 * be notified when operations are performed on the receiver,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
408 * by sending the listener 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
409 * <code>ShellListener</code> interface.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
410 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
411 * @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
412 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
413 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
414 * <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
415 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
416 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
417 * <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
418 * <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
419 * </ul>
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 * @see ShellListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
422 * @see #removeShellListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
423 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
424 public void addShellListener (ShellListener 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
425 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
426 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
427 TypedListener typedListener = new TypedListener (listener);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
428 addListener (DWT.Close,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
429 addListener (DWT.Iconify,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
430 addListener (DWT.Deiconify,typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
431 addListener (DWT.Activate, typedListener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
432 addListener (DWT.Deactivate, typedListener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
433 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
434
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
435 void adjustTrim () {
59
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 if (display.ignoreTrim) 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
437 int width = OS.GTK_WIDGET_WIDTH (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
438 int height = OS.GTK_WIDGET_HEIGHT (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
439 auto window = OS.GTK_WIDGET_WINDOW (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
440 GdkRectangle* rect = new GdkRectangle ();
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 OS.gdk_window_get_frame_extents (window, 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
442 int trimWidth = Math.max (0, 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
443 int trimHeight = Math.max (0, 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
444 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
445 * Bug in GTK. gdk_window_get_frame_extents() fails for various 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
446 * managers, causing a large incorrect value to be returned as the trim.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
447 * The fix is to ignore the returned trim values if they are too large.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
448 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
449 if (trimWidth > MAXIMUM_TRIM || trimHeight > MAXIMUM_TRIM) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
450 display.ignoreTrim = 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
451 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
452 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
453 bool hasTitle = false, hasResize = false, hasBorder = false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
454 if ((style & DWT.NO_TRIM) is 0) {
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
455 hasTitle = (style & (DWT.MIN | DWT.MAX | DWT.TITLE | DWT.MENU)) !is 0;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
456 hasResize = (style & DWT.RESIZE) !is 0;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
457 hasBorder = (style & DWT.BORDER) !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
458 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
459 if (hasTitle) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
460 if (hasResize) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
461 display.titleResizeTrimWidth = trimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
462 display.titleResizeTrimHeight = trimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
463 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
464 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
465 if (hasBorder) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
466 display.titleBorderTrimWidth = trimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
467 display.titleBorderTrimHeight = trimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
468 return;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
469 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
470 display.titleTrimWidth = trimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
471 display.titleTrimHeight = trimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
472 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
473 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
474 if (hasResize) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
475 display.resizeTrimWidth = trimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
476 display.resizeTrimHeight = trimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
477 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
478 }
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 if (hasBorder) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
480 display.borderTrimWidth = trimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
481 display.borderTrimHeight = trimHeight;
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;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
483 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
484 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
485
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
486 void bringToTop (bool force) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
487 if (!OS.GTK_WIDGET_VISIBLE (shellHandle)) 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
488 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
489 Shell activeShell = 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
490 if (activeShell is this) 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
491 if (!force) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
492 if (activeShell 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
493 if (!display.activePending) {
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 auto focusHandle = OS.gtk_window_get_focus (cast(GtkWindow*)activeShell.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
495 if (focusHandle !is null && !OS.GTK_WIDGET_HAS_FOCUS (focusHandle)) 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
496 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
497 }
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 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
499 * Bug in GTK. When a shell that is not managed by the 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
500 * manage is given focus, GTK gets stuck in "focus follows pointer"
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 * mode when the pointer is within the shell and its parent when
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 * the shell is hidden or disposed. The fix is to use XSetInputFocus()
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
503 * to assign focus when ever the active shell has not managed 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
504 * the window manager.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
505 *
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 * NOTE: This bug is fixed in GTK+ 2.6.8 and 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
507 */
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 bool xFocus = 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
509 if (activeShell !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
510 if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 8)) {
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 xFocus = activeShell.isUndecorated ();
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 }
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 display.activeShell = 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
514 display.activePending = 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
515 }
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 /*
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 * Feature in GTK. When the shell is an override redirect
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 * window, gdk_window_focus() does not give focus to 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
519 * window. The fix is to use XSetInputFocus() to force
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
520 * the 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
521 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
522 auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
523 if ((xFocus || (style & DWT.ON_TOP) !is 0) && OS.GDK_WINDOWING_X11 ()) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
524 auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (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
525 auto xWindow = OS.gdk_x11_drawable_get_xid (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
526 OS.gdk_error_trap_push ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
527 /* Use CurrentTime instead of the last event time to ensure that the shell becomes active */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
528 OS.XSetInputFocus (xDisplay, xWindow, OS.RevertToParent, OS.CurrentTime);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
529 OS.gdk_error_trap_pop ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
530 } 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
531 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
532 * Bug in metacity. Calling gdk_window_focus() with a timestamp more
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
533 * recent than the last user interaction time can cause windows not
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
534 * to come forward in versions > 2.10.0. The fix is to use the last
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
535 * user event 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
536 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
537 if ( Unicode.toLower( display.windowManager ) ==/*eq*/ "metacity") {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
538 OS.gdk_window_focus (window, display.lastUserEventTime);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
539 } 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
540 OS.gdk_window_focus (window, OS.GDK_CURRENT_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
541 }
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 }
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 display.activeShell = 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
544 display.activePending = true;
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
547 override void checkBorder () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
548 /* Do nothing */
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
549 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
550
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
551 override void checkOpen () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
552 if (!opened) resized = false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
553 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
554
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
555 override 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
556 return null;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
557 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
558
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 * Requests that the window manager close the receiver in
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
561 * the same way it would be closed when the user clicks on
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
562 * the "close box" or performs some other platform specific
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
563 * key or mouse combination that indicates the window
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
564 * should be removed.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
565 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
566 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
567 * <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
568 * <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
569 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
570 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
571 * @see DWT#Close
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
572 * @see #dispose
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
573 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
574 public void close () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
575 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
576 closeWidget ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
577 }
122
45921f44a4b2 Fix: stack access from listener in AddressBook example
Frank Benoit <benoit@tionex.de>
parents: 113
diff changeset
578
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
579 void closeWidget () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
580 Event event = new Event ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
581 sendEvent (DWT.Close, 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
582 if (event.doit && !isDisposed ()) dispose ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
583 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
584
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
585 override public Rectangle computeTrim (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
586 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
587 Rectangle trim = super.computeTrim (x, y, 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
588 int border = 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
589 if ((style & (DWT.NO_TRIM | DWT.BORDER | DWT.SHELL_TRIM)) 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
590 border = OS.gtk_container_get_border_width (cast(GtkContainer*)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
591 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
592 int trimWidth = trimWidth (), trimHeight = trimHeight ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
593 trim.x -= (trimWidth / 2) + border;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
594 trim.y -= trimHeight - (trimWidth / 2) + border;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
595 trim.width += trimWidth + border * 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
596 trim.height += trimHeight + border * 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
597 if (menuBar !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
598 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
599 int menuBarHeight = OS.GTK_WIDGET_HEIGHT (menuBar.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
600 trim.y -= menuBarHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
601 trim.height += menuBarHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
602 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
603 return trim;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
604 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
605
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
606 override void createHandle (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
607 state |= HANDLE | CANVAS;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
608 if (shellHandle 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
609 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
610 int type = OS.GTK_WINDOW_TOPLEVEL;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
611 if ((style & DWT.ON_TOP) !is 0) type = OS.GTK_WINDOW_POPUP;
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
612 shellHandle = cast(GtkWidget*)OS.gtk_window_new (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
613 } 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
614 shellHandle = cast(GtkWidget*) OS.gtk_plug_new (cast(uint)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
615 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
616 if (shellHandle 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
617 if (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
618 OS.gtk_window_set_transient_for (cast(GtkWindow*)shellHandle, cast(GtkWindow*)parent.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
619 OS.gtk_window_set_destroy_with_parent (cast(GtkWindow*)shellHandle, 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
620 if (!isUndecorated ()) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
621 OS.gtk_window_set_type_hint (cast(GtkWindow*)shellHandle, OS.GDK_WINDOW_TYPE_HINT_DIALOG);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
622 } 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
623 if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 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
624 OS.gtk_window_set_skip_taskbar_hint (cast(GtkWindow*)shellHandle, 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
625 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
626 }
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 }
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 /*
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 * Feature in GTK. The window size must be set when the 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
630 * is created or it will not be allowed to be resized smaller that 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
631 * initial size by the user. The fix is to set the size to zero.
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 */
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
633 if ((style & DWT.RESIZE) !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
634 OS.gtk_widget_set_size_request (shellHandle, 0, 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
635 OS.gtk_window_set_resizable (cast(GtkWindow*)shellHandle, 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
636 } 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
637 OS.gtk_window_set_resizable (cast(GtkWindow*)shellHandle, 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
638 }
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 vboxHandle = OS.gtk_vbox_new (false, 0);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
640 if (vboxHandle 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
641 createHandle (index, 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
642 OS.gtk_container_add (cast(GtkContainer*)vboxHandle, scrolledHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
643 OS.gtk_box_set_child_packing (cast(GtkBox*)vboxHandle, scrolledHandle, true, true, 0, OS.GTK_PACK_END);
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 152
diff changeset
644 String dummy = "a";
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
645 OS.gtk_window_set_title (cast(GtkWindow*)shellHandle, dummy.ptr );
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
646 if ((style & (DWT.NO_TRIM | DWT.BORDER | DWT.SHELL_TRIM)) 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
647 OS.gtk_container_set_border_width (cast(GtkContainer*)shellHandle, 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
648 GdkColor* color = new 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
649 OS.gtk_style_get_black (OS.gtk_widget_get_style (shellHandle), 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
650 OS.gtk_widget_modify_bg (shellHandle, OS.GTK_STATE_NORMAL, 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
651 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
652 int bits = DWT.PRIMARY_MODAL | DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL;
59
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 modal = (style & bits) !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
654 //TEMPORARY CODE
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
655 if ((style & DWT.ON_TOP) is 0) modal |= (parent !is null && (parent.style & bits) !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
656 OS.gtk_window_set_modal (cast(GtkWindow*)shellHandle, modal);
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 } 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
658 vboxHandle = OS.gtk_bin_get_child (cast(GtkBin*)shellHandle);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
659 if (vboxHandle 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
660 auto children = OS.gtk_container_get_children (cast(GtkContainer*)vboxHandle);
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 if (OS.g_list_length (children) > 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
662 scrolledHandle = cast(GtkWidget*)OS.g_list_data (children);
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 OS.g_list_free (children);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
665 if (scrolledHandle 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
666 handle = OS.gtk_bin_get_child (cast(GtkBin*)scrolledHandle);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
667 if (handle 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
668 }
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 /*
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 * Feature in GTK. Realizing the shell triggers a size allocate 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
671 * which may be confused for a resize event from the window manager if
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 * received too late. The fix is to realize the window during creation
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 * to avoid confusion.
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 OS.gtk_widget_realize (shellHandle);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
676 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
677
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
678 override int /*long*/ filterProc ( XEvent* xEvent, GdkEvent* gdkEvent, void* data2) {
59
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 int eventType = OS.X_EVENT_TYPE (xEvent);
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 if (eventType !is OS.FocusOut && eventType !is OS.FocusIn) 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
681 XFocusChangeEvent* xFocusEvent = cast(XFocusChangeEvent*)xEvent;
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 switch (eventType) {
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 case OS.FocusIn:
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 if (xFocusEvent.mode is OS.NotifyNormal || xFocusEvent.mode is OS.NotifyWhileGrabbed) {
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 switch (xFocusEvent.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
686 case OS.NotifyNonlinear:
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 case OS.NotifyNonlinearVirtual:
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 case OS.NotifyAncestor:
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 if (tooltipsHandle !is null) OS.gtk_tooltips_enable (cast(GtkTooltips*)tooltipsHandle);
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 display.activeShell = 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
691 display.activePending = false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
692 sendEvent (DWT.Activate);
59
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 break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
694 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
695 }
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 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
698 case OS.FocusOut:
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 if (xFocusEvent.mode is OS.NotifyNormal || xFocusEvent.mode is OS.NotifyWhileGrabbed) {
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 switch (xFocusEvent.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
701 case OS.NotifyNonlinear:
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 case OS.NotifyNonlinearVirtual:
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 case OS.NotifyVirtual:
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 if (tooltipsHandle !is null) OS.gtk_tooltips_disable (cast(GtkTooltips*)tooltipsHandle);
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 Display display = this.display;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
706 sendEvent (DWT.Deactivate);
59
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 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
708 if (display.activeShell 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
709 display.activeShell = 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
710 display.activePending = 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
711 }
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 break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
713 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
714 }
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 }
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 break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
717 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
718 }
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 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
720 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
721
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
722 override 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
723 return (state & BACKGROUND) !is 0 || backgroundImage !is null ? this : null;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
724 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
725
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
726 override Composite findDeferredControl () {
59
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 return layoutCount > 0 ? this : null;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
728 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
729
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
730 override bool hasBorder () {
59
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 return false;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
732 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
733
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
734 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
735 super.hookEvents ();
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 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [KEY_PRESS_EVENT], 0, display.closures [KEY_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
737 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [MAP_EVENT], 0, display.closures [MAP_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
738 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [UNMAP_EVENT], 0, display.closures [UNMAP_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
739 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [WINDOW_STATE_EVENT], 0, display.closures [WINDOW_STATE_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
740 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [SIZE_ALLOCATE], 0, display.closures [SIZE_ALLOCATE], 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
741 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [CONFIGURE_EVENT], 0, display.closures [CONFIGURE_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
742 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [DELETE_EVENT], 0, display.closures [DELETE_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
743 OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [MAP_EVENT], 0, display.shellMapProcClosure, 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
744 OS.g_signal_connect_closure_by_id (shellHandle, 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
745 OS.g_signal_connect_closure (shellHandle, OS.move_focus.ptr, display.closures [MOVE_FOCUS], 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
746 auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
747 display.doWindowAddFilter( &filterProcCallbackData, window, shellHandle );
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
748 //OS.gdk_window_add_filter (window, display.filterProc, shellHandle);
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
751 override 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
752 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
753 return getEnabled ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
754 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
755
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
756 bool isUndecorated () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
757 return
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
758 (style & (DWT.SHELL_TRIM | DWT.BORDER)) is DWT.NONE ||
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
759 (style & (DWT.NO_TRIM | DWT.ON_TOP)) !is 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
760 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
761
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
762 override 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
763 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
764 return getVisible ();
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
767 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
768 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
769 display.addWidget (shellHandle, this);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
770 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
771
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
772 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
773 /* Do nothing */
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
774 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
775
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
776 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
777 return shellHandle;
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
780 void fixActiveShell () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
781 if (display.activeShell 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
782 Shell shell = 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
783 if (parent !is null && parent.isVisible ()) shell = parent.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
784 if (shell is null && isUndecorated ()) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
785 Shell [] shells = display.getShells ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
786 for (int i = 0; i < shells.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
787 if (shells [i] !is null && shells [i].isVisible ()) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
788 shell = shells [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
789 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
790 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
791 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
792 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
793 if (shell !is null) 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
794 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
795 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
796
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
797 void fixShell (Shell newShell, 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
798 if (this is newShell) 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
799 if (control is lastActive) setActiveControl (null);
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 152
diff changeset
800 String toolTipText = control.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
801 if (toolTipText !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
802 control.setToolTipText (this, 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
803 control.setToolTipText (newShell, toolTipText);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
804 }
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
807 override void fixStyle (GtkWidget* handle) {
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
808 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
809
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
810 override 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
811 forceResize (OS.GTK_WIDGET_WIDTH (vboxHandle), OS.GTK_WIDGET_HEIGHT (vboxHandle));
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
812 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
813
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
814 void forceResize (int width, int height) {
124
11b0a1324732 Fix various stack access from anon-class
Frank Benoit <benoit@tionex.de>
parents: 122
diff changeset
815 GtkRequisition requisition;
11b0a1324732 Fix various stack access from anon-class
Frank Benoit <benoit@tionex.de>
parents: 122
diff changeset
816 OS.gtk_widget_size_request (vboxHandle, &requisition);
11b0a1324732 Fix various stack access from anon-class
Frank Benoit <benoit@tionex.de>
parents: 122
diff changeset
817 GtkAllocation allocation;
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
818 int border = OS.gtk_container_get_border_width (cast(GtkContainer*)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
819 allocation.x = border;
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 allocation.y = border;
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 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
822 allocation.height = height;
124
11b0a1324732 Fix various stack access from anon-class
Frank Benoit <benoit@tionex.de>
parents: 122
diff changeset
823 OS.gtk_widget_size_allocate (cast(GtkWidget*)vboxHandle, &allocation);
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
826 override 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
827 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
828 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
829 OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &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
830 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
831 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
832
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 * Returns a point describing the minimum receiver's size. The
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
835 * x coordinate of the result is the minimum width of the receiver.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
836 * The y coordinate of the result is the minimum height of the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
837 * receiver.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
838 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
839 * @return the receiver's size
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
840 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
841 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
842 * <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
843 * <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
844 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
845 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
846 * @since 3.1
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
847 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
848 public Point getMinimumSize () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
849 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
850 int width = Math.max (1, minWidth + trimWidth ());
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 int height = Math.max (1, minHeight + trimHeight ());
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 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
853 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
854
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
855 override 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
856 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
857 int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
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 int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
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 int border = 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
860 if ((style & (DWT.NO_TRIM | DWT.BORDER | DWT.SHELL_TRIM)) 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
861 border = OS.gtk_container_get_border_width (cast(GtkContainer*)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
862 }
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 return new Point (width + trimWidth () + 2*border, height + trimHeight () + 2*border);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
864 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
865
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
866 override 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
867 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
868 return OS.GTK_WIDGET_VISIBLE (shellHandle);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
869 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
870
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 * Returns the region that defines the shape of the shell,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
873 * or null if the shell has the default shape.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
874 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
875 * @return the region that defines the shape of the shell (or null)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
876 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
877 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
878 * <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
879 * <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
880 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
881 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
882 * @since 3.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
883 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
884 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
885 public Region getRegion () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
886 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
887 return region;
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
890 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
891 * Returns the receiver's input method editor mode. This
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
892 * will be the result of bitwise OR'ing together one or
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
893 * more of the following constants defined in class
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
894 * <code>DWT</code>:
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
895 * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
896 * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
897 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
898 * @return the IME mode
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
899 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
900 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
901 * <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
902 * <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
903 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
904 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
905 * @see DWT
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
906 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
907 public int getImeInputMode () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
908 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
909 return DWT.NONE;
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
912 override 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
913 return this;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
914 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
915 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
916 * Returns an array containing all shells which are
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
917 * descendants of the receiver.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
918 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
919 * @return the dialog shells
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
920 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
921 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
922 * <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
923 * <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
924 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
925 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
926 public Shell [] getShells () {
59
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 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
928 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
929 Shell [] shells = display.getShells ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
930 for (int i=0; i<shells.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
931 Control shell = shells [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
932 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
933 shell = shell.getParent ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
934 } while (shell !is null && shell !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
935 if (shell is this) 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
936 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
937 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
938 Shell [] result = new Shell [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
939 for (int i=0; i<shells.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
940 Control shell = shells [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
941 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
942 shell = shell.getParent ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
943 } while (shell !is null && shell !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
944 if (shell 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
945 result [index++] = shells [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
946 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
947 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
948 return result;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
949 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
950
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
951 override int /*long*/ gtk_configure_event (GtkWidget* widget, int /*long*/ 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
952 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
953 OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &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
954 if (!moved || oldX !is x || oldY !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
955 moved = 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
956 oldX = 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
957 oldY = y;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
958 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
959 // 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
960 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
961 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
962 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
963
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
964 override int /*long*/ gtk_delete_event (GtkWidget* widget, int /*long*/ 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
965 if (isEnabled()) closeWidget ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
966 return 1;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
967 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
968
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
969 override int /*long*/ gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* 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
970 if (widget !is 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
971 return super.gtk_enter_notify_event (widget, 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
972 }
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 return 0;
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
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
976 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
977 switch (cast(int)/*64*/directionType) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
978 case OS.GTK_DIR_TAB_FORWARD:
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
979 case OS.GTK_DIR_TAB_BACKWARD:
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
980 Control 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
981 if (control !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
982 if ((control.state & CANVAS) !is 0 && (control.style & DWT.EMBEDDED) !is 0) {
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
983 int traversal = directionType is OS.GTK_DIR_TAB_FORWARD ? 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
984 control.traverse (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
985 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
986 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
987 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
988 break;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
989 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
990 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
991 return super.gtk_focus (widget, directionType);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
992 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
993
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
994 override int /*long*/ gtk_move_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
995 Control 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
996 if (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
997 auto focusHandle = control.focusHandle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
998 OS.gtk_widget_child_focus (focusHandle, directionType);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
999 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1000 OS.g_signal_stop_emission_by_name (shellHandle, OS.move_focus.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
1001 return 1;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1002 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1003
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1004 override int /*long*/ gtk_key_press_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
1005 /* Stop menu mnemonics when the shell is 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
1006 if (widget is 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
1007 return (state & DISABLED) !is 0 ? 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
1008 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1009 return super.gtk_key_press_event (widget, event);
25
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
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1012 override int /*long*/ gtk_map_event (GtkWidget* widget, int /*long*/ 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
1013 minimized = false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1014 sendEvent (DWT.Deiconify);
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1015 return 0;
25
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
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1018 override int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1019 int width = OS.GTK_WIDGET_WIDTH (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
1020 int height = OS.GTK_WIDGET_HEIGHT (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
1021 if (!resized || oldWidth !is width || oldHeight !is 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
1022 oldWidth = 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
1023 oldHeight = 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
1024 resizeBounds (width, height, 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
1025 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1026 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1027 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1028
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1029 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
1030 auto result = super.gtk_realize (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
1031 auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1032 if ((style & DWT.SHELL_TRIM) !is DWT.SHELL_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
1033 int decorations = 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1034 if ((style & DWT.NO_TRIM) is 0) {
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1035 if ((style & DWT.MIN) !is 0) decorations |= OS.GDK_DECOR_MINIMIZE;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1036 if ((style & DWT.MAX) !is 0) decorations |= OS.GDK_DECOR_MAXIMIZE;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1037 if ((style & DWT.RESIZE) !is 0) decorations |= OS.GDK_DECOR_RESIZEH;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1038 if ((style & DWT.BORDER) !is 0) decorations |= OS.GDK_DECOR_BORDER;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1039 if ((style & DWT.MENU) !is 0) decorations |= OS.GDK_DECOR_MENU;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1040 if ((style & DWT.TITLE) !is 0) decorations |= OS.GDK_DECOR_TITLE;
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1041 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1042 * Feature in GTK. Under some Window Managers (Sawmill), in order
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1043 * to get any border at all from the window manager it is necessary 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
1044 * set GDK_DECOR_BORDER. The fix is to force these bits when 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
1045 * kind of border is requested.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1046 */
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1047 if ((style & DWT.RESIZE) !is 0) decorations |= OS.GDK_DECOR_BORDER;
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1048 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1049 OS.gdk_window_set_decorations (window, decorations);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1050 }
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1051 if ((style & DWT.ON_TOP) !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
1052 OS.gdk_window_set_override_redirect (window, 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
1053 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1054 return result;
25
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
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1057 override int /*long*/ gtk_unmap_event (GtkWidget* widget, int /*long*/ 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
1058 minimized = true;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1059 sendEvent (DWT.Iconify);
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1060 return 0;
25
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
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1063 override int /*long*/ gtk_window_state_event (GtkWidget* widget, GdkEventWindowState* 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
1064 minimized = (event.new_window_state & OS.GDK_WINDOW_STATE_ICONIFIED) !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
1065 maximized = (event.new_window_state & OS.GDK_WINDOW_STATE_MAXIMIZED) !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
1066 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1067 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1068
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1069 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1070 * Moves the receiver to the top of the drawing order for
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1071 * the display on which it was created (so that all other
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1072 * shells on that display, which are not the receiver's
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1073 * children will be drawn behind it), marks it visible,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1074 * sets the focus and asks the window manager to make the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1075 * shell active.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1076 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1077 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1078 * <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
1079 * <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
1080 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1081 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1082 * @see Control#moveAbove
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1083 * @see Control#setFocus
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1084 * @see Control#setVisible
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1085 * @see Display#getActiveShell
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1086 * @see Decorations#setDefaultButton(Button)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1087 * @see Shell#setActive
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1088 * @see Shell#forceActive
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1089 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1090 public void open () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1091 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
1092 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
1093 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
1094 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
1095 if (!restoreFocus () && !traverseGroup (true)) setFocus ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1096 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1097
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1098 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1099 * 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
1100 * be notified when operations are performed on the receiver.
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 * @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
1103 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1104 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1105 * <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
1106 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1107 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1108 * <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
1109 * <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
1110 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1111 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1112 * @see ShellListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1113 * @see #addShellListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1114 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1115 public void removeShellListener (ShellListener 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
1116 checkWidget();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1117 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
1118 if (eventTable is null) return;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1119 eventTable.unhook (DWT.Close, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1120 eventTable.unhook (DWT.Iconify,listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1121 eventTable.unhook (DWT.Deiconify,listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1122 eventTable.unhook (DWT.Activate, listener);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1123 eventTable.unhook (DWT.Deactivate, listener);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1124 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1125
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 * If the receiver is visible, moves it to the top of the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1128 * drawing order for the display on which it was created
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1129 * (so that all other shells on that display, which are not
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1130 * the receiver's children will be drawn behind it) and asks
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1131 * the window manager to make the shell active
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1132 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1133 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1134 * <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
1135 * <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
1136 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1137 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1138 * @since 2.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1139 * @see Control#moveAbove
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1140 * @see Control#setFocus
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1141 * @see Control#setVisible
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1142 * @see Display#getActiveShell
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1143 * @see Decorations#setDefaultButton(Button)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1144 * @see Shell#open
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1145 * @see Shell#setActive
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1146 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1147 public void setActive () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1148 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
1149 bringToTop (false);
25
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
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1152 void setActiveControl (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
1153 if (control !is null && control.isDisposed ()) 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
1154 if (lastActive !is null && lastActive.isDisposed ()) lastActive = 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
1155 if (lastActive is control) return;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1156
59
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 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1158 * Compute the list of controls to be activated and
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 * deactivated by finding the first common 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
1160 * 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
1161 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1162 Control [] activate = (control is null) ? new Control[0] : control.getPath ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1163 Control [] deactivate = (lastActive is null) ? new Control[0] : lastActive.getPath ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1164 lastActive = 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
1165 int index = 0, length = Math.min (activate.length, deactivate.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
1166 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
1167 if (activate [index] !is deactivate [index]) 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
1168 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
1169 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1170
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1171 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1172 * 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
1173 * code could have destroyed some of the widgets. If
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1174 * this happens, keep processing those widgets 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
1175 * are not disposed.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1176 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1177 for (int i=deactivate.length-1; i>=index; --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
1178 if (!deactivate [i].isDisposed ()) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1179 deactivate [i].sendEvent (DWT.Deactivate);
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1180 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1181 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1182 for (int i=activate.length-1; i>=index; --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
1183 if (!activate [i].isDisposed ()) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1184 activate [i].sendEvent (DWT.Activate);
59
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 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1186 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1187 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1188
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1189 void resizeBounds (int width, int height, bool notify) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1190 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
1191 OS.gdk_window_resize (redrawWindow, 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
1192 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1193 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
1194 OS.gdk_window_resize (enableWindow, 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
1195 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1196 int border = OS.gtk_container_get_border_width (cast(GtkContainer*)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
1197 int boxWidth = width - 2*border;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1198 int boxHeight = height - 2*border;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1199 OS.gtk_widget_set_size_request (vboxHandle, boxWidth, boxHeight);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1200 forceResize (boxWidth, boxHeight);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1201 if (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
1202 resized = true;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1203 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
1204 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
1205 if (layout_ !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
1206 markLayout (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
1207 updateLayout (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
1208 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1209 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1210 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1211
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
1212 override 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
1213 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1214 * Bug in GTK. When either of the location or size of
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1215 * a shell is changed while the shell is maximized, 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
1216 * shell is moved to (0, 0). The fix is to explicitly
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1217 * unmaximize the shell before setting the bounds 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
1218 * anything different from the current bounds.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1219 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1220 if (getMaximized ()) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1221 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
1222 bool sameOrigin = !move || (rect.x is x && rect.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
1223 bool sameExtent = !resize || (rect.width is width && rect.height is 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
1224 if (sameOrigin && sameExtent) 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
1225 setMaximized (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
1226 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1227 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
1228 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
1229 int x_pos, y_pos;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1230 OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x_pos, &y_pos);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1231 OS.gtk_window_move (cast(GtkWindow*)shellHandle, 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
1232 if (x_pos !is x || y_pos !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
1233 moved = 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
1234 oldX = 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
1235 oldY = y;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1236 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
1237 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
1238 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
1239 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1240 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1241 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
1242 width = Math.max (1, Math.max (minWidth, width - trimWidth ()));
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1243 height = Math.max (1, Math.max (minHeight, height - trimHeight ()));
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1244 if ((style & DWT.RESIZE) !is 0) OS.gtk_window_resize (cast(GtkWindow*)shellHandle, width, 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
1245 bool changed = 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
1246 if (changed) {
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 oldWidth = 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
1248 oldHeight = 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
1249 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
1250 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1251 resizeBounds (width, height, changed);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1252 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1253 return result;
25
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
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
1256 override 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
1257 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
1258 OS.gdk_window_set_cursor (cast(GdkDrawable*)enableWindow, 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
1259 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
1260 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
1261 } 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
1262 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
1263 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
1264 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1265 }
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: 100
diff changeset
1266 super.gtk_setCursor (cursor);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1267 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1268
150
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
1269 public override 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
1270 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
1271 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
1272 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
1273 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
1274 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
1275 if (!enabled) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1276 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
1277 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
1278 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
1279 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1280 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1281 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
1282 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
1283 } 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
1284 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
1285 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1286 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
1287 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
1288 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
1289 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
1290 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
1291 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
1292 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
1293 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1294 } 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
1295 auto parentHandle = 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
1296 OS.gtk_widget_realize (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
1297 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
1298 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
1299 GdkWindowAttr* attributes = new GdkWindowAttr ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1300 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
1301 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
1302 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
1303 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
1304 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
1305 enableWindow = 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
1306 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
1307 if (cursor !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
1308 OS.gdk_window_set_cursor (enableWindow, cursor.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
1309 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
1310 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
1311 } 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
1312 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
1313 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
1314 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1315 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1316 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
1317 OS.gdk_window_show (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
1318 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1319 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1320 if (fixFocus_) 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
1321 if (enabled && display.activeShell 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
1322 if (!restoreFocus ()) traverseGroup (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
1323 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1324 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1327 * Sets the input method editor mode to the argument which
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1328 * should be the result of bitwise OR'ing together one or more
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1329 * of the following constants defined in class <code>DWT</code>:
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1330 * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1331 * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1332 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1333 * @param mode the new IME mode
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1334 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1335 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1336 * <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
1337 * <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
1338 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1339 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1340 * @see DWT
25
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 public void setImeInputMode (int mode) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1343 checkWidget();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1344 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1345
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
1346 override 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
1347 if ((state & FOREIGN_HANDLE) !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
1348 dwt.widgets.Monitor.Monitor monitor = getMonitor ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1349 Rectangle rect = monitor.getClientArea ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1350 int width = rect.width * 5 / 8;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1351 int height = rect.height * 5 / 8;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1352 if ((style & DWT.RESIZE) !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
1353 OS.gtk_window_resize (cast(GtkWindow*)shellHandle, 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
1354 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1355 resizeBounds (width, height, false);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1356 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1357
150
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
1358 public override void setMaximized (bool maximized) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1359 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
1360 super.setMaximized (maximized);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1361 if (maximized) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1362 OS.gtk_window_maximize (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
1363 } 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
1364 OS.gtk_window_unmaximize (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
1365 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1366 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1367
150
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
1368 public override void setMenuBar (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
1369 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
1370 if (menuBar is menu) 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
1371 bool both = menu !is null && menuBar !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
1372 if (menu !is null) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1373 if ((menu.style & DWT.BAR) is 0) error (DWT.ERROR_MENU_NOT_BAR);
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1374 if (menu.parent !is this) 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
1375 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1376 if (menuBar !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
1377 auto menuHandle = menuBar.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
1378 OS.gtk_widget_hide (menuHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1379 destroyAccelGroup ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1380 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1381 menuBar = 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
1382 if (menuBar !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
1383 auto menuHandle = menu.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
1384 OS.gtk_widget_show (menuHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1385 createAccelGroup ();
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 menuBar.addAccelerators (accelGroup);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1387 }
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 int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1389 int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1390 resizeBounds (width, height, !both);
25
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
150
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
1393 public override void setMinimized (bool minimized) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1394 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
1395 if (this.minimized is minimized) 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
1396 super.setMinimized (minimized);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1397 if (minimized) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1398 OS.gtk_window_iconify (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
1399 } 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
1400 OS.gtk_window_deiconify (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
1401 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
1402 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1403 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1404
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1405 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1406 * Sets the receiver's minimum size to the size specified by the arguments.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1407 * If the new minimum size is larger than the current size of the receiver,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1408 * the receiver is resized to the new minimum size.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1409 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1410 * @param width the new minimum width for the receiver
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1411 * @param height the new minimum height for the receiver
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1412 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1413 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1414 * <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
1415 * <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
1416 * </ul>
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 * @since 3.1
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 public void setMinimumSize (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
1421 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
1422 GdkGeometry* geometry = new GdkGeometry ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1423 minWidth = geometry.min_width = Math.max (width, trimWidth ()) - trimWidth ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1424 minHeight = geometry.min_height = Math.max (height, trimHeight ()) - trimHeight ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1425 OS.gtk_window_set_geometry_hints (cast(GtkWindow*)shellHandle, null, geometry, OS.GDK_HINT_MIN_SIZE);
25
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
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 * Sets the receiver's minimum size to the size specified by the argument.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1430 * If the new minimum size is larger than the current size of the receiver,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1431 * the receiver is resized to the new minimum size.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1432 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1433 * @param size the new minimum size for the receiver
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1434 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1435 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1436 * <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
1437 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1438 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1439 * <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
1440 * <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
1441 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1442 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1443 * @since 3.1
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1444 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1445 public void setMinimumSize (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
1446 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1447 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
1448 setMinimumSize (size.x, size.y);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1449 }
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 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1452 * Sets the shape of the shell to the region specified
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1453 * by the argument. When the argument is null, the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1454 * default shape of the shell is restored. The shell
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1455 * must be created with the style DWT.NO_TRIM in order
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1456 * to specify a region.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1457 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1458 * @param region the region that defines the shape of the shell (or null)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1459 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1460 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1461 * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1462 * </ul>
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1463 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1464 * <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
1465 * <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
1466 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1467 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1468 * @since 3.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1469 *
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 public void setRegion (Region region) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1472 checkWidget ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1473 if ((style & DWT.NO_TRIM) is 0) return;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1474 if (region !is null && region.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
1475 auto window = OS.GTK_WIDGET_WINDOW (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
1476 auto shape_region = (region is null) ? null : region.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
1477 OS.gdk_window_shape_combine_region (window, shape_region, 0, 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
1478 this.region = region;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1479 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1480
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1481 /*
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1482 * Shells are never labelled by other widgets, so no initialization is needed.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1483 */
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
1484 override void setRelations() {
25
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
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 152
diff changeset
1487 public override void setText (String string) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1488 super.setText (string);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1489
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1490 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1491 * GTK bug 82013. For some reason, if the title string
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 * is less than 7 bytes long and is not terminated 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
1493 * a space, some window managers occasionally draw
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 * garbage after the last character in the title.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1495 * The fix is to pad the title.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1496 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1497 int length_ = string.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
1498 char [] chars = new char [Math.max (6, 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
1499 chars = string[ 0 .. 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
1500 for (int i=length_; i<chars.length; i++) chars [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
1501 OS.gtk_window_set_title (cast(GtkWindow*)shellHandle, toStringz( chars ) );
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1502 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1503
150
f2e04420fd6c reworked overrides and superclass aliases
Frank Benoit <benoit@tionex.de>
parents: 124
diff changeset
1504 public override 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
1505 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
1506 if ((OS.GTK_WIDGET_MAPPED (shellHandle) 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
1507 if (visible) {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1508 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
1509 if (isDisposed ()) return;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1510
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1511 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1512 * In order to ensure that the shell is 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
1513 * and fully painted, dispatch events such as
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1514 * GDK_MAP and GDK_CONFIGURE, until the GDK_MAP
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1515 * event for the shell is received.
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 *
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1517 * Note that if the parent is minimized or withdrawn
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 * from the desktop, this should not be done since
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1519 * the shell not will be mapped until the parent 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
1520 * unminimized or shown on the desktop.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1521 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1522 OS.gtk_widget_show (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
1523 if (!OS.GTK_IS_PLUG (cast(GTypeInstance*)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
1524 mapped = 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
1525 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
1526 display.dispatchEvents = [
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1527 OS.GDK_EXPOSE,
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1528 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
1529 OS.GDK_CONFIGURE,
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1530 OS.GDK_MAP,
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1531 OS.GDK_UNMAP,
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1532 OS.GDK_NO_EXPOSE
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1533 ];
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1534 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
1535 display.putGdkEvents();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1536 bool iconic = 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
1537 Shell shell = parent !is null ? parent.getShell() : 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
1538 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
1539 OS.g_main_context_iteration (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
1540 if (isDisposed ()) 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
1541 iconic = minimized || (shell !is null && shell.minimized);
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 } while (!mapped && !iconic);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1543 display.dispatchEvents = 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
1544 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
1545 if (!iconic) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1546 update (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
1547 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
1548 adjustTrim ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1549 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1550 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1551 mapped = true;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1552
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1553 int mask = DWT.PRIMARY_MODAL | DWT.APPLICATION_MODAL | DWT.SYSTEM_MODAL;
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1554 if ((style & 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
1555 OS.gdk_pointer_ungrab (OS.GDK_CURRENT_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
1556 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1557 opened = 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
1558 if (!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
1559 moved = 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
1560 Point location = getLocation();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1561 oldX = location.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
1562 oldY = location.y;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1563 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
1564 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
1565 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1566 if (!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
1567 resized = 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
1568 Point size = 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
1569 oldWidth = size.x - trimWidth ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1570 oldHeight = size.y - trimHeight ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1571 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
1572 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
1573 if (layout_ !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
1574 markLayout (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
1575 updateLayout (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
1576 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1577 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1578 } 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
1579 fixActiveShell ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1580 OS.gtk_widget_hide (shellHandle);
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1581 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
1582 }
25
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
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
1585 override 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
1586 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1587 * Bug in GTK+. Changing the toplevel window Z-order 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
1588 * X to send a resize event. Before the shell is mapped, these
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1589 * resize events always have a size of 200x200, causing extra
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 * layout work to occur. The fix is to modify the Z-order 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
1591 * if the shell has already been mapped at least once.
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 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1593 /* Shells are never included in labelled-by relations */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1594 if (mapped) setZOrder (sibling, above, false, false);
25
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
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1597 override int /*long*/ shellMapProc (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
1598 mapped = 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
1599 display.dispatchEvents = 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
1600 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1601 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1602
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1603 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
1604 if ((state & FOREIGN_HANDLE) !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
1605 OS.gtk_container_add (cast(GtkContainer*)shellHandle, vboxHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1606 if (scrolledHandle !is null) OS.gtk_widget_show (scrolledHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1607 if (handle !is null) OS.gtk_widget_show (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
1608 if (vboxHandle !is null) OS.gtk_widget_show (vboxHandle);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1609 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1610
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1611 override int /*long*/ sizeAllocateProc (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
1612 int offset = 16;
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 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
1614 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
1615 y += offset;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1616 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
1617 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
1618 int monitorNumber = OS.gdk_screen_get_monitor_at_point (screen, 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
1619 GdkRectangle* dest = new GdkRectangle ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1620 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
1621 int width = OS.GTK_WIDGET_WIDTH (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
1622 int height = OS.GTK_WIDGET_HEIGHT (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
1623 if (x + width > dest.x + 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
1624 x = (dest.x + dest.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
1625 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1626 if (y + height > dest.y + 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
1627 y = (dest.y + dest.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
1628 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1629 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1630 OS.gtk_window_move (cast(GtkWindow*)handle, 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
1631 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1632 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1633
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1634 override int /*long*/ sizeRequestProc (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
1635 OS.gtk_widget_hide (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
1636 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1637 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1638
152
17f8449522fd overloads second walkthrough
Frank Benoit <benoit@tionex.de>
parents: 150
diff changeset
1639 override 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
1640 if (parent 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
1641 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
1642 close ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1643 return true;
25
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 int trimHeight () {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1646 if ((style & DWT.NO_TRIM) !is 0) 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
1647 bool hasTitle = false, hasResize = false, hasBorder = false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1648 hasTitle = (style & (DWT.MIN | DWT.MAX | DWT.TITLE | DWT.MENU)) !is 0;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1649 hasResize = (style & DWT.RESIZE) !is 0;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1650 hasBorder = (style & DWT.BORDER) !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
1651 if (hasTitle) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1652 if (hasResize) return display.titleResizeTrimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1653 if (hasBorder) return display.titleBorderTrimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1654 return display.titleTrimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1655 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1656 if (hasResize) return display.resizeTrimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1657 if (hasBorder) return display.borderTrimHeight;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1658 return 0;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1659 }
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 int trimWidth () {
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1662 if ((style & DWT.NO_TRIM) !is 0) 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
1663 bool hasTitle = false, hasResize = false, hasBorder = false;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1664 hasTitle = (style & (DWT.MIN | DWT.MAX | DWT.TITLE | DWT.MENU)) !is 0;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1665 hasResize = (style & DWT.RESIZE) !is 0;
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1666 hasBorder = (style & DWT.BORDER) !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
1667 if (hasTitle) {
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1668 if (hasResize) return display.titleResizeTrimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1669 if (hasBorder) return display.titleBorderTrimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1670 return display.titleTrimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1671 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1672 if (hasResize) return display.resizeTrimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1673 if (hasBorder) return display.borderTrimWidth;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1674 return 0;
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
1677 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
1678 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
1679 display.removeWidget (shellHandle);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1680 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1681
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
1682 override public void dispose () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1683 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1684 * Note: It is valid to attempt to dispose a 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
1685 * more than once. If this happens, fail silently.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1686 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1687 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
1688 fixActiveShell ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1689 OS.gtk_widget_hide (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
1690 super.dispose ();
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1691 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1692
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1693 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1694 * If the receiver is visible, moves it to the top of the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1695 * drawing order for the display on which it was created
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1696 * (so that all other shells on that display, which are not
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1697 * the receiver's children will be drawn behind it) and forces
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1698 * the window manager to make the shell active.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1699 *
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1700 * @exception DWTException <ul>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1701 * <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
1702 * <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
1703 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1704 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1705 * @since 2.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1706 * @see Control#moveAbove
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1707 * @see Control#setFocus
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1708 * @see Control#setVisible
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1709 * @see Display#getActiveShell
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1710 * @see Decorations#setDefaultButton(Button)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1711 * @see Shell#open
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1712 * @see Shell#setActive
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1713 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1714 public void forceActive () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1715 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
1716 bringToTop (true);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1717 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1718
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
1719 override 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
1720 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
1721 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
1722 OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &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
1723 int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
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 int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
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 int border = 0;
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1726 if ((style & (DWT.NO_TRIM | DWT.BORDER | DWT.SHELL_TRIM)) 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
1727 border = OS.gtk_container_get_border_width (cast(GtkContainer*)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
1728 }
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 return new Rectangle (x, y, width + trimWidth () + 2*border, height + trimHeight () + 2*border);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1730 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1731
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
1732 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
1733 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
1734 shellHandle = null;
25
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
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
1737 override void releaseChildren (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
1738 Shell [] shells = getShells ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1739 for (int i=0; i<shells.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
1740 Shell shell = shells [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
1741 if (shell !is null && !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
1742 shell.release (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
1743 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1744 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1745 super.releaseChildren (destroy);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1746 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1747
58
a5c274fa5af9 extended helloworld crashing
Frank Benoit <benoit@tionex.de>
parents: 54
diff changeset
1748 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
1749 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
1750 destroyAccelGroup ();
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1751 if (display.activeShell is this) display.activeShell = 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
1752 if (tooltipsHandle !is null) OS.g_object_unref (tooltipsHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1753 tooltipsHandle = 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
1754 auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
38
6e625fa1612d Shell, some code left
Frank Benoit <benoit@tionex.de>
parents: 33
diff changeset
1755 display.doWindowRemoveFilter( &filterProcCallbackData, window, shellHandle );
59
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 region = 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
1757 lastActive = null;
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
238
380bad9f6852 reverted char[] to String
Frank Benoit <benoit@tionex.de>
parents: 152
diff changeset
1760 void setToolTipText (GtkWidget* widget, String string) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1761 char* buffer = toStringz( string );
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1762 if (tooltipsHandle 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
1763 tooltipsHandle = cast(GtkWidget*)OS.gtk_tooltips_new ();
71
295b29fc7d13 Renamed SWT to DWT
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1764 if (tooltipsHandle 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
1765 OS.g_object_ref (tooltipsHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1766 OS.gtk_object_sink (cast(GtkObject*)tooltipsHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1767 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1768
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1769 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1770 * Feature in GTK. There is no API to position a tooltip.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1771 * The fix is to connect to the size_allocate signal for
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1772 * the tooltip window and position it before it is 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
1773 *
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1774 * Bug in Solaris-GTK. Invoking gtk_tooltips_force_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
1775 * can cause a crash in older versions of GTK. The fix 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
1776 * to avoid this call if the GTK version is older than 2.2.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
1777 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1778 if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 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
1779 OS.gtk_tooltips_force_window (cast(GtkTooltips*)tooltipsHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1780 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1781 auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)tooltipsHandle);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1782 if (tipWindow !is null && tipWindow !is tooltipWindow) {
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
1783 display.doSizeAllocateConnect( &sizeAllocateProcCallbackData, tipWindow, shellHandle );
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1784 tooltipWindow = tipWindow;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1785 }
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1786
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1787 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1788 * Bug in GTK. If the cursor is inside the window when a new
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1789 * tooltip is set and the old tooltip is hidden, the new tooltip
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1790 * is not displayed until the mouse re-enters the window. 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
1791 * fix is force the new tooltip to be active.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1792 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1793 bool set = 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
1794 if (tipWindow !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
1795 if ((OS.GTK_WIDGET_FLAGS (widget) & (OS.GTK_REALIZED | 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
1796 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
1797 auto window = OS.gdk_window_at_pointer (&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
1798 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
1799 GtkWidget* 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
1800 OS.gdk_window_get_user_data (window, cast(void**)&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
1801 if (widget is 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
1802 /*
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1803 * Feature in GTK. Calling gtk_tooltips_set_tip() positions and
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1804 * shows the tooltip. If the tooltip is already visible, moving
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1805 * it to a new location in the size_allocate signal causes flashing.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1806 * The fix is to hide the tip window in the size_request 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
1807 * and before the new tooltip is forced to be active.
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1808 */
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1809 set = false;
54
8f049b136add first example working
Frank Benoit <benoit@tionex.de>
parents: 42
diff changeset
1810 int handler_id = display.doSizeRequestConnect( &sizeRequestProcCallbackData, tipWindow, shellHandle );
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1811 OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, widget, buffer, 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
1812 OS.gtk_widget_hide (tipWindow);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1813 auto data = OS.gtk_tooltips_data_get (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
1814 OS.GTK_TOOLTIPS_SET_ACTIVE (cast(GtkTooltips*)tooltipsHandle, cast(GtkTooltipsData*)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
1815 OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, widget, buffer, 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
1816 if (handler_id !is 0) OS.g_signal_handler_disconnect (tipWindow, handler_id);
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1817 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1818 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1819 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1820 }
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 58
diff changeset
1821 if (set) OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, widget, buffer, null);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1822 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1823 }