• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ WidgetFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中WidgetFactory的典型用法代码示例。如果您正苦于以下问题:C++ WidgetFactory类的具体用法?C++ WidgetFactory怎么用?C++ WidgetFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了WidgetFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: STLLookupAndRemovePtr

/**
 * @brief Signal a USB device has been removed.
 *
 * This can be called from either the libusb thread or the main thread. However
 * only one of those will be active at once, so we can avoid locking.
 */
void AsyncPluginImpl::USBDeviceRemoved(libusb_device *usb_device) {
  WidgetFactory *factory = STLLookupAndRemovePtr(
      &m_device_factory_map, usb_device);
  if (factory) {
    factory->DeviceRemoved(&m_widget_observer, usb_device);
  }
}
开发者ID:NextGenIntelligence,项目名称:ola,代码行数:13,代码来源:AsyncPluginImpl.cpp


示例2:

		Widget * Helper::CreateWidget ( std::string widget )
		///////////////////////////////////////////////////////////////////////
		{
			WidgetFactory widgetFactory;
			
			Widget *pWidget = widgetFactory.Create ( widget );
			pWidget->SetName ( widget );
			
			pWidget->SetRenderable ( HostIntegration::Renderer->CreateRenderable ( ) );
			
			return pWidget;
		}
开发者ID:markglenn,项目名称:MiniUI,代码行数:12,代码来源:Helper.cpp


示例3: mousePressEvent

void ResizeHandle::mousePressEvent(QMouseEvent *ev)
{
	const bool startDragging = !m_dragging;
	m_dragging = true;
	m_x = ev->x();
	m_y = ev->y();
	if (startDragging) {
//	m_form->resizeHandleDraggingStarted(m_set->widget());
		WidgetFactory *wfactory = m_set->m_form->library()->factoryForClassName(m_set->widget()->className());
		if (wfactory)
			wfactory->resetEditor();
	}
}
开发者ID:,项目名称:,代码行数:13,代码来源:


示例4: CS_ASSERT

 //-------------------------------------------------------
 //-------------------------------------------------------
 void Canvas::OnInit()
 {
     m_screen = Application::Get()->GetSystem<Screen>();
     CS_ASSERT(m_screen != nullptr, "Canvas must have access to screen");
     
     WidgetFactory* widgetFactory = Application::Get()->GetWidgetFactory();
     
     m_canvas = widgetFactory->CreateWidget();
     m_canvas->SetName("Canvas");
     m_canvas->SetAbsoluteSize(GetSize());
     m_canvas->SetCanvas(m_canvas.get());
     m_canvas->SetAbsolutePosition(GetSize() * 0.5f);
     m_canvas->SetInputEnabled(true);
     m_canvas->SetInputConsumeEnabled(false);
 }
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:17,代码来源:Canvas.cpp


示例5: initialize

void Dialog::initialize(const WidgetFactory& f)
{
    controller.reset(f.controller());
    controller->setOwner(this);
    controller->setDialogRoot(createDialog(f));
    controller->initialize();
}
开发者ID:PyroXFire,项目名称:ZeldaClassic,代码行数:7,代码来源:dialog.cpp


示例6: createMainMenu

