Mercurial > projects > dwt-linux
comparison dwt/widgets/Control.d @ 60:6537a52fde85
Text
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 12 Jan 2008 11:16:09 +0100 |
parents | 8cec8f536af3 |
children | 295b29fc7d13 |
comparison
equal
deleted
inserted
replaced
59:8cec8f536af3 | 60:6537a52fde85 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2007 IBM Corporation and others. | 2 * Copyright (c) 2000, 2007 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
836 setBounds (0, 0, Math.max (0, size.x), Math.max (0, size.y), false, true); | 836 setBounds (0, 0, Math.max (0, size.x), Math.max (0, size.y), false, true); |
837 } | 837 } |
838 | 838 |
839 void setRelations () { | 839 void setRelations () { |
840 auto parentHandle = parent.parentingHandle (); | 840 auto parentHandle = parent.parentingHandle (); |
841 | |
842 Stdout.formatln( "setRelations {:x}", cast(uint)parentHandle ); | |
843 Stdout.formatln( "showWidget gtk_container_get_children {:x}", parentHandle ); | |
844 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentHandle) ); | |
845 auto list = OS.gtk_container_get_children (cast(GtkContainer*)parentHandle); | 841 auto list = OS.gtk_container_get_children (cast(GtkContainer*)parentHandle); |
846 if (list is null) return; | 842 if (list is null) return; |
847 int count = OS.g_list_length (list); | 843 int count = OS.g_list_length (list); |
848 if (count > 1) { | 844 if (count > 1) { |
849 /* | 845 /* |
3527 OS.GTK_WIDGET_SET_Y (topHandle, 0); | 3523 OS.GTK_WIDGET_SET_Y (topHandle, 0); |
3528 } else { | 3524 } else { |
3529 resizeHandle (1, 1); | 3525 resizeHandle (1, 1); |
3530 forceResize (); | 3526 forceResize (); |
3531 } | 3527 } |
3532 Stdout.formatln( "{}: setInitialBounds gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() ); | |
3533 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) ); | |
3534 } | 3528 } |
3535 | 3529 |
3536 /** | 3530 /** |
3537 * Sets the receiver's pop up menu to the argument. | 3531 * Sets the receiver's pop up menu to the argument. |
3538 * All controls may optionally have a pop up | 3532 * All controls may optionally have a pop up |
3871 xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow); | 3865 xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow); |
3872 OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes); | 3866 OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes); |
3873 } | 3867 } |
3874 } | 3868 } |
3875 } | 3869 } |
3876 Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() ); | |
3877 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) ); | |
3878 if (fixChildren) { | 3870 if (fixChildren) { |
3879 if (above) { | 3871 if (above) { |
3880 Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() ); | |
3881 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) ); | |
3882 parent.moveAbove (topHandle, siblingHandle); | 3872 parent.moveAbove (topHandle, siblingHandle); |
3883 } else { | 3873 } else { |
3884 Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() ); | |
3885 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) ); | |
3886 parent.moveBelow (topHandle, siblingHandle); | 3874 parent.moveBelow (topHandle, siblingHandle); |
3887 } | 3875 } |
3888 } | 3876 } |
3889 Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() ); | |
3890 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) ); | |
3891 /* Make sure that the parent internal windows are on the bottom of the stack */ | 3877 /* Make sure that the parent internal windows are on the bottom of the stack */ |
3892 if (!above && fixChildren) parent.fixZOrder (); | 3878 if (!above && fixChildren) parent.fixZOrder (); |
3893 Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() ); | |
3894 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) ); | |
3895 | 3879 |
3896 if (fixRelations) { | 3880 if (fixRelations) { |
3897 /* determine the receiver's new index in the parent */ | 3881 /* determine the receiver's new index in the parent */ |
3898 if (sibling !is null) { | 3882 if (sibling !is null) { |
3899 if (above) { | 3883 if (above) { |
3959 // Comment this line to disable zero-sized widgets | 3943 // Comment this line to disable zero-sized widgets |
3960 state |= ZERO_WIDTH | ZERO_HEIGHT; | 3944 state |= ZERO_WIDTH | ZERO_HEIGHT; |
3961 auto topHandle = topHandle (); | 3945 auto topHandle = topHandle (); |
3962 auto parentHandle = parent.parentingHandle (); | 3946 auto parentHandle = parent.parentingHandle (); |
3963 parent.setParentWindow (topHandle); | 3947 parent.setParentWindow (topHandle); |
3964 Stdout.formatln( "showWidget {:x} {}", parentHandle, topHandle ); | |
3965 Stdout.formatln( "showWidget gtk_container_get_children {:x}", parentHandle ); | |
3966 Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentHandle) ); | |
3967 OS.gtk_container_add (cast(GtkContainer*)parentHandle, topHandle); | 3948 OS.gtk_container_add (cast(GtkContainer*)parentHandle, topHandle); |
3968 if (handle !is null && handle !is topHandle) OS.gtk_widget_show (handle); | 3949 if (handle !is null && handle !is topHandle) OS.gtk_widget_show (handle); |
3969 if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) is 0) { | 3950 if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) is 0) { |
3970 if (fixedHandle !is null) OS.gtk_widget_show (fixedHandle); | 3951 if (fixedHandle !is null) OS.gtk_widget_show (fixedHandle); |
3971 } | 3952 } |