Exemplo n.º 1
0
/**
 * @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);
  }
}
Exemplo n.º 2
0
		Widget * Helper::CreateWidget ( std::string widget )
		///////////////////////////////////////////////////////////////////////
		{
			WidgetFactory widgetFactory;
			
			Widget *pWidget = widgetFactory.Create ( widget );
			pWidget->SetName ( widget );
			
			pWidget->SetRenderable ( HostIntegration::Renderer->CreateRenderable ( ) );
			
			return pWidget;
		}
Exemplo n.º 3
0
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();
	}
}
Exemplo n.º 4
0
 //-------------------------------------------------------
 //-------------------------------------------------------
 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);
 }
Exemplo n.º 5
0
void Dialog::initialize(const WidgetFactory& f)
{
    controller.reset(f.controller());
    controller->setOwner(this);
    controller->setDialogRoot(createDialog(f));
    controller->initialize();
}
Exemplo n.º 6
0
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;
}
Exemplo n.º 7
0
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;
}
Exemplo n.º 8
0
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;
}
Exemplo n.º 9
0
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;
}
Exemplo n.º 10
0
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;
}
Exemplo n.º 11
0
Label* Label::create(Container* container)
{
	WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
	Label* label = wf->createLabel(sLabelNameGenerator.generate(), container);
	return label;
}
Exemplo n.º 12
0
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);

   sliderLayout->manageChild();

   parameterDialog->manageChild();

   return parameterDialogPopup;
}
Exemplo n.º 13
0
Container* Container::create(Layout layout, Container* container)
{
    WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
    return wf->createContainer(sContainerNameGenerator.generate(), container, layout);
}
Exemplo n.º 14
0
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;
}
Exemplo n.º 15
0
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;
}
Exemplo n.º 16
0
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);
}
Exemplo n.º 17
0
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;
}
	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);
	}
Exemplo n.º 19
0
Button* Button::create(Container* container)
{
	WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
	Button* btn = wf->createButton(sButtonNameGenerator.generate(), container);
	return btn;
}
Exemplo n.º 20
0
Slider* Slider::create(Container* container)
{
	WidgetFactory* wf = UiModule::instance()->getWidgetFactory();
	Slider* slider = wf->createSlider(sSliderNameGenerator.generate(), container);
	return slider;
}