GLMotif::PopupMenu* Viewer::createMainMenu()
{
   WidgetFactory factory;

   // create the top-level shell
   GLMotif::PopupMenu* mainMenuPopup=factory.createPopupMenu("MainPopupMenu", "Viewer Options");

   // create button array inside top-level shell
   GLMotif::Menu* mainMenu=factory.createMenu("MainMenu");

   // add buttons and assign callbacks

   // create a cascade button for selecting the dynamical system
   GLMotif::CascadeButton* dynamicsTogglesCascade=factory.createCascadeButton("DynamicsTogglesCascade", "Experiments");
   dynamicsTogglesCascade->setPopup(createDynamicsTogglesMenu());

   // create a cascade button for selecting the dynamical analysis tool
   GLMotif::CascadeButton* toolsTogglesCascade=factory.createCascadeButton("ToolTogglesCascade", "Tools");
   toolsTogglesCascade->setPopup(createToolsTogglesMenu());

   // create a toggle button for showing/hiding the frame rate dialog
   GLMotif::ToggleButton* showFrameRateDialog=factory.createToggleButton("ShowFrameRateDialogToggle", "Show Frame Rate Dialog");
   showFrameRateDialog->getSelectCallbacks().add(this, &Viewer::mainMenuTogglesCallback);

   // create a toggle button for showing/hiding the position dialog
   GLMotif::ToggleButton* showPositionDialog=factory.createToggleButton("ShowPositionDialog", "Show Position Dialog");
   showPositionDialog->getSelectCallbacks().add(this, &Viewer::mainMenuTogglesCallback);

   // create a toggle button for showing/hiding the dynamical parameter interface dialog
   showParameterDialogToggle=factory.createToggleButton("ShowParameterDialogToggle", "Show Experiment Options");
   showParameterDialogToggle->getSelectCallbacks().add(this, &Viewer::mainMenuTogglesCallback);

   // create a toggle for showing/hiding the tool option dialogs
   GLMotif::ToggleButton* showOptionsDialogs=factory.createToggleButton("ShowOptionsDialogsToggle", "Show Tool Options");

   showOptionsDialogs->getSelectCallbacks().add(this, &Viewer::mainMenuTogglesCallback);

   // create a push button for reseting the view
   GLMotif::Button* resetNavigationButton=factory.createButton("ResetNavigationButton", "Reset Navigation");
   resetNavigationButton->getSelectCallbacks().add(this, &Viewer::resetNavigationCallback);

   mainMenu->manageChild();

   return mainMenuPopup;
}
开发者ID:KeckCAVES,项目名称:flow,代码行数:45,代码来源:FieldViewer_ui.cpp


示例7: createToolsTogglesMenu

GLMotif::Popup* Viewer::createToolsTogglesMenu()
{
   WidgetFactory factory;

   // create the top-level shell
   GLMotif::Popup* toolsTogglesMenuPopup=factory.createPopupMenu("ToolsTogglesMenuPopup");

   // create array of buttons inside top-level shell
   GLMotif::RowColumn* toolsTogglesMenu=factory.createMenu("VisualizationTogglesMenu");

   // add toggle buttons for various analysis tools
   GLMotif::ToggleButton* particleSprayerToggle=factory.createToggleButton("ParticleSprayerToggle", "Particle Sprayer", true);
   GLMotif::ToggleButton* dotSpreaderToggle=factory.createToggleButton("DotSpreaderToggle", "Dot Spreader", true);
   GLMotif::ToggleButton* staticSolverToggle=factory.createToggleButton("StaticSolverToggle", "Static Solver", true);
   GLMotif::ToggleButton* dynamicSolverToggle=factory.createToggleButton("DynamicSolverToggle", "Dynamic Solver", true);

   // assign callbacks for each toggle button
   particleSprayerToggle->getValueChangedCallbacks().add(this, &Viewer::toolsMenuCallback);
   dotSpreaderToggle->getValueChangedCallbacks().add(this, &Viewer::toolsMenuCallback);
   staticSolverToggle->getValueChangedCallbacks().add(this, &Viewer::toolsMenuCallback);
   dynamicSolverToggle->getValueChangedCallbacks().add(this, &Viewer::toolsMenuCallback);

   // add toggle button pointers to vector for radio-button behavior
   toolsToggleButtons.push_back(particleSprayerToggle);
   toolsToggleButtons.push_back(dotSpreaderToggle);
   toolsToggleButtons.push_back(staticSolverToggle);
   toolsToggleButtons.push_back(dynamicSolverToggle);

   toolsTogglesMenu->manageChild();

   return toolsTogglesMenuPopup;
}
开发者ID:KeckCAVES,项目名称:flow,代码行数:32,代码来源:FieldViewer_ui.cpp


示例8: myName

Menu::Menu(const String& name, MenuManager* manager):
    myName(name),
    myManager(manager),
    myActiveSubMenu(NULL),
    myParent(NULL)
{
    UiModule* ui = UiModule::instance();
    WidgetFactory* wf = ui->getWidgetFactory();
    myContainer = wf->createContainer("container", ui->getUi(), Container::LayoutVertical);
    myContainer->setPosition(Vector2f(10, 10));
    myContainer->setStyleValue("fill", "#000000d0");
    //myContainer->setLayout(Container::LayoutHorizontal);

    my3dSettings.enable3d = MenuManager::instance()->is3dMenuEnabled();
    myContainer->setAutosize(true);
    myContainer->setHorizontalAlign(Container::AlignLeft);

    // By default menus are attached to the default camera.
    my3dSettings.node = manager->getEngine()->getDefaultCamera();
    firstHide = true;
}
开发者ID:UTSDataArena,项目名称:omegalib,代码行数:21,代码来源:Menu.cpp


