Пример #1
0
void
XFE_TaskBar::createDockedWidgets(Widget parent)
{
	XP_ASSERT( XfeIsAlive(parent) );

	// Create a horizontal task bar
	m_widget = XtVaCreateWidget(DOCKED_TASK_BAR_NAME,
								xfeTaskBarWidgetClass,
								parent,
								XmNorientation,			XmHORIZONTAL,
								XmNusePreferredWidth,	True,
								XmNusePreferredHeight,	True,
								NULL);

	// Floating undock image
	IconGroup_createAllIcons(&TaskSm_Handle_group,

							 XfeAncestorFindByClass(m_widget,
													shellWidgetClass,
													XfeFIND_ANY),

							 XfeForeground(m_widget),

							 XfeBackground(m_widget));

	// Create floating buttons
	createButtons(m_dockedSpec);
	
	if (XfePixmapGood(TaskSm_Handle_group.pixmap_icon.pixmap))
	{
		XtVaSetValues(m_widget,
					  XmNactionPixmap, TaskSm_Handle_group.pixmap_icon.pixmap,
					  NULL);
	}

	// If the floating taskbar does not have any enabled buttons, then 
	// we dont need to show the action button.
	XFE_TaskBar * ftb = XFE_Dashboard::getFloatingTaskBar();

	if (!ftb || !ftb->numEnabledButtons())
	{
		XtVaSetValues(m_widget,XmNshowActionButton,False,NULL);
	}
}
Пример #2
0
void
XFE_Toolbox::createMain(Widget parent)
{
	XP_ASSERT( XfeIsAlive(parent) );

	// The main frame
	m_widget = XtVaCreateWidget("toolBox",
								xfeToolBoxWidgetClass,
								parent,
								XmNusePreferredWidth,		False,
//								XmNusePreferredHeight,		True,
								XmNusePreferredHeight,		False,
								XmNheight,					200,
								NULL);

	// Create all the tab icons
	Pixel	fg = XfeForeground(m_widget);
	Pixel	bg = XfeBackground(m_widget);
	Widget	shell = XfeAncestorFindByClass(parent,
										   shellWidgetClass,
										   XfeFIND_ANY);

	IconGroup_createAllIcons(&BOTTOM_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&HORIZONTAL_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&LEFT_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&RIGHT_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&TOP_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&VERTICAL_ICON,shell,fg,bg);

	XtVaSetValues(
		m_widget,
		XmNbottomPixmap,			BOTTOM_ICON.pixmap_icon.pixmap,
		XmNbottomRaisedPixmap,		BOTTOM_ICON.pixmap_mo_icon.pixmap,
		XmNtopPixmap,				TOP_ICON.pixmap_icon.pixmap,
		XmNtopRaisedPixmap,			TOP_ICON.pixmap_mo_icon.pixmap,
		XmNleftPixmap,				LEFT_ICON.pixmap_icon.pixmap,
		XmNleftRaisedPixmap,		LEFT_ICON.pixmap_mo_icon.pixmap,
		XmNrightPixmap,				RIGHT_ICON.pixmap_icon.pixmap,
		XmNrightRaisedPixmap,		RIGHT_ICON.pixmap_mo_icon.pixmap,
		XmNverticalPixmap,			VERTICAL_ICON.pixmap_icon.pixmap,
		XmNverticalRaisedPixmap, 	VERTICAL_ICON.pixmap_mo_icon.pixmap,
		XmNhorizontalPixmap,		HORIZONTAL_ICON.pixmap_icon.pixmap,
		XmNhorizontalRaisedPixmap,	HORIZONTAL_ICON.pixmap_mo_icon.pixmap,
		NULL);

#if notyet
	// Set the hand cursor
	Cursor hand_cursor = XfeCursorGetDragHand(parent);

	if (hand_cursor != None)
	{
		XtVaSetValues(m_widget,XmNdragCursor,hand_cursor,NULL);
	}
#endif

	// Add new item callback
	XtAddCallback(m_widget,
				  XmNnewItemCallback,
				  &XFE_Toolbox::newItemCallback,
				  (XtPointer) this);

	// Add swap callback
	XtAddCallback(m_widget,
				  XmNswapCallback,
				  &XFE_Toolbox::swapCallback,
				  (XtPointer) this);


	// Add snap callback
	XtAddCallback(m_widget,
				  XmNsnapCallback,
				  &XFE_Toolbox::snapCallback,
				  (XtPointer) this);

	// Add close callback
	XtAddCallback(m_widget,
				  XmNcloseCallback,
				  &XFE_Toolbox::closeCallback,
				  (XtPointer) this);

	// Add open callback
	XtAddCallback(m_widget,
				  XmNopenCallback,
				  &XFE_Toolbox::openCallback,
				  (XtPointer) this);


	installDestroyHandler();
}