Ejemplo n.º 1
0
void TextInput::reset()
{
	str       = "";
	result    = 0;
	cursorPos = 0;
	enableEvents();
}
//----------------------------------------------------------------------------------------------------------------------
phdControlManager::phdControlManager() {
	usingEvents = false;
	selectedControl = NULL;
	focusedControl = NULL;
	popupMenu = NULL;
	setDrawMode(cmdmBoth);
	enableEvents();
}
Ejemplo n.º 3
0
void xmlgui::ofGuiEventDispatcher::setEnabled(bool enabled) {

    if(enabled!=this->enabled) {
        if(enabled) {
            enableEvents();
        } else {
            disableEvents();
        }
    }
    this->enabled = enabled;
}
Ejemplo n.º 4
0
void phdPopupMenu::setVisible(bool _value) {
    if(_value != visible) {
        visible = _value;
        if(!visible) {
            disableEvents();
            for(int i = 0; i < items.size(); i++) {
                if(items[i]->subMenu != NULL) items[i]->subMenu->setVisible(false); // ocults every child
            }
        } else {
            if(items.size() > 0) {
                enableEvents();
            }
        }
    }
}
Ejemplo n.º 5
0
void Placeable::loadProperties(const Aurora::GFF3Struct &gff) {
	// Tag
	_tag = gff.getString("Tag", _tag);

	// Name and description
	gff.getLocString("LocName"     , _name);
	gff.getLocString("LocPopupText", _description);

	// Conversation
	_conversation = gff.getString("Conversation", _conversation);

	// Static and usable
	_static = !gff.getBool("Active" , !_static);
	_usable =  gff.getBool("Useable",  _usable);

	// Appearance
	_appearanceID = gff.getUint("Appearance", _appearanceID);

	// Position
	if (gff.hasField("XPosition")) {
		const float position[3] = {
			(float) gff.getDouble("XPosition"),
			(float) gff.getDouble("YPosition"),
			(float) gff.getDouble("ZPosition")
		};

		setPosition(position[0], position[1], position[2]);
	}

	// Orientation
	if (gff.hasField("XOrientation")) {
		const float orientation[4] = {
			(float) gff.getDouble("XOrientation"),
			(float) gff.getDouble("YOrientation"),
			(float) gff.getDouble("ZOrientation"),
			(float) Common::rad2deg(acos(gff.getDouble("WOrientation")) * 2.0)
		};

		setOrientation(orientation[0], orientation[1], orientation[2], orientation[3]);
	}

	// Variables and script
	readVarTable(gff);
	readScript(gff);
	enableEvents(true);
}
Ejemplo n.º 6
0
void Waypoint::load(const Aurora::GFF3Struct &waypoint) {
	// Tag
	_tag = waypoint.getString("Tag");

	// Group
	_group = waypoint.getSint("Group", -1);

	// Map Note
	_hasMapNote     = waypoint.getBool("HasMapNote");
	_enabledMapNote = waypoint.getBool("MapNoteEnabled");

	waypoint.getLocString("MapNote", _mapNote);

	// Type
	_type = (uint32) ((int32) waypoint.getSint("MapNoteType", -1));

	// Position
	const float position[3] = {
		(float) waypoint.getDouble("XPosition"),
		(float) waypoint.getDouble("YPosition"),
		(float) waypoint.getDouble("ZPosition")
	};

	setPosition(position[0], position[1], position[2]);

	// Orientation
	const float orientation[4] = {
		(float) waypoint.getDouble("XOrientation"),
		(float) waypoint.getDouble("YOrientation"),
		(float) waypoint.getDouble("ZOrientation"),
		(float) Common::rad2deg(acos(waypoint.getDouble("WOrientation")) * 2.0)
	};

	setOrientation(orientation[0], orientation[1], orientation[2], orientation[3]);

	const Aurora::GDAFile &gda = getMGDA(kWorksheetWaypoints);

	// Icon
	_icon = gda.getString(_type, "Icon");

	// Variables and script
	readVarTable(waypoint);
	readScript(waypoint);
	enableEvents(true);
}
Ejemplo n.º 7
0
void MprSelectHandler::selectProc(MprTask *tp)
{
	MprSelectService	*ss;

	mprLog(8, log, "%d: selectProc BEGIN\n", fd);
	ss = selectService;

	ss->lock();
	inUse++;
	ss->unlock();

	(proc)(handlerData, presentMask, 1);
	mprLog(8, log, "%d: selectProc -- after proc\n", fd);

	ss->lock();
	mprLog(9, log, "%d: selectProc: inUse %d, flags %x\n", 
		fd, inUse, flags);
	flags &= ~MPR_SELECT_RUNNING;

#if BLD_FEATURE_MULTITHREAD
	if (stoppingCond) {
		stoppingCond->signalCond();
	}
#endif

	if (--inUse == 0 && flags & MPR_SELECT_DISPOSED) {
		mprLog(8, log, "%d: selectProc delete this\n", fd);
		delete this;
	} else {
		//
		//	EnableEvents can cause a new IO event which can invoke another
		//	pool thread. This call to makeIdle allows this thread to be
		//	selected to handle the new task rather than wakening another thread
		//
		tp->getThread()->makeIdle();
		if (! (flags & MPR_SELECT_DISPOSED)) {
			//
			//	FUTURE -- OPT. Only need to enable events if disableMask == 0
			//
			enableEvents(1);
		}
	}
	ss->unlock();
}
Ejemplo n.º 8
0
void ofxTimeline::enable(){
	isEnabled = true;
	enableEvents();
}
Ejemplo n.º 9
0
//----------------------------------------------------
void ofxCvCoordWarpingGui::setup(string _quadName){
    enableEvents();
    
	quadName = _quadName;
	bCameraView = false;
}
Ejemplo n.º 10
0
//------------------------------------------------------------------------------
//!
Spacer::Spacer()
   : Widget()
{
   // FIXME Should we have a default flex of 1?
   enableEvents( false );
}
Ejemplo n.º 11
0
void Window::shootEvent()
{
	static bool shooting = false;
	if (shooting)
		return;
	shooting = true;

	if (!initialised)
		return;

	//Gather information
	int delay = ui.SpinDelay->value();
	auto startTime = std::chrono::steady_clock::now() + std::chrono::seconds(delay);

	bool saveProcessed = ui.CheckSaveProcessed->isChecked();
	bool saveRaw = ui.CheckSaveRaw->isChecked();
	bool saveGroundTruth = ui.CheckSaveGroundTruth->isChecked();

	std::string processedExtension = ui.BoxProcessedformat->itemText(ui.BoxProcessedformat->currentIndex()).toUtf8();

	//Get and validate colours
	QStringList colours = mColourModel->stringList();
	if (colours.size() == 0)
	{
		Inform("Can not take photos with no colours selected.");
		shooting = false;
		return;
	}
	for (auto it = colours.begin(); it != colours.end(); ++it)
		if (!QColor(std::string(it->toUtf8()).c_str()).isValid())
		{
			Error(std::string(("Invalid colour " + *it + ", Aborting sequence.").toUtf8()));
			shooting = false;
			return;
		}

	if (!saveRaw && !saveProcessed && !saveGroundTruth)
	{
		Inform("Can not take photos: No target saving format");
		shooting = false;
		return;
	}

	if (saveGroundTruth && colours.size() < 5)
	{
		Inform("Can not take photos: Please select at least five colours for ground truth generation.");
		shooting = false;
		return;
	}

	//setWindowState(Qt::WindowState::WindowMinimized);
	disableEvents();

	//Shoot sequence
	if (!mActionClass->shootSequence(startTime, colours, saveProcessed,
		saveRaw, saveGroundTruth, processedExtension, mSaveDir))
		Error("Failed taking image sequence");

	enableEvents();
	shooting = false;
	//showNormal();
}
Ejemplo n.º 12
0
/**
 * Make the set of event filters that correspond with this
 * node active (including enabling the corresponding events).
 */
jint
eventFilterRestricted_install(HandlerNode *node)
{
    return enableEvents(node);
}
Ejemplo n.º 13
0
void EventListener::setEventPriority(int priority) {
    disableEvents();
    eventPriority = priority;
    enableEvents();
}
Ejemplo n.º 14
0
EventListener::EventListener(int priority)
{
    areEventsEnabled = false;
    eventPriority = priority;
    enableEvents();
}
Ejemplo n.º 15
0
EventsGuard::~EventsGuard()
{
    enableEvents();
}
Ejemplo n.º 16
0
void Frame::enable()
{
	enabled = true;
	enableEvents();
	onEnable();
}