void init_2dgrafik_interface(void) /*************************************************************************/ { b_init_2dgrafik = TRUE; /* Flagge dass Fenster initialisiert */ XtSetSensitive(widget2DGrafik.TB_ausgabe, TRUE); XtSetSensitive(widget2DGrafik.TB_manuell, TRUE); XtSetSensitive(widget2DGrafik.T_omin, FALSE); XtSetSensitive(widget2DGrafik.T_omax, FALSE); XtSetSensitive(widget2DGrafik.T_amin, FALSE); XtSetSensitive(widget2DGrafik.T_amax, FALSE); XtSetSensitive(widget2DGrafik.PB_zeichne, FALSE); XtSetSensitive(widget2DGrafik.PB_loesche, FALSE); XtSetSensitive(widget2DGrafik.PB_calculate, FALSE); XtSetSensitive(widget2DGrafik.PB_addpoint, FALSE); if (XmToggleButtonGetState(widget2DGrafik.TB_manuell) || XmToggleButtonGetState(widget2DGrafik.TB_pick)) { XtSetSensitive(widget2DGrafik.T_omin, FALSE); XtSetSensitive(widget2DGrafik.T_omax, FALSE); XtSetSensitive(widget2DGrafik.T_amin, FALSE); XtSetSensitive(widget2DGrafik.T_amax, FALSE); XtSetSensitive(widget2DGrafik.PB_zeichne, TRUE); XtSetSensitive(widget2DGrafik.PB_loesche, TRUE); XtSetSensitive(widget2DGrafik.PB_calculate, TRUE); } return; }
static void OkCallback(Widget w, void *userData, XmAnyCallbackStruct *callData) { /* set appData to the toggle button variables */ appData->show_name = XmToggleButtonGetState(nameToggle); appData->show_label = XmToggleButtonGetState(labelToggle); appData->show_tree = appData->show_label && XmToggleButtonGetState(treeToggle); appData->show_dist = XmToggleButtonGetState(distToggle); appData->show_annotation = XmTextGetString(annText); MEM_ALLOC_NOTIFY(appData->show_annotation); if(!appData->show_annotation[0]) { free(appData->show_annotation); appData->show_annotation = NULL; } else ListAddRear(appData->garbage, appData->show_annotation); /* similar to Resize() and CloseDB() */ BusyOn("reconfiguring photos"); XtpmIPHalt(appData->imp); XtpmITFree(appData->imt); XFreePixmap(appData->display, appData->no_image_pixmap); PixCacheFree(); if(debug) XC_BLOCKS(); ConfigurePhotos(); PixCacheCreate(); PixCacheSize(appData->cache_size); XtpmIPUpdate(appData->imp); }
/*=== restore_aux_windows =================================================== This gets called from client_message_handler to pop up the aux windows that were up when CUSTINFO was iconified. If the toggle is set in the View menu, then the window will be popped up. This has no effect on, nor is it affected by, the settings in the Information to View section on the main screen. ===========================================================================*/ void restore_aux_windows(Widget w, XtPointer client_data, XtPointer call_data) { if (XmToggleButtonGetState(ci_view_verify_btn)) show_window(ci_verifyinfo_shell, ci_verifyinfo_form) ; if (XmToggleButtonGetState(ci_view_tax_btn)) show_window(ci_taxinfo_shell, ci_taxinfo_form) ; if (XmToggleButtonGetState(ci_view_summary_btn)) show_window(cmf_sum_shell, cmf_sum_form) ; if (XmToggleButtonGetState(ci_view_payment_btn)) show_window(ci_paymentinfo_shell, ci_paymentinfo_form) ; if (XmToggleButtonGetState(ci_view_general_btn)) show_window(ci_miscinfo_shell, ci_miscinfo_form) ; if (XmToggleButtonGetState(ci_view_contact_btn)) show_window(ci_contactinfo_shell, ci_contactinfo_form) ; if (XmToggleButtonGetState(ci_view_bill_btn)) show_window(ci_billinfo_shell, ci_billinfo_form) ; if (XmToggleButtonGetState(ci_view_addr_btn)) show_window(ci_addrinfo_shell, ci_addrinfo_form) ; if (XmToggleButtonGetState(ci_view_acct_btn)) show_window(ci_accountinfo_shell, ci_accountinfo_form) ; return ; }
/* * define the draw options */ static void define_draw_proc(Widget w, XtPointer client_data, XtPointer call_data) { Arg a; int value; scrolling_islinked = XmToggleButtonGetState(linkscroll_item); auto_redraw = XmToggleButtonGetState(autoredraw_type_item); allow_refresh = XmToggleButtonGetState(autorefresh_type_item); cursortype = XmToggleButtonGetState(cursor_type_item); XtSetArg(a, XmNvalue, &value); XtGetValues(scrollper_item, &a, 1); scrollper = value / 100.0; XtUnmanageChild(draw_frame); drawgraph(); }
void init_vektor_interface(void) /*************************************************************************/ { char c_hilf[12]; b_init_vektor = TRUE; /* Flagge dass Fenster initialisiert */ if (g_animation.temp_on) XmToggleButtonSetState(widget_vektor.TB_temperatur, TRUE, FALSE); if (g_animation.spann_on) XmToggleButtonSetState(widget_vektor.TB_spannung, TRUE, FALSE); if (g_animation.stroem_on) XmToggleButtonSetState(widget_vektor.TB_stroemung, TRUE, FALSE); if (!XmToggleButtonGetState(widget_vektor.TB_spannung) && !XmToggleButtonGetState(widget_vektor.TB_stroemung)) { XtSetSensitive(widget_vektor.L_sp_faktor, FALSE); XtSetSensitive(widget_vektor.T_sp_faktor, FALSE); XtSetSensitive(widget_vektor.L_st_faktor, FALSE); XtSetSensitive(widget_vektor.T_st_faktor, FALSE); XtSetSensitive(widget_vektor.RC_animation, FALSE); } else { sprintf(c_hilf, "%8.3f", g_spannung.factor); XmTextFieldSetString(widget_vektor.T_sp_faktor, c_hilf); sprintf(c_hilf, "%8.3f", g_stroemung.factor); XmTextFieldSetString(widget_vektor.T_st_faktor, c_hilf); } if (g_loesung.gescannt) XtSetSensitive(widget_vektor.TB_temperatur, TRUE); else XtSetSensitive(widget_vektor.TB_temperatur, FALSE); if (g_spannung.vektor_gescannt) XtSetSensitive(widget_vektor.TB_spannung, TRUE); else XtSetSensitive(widget_vektor.TB_spannung, FALSE); if (g_stroemung.vektor_gescannt) XtSetSensitive(widget_vektor.TB_stroemung, TRUE); else XtSetSensitive(widget_vektor.TB_stroemung, FALSE); return; }
void Track_station_now(Widget w, XtPointer clientData, XtPointer callData) { char temp[MAX_CALLSIGN+1]; char temp2[200]; int found = 0; char *temp_ptr; temp_ptr = XmTextFieldGetString(track_station_data); xastir_snprintf(temp, sizeof(temp), "%s", temp_ptr); XtFree(temp_ptr); (void)remove_trailing_spaces(temp); (void)remove_trailing_dash_zero(temp); xastir_snprintf(tracking_station_call, sizeof(tracking_station_call), "%s", temp); track_case = (int)XmToggleButtonGetState(track_case_data); track_match = (int)XmToggleButtonGetState(track_match_data); found = locate_station(da, temp, track_case, track_match, 0); if ( valid_object(tracking_station_call) // Name of object is legal || valid_call(tracking_station_call) || valid_item(tracking_station_call ) ) { track_station_on = 1; // Track it whether we've seen it yet or not if (!found) { xastir_snprintf(temp2, sizeof(temp2), langcode("POPEM00026"), temp); popup_message_always(langcode("POPEM00025"),temp2); } // Check for exact match, includes SSID if ( track_me & !is_my_call( tracking_station_call, 1) ) { XmToggleButtonSetState( trackme_button, FALSE, FALSE ); track_me = 0; } } else { tracking_station_call[0] = '\0'; // Empty it out again track_station_on = 0; xastir_snprintf(temp2, sizeof(temp2), langcode("POPEM00002"), temp); popup_message_always(langcode("POPEM00003"),temp2); } track_station_destroy_shell(w, clientData, callData); display_zoom_status(); }
/* ARGSUSED */ void mpcstw_defConCb ( Widget w, XtPointer clnt, XtPointer call ) /************************************************************************ * mpcstw_defConCb * * * * This is the callback for DEF proj content button * * * * void mpcstw_defConCb(w, data, call) * * * * Input parameters: * * w Widget calling widget ID * * clnt XtPointer client data * * call XtPointer never used * * * * Output parameters: * * Return parameters: * * NONE * * * ** * * Log: * * S. Wang/GSC 09/96 * * C. Lin/EAI 02/97 add checking if text is NULL * * C. Lin/EAI 07/97 call new mapw module * * M. Li/GSC 03/01 removed mapw_getDEFproj * ***********************************************************************/ { unsigned char shadow_char; char *text; XmString str_def_con; /*---------------------------------------------------------------------*/ if ( XmToggleButtonGetState(_defaultBt) == FALSE ) return; XtVaGetValues( _defaultConFrame, XmNshadowType, &shadow_char, NULL); if ( shadow_char == XmSHADOW_OUT ) { /* * show the content of current DEF projection */ text = XmTextFieldGetString(_gareaTextW) ; if ( strlen(text) != (size_t)0 ) { XtFree(text); str_def_con = XmStringCreateLocalized( _curDef ); XtVaSetValues(w, XmNlabelString, str_def_con, NULL); XmStringFree(str_def_con); XtVaSetValues(_defaultConFrame, XmNshadowType, XmSHADOW_IN, NULL); } } else mpcstw_resetDefCon(); }
/* -------------------------------------------------------------------- */ bool plotWaveNumber() { if (SpectrumWindow == NULL) return(false); return(XmToggleButtonGetState(pmOptButt[4])); }
static void swing_callback(Widget w, XtPointer data, caddr_t cbs) { cd->swing = XmToggleButtonGetState(swing); cd->loop = 0; XmToggleButtonSetState(loop, 0, False); cd->stop = !cd->swing; }
Boolean options_checkbox_get_value(Widget checkbox) { return((Boolean)XmToggleButtonGetState(checkbox)); }
/* -------------------------------------------------------------------- */ bool plotWaveLength() { if (SpectrumWindow == NULL) return(false); return(XmToggleButtonGetState(pmOptButt[5])); }
void GUI_GeneralManage(Widget w,XtPointer client, XtPointer call) { struct CTransform *ctransform=(struct CTransform *)client; Widget dialog=ctransform->parentwidget; int lokke; for(lokke=0;lokke<3;lokke++){ if( ctransform->funcs[lokke]!=NULL && XmToggleButtonGetState(ctransform->funcs[lokke]->togglewidget) ) { SetFuncMinMax(lokke,ctransform->funcs[lokke]->minval,ctransform->funcs[lokke]->maxval); SetVisibleFunc( lokke+1, 1); }else{ SetVisibleFunc( lokke+1, 0); } } RestoreWin(ctransform->fftsound); XtManageChild(dialog); }
extern void get_dssw_times(DSSW *dssw) { char *str; str = XmTextGetString(dssw->start_text); strcpy(dssw->start_val.val, str); XtFree(str); dssw->start_val.block = XmToggleButtonGetState(dssw->start_am) ? TIME_AM : TIME_PM; str = XmTextGetString(dssw->stop_text); strcpy(dssw->stop_val.val, str); XtFree(str); dssw->stop_val.block = XmToggleButtonGetState(dssw->stop_am) ? TIME_AM : TIME_PM; }
/*=== hold_code_value_changed_cb ====================================================*/ void hold_code_value_changed_cb(Widget w, XtPointer client_data, XtPointer call_data) { #ifdef FT char *str; if (XmToggleButtonGetState (ci_none_btn)) { XmTextSetString (cmfj_origine_ret_txt, ""); XmTextSetString (cmfj_code_motif_txt, ""); set_editable_off (cmfj_origine_ret_txt); XtSetSensitive (cmfj_origine_ret_btn, FALSE); set_editable_off (cmfj_code_motif_txt); XtSetSensitive (cmfj_code_motif_btn, FALSE); } else { str = XmTextGetString (cmfj_origine_ret_txt); if (strlen (str) == 0) { XmTextSetString (cmfj_origine_ret_txt, origine_ret_list[cmfj_origine_ret_default].description); } set_editable_on (cmfj_origine_ret_txt); XtSetSensitive (cmfj_origine_ret_btn, TRUE); set_editable_on (cmfj_code_motif_txt); XtSetSensitive (cmfj_code_motif_btn, TRUE); } #endif }
void XFE_ABDirGenTabView::getDlgValues() { XFE_ABDirPropertyDlg *dlg = (XFE_ABDirPropertyDlg *)getToplevel(); DIR_Server *dir = dlg->getDir(); /* setting up the defaults */ char *tmp; tmp = fe_GetTextField(m_textFs[ABDIR_DESCRIPTION]); if (tmp && strlen(tmp)) dir->description = tmp; else dir->description = NULL; tmp = fe_GetTextField(m_textFs[ABDIR_LDAPSERVER]); if (tmp && strlen(tmp)) dir->serverName = tmp; else dir->serverName = NULL; tmp = fe_GetTextField(m_textFs[ABDIR_SEARCHROOT]); if (tmp && strlen(tmp)) dir->searchBase = tmp; else dir->searchBase = NULL; tmp = fe_GetTextField(m_textFs[ABDIR_PORTNUMBER]); if (tmp && strlen(tmp)) sscanf(tmp, "%d", &(dir->port)); else dir->port = 0; tmp = fe_GetTextField(m_textFs[ABDIR_MAXHITS]); if (tmp && strlen(tmp)) sscanf(tmp, "%d", &(dir->maxHits)); else dir->maxHits = 0; dir->isSecure = XmToggleButtonGetState(m_toggles[ABDIR_SECUR]); dir->enableAuth = XmToggleButtonGetState(m_toggles[ABDIR_USEPASSWD]); dir->savePassword = XmToggleButtonGetState(m_toggles[ABDIR_SAVEPASSWD]); }
//Called whenever something changes void InvPartEditor::apply() { static int count = 0; // important in case of cooperative working int partKey; int refPartKey; int i; for (i = 0; i < numberOfParts_; i++) { partKey = parts_[i].key_; //make the part visible if selected in list if (XmToggleButtonGetState(parts_[i].visible_)) { covViewer->switchPart(partKey, VIS); } else { covViewer->switchPart(partKey, INVIS); } } if (referenceTag) //do we use reference a reference part? { for (i = 0; i < numberOfParts_; i++) { bool setValue; Arg args[1]; XtSetArg(args[0], XmNset, &setValue); XtGetValues(parts_[i].referenced_, args, 1); if (setValue) { //A part to be referenced is found. break; } } if (i < numberOfParts_) { //we found really a part to be referenced if (transTag == DIS || !count) { covViewer->resetTransformedScene(); } refPartKey = parts_[i].key_; covViewer->setReferencePoint(refPartKey); covViewer->transformScene(refPartKey); transTag = DIS; } } else { // undo transformation if necessary if (transTag == DIS || !count) { covViewer->resetTransformedScene(); transTag = UNDIS; } } count++; }
/* * Callback for the lat/lon on/off button */ void SetLatLonGridOnCB (Widget w, XtPointer client_data, XtPointer xt_call_data ) { GuiLatLonGridDialogType *llg; GuiLineAttributesDialogType *atr; Widget sample; BooleanType state; XtCallbackProc callback; XtPointer clientData; atr = GetGuiLineAttributesDialog(); llg = GetGuiLatLonGridDialog(); state = XmToggleButtonGetState (w); SetLatLonSensitive (state); /* * Force the sample line to redraw */ sample = GetLatLonGridSampleW (llg); RefreshLatLonSampleCB (sample, client_data, xt_call_data ); /* * Special case: check if the user has turned off lat/lon while it * currently controls the line attributes dialog. If so, unmanage * the line attributes dialog. */ if ( (GetLatLonGridSampleW(llg) == GetLineAttributesCurrentSampleW(atr)) && ! state ) { XtUnmanageChild ( GetLineAttributesDialogW(atr) ); SetLineAttributesCurrentSampleW(atr, NULL); callback = GetLineAttributesCallback(atr); if ( callback != NULL ) { clientData = GetLineAttributesClientData(atr); XtRemoveCallback( GetLineAttributesApplyW(atr), XmNactivateCallback, callback, (XtPointer) clientData); } SetLineAttributesCallback(atr, NULL); SetLineAttributesClientData(atr, (XtPointer) NULL); } /* * Set the changed state flag */ SetLatLonGridChangeState ( llg, True ); }
void edit_set_proc(Widget w, XtPointer client_data, XtPointer call_data) { #ifdef HAVE_LIBXBAE if( XmToggleButtonGetState(ext_editor_item) == False ) do_ss_frame( NULL, NULL, NULL ); else #endif do_ext_editor( NULL, NULL, NULL ); }
void filter_ucr( Widget w, XtPointer client_data, XtPointer call_data ) { char *ucr_level_id; char *ucr_type; char ucr_descr[POPLIST_DESCR_LEN]; char temp_str[150]; char *tmp_str; Boolean audit_trail; /* Note: ucr_filter_str will always start with "and" since there is * already a where clause in populate_ucr_scrolled_list(). * */ /* get filter criteria from screen */ ucr_level_id = XmTextGetString (ci_ucr_level_id_filter_txt); ucr_type = XmTextGetString (ci_ucr_type_filter_txt); /* since the ci_ucr_type_filter_txt widget doesn't just contain the * description_text (it has duration also), we need to look up the * description_text in the poplist global structure */ if (strcmp(ucr_type,"") != 0) sprintf(ucr_descr, "%s", ucr_types_list[ucr_type_selection_for_fs].description); audit_trail = XmToggleButtonGetState (ci_ucr_audit_tgl); strcpy (ucr_filter_str, ""); strcpy (temp_str, ""); if (strcmp(ucr_level_id, "") != 0){ tmp_str = convert_to_db_string(ucr_level_id); sprintf (temp_str, " and external_id = '%s' ", tmp_str ); strcat (ucr_filter_str, temp_str ); free(tmp_str); } if (strcmp(ucr_type, "") != 0){ /* we display description_text version of ucr_type */ sprintf (temp_str, " and D.description_text = '%s' ", ucr_descr ); strcat (ucr_filter_str, temp_str ); } if (!audit_trail){ sprintf (temp_str, " and CUC.no_bill = 0 " ); strcat ( ucr_filter_str, temp_str ); } XtFree ( ucr_level_id ); XtFree ( ucr_type ); populate_ucr_scrolled_list(); }
void InvPartEditor::invertAllToggleButtons(InvPartEditor *p) { int i; for (i = 0; i < p->numberOfParts_; i++) { XmToggleButtonSetState(p->parts_[i].visible_, !XmToggleButtonGetState(p->parts_[i].visible_), False); } p->apply(); }
void SetVPModelGridTypeCB ( Widget w, XtPointer clientData, XtPointer call_data ) /* * This function sets the plot type to SCALAROBJECT or VECTOROBJECT when * an FDF is chosen for model grids. It also activates the appropriate * radio button. This routine is used both as a callback and as a general * use routine so the widget id may not be that of either the scalar or * vector radio buttons. */ { Widget scalar_b, vector_b; GuiVertProfileObjectType *vpt; int type; type = (int) clientData; vpt = GetGuiVertProfileDialog(); /* * Set grid type to SCALAROBJECT or VECTOROBJECT. */ SetVPGridType ( vpt, type ); /* * Set radio button to either Scalar or Vector. */ scalar_b = GetModelScalarButtonVPW ( vpt ); vector_b = GetModelVectorButtonVPW ( vpt ); if ( type == SCALARGRIDOBJECT ) { if ( ! XmToggleButtonGetState ( scalar_b ) ) XmToggleButtonSetState ( scalar_b, TRUE, FALSE ); if ( XmToggleButtonGetState ( vector_b ) ) XmToggleButtonSetState ( vector_b, FALSE, FALSE ); } else if ( type == VECTORGRIDOBJECT ) { if ( ! XmToggleButtonGetState ( vector_b ) ) XmToggleButtonSetState ( vector_b, TRUE, FALSE ); if ( XmToggleButtonGetState ( scalar_b ) ) XmToggleButtonSetState ( scalar_b, FALSE, FALSE ); } }
void CLogMotif::filter_act_but_cb( Widget w, CLog *clog, XmAnyCallbackStruct *data) { int key; char *str; bool success = XmToggleButtonGetState( ((CLogMotif *)clog)->show_success_w); bool info = XmToggleButtonGetState( ((CLogMotif *)clog)->show_info_w); bool warning = XmToggleButtonGetState( ((CLogMotif *)clog)->show_warning_w); bool error = XmToggleButtonGetState( ((CLogMotif *)clog)->show_error_w); bool fatal = XmToggleButtonGetState( ((CLogMotif *)clog)->show_fatal_w); bool text = XmToggleButtonGetState( ((CLogMotif *)clog)->show_text_w); str = XmTextGetString( ((CLogMotif *)clog)->filter_string_w); XtVaGetValues(w, XmNuserData, &key, NULL); switch (key) { case 1 : // Ok XtUnmanageChild( ((CLogMotif *)clog)->filter_form); case 2 : // Apply clog->set_clock_cursor(); clog->clognav->set_filter( success, info, warning, error, fatal, text, str); clog->reset_cursor(); break; case 3 : // Cancel XtUnmanageChild( ((CLogMotif *)clog)->filter_form); break; } }
static void do_constr_toggle (Widget w, XtPointer client_data, XtPointer call_data) { int value = (int) client_data; if (XmToggleButtonGetState(nonl_constr_item[value])) { XtSetSensitive(nonl_lowb_item[value], True); XtSetSensitive(nonl_uppb_item[value], True); nonl_parms[value].constr = TRUE; } else { XtSetSensitive(nonl_lowb_item[value], False); XtSetSensitive(nonl_uppb_item[value], False); nonl_parms[value].constr = FALSE; } }
/* * file->open->ok */ static void file_open_ok(Widget w, XtPointer closure, XtPointer call) { XmFSS *cbs = (XmFSS *)call; MGV *m = (MGV *)closure; char *file; Widget top; int status; USEUP(w); assert(MgvOK(m)); if(!XmStringGetLtoR(cbs->value, XmFONTLIST_DEFAULT_TAG, &file)) return; if(XmToggleButtonGetState(wl_find1(w, "*openNew"))) { top = XtAppCreateShell(NULL, "MGv", wlAppShellWidgetClass, XtDisplay(w), NULL, 0); if(top == NULL) { XtFree((XtPointer)file); return; } if((m = mgv_create(top, file)) == NULL) { XtFree((XtPointer)file); XtDestroyWidget(top); return; } } else if((status = mgv_open(m, file)) != 0) { wl_error(w, "%s: %s", file, strerror(status)); XtFree((XtPointer)file); return; } XtFree((XtPointer)file); if(!XmToggleButtonGetState(wl_find1(w, "*openBrowse"))) XtUnmanageChild(w); if(m->docinfo != NULL) XtUnmanageChild(m->docinfo); mgv_pgstack_goto(m->pgstack, 0); }
void update_asc_desc_list(Widget w, XtPointer client_data, XtPointer call_data) { /* This function is called when the state of a "reverse" button * changes. If button is selected (XmToggleButtonGetState == TRUE), * set the list to indicate descending order for the selected item. */ if (XmToggleButtonGetState(w)) asc_desc_list[(int)client_data] = DESC; else asc_desc_list[(int)client_data] = ASC; build_sort_order(); }
static void accept_special_proc(Widget w, XtPointer client_data, XtPointer call_data) { tickmarks t; int iv, i; get_graph_tickmarks(cg, &t, curaxis); t.t_type = XmToggleButtonGetState(specticks) ? TYPE_SPEC : TYPE_AUTO; t.tl_type = XmToggleButtonGetState(specticklabels) ? TYPE_SPEC : TYPE_AUTO; iv = atoi((char *) xv_getstr(nspec)); if (iv > MAX_TICK_LABELS) { sprintf(buf, "Number of ticks/tick labels exceeds %d", MAX_TICK_LABELS); errwin(buf); return; } t.t_spec = iv; for (i = 0; i < MAX_TICK_LABELS; i++) { t.t_specloc[i] = atof((char *) xv_getstr(specloc[i])); set_plotstr_string(&t.t_speclab[i], (char *) xv_getstr(speclabel[i])); } set_graph_tickmarks(cg, &t, curaxis); drawgraph(); set_dirtystate(); }
int structGuiOptionMenu :: f_getValue () { d_value = 0; #if gtk // TODO: Graag even een check :) d_value = gtk_combo_box_get_active (GTK_COMBO_BOX (d_widget)) + 1; #elif motif for (int i = 1; i <= d_options -> size; i ++) { GuiMenuItem menuItem = static_cast <GuiMenuItem> (d_options -> item [i]); if (XmToggleButtonGetState (menuItem -> d_widget)) d_value = i; } #endif return d_value; }
void reverse_cciu_sort_items(Widget w, XtPointer client_data, XmToggleButtonCallbackStruct *call_data) { if (XmToggleButtonGetState(w)) cciu_sort_data[(int)client_data].ascdesc_order = DESC; else cciu_sort_data[(int)client_data].ascdesc_order = ASC; cciu_build_sort_order (cciu_sort_data, num_man_sort_items); XmTextSetString(cc_man_sort_order_txt, cciu_sort_text); } /* reverse_cciu_sort_items */
static void SetContourCB(Widget w, XtPointer client_data, XtPointer) { PlotWindowInfo *plot = (PlotWindowInfo *)client_data; Widget base = XtNameToWidget(XtParent(w), "base"); Widget surface = XtNameToWidget(XtParent(w), "surface"); assert (base != 0 && surface != 0); bool base_set = XmToggleButtonGetState(base); bool surface_set = XmToggleButtonGetState(surface); string cmd; if (base_set && surface_set) cmd = "set contour both"; else if (base_set && !surface_set) cmd = "set contour base"; else if (!base_set && surface_set) cmd = "set contour surface"; else cmd = "set nocontour"; send_and_replot(plot, cmd); }
/* * Show not only the parameter to the callback function but also * the current widget state. */ void toggle_cb(Widget w, XtPointer client_data, XtPointer call_data) { XmToggleButtonCallbackStruct *state = (XmToggleButtonCallbackStruct *) call_data; Boolean x = XmToggleButtonGetState(w); fprintf(stderr, "Widget %s\t", x ? "set" : "clear"); fprintf(stderr, "Button %d ", (int)client_data); if(state->set){ fprintf(stderr, "set\n"); } else { fprintf(stderr, "clear\n"); } }