示例9: qDebug

QList<QVariant> WidgetDataBase::defaultPropertyValues(const QString &name)
{
    WidgetFactory *factory = qobject_cast<WidgetFactory *>(m_core->widgetFactory());
    Q_ASSERT(factory);
    // Create non-widgets, widgets in order
    QObject* object = factory->createObject(name, 0);
    if (!object)
        object = factory->createWidget(name, 0);
    if (!object) {
        qDebug() << "** WARNING Factory failed to create " << name;
        return QList<QVariant>();
    }
    // Get properties from sheet.
    QList<QVariant> result;
    if (const QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(m_core->extensionManager(), object)) {
        const int propertyCount = sheet->count();
        for (int i = 0; i < propertyCount; ++i) {
            result.append(sheet->property(i));
        }
    }
    delete object;
    return result;
}
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:23,代码来源:widgetdatabase.cpp


示例10: createDynamicsTogglesMenu

GLMotif::Popup* Viewer::createDynamicsTogglesMenu()
{
   WidgetFactory factory;

   // create the top-level shell
   GLMotif::Popup* dynamicsTogglesMenuPopup=factory.createPopupMenu("DynamicsTogglesMenuPopup");

   // create button array inside top-level shell
   GLMotif::RowColumn* dynamicsTogglesMenu=factory.createMenu("DynamicsTogglesMenu");

   // for each of the experiment names
   for (std::vector<std::string>::const_iterator name=experiment_names.begin(); name!=experiment_names.end(); ++name)
   {
      size_t iIndex = (*name).rfind("Hidden");
      if( iIndex != std::string::npos )
      {
         // then while loaded, we do not make this experiment available to the user
         continue;
      }

      // create toggle button
      std::string toggle_name=(*name) + "toggle";
      GLMotif::ToggleButton* toggle=factory.createToggleButton(const_cast<char*> (toggle_name.c_str()), const_cast<char*> ((*name).c_str()));

      // turn on the first toggle
      //if (name == experiment_names.begin())
      //   toggle->setToggle(true);

      toggle->getValueChangedCallbacks().add(this, &Viewer::dynamicsMenuCallback);
      dynamicsToggleButtons.push_back(toggle);

   }

   dynamicsTogglesMenu->manageChild();

   return dynamicsTogglesMenuPopup;
}
开发者ID:KeckCAVES,项目名称:flow,代码行数:37,代码来源:FieldViewer_ui.cpp


示例11: create

Label* Label::create(Container* container)
{
	WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
	Label* label = wf->createLabel(sLabelNameGenerator.generate(), container);
	return label;
}
开发者ID:drspiff,项目名称:omegalib,代码行数:6,代码来源:Label.cpp


示例12: createDialog

