comparison lwlib/lwlib-Xm.c @ 1201:c2569faae8ed

[xemacs-hg @ 2003-01-12 10:45:53 by michaels] 2002-12-16 Ben Wing <ben@xemacs.org> * lwlib-Xlw.c (xlw_update_one_widget): * lwlib-Xm.c (xm_update_one_widget): * lwlib-Xm.c (xm_update_one_value): * lwlib.c: * lwlib.c (merge_scrollbar_values): * xlwmenu.c: * xlwmenu.c (display_menu): * xlwmenu.c (XlwMenuInitialize): * xlwmenu.c (XlwMenuSetValues): * xlwradio.c: * xlwradio.c (RadioClassPartInit): * xlwradio.c (RadioSet): * xlwradio.c (RadioUnset): class -> class_, new -> new_.
author michaels
date Sun, 12 Jan 2003 10:45:53 +0000
parents 4a27df428c73
children 465bd3c7d932
comparison
equal deleted inserted replaced
1200:6eeff8af17a2 1201:c2569faae8ed
822 822
823 void 823 void
824 xm_update_one_widget (widget_instance* instance, Widget widget, 824 xm_update_one_widget (widget_instance* instance, Widget widget,
825 widget_value* val, Boolean deep_p) 825 widget_value* val, Boolean deep_p)
826 { 826 {
827 WidgetClass class; 827 WidgetClass class_;
828 Arg al [20]; 828 Arg al [20];
829 int ac = 0; 829 int ac = 0;
830 830
831 /* Mark as not edited */ 831 /* Mark as not edited */
832 val->edited = False; 832 val->edited = False;
838 838
839 #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) 839 #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF)
840 /* Common to all label like widgets */ 840 /* Common to all label like widgets */
841 xm_safe_update_label (instance, widget, val); 841 xm_safe_update_label (instance, widget, val);
842 #endif 842 #endif
843 class = XtClass (widget); 843 class_ = XtClass (widget);
844 /* Class specific things */ 844 /* Class specific things */
845 if (class == xmPushButtonWidgetClass || 845 if (class_ == xmPushButtonWidgetClass ||
846 class == xmArrowButtonWidgetClass) 846 class_ == xmArrowButtonWidgetClass)
847 { 847 {
848 xm_update_pushbutton (instance, widget, val); 848 xm_update_pushbutton (instance, widget, val);
849 } 849 }
850 #ifdef LWLIB_MENUBARS_MOTIF 850 #ifdef LWLIB_MENUBARS_MOTIF
851 else if (class == xmCascadeButtonWidgetClass) 851 else if (class_ == xmCascadeButtonWidgetClass)
852 { 852 {
853 xm_update_cascadebutton (instance, widget, val); 853 xm_update_cascadebutton (instance, widget, val);
854 } 854 }
855 #endif 855 #endif
856 else if (class == xmToggleButtonWidgetClass 856 else if (class_ == xmToggleButtonWidgetClass
857 || class == xmToggleButtonGadgetClass) 857 || class_ == xmToggleButtonGadgetClass)
858 { 858 {
859 xm_update_toggle (instance, widget, val); 859 xm_update_toggle (instance, widget, val);
860 } 860 }
861 else if (class == xmRowColumnWidgetClass) 861 else if (class_ == xmRowColumnWidgetClass)
862 { 862 {
863 Boolean radiobox = 0; 863 Boolean radiobox = 0;
864 864
865 XtSetArg (al [0], XmNradioBehavior, &radiobox); 865 XtSetArg (al [0], XmNradioBehavior, &radiobox);
866 XtGetValues (widget, al, 1); 866 XtGetValues (widget, al, 1);
870 #ifdef LWLIB_MENUBARS_MOTIF 870 #ifdef LWLIB_MENUBARS_MOTIF
871 else 871 else
872 xm_update_menu (instance, widget, val, deep_p); 872 xm_update_menu (instance, widget, val, deep_p);
873 #endif 873 #endif
874 } 874 }
875 else if (class == xmTextWidgetClass) 875 else if (class_ == xmTextWidgetClass)
876 { 876 {
877 xm_update_text (instance, widget, val); 877 xm_update_text (instance, widget, val);
878 } 878 }
879 else if (class == xmTextFieldWidgetClass) 879 else if (class_ == xmTextFieldWidgetClass)
880 { 880 {
881 xm_update_text_field (instance, widget, val); 881 xm_update_text_field (instance, widget, val);
882 } 882 }
883 else if (class == xmListWidgetClass) 883 else if (class_ == xmListWidgetClass)
884 { 884 {
885 xm_update_list (instance, widget, val); 885 xm_update_list (instance, widget, val);
886 } 886 }
887 #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 887 #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1
888 else if (class == xmComboBoxWidgetClass) 888 else if (class_ == xmComboBoxWidgetClass)
889 { 889 {
890 xm_update_combo_box (instance, widget, val); 890 xm_update_combo_box (instance, widget, val);
891 } 891 }
892 #endif 892 #endif
893 #ifdef LWLIB_SCROLLBARS_MOTIF 893 #ifdef LWLIB_SCROLLBARS_MOTIF
894 else if (class == xmScrollBarWidgetClass) 894 else if (class_ == xmScrollBarWidgetClass)
895 { 895 {
896 xm_update_scrollbar (instance, widget, val); 896 xm_update_scrollbar (instance, widget, val);
897 } 897 }
898 #endif 898 #endif
899 else if (class == xmScaleWidgetClass) 899 else if (class_ == xmScaleWidgetClass)
900 { 900 {
901 xm_update_progress (instance, widget, val); 901 xm_update_progress (instance, widget, val);
902 } 902 }
903 /* Lastly update our global arg values. */ 903 /* Lastly update our global arg values. */
904 if (val->args && val->args->nargs) 904 if (val->args && val->args->nargs)
908 /* getting the value back */ 908 /* getting the value back */
909 void 909 void
910 xm_update_one_value (widget_instance* instance, Widget widget, 910 xm_update_one_value (widget_instance* instance, Widget widget,
911 widget_value* val) 911 widget_value* val)
912 { 912 {
913 WidgetClass class = XtClass (widget); 913 WidgetClass class_ = XtClass (widget);
914 widget_value *old_wv; 914 widget_value *old_wv;
915 915
916 /* copy the call_data slot into the "return" widget_value */ 916 /* copy the call_data slot into the "return" widget_value */
917 for (old_wv = instance->info->val->contents; old_wv; old_wv = old_wv->next) 917 for (old_wv = instance->info->val->contents; old_wv; old_wv = old_wv->next)
918 if (!strcmp (val->name, old_wv->name)) 918 if (!strcmp (val->name, old_wv->name))
919 { 919 {
920 val->call_data = old_wv->call_data; 920 val->call_data = old_wv->call_data;
921 break; 921 break;
922 } 922 }
923 923
924 if (class == xmToggleButtonWidgetClass || class == xmToggleButtonGadgetClass) 924 if (class_ == xmToggleButtonWidgetClass || class_ == xmToggleButtonGadgetClass)
925 { 925 {
926 Arg al [1]; 926 Arg al [1];
927 XtSetArg (al [0], XmNset, &val->selected); 927 XtSetArg (al [0], XmNset, &val->selected);
928 XtGetValues (widget, al, 1); 928 XtGetValues (widget, al, 1);
929 val->edited = True; 929 val->edited = True;
930 } 930 }
931 else if (class == xmTextWidgetClass) 931 else if (class_ == xmTextWidgetClass)
932 { 932 {
933 if (val->value) 933 if (val->value)
934 XtFree (val->value); 934 XtFree (val->value);
935 val->value = XmTextGetString (widget); 935 val->value = XmTextGetString (widget);
936 val->edited = True; 936 val->edited = True;
937 } 937 }
938 else if (class == xmTextFieldWidgetClass) 938 else if (class_ == xmTextFieldWidgetClass)
939 { 939 {
940 if (val->value) 940 if (val->value)
941 XtFree (val->value); 941 XtFree (val->value);
942 val->value = XmTextFieldGetString (widget); 942 val->value = XmTextFieldGetString (widget);
943 val->edited = True; 943 val->edited = True;
944 } 944 }
945 else if (class == xmRowColumnWidgetClass) 945 else if (class_ == xmRowColumnWidgetClass)
946 { 946 {
947 Boolean radiobox = 0; 947 Boolean radiobox = 0;
948 { 948 {
949 Arg al [1]; 949 Arg al [1];
950 XtSetArg (al [0], XmNradioBehavior, &radiobox); 950 XtSetArg (al [0], XmNradioBehavior, &radiobox);
971 } 971 }
972 } 972 }
973 val->edited = True; 973 val->edited = True;
974 } 974 }
975 } 975 }
976 else if (class == xmListWidgetClass 976 else if (class_ == xmListWidgetClass
977 #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 977 #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1
978 || class == xmComboBoxWidgetClass 978 || class_ == xmComboBoxWidgetClass
979 #endif 979 #endif
980 ) 980 )
981 { 981 {
982 int pos_cnt; 982 int pos_cnt;
983 int* pos_list; 983 int* pos_list;
984 Widget list = widget; 984 Widget list = widget;
985 #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 985 #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1
986 if (class == xmComboBoxWidgetClass) 986 if (class_ == xmComboBoxWidgetClass)
987 list = CB_List (widget); 987 list = CB_List (widget);
988 #endif 988 #endif
989 if (XmListGetSelectedPos (list, &pos_list, &pos_cnt)) 989 if (XmListGetSelectedPos (list, &pos_list, &pos_cnt))
990 { 990 {
991 int i; 991 int i;
1006 val->edited = 1; 1006 val->edited = 1;
1007 XtFree ((char *) pos_list); 1007 XtFree ((char *) pos_list);
1008 } 1008 }
1009 } 1009 }
1010 #ifdef LWLIB_SCROLLBARS_MOTIF 1010 #ifdef LWLIB_SCROLLBARS_MOTIF
1011 else if (class == xmScrollBarWidgetClass) 1011 else if (class_ == xmScrollBarWidgetClass)
1012 { 1012 {
1013 /* This function is not used by the scrollbar. */ 1013 /* This function is not used by the scrollbar. */
1014 return; 1014 return;
1015 } 1015 }
1016 #endif 1016 #endif