void SplitPaneLayout::constructMenus()
{
	// Hide the camera toggle option for non-floating views
	IMenuManager& menuManager = GlobalUIManager().getMenuManager();
	menuManager.setVisibility("main/view/cameraview", false);

	// Add the commands for changing the camera position
	GlobalEventManager().addToggle("CameraPositionTopLeft", boost::bind(&SplitPaneLayout::setCameraTopLeft, this, _1));
	GlobalEventManager().addToggle("CameraPositionTopRight", boost::bind(&SplitPaneLayout::setCameraTopRight, this, _1));
	GlobalEventManager().addToggle("CameraPositionBottomLeft", boost::bind(&SplitPaneLayout::setCameraBottomLeft, this, _1));
	GlobalEventManager().addToggle("CameraPositionBottomRight", boost::bind(&SplitPaneLayout::setCameraBottomRight, this, _1));

	// Add the corresponding menu items
	menuManager.insert("main/view/camera", "cameraposition",
					ui::menuFolder, _("Camera Position"), "", "");

	menuManager.add("main/view/cameraposition", "camtopleft",
					ui::menuItem, _("Top Left"), "", "CameraPositionTopLeft");
	menuManager.add("main/view/cameraposition", "camtopright",
					ui::menuItem, _("Top Right"), "", "CameraPositionTopRight");
	menuManager.add("main/view/cameraposition", "cambottomleft",
					ui::menuItem, _("Bottom Left"), "", "CameraPositionBottomLeft");
	menuManager.add("main/view/cameraposition", "cambottomright",
					ui::menuItem, _("Bottom Right"), "", "CameraPositionBottomRight");

	updateCameraPositionToggles();
}
bool ShortcutChooser::onShortcutKeyPress(GdkEventKey* ev)
{
	std::string statusText("");

	/** greebo: Workaround for allowing Shift+TAB as well (Tab becomes ISO_Left_Tab in that case)
	 */
	if (ev->keyval == GDK_ISO_Left_Tab)
	{
		ev->keyval = GDK_Tab;
	}

	// Store the shortcut string representation into the Entry field
	_entry->set_text(GlobalEventManager().getGDKEventStr(ev));

	// Store this key/modifier combination for later use (UPPERCASE!)
	_keyval = gdk_keyval_to_upper(ev->keyval);
	_state = ev->state;

	IEventPtr foundEvent = GlobalEventManager().findEvent(ev);

	// Only display the note if any event was found and it's not the "self" event
	if (!foundEvent->empty() && foundEvent != _event)
	{
		statusText = (boost::format(_("Note: This is already assigned to: <b>%s</b>")) %
					  GlobalEventManager().getEventName(foundEvent)).str();
	}

	_statusWidget->set_markup(statusText);

	return true; // don't propagate
}
Exemple #3
0
gboolean ShortcutChooser::onShortcutKeyPress(GtkWidget* widget, GdkEventKey* event, ShortcutChooser* self) {
	std::string statusText("");

	/** greebo: Workaround for allowing Shift+TAB as well (Tab becomes ISO_Left_Tab in that case)
	 */
	if (event->keyval == GDK_ISO_Left_Tab) {
		event->keyval = GDK_Tab;
	}

	// Store the shortcut string representation into the GtkEntry field
	gtk_entry_set_text(GTK_ENTRY(widget), GlobalEventManager().getGDKEventStr(event).c_str());

	// Store this key/modifier combination for later use (UPPERCASE!)
	self->_keyval = gdk_keyval_to_upper(event->keyval);
	self->_state = event->state;

	IEvent* foundEvent = GlobalEventManager().findEvent(event);

	// Only display the note if any event was found and it's not the "self" event
	if (foundEvent != NULL && foundEvent != self->_event) {
		statusText = "Note: This is already assigned to: <b>";
		statusText += GlobalEventManager().getEventName(foundEvent) + "</b>";
	}

	gtk_label_set_markup(GTK_LABEL(self->_statusWidget), statusText.c_str());

	return true;
}
Exemple #4
0
void Clipper::initialiseModule(const ApplicationContext& ctx)
{
	rMessage() << "Clipper::initialiseModule called\n";

	_useCaulk = registry::getValue<bool>(RKEY_CLIPPER_USE_CAULK);
	_caulkShader = GlobalRegistry().get(RKEY_CLIPPER_CAULK_SHADER);

	GlobalRegistry().signalForKey(RKEY_CLIPPER_USE_CAULK).connect(
        sigc::mem_fun(this, &Clipper::keyChanged)
    );
	GlobalRegistry().signalForKey(RKEY_CLIPPER_CAULK_SHADER).connect(
        sigc::mem_fun(this, &Clipper::keyChanged)
    );

	constructPreferences();

	// Register the clip commands
	GlobalCommandSystem().addCommand("ClipSelected", boost::bind(&Clipper::clipSelectionCmd, this, _1));
	GlobalCommandSystem().addCommand("SplitSelected", boost::bind(&Clipper::splitSelectedCmd, this, _1));
	GlobalCommandSystem().addCommand("FlipClip", boost::bind(&Clipper::flipClipperCmd, this, _1));

	// Connect some events to these commands
	GlobalEventManager().addCommand("ClipSelected", "ClipSelected");
	GlobalEventManager().addCommand("SplitSelected", "SplitSelected");
	GlobalEventManager().addCommand("FlipClip", "FlipClip");
}
void SplitPaneLayout::updateCameraPositionToggles()
{
	// Update toggle state
	GlobalEventManager().setToggled("CameraPositionTopLeft", _cameraPosition == QuadrantTopLeft);
	GlobalEventManager().setToggled("CameraPositionTopRight", _cameraPosition == QuadrantTopRight);
	GlobalEventManager().setToggled("CameraPositionBottomLeft", _cameraPosition == QuadrantBottomLeft);
	GlobalEventManager().setToggled("CameraPositionBottomRight", _cameraPosition == QuadrantBottomRight);
}
Exemple #6
0
void Entity_Construct ()
{
	// instanciate once to register the preferences
	entity::EntitySettings::Instance();

	GlobalEventManager().addCommand("ConnectSelection", FreeCaller<selection::algorithm::connectSelectedEntities>());
	GlobalEventManager().addCommand("GroupSelection", FreeCaller<selection::algorithm::groupSelected> ());
	GlobalEventManager().addCommand("UngroupSelection", FreeCaller<selection::algorithm::ungroupSelected> ());
}
void ToolChanged ()
{
	GlobalEventManager().setToggled("ToggleClipper", GlobalClipper().clipMode());
	GlobalEventManager().setToggled("MouseTranslate", GlobalSelectionSystem().ManipulatorMode()
			== SelectionSystem::eTranslate);
	GlobalEventManager().setToggled("MouseRotate", GlobalSelectionSystem().ManipulatorMode()
			== SelectionSystem::eRotate);
	GlobalEventManager().setToggled("MouseScale", GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eScale);
	GlobalEventManager().setToggled("MouseDrag", GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eDrag);
}
Exemple #8
0
void CamWnd::disableDiscreteMoveEvents() {
	GlobalEventManager().disableEvent("CameraForward");
	GlobalEventManager().disableEvent("CameraBack");
	GlobalEventManager().disableEvent("CameraLeft");
	GlobalEventManager().disableEvent("CameraRight");
	GlobalEventManager().disableEvent("CameraStrafeRight");
	GlobalEventManager().disableEvent("CameraStrafeLeft");
	GlobalEventManager().disableEvent("CameraUp");
	GlobalEventManager().disableEvent("CameraDown");
	GlobalEventManager().disableEvent("CameraAngleUp");
	GlobalEventManager().disableEvent("CameraAngleDown");
}
Exemple #9
0
static void Camera_motionDelta(int x, int y, unsigned int state, void *data) {
	Camera* cam = reinterpret_cast<Camera*>(data);

	cam->m_mouseMove.motion_delta(x, y, state);
	cam->m_strafe = GlobalEventManager().MouseEvents().strafeActive(state);

	if (cam->m_strafe) {
		cam->m_strafe_forward = GlobalEventManager().MouseEvents().strafeForwardActive(state);
	} else {
		cam->m_strafe_forward = false;
	}
}
Exemple #10
0
void registerCommands()
{
	GlobalCommandSystem().addCommand("CSGSubtract", subtractBrushesFromUnselected);
	GlobalCommandSystem().addCommand("CSGMerge", mergeSelectedBrushes);
	GlobalCommandSystem().addCommand("CSGHollow", hollowSelectedBrushes);
	GlobalCommandSystem().addCommand("CSGRoom", makeRoomForSelectedBrushes);

	GlobalEventManager().addCommand("CSGSubtract", "CSGSubtract");
	GlobalEventManager().addCommand("CSGMerge", "CSGMerge");
	GlobalEventManager().addCommand("CSGHollow", "CSGHollow");
	GlobalEventManager().addCommand("CSGRoom", "CSGRoom");
}
Exemple #11
0
void registerCommands()
{
    GlobalCommandSystem().addCommand("ConnectSelection", selection::algorithm::connectSelectedEntities);
    GlobalCommandSystem().addCommand("BindSelection", selection::algorithm::bindEntities);
    GlobalCommandSystem().addCommand("CreateCurveNURBS", entity::createCurveNURBS);
    GlobalCommandSystem().addCommand("CreateCurveCatmullRom", entity::createCurveCatmullRom);

    GlobalEventManager().addCommand("ConnectSelection", "ConnectSelection");
    GlobalEventManager().addCommand("BindSelection", "BindSelection");
    GlobalEventManager().addRegistryToggle("ToggleFreeModelRotation", RKEY_FREE_MODEL_ROTATION);
    GlobalEventManager().addCommand("CreateCurveNURBS", "CreateCurveNURBS");
    GlobalEventManager().addCommand("CreateCurveCatmullRom", "CreateCurveCatmullRom");
}
void SplitPaneLayout::deconstructMenus()
{
	// Show the camera toggle option again
    GlobalUIManager().getMenuManager().setVisibility("main/view/cameraview", true);

	// Remove the camera position menu items
	GlobalUIManager().getMenuManager().remove("main/view/cameraposition");

	// Remove the camera position events
	GlobalEventManager().removeEvent("CameraPositionTopLeft");
	GlobalEventManager().removeEvent("CameraPositionTopRight");
	GlobalEventManager().removeEvent("CameraPositionBottomLeft");
	GlobalEventManager().removeEvent("CameraPositionBottomRight");
}
void ModelCache::initialiseModule(const ApplicationContext& ctx) {
	rMessage() << "ModelCache::initialiseModule called.\n";

	GlobalCommandSystem().addCommand(
		"RefreshModels",
		boost::bind(&ModelCache::refreshModels, this, _1)
	);
	GlobalCommandSystem().addCommand(
		"RefreshSelectedModels",
		boost::bind(&ModelCache::refreshSelectedModels, this, _1)
	);
	GlobalEventManager().addCommand("RefreshModels", "RefreshModels");
	GlobalEventManager().addCommand("RefreshSelectedModels", "RefreshSelectedModels");
}
Exemple #14
0
	virtual void initialiseModule(const ApplicationContext& ctx)
	{
		rMessage() << getName() << "::initialiseModule called." << std::endl;

		// Associated "def_head" with an empty property editor instance
		GlobalEntityInspector().registerPropertyEditor(
			ui::DEF_HEAD_KEY, ui::IPropertyEditorPtr(new ui::AIHeadPropertyEditor())
		);

		GlobalEntityInspector().registerPropertyEditor(
			ui::DEF_VOCAL_SET_KEY, ui::IPropertyEditorPtr(new ui::AIVocalSetPropertyEditor())
		);

		GlobalCommandSystem().addCommand("FixupMapDialog", ui::FixupMapDialog::RunDialog);
		GlobalEventManager().addCommand("FixupMapDialog", "FixupMapDialog");

		GlobalUIManager().getMenuManager().add("main/map",
			"FixupMapDialog", ui::menuItem,
			_("Fixup Map..."), // caption
			"", // icon
			"FixupMapDialog"
		);

		GlobalRadiant().signal_radiantStarted().connect(
			sigc::ptr_fun(ui::AIEditingPanel::onRadiantStartup)
		);	
	}
