- XtVaSetValues (button,
- XmNindicatorOn, False,
- XmNshadowThickness, 2,
- // XmNborderWidth, 0,
- // XmNspacing, 0,
- XmNmarginWidth, 0,
- XmNmarginHeight, 0,
- XmNfillOnSelect, True,
- XmNlabelPixmap, pixmap,
- XmNselectPixmap, pixmap2,
- XmNlabelInsensitivePixmap, insensPixmap,
- XmNselectInsensitivePixmap, insensPixmap2,
- XmNlabelType, XmPIXMAP,
- NULL);
- }
- else
- {
- Pixmap pixmap2 = (Pixmap) 0;
-
- // If there's a bitmap for the armed state, use it,
- // otherwise generate one.
- if (tool->m_bitmap2.Ok())
- {
- pixmap2 = (Pixmap) tool->m_bitmap2.GetPixmap();
- }
- else
- {
- pixmap2 = (Pixmap) tool->m_bitmap1.GetArmPixmap(button);
-
- }
- // Normal button
- XtVaSetValues(button,
- XmNlabelPixmap, pixmap,
- XmNlabelInsensitivePixmap, insensPixmap,
- XmNarmPixmap, pixmap2,
- NULL);
- }
- XtManageChild(button);
-
- Dimension width, height;
- XtVaGetValues(button, XmNwidth, & width, XmNheight, & height,
- NULL);
- currentX += width + marginX;
- buttonHeight = wxMax(buttonHeight, height);
-
- XtAddEventHandler (button, EnterWindowMask | LeaveWindowMask,
- False, wxToolButtonPopupCallback, (XtPointer) this);
- m_widgets.Append(tool->m_index, (wxObject*) button);
-
- prevButton = button;
- currentSpacing = 0;
- }
- node = node->Next();
- }
-
- SetSize(-1, -1, currentX, buttonHeight + 2*marginY);
-
- return TRUE;
-}
-
-// Old version, assuming we use a form. Now we use
-// a bulletin board, so we can create controls on the toolbar.
-#if 0
-bool wxToolBar::CreateTools()
-{
- if (m_tools.Number() == 0)
- return FALSE;