- if (tool->m_isToggle)
- {
- button = XtVaCreateManagedWidget("toggleButton",
- xmToggleButtonWidgetClass, (Widget) m_mainWidget,
- XmNleftAttachment, (prevButton == (Widget) 0) ? XmATTACH_FORM : XmATTACH_WIDGET,
- XmNleftWidget, (prevButton == (Widget) 0) ? NULL : prevButton,
- XmNleftOffset, currentSpacing,
- XmNtopAttachment, XmATTACH_FORM,
- // XmNpushButtonEnabled, True,
- XmNmultiClick, XmMULTICLICK_KEEP,
- XmNlabelType, XmPIXMAP,
- NULL);
- XtAddCallback ((Widget) button, XmNvalueChangedCallback, (XtCallbackProc) wxToolButtonCallback,
- (XtPointer) this);
- }
- else
- {
- button = XtVaCreateManagedWidget("button",
- xmPushButtonWidgetClass, (Widget) m_mainWidget,
- XmNleftAttachment, (prevButton == (Widget) 0) ? XmATTACH_FORM : XmATTACH_WIDGET,
- XmNleftWidget, (prevButton == (Widget) 0) ? NULL : prevButton,
- XmNleftOffset, currentSpacing,
- XmNtopAttachment, XmATTACH_FORM,
- XmNpushButtonEnabled, True,
- XmNmultiClick, XmMULTICLICK_KEEP,
- XmNlabelType, XmPIXMAP,
- NULL);
- XtAddCallback (button,
- XmNactivateCallback, (XtCallbackProc) wxToolButtonCallback,
- (XtPointer) this);
- }
-
- // For each button, if there is a mask, we must create
- // a new wxBitmap that has the correct background colour
- // for the button. Otherwise the background will just be
- // e.g. black if a transparent XPM has been loaded.
- wxBitmap originalBitmap = tool->m_bitmap1;