Exemple #15
0
MRU::MRU() :
	_numMaxFiles(registry::getValue<int>(RKEY_MRU_LENGTH)),
	_loadLastMap(registry::getValue<bool>(RKEY_LOAD_LAST_MAP)),
	_list(_numMaxFiles),
	_emptyMenuItem(_(RECENT_FILES_CAPTION), *this, 0)
{
	GlobalRegistry().signalForKey(RKEY_MRU_LENGTH).connect(
        sigc::mem_fun(this, &MRU::keyChanged)
    );

	// Add the preference settings
	constructPreferences();

	// Create _numMaxFiles menu items
	for (std::size_t i = 0; i < _numMaxFiles; i++) {

		_menuItems.push_back(MRUMenuItem(string::to_string(i), *this, i+1));

		MRUMenuItem& item = (*_menuItems.rbegin());

		const std::string commandName = std::string("MRUOpen") + string::to_string(i+1);

		// Connect the command to the last inserted menuItem
		GlobalCommandSystem().addCommand(
			commandName,
			std::bind(&MRUMenuItem::activate, &item, std::placeholders::_1)
		);
		GlobalEventManager().addCommand(commandName, commandName);
	}
}
void RadiantSelectionSystem::initialiseModule(const ApplicationContext& ctx) 
{
    rMessage() << "RadiantSelectionSystem::initialiseModule called.\n";

    constructStatic();

    SetManipulatorMode(eTranslate);
    pivotChanged();

    _sigSelectionChanged.connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::pivotChangedSelection)
    );

    GlobalGrid().signal_gridChanged().connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::pivotChanged)
    );

    GlobalRegistry().signalForKey(RKEY_ROTATION_PIVOT).connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::keyChanged)
    );

    // Pass a reference to self to the global event manager
    GlobalEventManager().connectSelectionSystem(this);

    // Connect the bounds changed caller
    GlobalSceneGraph().signal_boundsChanged().connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::onSceneBoundsChanged)
    );

    GlobalRenderSystem().attachRenderable(*this);
}
Exemple #17
0
void UIManager::initialiseModule(const ApplicationContext& ctx)
{
	rMessage() << "UIManager::initialiseModule called" << std::endl;

	_dialogManager = DialogManagerPtr(new DialogManager);

	_menuManager.loadFromRegistry();
	_toolbarManager.initialise();
	ColourSchemeManager::Instance().loadColourSchemes();

	GlobalCommandSystem().addCommand("EditColourScheme", ColourSchemeEditor::editColourSchemes);
	GlobalEventManager().addCommand("EditColourScheme", "EditColourScheme");

	GlobalRadiant().signal_radiantShutdown().connect(
        sigc::mem_fun(this, &UIManager::clear)
    );

	// Add the statusbar command text item
	_statusBarManager.addTextElement(
		STATUSBAR_COMMAND,
		"",  // no icon
		IStatusBarManager::POS_COMMAND
	);

    addLocalBitmapsAsIconFactory();
}
Exemple #18
0
void SelectionSetToolmenu::onSelectionChanged(GtkComboBox* comboBox, 
											  SelectionSetToolmenu* self)
{
	GtkTreeIter iter;

	if (gtk_combo_box_get_active_iter(comboBox, &iter))
	{
		std::string name = gtkutil::ComboBox::getActiveText(comboBox);

		if (name.empty()) return;

		ISelectionSetPtr set = GlobalSelectionSetManager().findSelectionSet(name);

		if (set == NULL) return;

		// The user can choose to DESELECT the set nodes when holding down shift
		if ((GlobalEventManager().getModifierState() & GDK_SHIFT_MASK) != 0)
		{
			set->deselect();
		}
		else
		{
			set->select();
		}

		GtkWidget* childEntry = gtk_bin_get_child(GTK_BIN(self->_entry));
		gtk_entry_set_text(GTK_ENTRY(childEntry), "");
	}
}
/* greebo: Handle the mouseUp event. Usually, this means the end of an operation, so
 * this has to check, if there are any callbacks connected, and call them if this is the case
 */
