Fixes the GridBagLayout issue I mentioned in the last email.
This fixes a layout problem in MegaMek.

2006-03-10  Lillian Angel  <[EMAIL PROTECTED]>

        * java/awt/GridBagLayout.java
        (ArrangeGrid): Added checks to determine if component
        is placed last in a row or column. If so, the location
        of the last component should be used to get the location
        of the current component.


On Fri, 2006-03-10 at 15:04 -0500, Lillian Angel wrote:
> If the last component in a column had its gridheight = REMAINDER, then
> the row height would be set to 0 and that component would not be
> visible. Fixed and committed. There is still a bug in GridBagLayout, the
> location/size for these type of components is not set properly. I am
> working on it.
> 
> 2006-03-10  Lillian Angel  <[EMAIL PROTECTED]>
> 
>         * java/awt/GridBagLayout.java
>         (distributeSizeAndWeight): Change else if to else. This
>         allows for components to be added to a new row when
>         their gridheight is REMAINDER.
> 
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c,v
retrieving revision 1.5
diff -u -r1.5 gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c	22 Sep 2005 20:25:39 -0000	1.5
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c	10 Mar 2006 20:59:17 -0000
@@ -39,6 +39,8 @@
 #include "gtkpeer.h"
 #include "gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h"
 
+static GtkWidget *comboboxgroup_get_widget (GtkWidget *widget);
+
 JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_dispose
   (JNIEnv *env, jobject obj)
@@ -59,7 +61,7 @@
   gdk_threads_enter ();
 
   ptr = NSA_GET_PTR (env, checkbox);
-  button = GTK_RADIO_BUTTON (ptr);
+  button = GTK_RADIO_BUTTON (comboboxgroup_get_widget (GTK_WIDGET (ptr)));
 
   /* Update the group to point to some other widget in the group.  We
      have to do this because Gtk doesn't have a separate object to
@@ -75,3 +77,14 @@
 
   gdk_threads_leave ();
 }
+
+static GtkWidget *
+comboboxgroup_get_widget (GtkWidget *widget)
+{
+  GtkWidget *wid;
+
+  g_assert (GTK_IS_EVENT_BOX (widget));
+  wid = gtk_bin_get_child (GTK_BIN(widget));
+
+  return wid;
+}
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c,v
retrieving revision 1.24
diff -u -r1.24 gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c	10 Mar 2006 20:05:56 -0000	1.24
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c	10 Mar 2006 20:59:17 -0000
@@ -127,16 +127,18 @@
 {
   GtkRadioButton *button;
   void *native_group, *ptr;
+  GtkWidget *bin;
 
   gdk_threads_enter ();
 
   ptr = NSA_GET_PTR (env, obj);
+  bin = combobox_get_widget (GTK_WIDGET (ptr));
   
   /* FIXME: we can't yet switch between a checkbutton and a
      radiobutton.  However, AWT requires this.  For now we just
      crash.  */
 
-  button = GTK_RADIO_BUTTON (ptr);
+  button = GTK_RADIO_BUTTON (bin);
 
   native_group = NSA_GET_PTR (env, group);
   if (native_group == NULL)

Reply via email to