Пример #1
0
ramPresetTab::ramPresetTab()
:ofxUITab("Presets", false)
,preset_cam_index(1)
,use_node_cam(false)
,cam_position(false)
,cam_look_at(false)
{
	// should probably be a list of named presets instead of a grid
    addLabelButton("Line", false);
    addLabelButton("Hasty Chase", false);
    addLabelButton("HC + Stamp", false);
    addLabelButton("HC + Stamp + Natto", false);
    addLabelButton("HC + Future", false);
	addLabelButton("Line + Future", false);
// ignore win32
#ifndef TARGET_WIN32
	addLabelButton("Particles + Future", false);
	addLabelButton("Particles", false);
#else
	addLabelButton("Future", false); // only for windows
#endif
	addSpacer();
	
	vector<string> cameraPresetNames;
	cameraPresetNames.push_back("Low");
	cameraPresetNames.push_back("High");
	cameraPresetNames.push_back("Overhead");
	preset_cam_radio = addRadio("Camera position", cameraPresetNames);
	preset_cam_radio->getToggles()[preset_cam_index]->setValue(true);
	addSpacer();
	
    // nodecam
    addLabel("NodeCam", OFX_UI_FONT_LARGE);
    addLabel("1. Click a node on actor", OFX_UI_FONT_SMALL);
    addLabel("which you want to set as", OFX_UI_FONT_SMALL);
    addLabel("camera pos or lookAt.", OFX_UI_FONT_SMALL);
    
    addLabel("2. Click a button below.", OFX_UI_FONT_SMALL);
    addLabel("a joint with red circle", OFX_UI_FONT_SMALL);
    addLabel("will be set as pos or lookAt.", OFX_UI_FONT_SMALL);
    addButton("Set Camera Position", &cam_position, 15, 15);
    addButton("Set Camera LookAt", &cam_look_at, 15, 15);
    
    addLabel("3. Enable NodeCam.", OFX_UI_FONT_SMALL);
    addToggle("Enable Node Cam", &use_node_cam, 30, 30);
    
	autoSizeToFitWidgets();
	
	ofAddListener(ofEvents().update, this, &ramPresetTab::update);
	ofAddListener(ofEvents().draw, this, &ramPresetTab::draw);
	ofAddListener(newGUIEvent, this, &ramPresetTab::guiEvent);
}
void PMUICanvasRibbonRenderer::init(int posX, int posY, bool autosize, int width, int height)
{
    PMUICanvasBaseRenderer::init(posX, posY, autosize, width, height);

    gradientImage.load("./gradients/gradient4x_512x160.png");
    numGradients = 4;

    setGlobalSliderHeight(10);
    setGlobalButtonDimension(14);

    { // Brush (basic)
        addSpacer();
        addLabel(STR_BRUSH_BASIC);
        addIntSlider(STR_BRUSH_BASIC_NUMPAINTERS, 1, 100, &numPainters);
        addIntSlider(STR_BRUSH_BASIC_WIDTH, 1, 10, &strokeWidth);
        addSlider(STR_BRUSH_BASIC_SPEED, 1.01f, 100, &speed);
        addToggle(STR_BRUSH_BASIC_ENABLEBOUNCE, &enableBounce);
    }

    { // Brush (advanced)
        addSpacer();
        addLabel(STR_BRUSH_ADVANCED);
        addSlider(STR_BRUSH_ADVANCED_DIVISIONS, 0.001, 4.5, &divisions);
//        addSlider(STR_BRUSH_ADVANCED_EASE, -1.0, 10.0, &ease);
//        addSlider("Ease Randomness",0.0,1.0,&easeRandomness);
//        addIntSlider(STR_BRUSH_ADVANCED_MAXVERT,3, 4000, &pathMaxVertices);
        addSlider("Next Position Delta",0.0,1.0,&nextPositionDelta);
    }

    { // Color mode
        addSpacer();
        addLabel(STR_BRUSH_COLORMODE);

        vector<string> colorModesNames;
        colorModesNames.push_back(STR_BRUSH_COLORMODE_MFIXEDCOLOR);
        colorModesNames.push_back(STR_BRUSH_COLORMODE_MGRSPEED);
        colorModesNames.push_back(STR_BRUSH_COLORMODE_MGREDGES);
        addRadio(STR_BRUSH_COLORMODE_RADIO, colorModesNames, OFX_UI_ORIENTATION_VERTICAL);

        addImageSampler(STR_BRUSH_COLORMODE_GRIMAGE, &gradientImage);
        addIntSlider(STR_BRUSH_COLORMODE_GRID, 1, 4, &gradientId);
        addIntSlider(STR_BRUSH_COLORMODE_GRSPEED, 1, 500, &gradientSpeed);
        addIntSlider(STR_BRUSH_COLORMODE_R, 0, 255, &colorR);
        addIntSlider(STR_BRUSH_COLORMODE_G, 0, 255, &colorG);
        addIntSlider(STR_BRUSH_COLORMODE_B, 0, 255, &colorB);
    }

    if (autosize) autoSizeToFitWidgets();

    loadPreset(selectedPreset);
}
ramPresetTab::ramPresetTab()
:ofxUITab("Presets", false)
,cameraPreset(1)
{
	// should probably be a list of named presets instead of a grid
	matrix = addToggleMatrix("Presets", 4, 4);
	matrix->setAllowMultiple(false);
	addSpacer();
	
	vector<string> cameraPresetNames;
	cameraPresetNames.push_back("Low");
	cameraPresetNames.push_back("High");
	cameraPresetNames.push_back("Overhead");
	cameraPresetRadio = addRadio("Camera position", cameraPresetNames);
	cameraPresetRadio->getToggles()[cameraPreset]->setValue(true);
	
	autoSizeToFitWidgets();
	
	ofAddListener(ofEvents().update, this, &ramPresetTab::setupCamera);
	ofAddListener(newGUIEvent, this, &ramPresetTab::guiEvent);
}
Пример #4
0
//===========================================================================
void page3::sendQuestions( ) const
{
	bool errors = showErrors();
	const patient& patient = getData().getPatient();

	std::string p = patient.getlivewith().getText();
	int selection = patient.getIDFromLiveWith(p);

	std::string tsuport = patient.getcaregiversupport().getText();

	std::cout << "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">\n";
	std::cout << "	  <tr>\n";
	std::cout << "		<td style=\"WIDTH: 330px\">\n";
		std::cout << "<p align=\"left\"><b>Lives with</b></p>";
	std::cout << "		</td>\n";
	std::cout << "	  </tr>\n";

	std::cout << "	  <tr bgcolor=\"#EEEEEE\">\n";
	std::cout << "		<td>\n";
	std::cout << "<p align=\"left\">";
	exAddRadio(std::string("spouse/partner"), std::string("livewith"), 0, selection == 0,RADIO_REQUIRED,false );
	std::cout << "&nbsp;&nbsp;";
	exAddRadio(std::string("alone"),std::string("livewith"), 1, selection == 1,RADIO_REQUIRED,false );
	std::cout << "&nbsp;&nbsp;";
	exAddRadio(std::string("Other"),std::string("livewith"), 2, selection == 2,RADIO_REQUIRED,true );
	std::cout << "&nbsp;&nbsp; Specify ";
	if (selection == 2)
		std::cout << "<input style=\"HEIGHT: 22px; WIDTH: 200px\" size=\"5\"  maxlength=\"60\" name=\"caregiversupportfreetext\" " << patient.getlivewith().getValueText() << ">";
	else
		std::cout << "<input style=\"HEIGHT: 22px; WIDTH: 200px\" size=\"5\"  maxlength=\"60\" name=\"caregiversupportfreetext\" >";
	std::cout << "</p>";
	std::cout << "		</td>\n";

	std::cout << "	  </tr>\n";

	std::cout << "	  <tr>\n";
	std::cout << "		<td style=\"WIDTH: 330px\">\n";
		std::cout << "<p align=\"left\"><b>Caregiver Support</b></p>";
	std::cout << "		</td>\n";
	std::cout << "	  </tr>\n";

	std::cout << "	  <tr bgcolor=\"#EEEEEE\">\n";
	std::cout << "		<td>\n";
	std::cout << "<p align=\"left\">";
	addRadio(std::string("Live-in"),std::string("caregiversupport"), 0, tsuport == "0",RADIO_REQUIRED );
	std::cout << "&nbsp;&nbsp;";
	addRadio(std::string("Visits at least once/day"),std::string("caregiversupport"), 1, tsuport == "1",RADIO_REQUIRED );
	std::cout << "&nbsp;&nbsp;";
	addRadio(std::string("Visits less than once/day"),std::string("caregiversupport"), 2, tsuport == "2",RADIO_REQUIRED );
	std::cout << "</p>\n";
	std::cout << "<p align=\"left\">";
	if (errors)
		std::cout << patient.getcaregiversupport().getHTMLErrorWarning();	std::cout << "</p>";
	std::cout << "		</td>\n";
	std::cout << "	  </tr>\n";
	std::cout << "  </table>\n";

	std::cout << "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">\n";
	std::cout << "	  <tr>\n";
	std::cout << "		<td style=\"WIDTH: 330px\">\n";
		std::cout << "<p align=\"left\">Principal caregiver's full name</p>";
	std::cout << "		</td>\n";
	std::cout << "		<td>\n";
	std::cout << "<p align=\"centre\"><input style=\"HEIGHT: 22px; WIDTH: 267px\" size=\"5\"  maxlength=\"60\"  name=\"carersname\" "  << patient.getcarersname().getValueText() << REQUIRED << " > \n";
	if (errors)
		std::cout << patient.getcarersname().getHTMLErrorWarning();
	std::cout << "</p>";
	std::cout << "		</td>\n";
	std::cout << "	  </tr>\n";

	std::cout << "	  <tr bgcolor=\"#EEEEEE\">\n";
	std::cout << "		<td>\n";
		std::cout << "<p align=\"left\">Date of birth</p>";
	std::cout << "		</td>\n";
	std::cout << "		<td>\n";
		std::cout << "<p align=\"centre\"><input type=\"text\" pattern=\"\\d{1,2}/\\d{1,2}/\\d{4}\" style=\"HEIGHT: 22px; WIDTH: 267px\" size=\"5\" name=\"carerdob\" title =\"DD/MM/YYYY\"  " << patient.getcarerdob().getValueText() <<  REQUIRED << " placeholder=\"DD/MM/YYYY\" > \n";
	if (errors)
		std::cout << patient.getcarerdob().getHTMLErrorWarning();
	std::cout << "</p>";

	std::cout << "		</td>\n";
	std::cout << "	  </tr>\n";
	std::cout << "  </table>\n";

	std::cout << "<hr>";
}
Пример #5
0
void Dialog::addRadio(GtkWidget* vbox, const char* name, int& data, StringArrayRange names)
{
  addRadio(vbox, name, names, IntImportCaller(data), IntExportCaller(data));
}
Пример #6
0
	/* Constructor */
	ModFrame::ModFrame(FilterWin *parent) : QFrame(parent), filterWin(parent)
	{
		// base layout
		QVBoxLayout * layout = new QVBoxLayout;
		QVBoxLayout * vbox;
		QHBoxLayout * hbox;
		QFrame * frame;
		int i;
		// mode div
		frame = new QFrame;
		vbox = new QVBoxLayout;
		frame->setLayout(vbox);
		addLabelRow(vbox, "Mode:");
		hbox = new QHBoxLayout;
		modeRadios[MOVIESOAP_SKIP] = addRadio(hbox, "&Skip");
		modeRadios[MOVIESOAP_MUTE] = addRadio(hbox, "&Mute");
		modeRadios[MOVIESOAP_BLACKOUT] = addRadio(hbox, "&Blackout");
		QPushButton *blackoutButton = addButton(hbox, "S&et blackout bounds");
		connect( blackoutButton, SIGNAL(clicked()), this, SLOT(blackoutClicked()) );
		vbox->addLayout(hbox);
		layout->addWidget(frame);
		// time div
		addLabelRow(layout, "Time:");
		hbox = new QHBoxLayout;
		hbox->addWidget(new QLabel(tr("from")));
		startText = addText(hbox, "00:00:00.00");
		startText->setFixedWidth(110);
		hbox->addWidget(new QLabel(tr("to")));
		stopText = addText(hbox, "00:00:00.00");
		stopText->setFixedWidth(110);
		hbox->addWidget(new QLabel(tr("title")));
		titleText = addText(hbox, "-1");
		titleText->setFixedWidth(50);
		layout->addLayout(hbox);
		// severity/tolerance div
		frame = new QFrame;
		vbox = new QVBoxLayout;
		frame->setLayout(vbox);
		addLabel(vbox, "Offensiveness (scarcely <-> very)");
		hbox = new QHBoxLayout;
		for (i = 0; i < MOVIESOAP_TOLERANCE_COUNT-1; i++) {
			severityRadios[i] = addRadio(hbox);	}
		vbox->addLayout(hbox);
		layout->addWidget(frame);
		// category div
		hbox = new QHBoxLayout;
		addLabel(hbox, "Category:");
		categoryBox = new QComboBox;
		for (i = 0; i < MOVIESOAP_CAT_COUNT; i ++) {
			categoryBox->addItem(QString(toleranceLabels[i]), QVariant(i)); }
		hbox->addWidget(categoryBox);
		layout->addLayout(hbox);
		// description div
		hbox = new QHBoxLayout;
		addLabel(hbox, "Description:");
		descText = addText(hbox, "e.g. skip shootout scene");
		layout->addLayout(hbox);
		// Submit div
		hbox = new QHBoxLayout;
		QPushButton * okButton = addButton(hbox, "&Ok");
		QPushButton * cancelButton = addButton(hbox, "<< (&cancel)");
		layout->addLayout(hbox);
		connect( okButton, SIGNAL(clicked()), this, SLOT(okClicked()) );
		connect( cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()) );

		hbox = new QHBoxLayout;
		QPushButton * previewButton = addButton(hbox, "&Preview edit");
		layout->addLayout(hbox);
		connect( previewButton, SIGNAL(clicked()), this, SLOT(previewClicked()) );
		// finish
		hbox = new QHBoxLayout;
		layout->addLayout(hbox, 9);
		setLayout(layout);
	}