void RadiantWindowObserver::onMouseUp(const WindowVector& position, GdkEventButton* ev)
{
	// Retrieve the according ObserverEvent for the GdkEventButton
	ui::ObserverEvent observerEvent = GlobalEventManager().MouseEvents().getObserverEvent(ev);

	// Only react, if the "select" or "manipulate" is held, ignore this otherwise
	bool reactToEvent = (observerEvent == ui::obsManipulate || observerEvent == ui::obsSelect ||
						 observerEvent == ui::obsToggle || observerEvent == ui::obsToggleFace ||
						 observerEvent == ui::obsToggleGroupPart ||
						 observerEvent == ui::obsReplace || observerEvent == ui::obsReplaceFace);

	if (reactToEvent)
	{
		// No mouse button is active anymore
  		_mouseDown = false;

  		// Store the current event in the observer classes
  		_selectObserver.setEvent(ev);
  		_manipulateObserver.setEvent(ev);

  		// Get the callback and call it with the arguments
		if (_mouseUpCallback)
		{
			_mouseUpCallback(window_to_normalised_device(position, _width, _height));
		}
	}

	// Stop listening for cancel events
	_listenForCancelEvents = false;

	// Disconnect the mouseMoved and mouseUp callbacks, mouse has been released
	_mouseMotionCallback.clear();
	_mouseUpCallback.clear();
}
Exemple #20
0
void Doom3EntityCreator::initialiseModule(const ApplicationContext& ctx)
{
    globalOutputStream() << "Doom3EntityCreator::initialiseModule called." << std::endl;

    LightShader::m_defaultShader = GlobalRegistry().get("game/defaults/lightShader");

    // Construct Doom3Group stuff
    CurveEditInstance::initialiseShaders();

    RenderablePivot::StaticShader() = GlobalRenderSystem().capture("$PIVOT");

    GlobalRenderSystem().attachRenderable(RenderableTargetInstances::Instance());

    GlobalEventManager().addRegistryToggle("ToggleShowAllLightRadii", RKEY_SHOW_ALL_LIGHT_RADII);
    GlobalEventManager().addRegistryToggle("ToggleShowAllSpeakerRadii", RKEY_SHOW_ALL_SPEAKER_RADII);
    GlobalEventManager().addRegistryToggle("ToggleDragResizeEntitiesSymmetrically", RKEY_DRAG_RESIZE_SYMMETRICALLY);
}
void MediaBrowser::registerCommandsAndPreferences()
{
	// Add a page to the given group
	PreferencesPagePtr page = GlobalPreferenceSystem().getPage(_("Settings/Media Browser"));
	page->appendCheckBox("", _("Load media tree at startup"), RKEY_MEDIA_BROWSER_PRELOAD);

	GlobalCommandSystem().addCommand("ToggleMediaBrowser", toggle);
	GlobalEventManager().addCommand("ToggleMediaBrowser", "ToggleMediaBrowser");
}
Exemple #22
0
gboolean CamWnd::disable_freelook_button_press(GtkWidget* widget, GdkEventButton* event, CamWnd* camwnd) {
	if (event->type == GDK_BUTTON_PRESS) {
		if (GlobalEventManager().MouseEvents().stateMatchesCameraViewEvent(ui::camDisableFreeLookMode, event)) {
			camwnd->disableFreeMove();
			return TRUE;
		}
	}
	return FALSE;
}
void EClassManager::initialiseModule(const ApplicationContext& ctx)
{
	rMessage() << "EntityClassDoom3::initialiseModule called." << std::endl;

	GlobalFileSystem().addObserver(*this);
	realise();

	GlobalCommandSystem().addCommand("ReloadDefs", boost::bind(&EClassManager::reloadDefsCmd, this, _1));
	GlobalEventManager().addCommand("ReloadDefs", "ReloadDefs");
}
Exemple #24
0
	/* Checks the passed xmlNode for a recognized item (ToolButton, ToggleToolButton, Separator)
	 * Returns the widget or NULL if nothing useful is found
	 */
	GtkWidget* ToolbarCreator::createToolItem(xml::Node& node, GtkToolbar* toolbar) {
		const std::string nodeName = node.getName();
		GtkWidget* toolItem;

		if (nodeName == "separator") {
			toolItem = GTK_WIDGET(gtk_separator_tool_item_new());
		}
		else if (nodeName == "toolbutton" || nodeName == "toggletoolbutton") {
			// Found a button, load the values that are shared by both types
			const std::string name 		= node.getAttributeValue("name");
			const std::string icon 		= node.getAttributeValue("icon");
			const std::string tooltip 	= _(node.getAttributeValue("tooltip").c_str());
			const std::string action 	= node.getAttributeValue("action");

			if (nodeName == "toolbutton") {
				// Create a new GtkToolButton and assign the right callback
				toolItem = GTK_WIDGET(gtk_tool_button_new(NULL, name.c_str()));

			}
			else {
				// Create a new GtkToggleToolButton and assign the right callback
				toolItem = GTK_WIDGET(gtk_toggle_tool_button_new());

			}

			IEvent* event = GlobalEventManager().findEvent(action);
			if (event != NULL) {
				event->connectWidget(GTK_WIDGET(toolItem));

				// Tell the event to update the state of this button
				event->updateWidgets();
			} else {
				globalErrorStream() << "ToolbarCreator: Failed to lookup command " << action << "\n";
			}

			// Set the tooltip, if not empty
			if (!tooltip.empty()) {
				gtk_tooltips_set_tip(_tooltips, GTK_WIDGET(toolItem), tooltip.c_str(), "");
				//gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(toolItem), _tooltips, tooltip.c_str(), "");
			}

			// Load and assign the icon, if specified
			if (icon != "") {
				GtkWidget* image = gtk_image_new_from_pixbuf(gtkutil::getLocalPixbufWithMask(icon));
				gtk_widget_show(image);
				gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(toolItem), image);
			}
		}
		else {
			return NULL;
		}

		gtk_widget_show(toolItem);
		return toolItem;
	}
