Beispiel #1
0
void MouseEventManager::updateStatusText(GdkEventKey* event) {
	_activeFlags = _modifiers.getKeyboardFlags(event->state);

	std::string statusText("");

	if (_activeFlags != 0) {
		for (ButtonIdMap::iterator it = _buttonId.begin(); it != _buttonId.end(); ++it) {
			// Look up an event with this button ID and the given modifier
			ui::XYViewEvent xyEvent = findXYViewEvent(it->second, _activeFlags);

			if (xyEvent != ui::xyNothing) {
				statusText += _modifiers.getModifierStr(_activeFlags, true) + "-";
				statusText += getShortButtonName(it->first) + ": ";
				statusText += printXYViewEvent(xyEvent);
				statusText += " ";
			}

			// Look up an event with this button ID and the given modifier
			ui::ObserverEvent obsEvent = findObserverEvent(it->second, _activeFlags);

			if (obsEvent != ui::obsNothing) {
				statusText += _modifiers.getModifierStr(_activeFlags, true) + "-";
				statusText += getShortButtonName(it->first) + ": ";
				statusText += printObserverEvent(obsEvent);
				statusText += " ";
			}
		}
	}

	GlobalRadiant().setStatusText(statusText);
}
Beispiel #2
0
ui::ObserverEvent MouseEventManager::getObserverEvent (const unsigned int& state)
{
	unsigned int button = getButtonFlags(state);
	unsigned int modifierFlags = _modifiers.getKeyboardFlags(state);

	return findObserverEvent(button, modifierFlags);
}
Beispiel #3
0
ui::ObserverEvent MouseEventManager::getObserverEvent (GdkEventButton* event)
{
	unsigned int button = event->button;
	unsigned int modifierFlags = _modifiers.getKeyboardFlags(event->state);

	return findObserverEvent(button, modifierFlags);
}
Beispiel #4
0
ui::ObserverEvent MouseEventManager::getObserverEventForMouseButtonState(unsigned int state)
{
	unsigned int button = getButtonFlagsFromState(state);
	unsigned int modifierFlags = _modifiers.getKeyboardFlagsFromMouseButtonState(state);

	return findObserverEvent(button, modifierFlags);
}
Beispiel #5
0
void MouseEventManager::updateStatusText(wxKeyEvent& ev)
{
	unsigned int newFlags = _modifiers.getKeyboardFlags(ev);

    // Only do this if the flags actually changed
    if (newFlags == _activeFlags)
    {
        return;
    }

    _activeFlags = newFlags;

    std::string statusText("");

    if (_activeFlags != 0)
    {
        for (ButtonIdMap::iterator it = _buttonId.begin(); it != _buttonId.end(); it++)
        {
            // Look up an event with this button ID and the given modifier
            ui::XYViewEvent xyEvent = findXYViewEvent(it->second, _activeFlags);

            if (xyEvent != ui::xyNothing)
            {
                statusText += _modifiers.getModifierStr(_activeFlags, true) + "-";
                statusText += getShortButtonName(it->first) + ": ";
                statusText += printXYViewEvent(xyEvent);
                statusText += " ";
            }

            // Look up an event with this button ID and the given modifier
            ui::ObserverEvent obsEvent = findObserverEvent(it->second, _activeFlags);

            if (obsEvent != ui::obsNothing)
            {
                statusText += _modifiers.getModifierStr(_activeFlags, true) + "-";
                statusText += getShortButtonName(it->first) + ": ";
                statusText += printObserverEvent(obsEvent);
                statusText += " ";
            }
        }
    }

    // Pass the call
    GlobalUIManager().getStatusBarManager().setText(STATUSBAR_COMMAND, statusText);
}