GLMotif::PopupWindow* DynamicSolverOptionsDialog::createDialog()
{
   WidgetFactory factory;

   // create the popup-shell
   GLMotif::PopupWindow* parameterDialogPopup=factory.createPopupWindow("ParameterDialogPopup", " Dynamic Solver Options");

   // create the main layout
   GLMotif::RowColumn* parameterDialog=factory.createRowColumn("ParameterDialog", 1);
   factory.setLayout(parameterDialog);

   // create a layout for check boxes (toggle buttons)
   GLMotif::RowColumn* checkBoxLayout=factory.createRowColumn("CheckBoxLayout", 4);
   factory.setLayout(checkBoxLayout);

   // create line style toggle buttons (check boxes)
   factory.createLabel("", "Line Style");
   GLMotif::ToggleButton* noneLineToggle=
         factory.createCheckBox("NoneLineToggle", "None");
   GLMotif::ToggleButton* basicLineToggle=
         factory.createCheckBox("BasicLineToggle", "2D");
   GLMotif::ToggleButton* polyLineToggle=
         factory.createCheckBox("PolyLineToggle", "3D", true);

   // assign callbacks for line style toggle buttons
   noneLineToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::lineStyleTogglesCallback);
   basicLineToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::lineStyleTogglesCallback);
   polyLineToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::lineStyleTogglesCallback);

   // add line style toggles to array for radio-button behavior
   lineStyleToggles.push_back(noneLineToggle);
   lineStyleToggles.push_back(basicLineToggle);
   lineStyleToggles.push_back(polyLineToggle);

   // create head style toggle buttons (check boxes)
   factory.createLabel("", "Head Style");
   GLMotif::ToggleButton* noneHeadToggle=factory.createCheckBox("NoneHeadToggle", "None");
   GLMotif::ToggleButton* pointHeadToggle=factory.createCheckBox("PointHeadToggle", "Point", true);
   GLMotif::ToggleButton* sphereHeadToggle=factory.createCheckBox("SphereHeadToggle", "Sphere");

   // assign callbacks for head style toggle buttons
   noneHeadToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::headStyleTogglesCallback);
   pointHeadToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::headStyleTogglesCallback);
   sphereHeadToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::headStyleTogglesCallback);

   // add head style toggles to array for radio-button behavior
   headStyleToggles.push_back(noneHeadToggle);
   headStyleToggles.push_back(pointHeadToggle);
   headStyleToggles.push_back(sphereHeadToggle);

   // create color style toggle buttons (check boxes)
   factory.createLabel("", "Color Map");
   GLMotif::ToggleButton* solidColorToggle=factory.createCheckBox("SolidColorToggle", "Solid", true);
   GLMotif::ToggleButton* gradientColorToggle=factory.createCheckBox("GradientColorToggle", "Gradient");

   // assign callbacks for color style toggle buttons
   solidColorToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::colorStyleTogglesCallback);
   gradientColorToggle->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::colorStyleTogglesCallback);

   // add color style toggles to array for radio-button behavior
   colorMapToggles.push_back(solidColorToggle);
   colorMapToggles.push_back(gradientColorToggle);

   // create spacer (newline)
   factory.createLabel("Spacer", "");

   checkBoxLayout->manageChild();

   factory.setLayout(parameterDialog);

   // create layout for sliders
   GLMotif::RowColumn* sliderLayout=factory.createRowColumn("SliderLayout", 3);
   factory.setLayout(sliderLayout);

   factory.createLabel("ReleaseSizeLabel", "Number of Particles");

   releaseSizeValue=factory.createTextField("ReleaseSizeTextField", 10);
   releaseSizeValue->setString("1");

   releaseSizeSlider=factory.createSlider("ReleaseSizeSlider", 15.0);
   releaseSizeSlider->setValueRange(1, 250, 1);
   releaseSizeSlider->setValue(1);

   releaseSizeSlider->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::sliderCallback);

   factory.createLabel("ParticleSizeLabel", "Particle Size");

   pointSizeValue=factory.createTextField("PointSizeTextField", 10);
   pointSizeValue->setString("0.25");

   pointSizeSlider=factory.createSlider("PointSizeSlider", 15.0);
   pointSizeSlider->setValueRange(0.01, 0.25, 0.01);
   pointSizeSlider->setValue(0.25);

   pointSizeSlider->getValueChangedCallbacks().add(this, &DynamicSolverOptionsDialog::sliderCallback);

   // create a push button for clearing particles and assign callback
   GLMotif::Button* clearButton=factory.createButton("ClearButton", "Clear");
   clearButton->getSelectCallbacks().add(this, &DynamicSolverOptionsDialog::clearPointsCallback);

//.........这里部分代码省略.........
开发者ID:KeckCAVES,项目名称:flow,代码行数:101,代码来源:DynamicSolverOptionsDialog.cpp


示例13: create

Container* Container::create(Layout layout, Container* container)
{
    WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
    return wf->createContainer(sContainerNameGenerator.generate(), container, layout);
}
开发者ID:caishanli,项目名称:omegalib,代码行数:5,代码来源:Container.cpp


示例14: createDialog

