/*----------------------------------------------------------------------*/ static void TitleConfigure(Widget w) { XfeComboBoxPart * cp = _XfeComboBoxPart(w); Arg av[10]; Cardinal ac = 0; assert( _XfeIsAlive(cp->title) ); if (cp->combo_box_type == XmCOMBO_BOX_EDITABLE) { XfeOverrideTranslations(cp->title, _XfeComboBoxTextEditableTranslations); XtSetArg(av[ac],XmNeditable,True); ac++; XtSetArg(av[ac],XmNcursorPositionVisible,True); ac++; } else { XfeOverrideTranslations(cp->title, _XfeComboBoxTextReadOnlyTranslations); XtSetArg(av[ac],XmNeditable,False); ac++; XtSetArg(av[ac],XmNcursorPositionVisible,False); ac++; } XtSetValues(cp->title,av,ac); }
/*----------------------------------------------------------------------*/ static Widget ArrowCreate(Widget w) { /* XfeComboBoxPart * cp = _XfeComboBoxPart(w); */ Widget arrow = NULL; arrow = XtVaCreateWidget(ARROW_NAME, xfeArrowWidgetClass, w, XmNbackground, _XfeBackgroundPixel(w), XmNbackgroundPixmap, _XfeBackgroundPixmap(w), XmNshadowThickness, 1, /* XmNemulateMotif, False, */ XmNraiseBorderThickness, 0, XmNraiseOnEnter, False, XmNfillOnEnter, False, XmNshadowThickness, 0, XmNbuttonType, XmBUTTON_TOGGLE, NULL); XfeOverrideTranslations(arrow,_XfeComboBoxArrowTranslations); #if 0 XtAddCallback(arrow,XmNarmCallback,ArrowArmCB,w); XtAddCallback(arrow,XmNdisarmCallback,ArrowDisarmCB,w); XtAddCallback(arrow,XmNactivateCallback,ArrowActivateCB,w); #endif /* XtAddCallback(arrow,XmNactivateCallback,ArrowActivateCB,w); */ return arrow; }
/*----------------------------------------------------------------------*/ static void Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs) { XfeBmCascadePart * bmc = _XfeBmCascadePart(nw); XmLabelPart * lp = _XfeXmLabelPart(nw); /* Force the type to be string always */ lp->label_type = XmSTRING; bmc->pixmap_GC = XfeAllocateTransparentGc(nw); _XfePixmapPrepare(nw, &lp->pixmap, &bmc->pixmap_width, &bmc->pixmap_height, XmNlabelPixmap); XfeOverrideTranslations(nw,_XfeBmButtonExtraTranslations); }
/*----------------------------------------------------------------------*/ static void Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs) { XfeComboBoxPart * cp = _XfeComboBoxPart(nw); /* Make sure rep types are ok */ XfeRepTypeCheck(nw,XmRShadowType,&cp->title_shadow_type, XmSHADOW_IN); XfeRepTypeCheck(nw,XmRComboBoxType,&cp->combo_box_type, XmCOMBO_BOX_READ_ONLY); /* Make sure read-only resources aren't set */ if (cp->title) { _XmWarning(nw,MESSAGE2); cp->title = NULL; } if (cp->list) { _XmWarning(nw,MESSAGE3); cp->list = NULL; } if (cp->shell) { _XmWarning(nw,MESSAGE4); cp->shell = NULL; } if (cp->arrow) { _XmWarning(nw,MESSAGE5); cp->arrow = NULL; } /* Create components */ cp->arrow = ArrowCreate(nw); cp->title = TitleCreate(nw); cp->shell = ShellCreate(nw); cp->list = ListCreate(nw); /* Configure the title */ TitleConfigure(nw); /* Initialize private members */ cp->highlighted = False; cp->delay_timer_id = 0; /* Manage the children */ XtManageChild(cp->title); XtManageChild(cp->list); XtManageChild(cp->arrow); XfeOverrideTranslations(nw,_XfeComboBoxExtraTranslations); /* Finish of initialization */ _XfeManagerChainInitialize(rw,nw,xfeComboBoxWidgetClass); }