void ParticlesManager::initialiseModule(const ApplicationContext& ctx)
{
	rMessage() << "ParticlesManager::initialiseModule called" << std::endl;

	// Load the .prt files
	reloadParticleDefs();

	// Register the "ReloadParticles" commands
	GlobalCommandSystem().addCommand("ReloadParticles", boost::bind(&ParticlesManager::reloadParticleDefs, this));
	GlobalEventManager().addCommand("ReloadParticles", "ReloadParticles");
}
Exemple #26
0
void EntityList::onRadiantShutdown()
{
	// Tell the position tracker to save the information
	_windowPosition.saveToPath(RKEY_WINDOW_STATE);
	
	GlobalSelectionSystem().removeObserver(this);
	GlobalEventManager().disconnectDialogWindow(GTK_WINDOW(getWindow()));

	// Destroy the transient window
	destroy();
}
Exemple #27
0
CamWnd::~CamWnd() {
	// Subscribe to the global scene graph update
	GlobalSceneGraph().removeSceneObserver(this);

	if (m_bFreeMove) {
		disableFreeMove();
	}

	removeHandlersMove();

	g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_sizeHandler);
	g_signal_handler_disconnect(G_OBJECT(m_gl_widget), m_exposeHandler);

	gtk_widget_unref(m_gl_widget);

	// Disconnect self from EventManager\r
	GlobalEventManager().disconnect(GTK_OBJECT(m_gl_widget));
	GlobalEventManager().disconnect(GTK_OBJECT(m_parent));

	delete m_window_observer;
}
LayerCommandTarget::LayerCommandTarget(int layerID) :
	_layerID(layerID)
{
	GlobalCommandSystem().addCommand(
		COMMAND_PREFIX_ADDTOLAYER + string::to_string(_layerID),
		std::bind(&LayerCommandTarget::addSelectionToLayer, this, std::placeholders::_1)
	);
	GlobalEventManager().addCommand(
		COMMAND_PREFIX_ADDTOLAYER + string::to_string(_layerID),
		COMMAND_PREFIX_ADDTOLAYER + string::to_string(_layerID)
	);

	GlobalCommandSystem().addCommand(
		COMMAND_PREFIX_MOVETOLAYER + string::to_string(_layerID),
		std::bind(&LayerCommandTarget::moveSelectionToLayer, this, std::placeholders::_1)
	);
	GlobalEventManager().addCommand(
		COMMAND_PREFIX_MOVETOLAYER + string::to_string(_layerID),
		COMMAND_PREFIX_MOVETOLAYER + string::to_string(_layerID)
	);

	GlobalCommandSystem().addCommand(
		COMMAND_PREFIX_SHOWLAYER + string::to_string(_layerID),
		std::bind(&LayerCommandTarget::showLayer, this, std::placeholders::_1)
	);
	GlobalEventManager().addCommand(
		COMMAND_PREFIX_SHOWLAYER + string::to_string(_layerID),
		COMMAND_PREFIX_SHOWLAYER + string::to_string(_layerID)
	);

	GlobalCommandSystem().addCommand(
		COMMAND_PREFIX_HIDELAYER + string::to_string(_layerID),
		std::bind(&LayerCommandTarget::hideLayer, this, std::placeholders::_1)
	);
	GlobalEventManager().addCommand(
		COMMAND_PREFIX_HIDELAYER + string::to_string(_layerID),
		COMMAND_PREFIX_HIDELAYER + string::to_string(_layerID)
	);
}
Exemple #29
0
FindAndReplaceShader::FindAndReplaceShader() :
	gtkutil::BlockingTransientWindow(_(FINDDLG_WINDOW_TITLE), GlobalMainFrame().getTopLevelWindow())
{
	set_default_size(FINDDLG_DEFAULT_SIZE_X, FINDDLG_DEFAULT_SIZE_Y);
	set_border_width(12);
	set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);

	// Create all the widgets
	populateWindow();

	// Propagate shortcuts to the main window
	GlobalEventManager().connectDialogWindow(this);
}
Exemple #30
0
    virtual void initialiseModule(const ApplicationContext& ctx)
    {
        rMessage() << "UndoSystem::initialiseModule called" << std::endl;

        // Add commands for console input
        GlobalCommandSystem().addCommand("Undo", boost::bind(&RadiantUndoSystem::undoCmd, this, _1));
        GlobalCommandSystem().addCommand("Redo", boost::bind(&RadiantUndoSystem::redoCmd, this, _1));

        // Bind events to commands
        GlobalEventManager().addCommand("Undo", "Undo");
        GlobalEventManager().addCommand("Redo", "Redo");

        _undoLevels = registry::getValue<int>(RKEY_UNDO_QUEUE_SIZE);

        // Add self to the key observers to get notified on change
        GlobalRegistry().signalForKey(RKEY_UNDO_QUEUE_SIZE).connect(
            sigc::mem_fun(this, &RadiantUndoSystem::keyChanged)
        );

        // add the preference settings
        constructPreferences();
    }