GLMotif::PopupWindow* DotSpreaderOptionsDialog::createDialog()
{
   WidgetFactory factory;

   // create popup-shell
   GLMotif::PopupWindow* parameterDialogPopup=factory.createPopupWindow("ParameterDialogPopup", "Dot Spreader Options");

   // create the main layout
   GLMotif::RowColumn* parameterDialog=factory.createRowColumn("ParameterDialog", 3);
   factory.setLayout(parameterDialog);

   factory.createLabel("", "NumberOfParticles");

   // create text field
   numberOfParticlesValue=factory.createTextField("NumberOfParticlesTextField", 10);
   numberOfParticlesValue->setString("10000");

   // create and initialize slider object
   numberOfParticlesSlider=factory.createSlider("NumberOfParticlesSlider", 15.0);
   numberOfParticlesSlider->setValueRange(1000.0, 250000.0, 1000.0);
   numberOfParticlesSlider->setValue(10000.0);

   // set the slider callback
   numberOfParticlesSlider->getValueChangedCallbacks().add(this, &DotSpreaderOptionsDialog::sliderCallback);

   factory.createLabel("ParticleSizeLabel", "Particle Size");

   pointSizeValue=factory.createTextField("PointSizeTextField", 10);
   pointSizeValue->setString("0.05");

   pointSizeSlider=factory.createSlider("PointSizeSlider", 15.0);
   pointSizeSlider->setValueRange(0.01, 1.0, 0.05);
   pointSizeSlider->setValue(0.05);

   pointSizeSlider->getValueChangedCallbacks().add(this, &DotSpreaderOptionsDialog::sliderCallback);

   // create distribution check boxes
   GLMotif::ToggleButton* surfaceDistributionToggle=factory.createCheckBox("SurfaceDistributionToggle", "Surface", true);
   GLMotif::ToggleButton* volumeDistributionToggle=factory.createCheckBox("VolumeDistributionToggle", "Volume");

   // set callbacks for toggle buttons (check boxes)
   surfaceDistributionToggle->getValueChangedCallbacks().add(this, &DotSpreaderOptionsDialog::distributionTogglesCallback);
   volumeDistributionToggle->getValueChangedCallbacks().add(this, &DotSpreaderOptionsDialog::distributionTogglesCallback);

   // add toggle buttons to array for radio-button behavior
   distributionToggles.push_back(surfaceDistributionToggle);
   distributionToggles.push_back(volumeDistributionToggle);

   // create push buttons
   clearParticles = factory.createButton("ClearParticles", "Clear Particles");

   // assign callbacks for buttons
   clearParticles->getSelectCallbacks().add(this, &DotSpreaderOptionsDialog::buttonCallback);

   parameterDialog->manageChild();

   return parameterDialogPopup;
}
开发者ID:KeckCAVES,项目名称:flow,代码行数:58,代码来源:DotSpreaderOptionsDialog.cpp


示例15: dataDirectory

GLMotif::PopupWindow* CartesianGrid3DParameterDialog::createDialog()
{
  WidgetFactory factory;
  GLMotif::PopupWindow* parameterDialogPopup=factory.createPopupWindow("ParameterDialogPopup", "CartesianGrid3D Parameters");

  GLMotif::RowColumn* parameterDialog=factory.createRowColumn("ParameterDialog", 3);
  factory.setLayout(parameterDialog);
   
  openFileButton = factory.createButton("OpenFileButton", "Load Data");
  openFileStatusA = factory.createLabel("OpenFileStatusA", "");
  openFileStatusB = factory.createLabel("OpenFileStatusB", "");
  openFileButton->getSelectCallbacks().add(this, &CartesianGrid3DParameterDialog::openFileCallback);

  char cwd[512];
  getcwd(cwd, 512);
  std::string dataDirectory(cwd);
  IO::DirectoryPtr dirptr = IO::openDirectory(dataDirectory.c_str());

  fileDialog = new GLMotif::FileSelectionDialog(Vrui::getWidgetManager(), "Open file...", dirptr, ".grid");
  // Need to modify FileSelectionDialog to accept filterDescriptions. For ex: "Simple Grid (.grid)"
  //  fileDialog->addFileNameFilters("Numpy Array (.npy)");
  fileDialog->getOKCallbacks().add(this, &CartesianGrid3DParameterDialog::fileOpenAction);
  fileDialog->getCancelCallbacks().add(this, &CartesianGrid3DParameterDialog::fileCancelAction);

/*  factory.createLabel("Dummy3", "");
  openFileStatusC = factory.createLabel("OpenFileStatusC", "");
  factory.createLabel("Dummy4", "");
*/

  factory.createLabel("Dummy3b", "");
  shapeLabel = factory.createLabel("ShapeLabel", "");
  shapeValue = factory.createLabel("ShapeValue", "");

  factory.createLabel("Dummy5", "");
  factory.createLabel("Dummy6", "");
  factory.createLabel("Dummy7", "");

  factory.createLabel("StepSizeLabel", "step size");
  stepSizeValue=factory.createTextField("StepSizeValue", 10);
  double step_size = IntegrationStepSize::instance()->getSavedValue("CartesianGrid3D");
  if (step_size > 0.0) stepSizeValue->setString(toString(step_size).c_str());
  else stepSizeValue->setString("0.01");
  stepSizeSlider=factory.createSlider("StepSizeSlider", 15.0);
  stepSizeSlider->setValueRange(0.0001, 0.05, 0.0001);
  if (step_size > 0.0) stepSizeSlider->setValue(step_size);
  else stepSizeSlider->setValue(0.01);
  stepSizeSlider->getValueChangedCallbacks().add(this, &CartesianGrid3DParameterDialog::sliderCallback);

  parameterDialog->manageChild();
  return parameterDialogPopup;
}
开发者ID:chebee7i,项目名称:DTS,代码行数:51,代码来源:CartesianGrid3DParameterDialog.cpp


