Example #1
0
int Frigid::init() {
	//Load stuff

	//TODO: Change to the refresh rate of the monitor.
	//mWindow.setFramerateLimit(30);

	//Get the user folder path.
	char path[MAX_PATH];
	if (SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path) != S_OK) {
		_error("Could not get the user path")
	}

	mPrefs = Preferences::instance();
	mPrefs->setHomeDir(path);
	mPrefs->setConfigDir(String(path) + "/Documents/_quark");

	BindingManager::instance()->setDefaultBindings();

	loadConfig();

	uint32 w = mPrefs->getStartingWindowWidth();
	uint32 h = mPrefs->getStartingWindowHeight();
	bool m = mPrefs->getStartMaximized();

	if (w == 0 || h == 0) {
		m = true;
		w = 1024;
		h = 600;
	}

	mWindow = new RenderWindow(VideoMode(w, h, 32, m), "Quark");

	mMainPanel = Panel();

	tempHelpText = Text("Press control + ? for help.", *mPrefs->getFont(), 12);

	getPreferences();

	CodeEditor *editor = new CodeEditor();
	mMainPanel.setWidget(editor);

	Input::initInput();

	WindowEvent e;
	e.type = WindowEvent::Resized;
	e.size.width = mWindow->getWidth();
	e.size.height = mWindow->getHeight();
	Rectf visibleArea(0, 0, staticCastf(e.size.width), staticCastf(e.size.height));
	mWindow->setView(View(visibleArea));
	mMainPanel.resizeEvent(e);

	update();
	quit();
	return 0;
}
Example #2
0
	void TestInit()
	{
		getPreferences();
		testingLeft  = false;
		testingRight = false;

		rShooter->SetF(kRightF);
		rShooter->SetP(kRightP);
		rShooter->SetI(kRightI);
		rShooter->SetD(kRightD);

		lShooter->SetF(kLeftF);
		lShooter->SetP(kLeftP);
		lShooter->SetI(kLeftI);
		lShooter->SetD(kLeftD);
	}
Example #3
0
	void TeleopInit()
	{
		getPreferences();

		rShooter->SetF(kRightF);
		rShooter->SetP(kRightP);
		rShooter->SetI(kRightI);
		rShooter->SetD(kRightD);

		lShooter->SetF(kLeftF);
		lShooter->SetP(kLeftP);
		lShooter->SetI(kLeftI);
		lShooter->SetD(kLeftD);

		resetPIDControllers();
	}
Example #4
0
CodeEditor::CodeEditor() {
	//TODO: No hard coded values.
	mPos = Vector2u(4, 42);
	mSize = Vector2u(10, 10);

	getPreferences();

	mCurrentLine = 0;
	mMarkLine = 0;

	mMode = Edit;

	Text text("", *Preferences::instance()->getFont(), mFontSize);
	text.setDoMultiColor(false);
	text.setColor(mTextColor);
	text.setPosition(mPos.x + mLineNumberAreaWidth, mPos.y);
	mText.push_back(text);
	
	mClock = Clock();

	addLineNumber();

	mLineIndex = 0;
	mUpperBound = 0;
	mMarkIndex = 0;

	mCode = "Hello";

	mFilename = "";
	mWorkingDirectory = "";

	frames = 0;
	timeNow = mClock.getCurrentTimeInMilliseconds() - 1000;

	mFirstMarkSet = false;
}
Example #5
0
	void AutonomousInit()
	{
		getPreferences();
		done = false;
	}
Example #6
0
void Frigid::reloadConfig() {
	BindingManager::instance()->setDefaultBindings();
	loadConfig();
	getPreferences();
}
void PrintDialogController::setDefaultPrintPreferences()
{
    getPreferences()->setDefaultPrintNumberOfCopies(getView()->getSpinBox()->text().toInt());
    getPreferences()->setDefaultPrintAction(getView()->getBoxPrint()->currentIndex());
}