Ejemplo n.º 1
0
	void Widget::setParent(Widget *w) {
		if(w != NULL && mParent != NULL && mParent != w) {
			PANIC_MESSAGE("Widget already has a mParent!");
		}
		mParent = w;
		updateAbsolutePosition();
		requestRepaint();
	}
Ejemplo n.º 2
0
static void soft_popMatrix(void) {
	soft_init();
	if(sTransformStackPtr < 0) {
		PANIC_MESSAGE("Transform stack underflow");
		return;
	}
	sCurrentOffset = sTransformStack[sTransformStackPtr];
	sTransformStackPtr--;
}
Ejemplo n.º 3
0
static void soft_pushMatrix(void) {
	soft_init();
	if(sTransformStackPtr >= MA_TRANSFORM_STACK_DEPTH-1) {
		PANIC_MESSAGE("Transform stack overflow");
		return;
	}

	sTransformStackPtr++;
	sTransformStack[sTransformStackPtr] = sCurrentOffset;
}
Ejemplo n.º 4
0
void NativeEditBox::activate(NativeEditBoxListener* listener) {
	mListener = listener;
	wsprintf(mString, L"%s",getCaption().c_str());
	int res = maTextBox((const wchar*)mTitleString.c_str(), (wchar*)mString,
		(wchar*)mString, mMaxSize, mOptions);
	if(res < 0) {
		PANIC_MESSAGE("maTextBox failed");
	}
	Environment::getEnvironment().addTextBoxListener(this);
}
Ejemplo n.º 5
0
	// Only one listener per connection is allowed, but the same ConnectionListener
	// can be used for several connections.
	void Environment::setConnListener(MAHandle conn, ConnListener* cl) {
		if (NULL == cl) {
			PANIC_MESSAGE("Environment::setConnListener: The listener must not be NULL");
		}
		
		//MAASSERT(sEnvironment == this);
		
		// First remove the existing listener, if any.
		removeConnListener(conn);
		
		// Set the listener for the connection.
		cl->_mConn = conn;
		mConnListeners.add(cl);
	}
Ejemplo n.º 6
0
	Environment::Environment() 
		: mKeyListeners(false),
		mPointerListeners(false),
		mBtListener(NULL),
		mConnListeners(false),
		mIdleListeners(false),
		mTimerEvents(true),
		mFocusListeners(false),
		mCustomEventListeners(false),
		mTextBoxListeners(false)		
	{
		if(sEnvironment)
			PANIC_MESSAGE("The application tried to instantiate more than one Environment. "
			"There can be only one per application.");
		sEnvironment = this;
	}
Ejemplo n.º 7
0
void NativeEditBox::activate() {
	
#ifdef USE_NEWLIB
	swprintf(mString, mMaxSize, L"%s", mCaption.c_str());
#else
	wsprintf(mString, L"%s", mCaption.c_str());
#endif
	int res = 
		maTextBox(
			(const wchar*)mTitleString.c_str(), 
			(wchar*)mString,
			(wchar*)mString, 
			mMaxSize, 
			mOptions);
	if(res < 0) {
		PANIC_MESSAGE("maTextBox failed");
	}
	Environment::getEnvironment().addTextBoxListener(this);
}
Ejemplo n.º 8
0
	Environment& Environment::getEnvironment() {
		if(!sEnvironment)
			PANIC_MESSAGE("The application tried to get an Environment, "
			"but none has been instantiated.");
		return *sEnvironment;
	}