示例16: myMenu

MenuItem::MenuItem(Type type, Menu* owner):
    myMenu(owner),
    myType(type),
    myListener(NULL),
    myButton(NULL),
    myCommand(NULL),
    myWidget(NULL),
    myUserData(NULL),
    mySubMenu(NULL)
{
    UiModule* ui = owner->getManager()->getUiModule();
    WidgetFactory* wf = ui->getWidgetFactory();

    if(type == MenuItem::SubMenu)
    {
        myButton = wf->createButton("subMenu_button", myMenu->myContainer);
        myButton->setText("Button");
        myWidget = myButton;
        myWidget->setUIEventHandler(this);

        mySubMenu = myMenu->getManager()->createMenu("Submenu");
    }
    else if(type == MenuItem::Button)
    {
        myButton = wf->createButton("button", myMenu->myContainer);
        myButton->setText("Button");
        myWidget = myButton;
    }
    else if(type == MenuItem::Slider)
    {
        mySlider = wf->createSlider("slider", myMenu->myContainer);
        myWidget = mySlider;
    }
    else if(type == MenuItem::Checkbox)
    {
        myButton = wf->createButton("button", myMenu->myContainer);
        myButton->setText("Checkbox");
        myButton->setCheckable(true);
        myWidget = myButton;
    }
    else if(type == MenuItem::Label)
    {
        myLabel = wf->createLabel("label", myMenu->myContainer);
        myLabel->setText("Label");
        myWidget = myLabel;
    }
    else if(type == MenuItem::Image)
    {
        myImage = wf->createImage("img", myMenu->myContainer);
        myWidget = myImage;
    }
    else if(type == MenuItem::Container)
    {
        myContainer = wf->createContainer("container", myMenu->myContainer);
        myWidget = myContainer;
    }

    //myWidget->setStyleValue("fill", "#00000090");

    myWidget->setAutosize(true);
}
开发者ID:UTSDataArena,项目名称:omegalib,代码行数:61,代码来源:Menu.cpp


示例17: createDialog

