Exemplo n.º 1
0
ActionEffectEditor::ActionEffectEditor(QWidget *parent)
	: MyTabSubWidgetBase(parent)
{
	//m_pHbox = new QHBoxLayout;
	m_pView = new MyGraphicsView(this);
	m_pScene = new MyGraphicsScene;

	addMultiPolygon();
	addEllipse();
	addDragWidget();
	addBezierCurve();

	m_pView->setScene(m_pScene);

	//m_pHbox->addWidget(m_pView);
	//this->setLayout(m_pHbox);
	//this->resize(600, 400);
	setCentralWidget(m_pView);

	g_pQtGameEditorSys->setGraphicsScenePtr(m_pScene);
	g_pQtGameEditorSys->setGraphicsViewPtr(m_pView);

	m_pNodeDockWidget = new NodeDockWidget(this);
	this->addDockWidget(Qt::RightDockWidgetArea, m_pNodeDockWidget);
	this->setAcceptDrops(true);		// ½ÓÊÕÍ϶¯²Ù×÷
}
Exemplo n.º 2
0
XFE_MNBanner::XFE_MNBanner(XFE_Frame *parent_frame,
						   XFE_Toolbox * parent_toolbox,
						   char *title, char *subtitle,
						   char *info) 
	: XFE_ToolboxItem(parent_frame,parent_toolbox)
{
  Widget tool_item;

  m_parentFrame = parent_frame;

  // Create the base widget - a tool item
  tool_item = XtVaCreateWidget("bannerItem",
							   xfeToolItemWidgetClass,
							   parent_toolbox->getBaseWidget(),
							   XmNuserData,				this,
							   NULL);
	
  m_form = XtVaCreateManagedWidget("banner",
								   xmFormWidgetClass,
								   tool_item,
								   NULL);
  
  // no proxy icon yet -- you must call setProxyIcon.
  
  m_titlelabel = XtVaCreateManagedWidget("title",
										 xmLabelWidgetClass,
										 m_form,
										 XmNleftAttachment, XmATTACH_FORM,
										 XmNrightAttachment, XmATTACH_NONE,
										 XmNtopAttachment, XmATTACH_FORM,
										 XmNbottomAttachment, XmATTACH_FORM,
										 NULL);

  m_subtitlelabel = XtVaCreateManagedWidget("subtitle",
											xmLabelWidgetClass,
											m_form,
											XmNleftAttachment, XmATTACH_WIDGET,
											XmNleftWidget, m_titlelabel,
											XmNrightAttachment, XmATTACH_NONE,
											XmNtopAttachment, XmATTACH_FORM,
											XmNbottomAttachment, XmATTACH_FORM,
											NULL);

  m_infolabel = XtVaCreateManagedWidget("info",
										xmLabelWidgetClass,
										m_form,
										XmNalignment, XmALIGNMENT_END,
										XmNleftAttachment, XmATTACH_WIDGET,
										XmNleftWidget, m_subtitlelabel,
										XmNrightAttachment, XmATTACH_FORM,
										XmNtopAttachment, XmATTACH_FORM,
										XmNbottomAttachment, XmATTACH_FORM,
										NULL);

  // Register banner widgets for dragging
  addDragWidget(m_form);
  addDragWidget(m_titlelabel);
  addDragWidget(m_subtitlelabel);
  addDragWidget(m_infolabel);

  // Create the logo
  m_logo = new XFE_Logo(m_parentFrame,tool_item,"logo");

  // It will always be small for this component
  m_logo->setSize(XFE_ANIMATION_SMALL);
										
  setBaseWidget(tool_item);

  m_proxyicon = NULL;
  m_mommyButton = NULL;
  m_titleComponent = NULL;
  m_arrowButton = NULL;

  setTitle(title);
  setSubtitle(subtitle);
  setInfo(info);
}