Example #1
0
ofxConsole::ofxConsole()
{
	enableCallbacks();
	bActive = true;
	setDefaultCommand(this, &ofxConsole::defaultFunction);
	//setDefaultCommandPre(this, &ofxConsole::defaultFunctionPre);
		
	/*
	 * this is just to show the difference between the syntax. The boost part is
	 * some syntactic c++ madness but pretty straight forward to use and alot more powerful
	 * than the default version since you can register almost any void function you want!
	 */

#ifndef USE_BOOST
	addFunction("close", this, &ofxConsole::close);
#else
	//adds the close function to the console the boost way (boost::function< void(argument types (eg: int, float)) >)
	addFunction("close", (boost::function< void() >)(boost::bind(&ofxConsole::close, this)));
#endif


	backgroundColor.set(255, 255, 255);		// history background
	copyTextColor.set(130, 130, 130);       // history text
	commandlineColor.set(0, 0, 0);          // current background
	commandlineTextColor.set(80, 80, 80);	// current text
	messageTextColor.set(100, 100, 102);	// message like testInt
	sugestColor.set(255, 0, 0);
	errorTextColor.set(200, 0, 100);	// error

	setToggleKey('+');
	
	bw = 13; /// band width
	sp = 100; /// space before string
		
	boxW = 300;
	boxH = bw * (textBufferSize+1);

	bSugestMode = false;
	bFixConsolePos = true;

    commandLineClearCount = 0;

}
Example #2
0
static void initialize() {
    setDefaultCommand(Command_new(&SetIntake, IntakeDirection_Stop));
}