GLMotif::PopupWindow* RikitakeDynamoParameterDialog::createDialog()
{
  WidgetFactory factory;
  GLMotif::PopupWindow* parameterDialogPopup=factory.createPopupWindow("ParameterDialogPopup", "RikitakeDynamo Parameters");

  GLMotif::RowColumn* parameterDialog=factory.createRowColumn("ParameterDialog", 3);
  factory.setLayout(parameterDialog);

  factory.createLabel("NuParameterLabel", "nu");

  currentNuValue=factory.createTextField("CurrentNuValue", 10);
  currentNuValue->setString("0.2");

  nuParameterSlider=factory.createSlider("NuParameterSlider", 15.0);
  nuParameterSlider->setValueRange(0.0, 10.0, 0.01);
  nuParameterSlider->setValue(0.2);
  nuParameterSlider->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::sliderCallback);

  factory.createLabel("AParameterLabel", "a");

  currentAValue=factory.createTextField("CurrentAValue", 10);
  currentAValue->setString("5.0");

  aParameterSlider=factory.createSlider("AParameterSlider", 15.0);
  aParameterSlider->setValueRange(0.0, 10.0, 0.01);
  aParameterSlider->setValue(5.0);
  aParameterSlider->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::sliderCallback);


  factory.createLabel("StepSizeLabel", "step size");
  stepSizeValue=factory.createTextField("StepSizeValue", 10);
  double step_size = IntegrationStepSize::instance()->getSavedValue("Rikitake Dynamo");
  if (step_size > 0.0) stepSizeValue->setString(toString(step_size).c_str());
  else stepSizeValue->setString("0.01");
  stepSizeSlider=factory.createSlider("StepSizeSlider", 15.0);
  stepSizeSlider->setValueRange(0.0001, 0.05, 0.0001);
  if (step_size > 0.0) stepSizeSlider->setValue(step_size);
  else stepSizeSlider->setValue(0.01);
  stepSizeSlider->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::sliderCallback);


  factory.createLabel("EvaluationLabel", "Evaluation Method");
  GLMotif::ToggleButton* exactEvalToggle=factory.createCheckBox("ExactEvalToggle", "Exact", true);
  GLMotif::ToggleButton* gridEvalToggle=factory.createCheckBox("GridEvalToggle", "Interpolated Grid");
  // assign line style toggle callbacks
  exactEvalToggle->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::evalTogglesCallback);
  gridEvalToggle->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::evalTogglesCallback);

  factory.createLabel("xSpacingLabel", "x-Grid Spacing");
  currentXValue=factory.createTextField("xTextField", 12);
  currentXValue->setString("1.0");
  currentXValue->setCharWidth(5);
  currentXValue->setPrecision(5);
  xSpacingSlider=factory.createSlider("XSpacingSlider", 15.0);
  xSpacingSlider->setValueRange(.001, 2.0, 0.001);
  xSpacingSlider->setValue(1.0);
  xSpacingSlider->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::sliderCallback);

  factory.createLabel("ySpacingLabel", "y-Grid Spacing");
  currentYValue=factory.createTextField("yTextField", 12);
  currentYValue->setString("1.0");
  currentYValue->setCharWidth(5);
  currentYValue->setPrecision(5);  ySpacingSlider=factory.createSlider("YSpacingSlider", 15.0);
  ySpacingSlider->setValueRange(.001, 2.0, 0.001);
  ySpacingSlider->setValue(1.0);
  ySpacingSlider->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::sliderCallback);

  factory.createLabel("zSpacingLabel", "z-Grid Spacing");
  currentZValue=factory.createTextField("zTextField", 12);
  currentZValue->setString("1.0");
  currentZValue->setCharWidth(5);
  currentZValue->setPrecision(5);
  zSpacingSlider=factory.createSlider("ZSpacingSlider", 15.0);
  zSpacingSlider->setValueRange(.001, 2.0, 0.001);
  zSpacingSlider->setValue(1.0);
  zSpacingSlider->getValueChangedCallbacks().add(this, &RikitakeDynamoParameterDialog::sliderCallback);

  // add toggles to array for radio-button behavior
  evalToggles.push_back(exactEvalToggle);
  evalToggles.push_back(gridEvalToggle);

  parameterDialog->manageChild();
  return parameterDialogPopup;
}
开发者ID:chebee7i,项目名称:DTS,代码行数:84,代码来源:RikitakeDynamoParameterDialog.cpp


示例18:

	ComponentWidget::~ComponentWidget()
	{
		WidgetFactory* f = FactoryManager::getSingleton().getWidgetFactory();
		for(std::map<Ogre::String,Widget*>::iterator it = mComponents.begin(); it != mComponents.end(); ++it)
			f->destroyInstance((*it).second);
	}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:6,代码来源:QuickGUIComponentWidget.cpp


示例19: create

Button* Button::create(Container* container)
{
	WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
	Button* btn = wf->createButton(sButtonNameGenerator.generate(), container);
	return btn;
}
开发者ID:a011095,项目名称:omegalib,代码行数:6,代码来源:Button.cpp


示例20: create

Slider* Slider::create(Container* container)
{
	WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
	Slider* slider = wf->createSlider(sSliderNameGenerator.generate(), container);
	return slider;
}
开发者ID:B-Rich,项目名称:omegalib,代码行数:6,代码来源:Slider.cpp



注:本文中的WidgetFactory类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ WidgetKeyboardEvent类代码示例发布时间:2022-05-31
下一篇:
C++ WidgetDialog类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap