[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 
        * 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
        * include/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h: Removed 
        * include/gnu_java_awt_peer_gtk_GtkCheckboxPeer.h: Added 
	definitions for new functions.
        * native/jni/gtk-peer/Makefile.am: Removed reference to
        Removed file.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
        Renamed to checkbox_get_widget.
        Changed to use checkbox_get_widget.


        Changed to use checkbox_get_widget.
        New function. Creates checkbutton without a group.
        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.
	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