[cp-patches] Patch: Checkbox group fix

Lillian Angel langel at redhat.com
Fri Jun 30 14:46:44 UTC 2006


This patch fixes the long standing problem of not being able to
dynamically switch between a checkbox and a radio button. I.e. moving a
checkbox to a checkbox group changes the checkbox to a radio button.

Tom helped a lot with this patch. He removed the CheckboxGroupPeer and
we fixed it so everything is handled in GtkCheckboxPeer.

There is a mauve test for this. The harmony test
(test.java.awt.CheckboxTest) now passes.


2006-06-30  Lillian Angel  <langel at redhat.com>
            Tom Fitzsimmons <fitzsim at redhat.com>

        * gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java: Removed 
	class.
        * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java:
        Added current_group, groupMap fields. Added definitions for
        new native functions.
        (create): Removed FIXME. Added code to create the check button 
	or radio button when appropriate. Updated groupMap to contain
        pointer to the newly created group.
        (setCheckboxGroup): Added code to handle all cases. Removing
        a button from a group, adding a button to a group, or changing 
	the group of a button.
        (dispose): Changed to call super.
        * include/Makefile.am: Removed reference to
        gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h.
        * include/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h: Removed 
	file.
        * include/gnu_java_awt_peer_gtk_GtkCheckboxPeer.h: Added 
	definitions for new functions.
        * native/jni/gtk-peer/Makefile.am: Removed reference to
        gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c.
        *
native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c:
        Removed file.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
       (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_combobox_get_widget):
        Renamed to checkbox_get_widget.
        (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals):
        Changed to use checkbox_get_widget.

(Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeSetCheckboxGroup):
        Removed.

(Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_gtkWidgetModifyFont):
        Changed to use checkbox_get_widget.
        (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_gtkButtonSetLabel):
        Likewise.
        (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_createCheckButton):
        New function. Creates checkbutton without a group.
        (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_createRadioButton):
        Creates a radio button in a group, using groupPointer. If 
	groupPointer is 0, then a new group is created.
        (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_addToGroup): Adds 
	the check button to a group, using groupPointer. A radio button 
	is created in its place. If groupPointer is 0, then a new group 
	is created.
        (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_removeFromGroup): 
	The radio button is removed from the group. A check button is 
	created in its place.
        (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_switchToGroup): The
        radio button is moved to a new group.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 29739 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20060630/fc8f3ee9/patch-0001.bin


More information about the Classpath-patches mailing list