void SplitPaneLayout::createViews()
{
    // We need to know the camera position first
    _cameraPosition = getCameraPositionFromRegistry();

	// Initialise mapping and create the views
    for (int i = QuadrantTopLeft; i <= QuadrantBottomRight; ++i)
    {
        Position pos = static_cast<Position>(i);

        Quadrant quadrant;

        quadrant.type = (_cameraPosition == pos) ? Quadrant::Camera : Quadrant::OrthoView;

        wxWindow* parent = (pos == QuadrantTopLeft || pos == QuadrantBottomLeft) ? _splitPane.vertPane1 : _splitPane.vertPane2;

        if (quadrant.type == Quadrant::Camera)
        {
            _camWnd = GlobalCamera().createCamWnd(parent);
            quadrant.widget = _camWnd->getMainWidget();
        }
        else
        {
            quadrant.xyWnd = GlobalXYWnd().createEmbeddedOrthoView(XY, parent);
            quadrant.widget = quadrant.xyWnd->getGLWidget();
        }

        _quadrants[pos] = quadrant;
    }

    // Call Split on the wxSplitterWindows to complete creation
    _splitPane.vertPane1->SplitHorizontally(_quadrants[QuadrantTopLeft].widget, _quadrants[QuadrantBottomLeft].widget);
    _splitPane.vertPane2->SplitHorizontally(_quadrants[QuadrantTopRight].widget, _quadrants[QuadrantBottomRight].widget);
}
void FloatingOrthoView::_onSetFocus() 
{
	TransientWindow::_onSetFocus();

	// Let the global XYWndManager know about the focus change
	GlobalXYWnd().setActiveXY(_id);
}
void SplitPaneLayout::distributeWidgets()
{
	// Set camera position afresh
	_quadrants[_cameraPosition].widget = _camera;
	_quadrants[_cameraPosition].isCamera = true;

	for (WidgetMap::iterator i = _quadrants.begin(); i != _quadrants.end(); ++i)
	{
		if (i->second.widget == NULL)
		{
			// Missing widget, this must be an orthoview
			i->second.isCamera = false;

			// Ensure we have an XYWnd instance at hand
			if (i->second.xyWnd == NULL)
			{
				i->second.xyWnd = GlobalXYWnd().createEmbeddedOrthoView();

				// FIXME: This could be the third complementing viewtype
				i->second.xyWnd->setViewType(XY);
			}

			// Frame the widget to make it ready for packing
			i->second.widget = Gtk::manage(new gtkutil::FramedWidget(*i->second.xyWnd->getWidget()));
		}
	}

	_splitPane.vertPane1->pack1(*_quadrants[QuadrantTopLeft].widget, true, true); // allow shrinking
	_splitPane.vertPane1->pack2(*_quadrants[QuadrantBottomLeft].widget, true, true); // allow shrinking

	_splitPane.vertPane2->pack1(*_quadrants[QuadrantTopRight].widget, true, true); // allow shrinking
	_splitPane.vertPane2->pack2(*_quadrants[QuadrantBottomRight].widget, true, true); // allow shrinking
}
示例#4
0
gboolean XYWndManager::onDeleteOrthoView(GtkWidget *widget, GdkEvent *event, gpointer data) {
	// Get the pointer to the deleted XY view from data
	XYWnd* deletedView = reinterpret_cast<XYWnd*>(data);

	GlobalXYWnd().destroyOrthoView(deletedView);

	return false;
}
bool FloatingOrthoView::_onDeleteEvent()
{
    // Don't call base class, just issue the call to GlobalXYWnd
    // which will call the destructor.
    GlobalXYWnd().destroyXYWnd(_id);

    return true; // veto this event
}
示例#6
0
void createPrefabInternal(EPatchPrefab prefabType, const std::string& undoCmdName)
{
	UndoableCommand undo(undoCmdName);

	constructPrefab(getDefaultBoundsFromSelection(), 
					GlobalTextureBrowser().getSelectedShader(), 
					prefabType, 
					GlobalXYWnd().getActiveViewType());
}
示例#7
0
int GetViewAxis()
{
  switch(GlobalXYWnd().getActiveViewType())
  {
    case XY:
      return 2;
    case XZ:
      return 1;
    case YZ:
      return 0;
  }
  return 2;
}
示例#8
0
void createSimplePatch(const cmd::ArgumentList& args)
{
	std::size_t width = 0;
	std::size_t height = 0;
	bool removeSelectedBrush = false;

	if (args.size() == 1)
	{
		// Try to convert the arguments to actual integers and do the range checks
		width = height = checkPatchDimension(args[0].getInt());
	}
	else if (args.size() == 2)
	{
		width = checkPatchDimension(args[0].getInt());
		height = checkPatchDimension(args[1].getInt());
	}

	// Only fire the dialog if no or invalid command arguments are given
	if (width == 0 || height == 0)
	{
		ui::PatchCreateDialog dialog;

		if (dialog.run() == ui::IDialog::RESULT_OK)
		{
			width = dialog.getSelectedWidth();
			height = dialog.getSelectedHeight();
			removeSelectedBrush = dialog.getRemoveSelectedBrush();
		}
		else
		{
			return; // dialog cancelled
		}
	}

	UndoableCommand undo("patchCreatePlane");

	// Retrieve the boundaries before any delete operation
	AABB bounds = getDefaultBoundsFromSelection();

	if (removeSelectedBrush)
	{
		// Delete the selection, the should be only one brush selected
		selection::algorithm::deleteSelection();
	}

	// Call the PatchConstruct routine (GtkRadiant legacy)
	constructPrefab(bounds,
					GlobalTextureBrowser().getSelectedShader(),
					ePlane, GlobalXYWnd().getActiveViewType(),
					width, height);
}
示例#9
0
void SelectBrush (int entitynum, int brushnum)
{
  scene::Path path;
  Scene_FindEntityBrush(entitynum, brushnum, path);
  if (path.size() == 3 || (path.size() == 2 && !Node_hasChildren(path.top())))
  {
	  Node_setSelected(path.top(), true);
    
    XYWndPtr xyView = GlobalXYWnd().getActiveXY();
    
    if (xyView) {
    	xyView->positionView(path.top()->worldAABB().origin);
    }
  }
}
示例#10
0
/** 
 * greebo: Creates a new entity with an attached curve
 *
 * @key: The curve type: pass either "curve_CatmullRomSpline" or "curve_Nurbs".
 */
void createCurve(const std::string& key)
{
    UndoableCommand undo(std::string("createCurve: ") + key);

    // De-select everything before we proceed
    GlobalSelectionSystem().setSelectedAll(false);
    GlobalSelectionSystem().setSelectedAllComponents(false);

    std::string curveEClass = game::current::getValue<std::string>(GKEY_DEFAULT_CURVE_ENTITY);

    // Fallback to func_static, if nothing defined in the registry
    if (curveEClass.empty()) {
        curveEClass = "func_static";
    }

    // Find the default curve entity
    IEntityClassPtr entityClass = GlobalEntityClassManager().findOrInsert(
        curveEClass,
        true
    );

    // Create a new entity node deriving from this entityclass
    IEntityNodePtr curve(GlobalEntityCreator().createEntity(entityClass));

    // Insert this new node into the scenegraph root
    GlobalSceneGraph().root()->addChildNode(curve);

    // Select this new curve node
    Node_setSelected(curve, true);

    // Set the model key to be the same as the name
    curve->getEntity().setKeyValue("model",
                                   curve->getEntity().getKeyValue("name"));

    // Initialise the curve using three pre-defined points
    curve->getEntity().setKeyValue(
        key,
        "3 ( 0 0 0  50 50 0  50 100 0 )"
    );

    ITransformablePtr transformable = Node_getTransformable(curve);
    if (transformable != NULL) {
        // Translate the entity to the center of the current workzone
        transformable->setTranslation(GlobalXYWnd().getActiveXY()->getOrigin());
        transformable->freezeTransform();
    }
}
示例#11
0
void MainFrame::Shutdown (void)
{
	map::AutoSaver().stopTimer();
	ui::TexTool::Instance().shutdown();

	GlobalUndoSystem().trackerDetach(m_saveStateTracker);

	GlobalXYWnd().destroyViews();

	GlobalCamera().deleteCamWnd(m_pCamWnd);
	m_pCamWnd = 0;

	PreferencesDialog_destroyWindow();

	delete _sidebar;

	// Stop the AutoSaver class from being called
	map::AutoSaver().stopTimer();
}
示例#12
0
void RegularLayout::activate()
{
	wxFrame* topLevelParent = GlobalMainFrame().getWxTopLevelWindow();

	// Main splitter
	_regular.horizPane = new wxSplitterWindow(topLevelParent, wxID_ANY, 
		wxDefaultPosition, wxDefaultSize, 
		wxSP_LIVE_UPDATE | wxSP_3D | wxWANTS_CHARS, "RegularHorizPane");

	_regular.horizPane->SetSashGravity(0.5);
	_regular.horizPane->SetSashPosition(500);
    _regular.horizPane->SetMinimumPaneSize(1); // disallow unsplitting

	GlobalMainFrame().getWxMainContainer()->Add(_regular.horizPane, 1, wxEXPAND);

	// Allocate a new OrthoView and set its ViewType to XY
	XYWndPtr xywnd = GlobalXYWnd().createEmbeddedOrthoView(XY, _regular.horizPane);

	// Texture/Camera Pane
	_regular.texCamPane = new wxSplitterWindow(_regular.horizPane, wxID_ANY, 
		wxDefaultPosition, wxDefaultSize, 
		wxSP_LIVE_UPDATE | wxSP_3D | wxWANTS_CHARS, "RegularTexCamPane");

	_regular.texCamPane->SetSashGravity(0.5);
	_regular.texCamPane->SetSashPosition(350);
    _regular.texCamPane->SetMinimumPaneSize(1); // disallow unsplitting

	// Create a new camera window and parent it
	_camWnd = GlobalCamera().createCamWnd(_regular.texCamPane);

	// Texture Window
	wxWindow* texBrowser = GlobalTextureBrowser().constructWindow(_regular.texCamPane);

	_regular.texCamPane->SplitHorizontally(_camWnd->getMainWidget(), texBrowser);

	if (_regularLeft)
	{
		_regular.horizPane->SplitVertically(_regular.texCamPane, xywnd->getGLWidget());
    }
    else
	{
		// This is "regular", put the xyview to the left
		_regular.horizPane->SplitVertically(xywnd->getGLWidget(), _regular.texCamPane);
    }

	// Connect the pane position trackers
	_regular.posHPane.connect(_regular.horizPane);
	_regular.posTexCamPane.connect(_regular.texCamPane);

	// Now attempt to load the paned positions from the registry
	restoreStateFromPath(RKEY_REGULAR_ROOT);

	GlobalGroupDialog().showDialogWindow();

	// greebo: Now that the dialog is shown, tell the Entity Inspector to reload
	// the position info from the Registry once again.
	GlobalEntityInspector().restoreSettings();

	GlobalGroupDialog().hideDialogWindow();

	topLevelParent->Layout();

	// Hide the camera toggle option for non-floating views
    GlobalUIManager().getMenuManager().setVisibility("main/view/cameraview", false);
	// Hide the console/texture browser toggles for non-floating/non-split views
	GlobalUIManager().getMenuManager().setVisibility("main/view/textureBrowser", false);
}
示例#13
0
文件: Map.cpp 项目: Zbyl/DarkRadiant
// move the view to a certain position
void Map::focusViews(const Vector3& point, const Vector3& angles) {
    // Set the camera and the views to the given point
    GlobalCamera().focusCamera(point, angles);
    GlobalXYWnd().setOrigin(point);
}
void RadiantSelectionSystem::testSelectScene(SelectablesList& targetList, SelectionTest& test,
                                             const View& view, SelectionSystem::EMode mode,
                                             SelectionSystem::EComponentMode componentMode)
{
    // The (temporary) storage pool
    SelectionPool selector;
    SelectionPool sel2;

    switch(mode)
    {
        case eEntity:
        {
            // Instantiate a walker class which is specialised for selecting entities
            EntitySelector entityTester(selector, test);
            GlobalSceneGraph().foreachVisibleNodeInVolume(view, entityTester);

            for (SelectionPool::iterator i = selector.begin(); i != selector.end(); ++i)
            {
                targetList.push_back(i->second);
            }
        }
        break;

        case ePrimitive:
        {
            // Do we have a camera view (filled rendering?)
            if (view.fill() || !GlobalXYWnd().higherEntitySelectionPriority())
            {
                // Test for any visible elements (primitives, entities), but don't select child primitives
                AnySelector anyTester(selector, test);
                GlobalSceneGraph().foreachVisibleNodeInVolume(view, anyTester);
            }
            else
            {
                // We have an orthoview, here, select entities first

                // First, obtain all the selectable entities
                EntitySelector entityTester(selector, test);
                GlobalSceneGraph().foreachVisibleNodeInVolume(view, entityTester);

                // Now retrieve all the selectable primitives
                PrimitiveSelector primitiveTester(sel2, test);
                GlobalSceneGraph().foreachVisibleNodeInVolume(view, primitiveTester);
            }

            // Add the first selection crop to the target vector
            for (SelectionPool::iterator i = selector.begin(); i != selector.end(); ++i) {
                targetList.push_back(i->second);
            }

            // Add the secondary crop to the vector (if it has any entries)
            for (SelectionPool::iterator i = sel2.begin(); i != sel2.end(); ++i) {
                // Check for duplicates
                SelectablesList::iterator j;
                for (j = targetList.begin(); j != targetList.end(); ++j) {
                    if (*j == i->second) break;
                }
                // Insert if not yet in the list
                if (j == targetList.end()) {
                    targetList.push_back(i->second);
                }
            }
        }
        break;

        case eGroupPart:
        {
            // Retrieve all the selectable primitives of group nodes
            GroupChildPrimitiveSelector primitiveTester(selector, test);
            GlobalSceneGraph().foreachVisibleNodeInVolume(view, primitiveTester);

            // Add the selection crop to the target vector
            for (SelectionPool::iterator i = selector.begin(); i != selector.end(); ++i)
            {
                targetList.push_back(i->second);
            }
        }
        break;

        case eComponent:
        {
            ComponentSelector selectionTester(selector, test, componentMode);
            foreachSelected(selectionTester);

            for (SelectionPool::iterator i = selector.begin(); i != selector.end(); ++i)
            {
                targetList.push_back(i->second);
            }
        }
        break;
    } // switch
}
示例#15
0
/**
 * @brief Create the user settable window layout
 */
void MainFrame::Create (void)
{
	GtkWindow* window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));

	// do this here, because the commands are needed
	_sidebar = new ui::Sidebar();
	GtkWidget *sidebar = _sidebar->getWidget();

	// Tell the XYManager which window the xyviews should be transient for
	GlobalXYWnd().setGlobalParentWindow(window);

	GlobalWindowObservers_connectTopLevel(window);

	gtk_window_set_transient_for(ui::Splash::Instance().getWindow(), window);

#ifndef _WIN32
	{
		GdkPixbuf* pixbuf = gtkutil::getLocalPixbuf(ui::icons::ICON);
		if (pixbuf != 0) {
			gtk_window_set_icon(window, pixbuf);
			g_object_unref(pixbuf);
		}
	}
#endif

	gtk_widget_add_events(GTK_WIDGET(window), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK);
	g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(mainframe_delete), this);

	m_position_tracker.connect(window);

	g_MainWindowActive.connect(window);

	GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(window), vbox);
	gtk_widget_show(vbox);

	GlobalEventManager().connect(GTK_OBJECT(window));
	GlobalEventManager().connectAccelGroup(GTK_WINDOW(window));

	m_nCurrentStyle = eSplit;

	// Create the Filter menu entries
	ui::FiltersMenu::addItemsToMainMenu();

	// Retrieve the "main" menubar from the UIManager
	GtkMenuBar* mainMenu = GTK_MENU_BAR(GlobalUIManager().getMenuManager()->get("main"));
	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(mainMenu), false, false, 0);

	// Instantiate the ToolbarCreator and retrieve the standard toolbar widget
	ui::ToolbarCreator toolbarCreator;

	GtkToolbar* generalToolbar = toolbarCreator.getToolbar("view");
	gtk_widget_show(GTK_WIDGET(generalToolbar));

	GlobalSelectionSetManager().init(generalToolbar);

	// Pack it into the main window
	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(generalToolbar), FALSE, FALSE, 0);

	GtkWidget* main_statusbar = create_main_statusbar(m_pStatusLabel);
	gtk_box_pack_end(GTK_BOX(vbox), main_statusbar, FALSE, TRUE, 2);

	GtkWidget* hbox = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), TRUE, TRUE, 0);
	gtk_widget_show(hbox);

	GtkToolbar* main_toolbar_v = toolbarCreator.getToolbar("edit");
	gtk_widget_show(GTK_WIDGET(main_toolbar_v));

	gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(main_toolbar_v), FALSE, FALSE, 0);


	// Connect the window position tracker
	_windowPosition.loadFromPath(RKEY_WINDOW_STATE);

	// Yes, connect the position tracker, this overrides the existing setting.
	_windowPosition.connect(window);

	int startMonitor = GlobalRegistry().getInt(RKEY_MULTIMON_START_MONITOR);
	if (startMonitor < gtkutil::MultiMonitor::getNumMonitors()) {
		// Load the correct coordinates into the position tracker
		_windowPosition.fitToScreen(gtkutil::MultiMonitor::getMonitor(startMonitor), 0.8f, 0.8f);
	}

	// Apply the position
	_windowPosition.applyPosition();

	int windowState = string::toInt(GlobalRegistry().getAttribute(RKEY_WINDOW_STATE, "state"), GDK_WINDOW_STATE_MAXIMIZED);
	if (windowState & GDK_WINDOW_STATE_MAXIMIZED)
		gtk_window_maximize(window);

	m_window = window;

	gtk_widget_show(GTK_WIDGET(window));

	// The default XYView pointer
	XYWnd* xyWnd;

	GtkWidget* mainHBox = gtk_hbox_new(0, 0);
	gtk_box_pack_start(GTK_BOX(hbox), mainHBox, TRUE, TRUE, 0);
	gtk_widget_show(mainHBox);

	int w, h;
	gtk_window_get_size(window, &w, &h);

	// camera
	m_pCamWnd = GlobalCamera().newCamWnd();
	GlobalCamera().setCamWnd(m_pCamWnd);
	GlobalCamera().setParent(m_pCamWnd, window);
	GtkWidget* camera = m_pCamWnd->getWidget();

	// Allocate the three ortho views
	xyWnd = GlobalXYWnd().createXY();
	xyWnd->setViewType(XY);
	GtkWidget* xy = xyWnd->getWidget();

	XYWnd* yzWnd = GlobalXYWnd().createXY();
	yzWnd->setViewType(YZ);
	GtkWidget* yz = yzWnd->getWidget();

	XYWnd* xzWnd = GlobalXYWnd().createXY();
	xzWnd->setViewType(XZ);
	GtkWidget* xz = xzWnd->getWidget();

	// split view (4 views)
	GtkHPaned* split = create_split_views(camera, yz, xy, xz);
	gtk_box_pack_start(GTK_BOX(mainHBox), GTK_WIDGET(split), TRUE, TRUE, 0);

	// greebo: In any layout, there is at least the XY view present, make it active
	GlobalXYWnd().setActiveXY(xyWnd);

	PreferencesDialog_constructWindow(window);

	GlobalGrid().addGridChangeCallback(FreeCaller<XY_UpdateAllWindows> ());

	/* enable button state tracker, set default states for begin */
	GlobalUndoSystem().trackerAttach(m_saveStateTracker);

	gtk_box_pack_start(GTK_BOX(mainHBox), GTK_WIDGET(sidebar), FALSE, FALSE, 0);

	// Start the autosave timer so that it can periodically check the map for changes
	map::AutoSaver().startTimer();
}
示例#16
0
void XY_UpdateAllWindows (void)
{
	if (g_pParentWnd != 0) {
		GlobalXYWnd().updateAllViews();
	}
}
示例#17
0
void RegularLayout::activate() {

	GtkWindow* parent = GlobalMainFrame().getTopLevelWindow();

	// Create a new camera window and parent it
	_camWnd = GlobalCamera().createCamWnd();
	 // greebo: The mainframe window acts as parent for the camwindow
	_camWnd->setContainer(parent);
	// Pack in the camera window
	GtkWidget* camWindow = gtkutil::FramedWidget(_camWnd->getWidget());

	// Allocate a new OrthoView and set its ViewType to XY
	XYWndPtr xyWnd = GlobalXYWnd().createEmbeddedOrthoView();
    xyWnd->setViewType(XY);
    // Create a framed window out of the view's internal widget
    GtkWidget* xyView = gtkutil::FramedWidget(xyWnd->getWidget());

	// Create the texture window
	GtkWidget* texWindow = gtkutil::FramedWidget(
		GlobalTextureBrowser().constructWindow(parent)
	);

	// Now pack those widgets into the paned widgets
	gtkutil::Paned texCamPane(gtkutil::Paned::Vertical);

	// First, pack the texwindow and the camera
	texCamPane.setFirstChild(camWindow, true); // allow shrinking
	texCamPane.setSecondChild(texWindow, true); // allow shrinking

	_regular.texCamPane = texCamPane.getWidget();
    
    // Depending on the viewstyle, pack the xy left or right
	gtkutil::Paned horizPane(gtkutil::Paned::Horizontal);

    if (_regularLeft)
	{
		horizPane.setFirstChild(_regular.texCamPane, true); // allow shrinking
		horizPane.setSecondChild(xyView, true); // allow shrinking
    }
    else
	{
		// This is "regular", put the xyview to the left
		horizPane.setFirstChild(xyView, true); // allow shrinking
		horizPane.setSecondChild(_regular.texCamPane, true); // allow shrinking
    }

	_regular.horizPane = horizPane.getWidget();
    
	// Retrieve the main container of the main window
	GtkWidget* mainContainer = GlobalMainFrame().getMainContainer();
	gtk_container_add(GTK_CONTAINER(mainContainer), GTK_WIDGET(_regular.horizPane));

	// Set some default values for the width and height
	gtk_paned_set_position(GTK_PANED(_regular.horizPane), 500);
	gtk_paned_set_position(GTK_PANED(_regular.texCamPane), 350);

	// Connect the pane position trackers
	_regular.posHPane.connect(_regular.horizPane);
	_regular.posTexCamPane.connect(_regular.texCamPane);
	
	// Now attempt to load the paned positions from the registry
	restoreStateFromPath(RKEY_REGULAR_ROOT);
	
    GlobalGroupDialog().showDialogWindow();

	// greebo: Now that the dialog is shown, tell the Entity Inspector to reload 
	// the position info from the Registry once again.
	GlobalEntityInspector().restoreSettings();

	GlobalGroupDialog().hideDialogWindow();

	gtk_widget_show_all(mainContainer);

	// Hide the camera toggle option for non-floating views
    GlobalUIManager().getMenuManager().setVisibility("main/view/cameraview", false);
	// Hide the console/texture browser toggles for non-floating/non-split views
	GlobalUIManager().getMenuManager().setVisibility("main/view/textureBrowser", false);	
}
void SplitPaneLayout::restoreStateFromPath(const std::string& path)
{
	if (GlobalRegistry().keyExists(path + "/pane[@name='horizontal']"))
	{
		_splitPane.posHPane.loadFromPath(path + "/pane[@name='horizontal']");
		_splitPane.posHPane.applyPosition();
	}

	if (GlobalRegistry().keyExists(path + "/pane[@name='vertical1']"))
	{
		_splitPane.posVPane1.loadFromPath(path + "/pane[@name='vertical1']");
		_splitPane.posVPane1.applyPosition();
	}

	if (GlobalRegistry().keyExists(path + "/pane[@name='vertical2']"))
	{
		_splitPane.posVPane2.loadFromPath(path + "/pane[@name='vertical2']");
		_splitPane.posVPane2.applyPosition();
	}

	int topLeft = string::convert<int>(GlobalRegistry().getAttribute(RKEY_SPLITPANE_VIEWTYPES, "topleft"), -1);
	int topRight = string::convert<int>(GlobalRegistry().getAttribute(RKEY_SPLITPANE_VIEWTYPES, "topright"), XY);
	int bottomLeft = string::convert<int>(GlobalRegistry().getAttribute(RKEY_SPLITPANE_VIEWTYPES, "bottomleft"), YZ);
	int bottomRight = string::convert<int>(GlobalRegistry().getAttribute(RKEY_SPLITPANE_VIEWTYPES, "bottomright"), XZ);

	// Load mapping, but leave widget pointer NULL
	_quadrants[QuadrantTopLeft] = QuadrantInfo();
	_quadrants[QuadrantTopLeft].isCamera = (topLeft == -1);

	if (!_quadrants[QuadrantTopLeft].isCamera)
	{
		_quadrants[QuadrantTopLeft].xyWnd = GlobalXYWnd().createEmbeddedOrthoView();
		_quadrants[QuadrantTopLeft].xyWnd->setViewType(static_cast<EViewType>(topLeft));
	}

	_quadrants[QuadrantTopRight] = QuadrantInfo();
	_quadrants[QuadrantTopRight].isCamera = (topRight == -1);

	if (!_quadrants[QuadrantTopRight].isCamera)
	{
		_quadrants[QuadrantTopRight].xyWnd = GlobalXYWnd().createEmbeddedOrthoView();
		_quadrants[QuadrantTopRight].xyWnd->setViewType(static_cast<EViewType>(topRight));
	}

	_quadrants[QuadrantBottomLeft] = QuadrantInfo();
	_quadrants[QuadrantBottomLeft].isCamera = (bottomLeft == -1);

	if (!_quadrants[QuadrantBottomLeft].isCamera)
	{
		_quadrants[QuadrantBottomLeft].xyWnd = GlobalXYWnd().createEmbeddedOrthoView();
		_quadrants[QuadrantBottomLeft].xyWnd->setViewType(static_cast<EViewType>(bottomLeft));
	}

	_quadrants[QuadrantBottomRight] = QuadrantInfo();
	_quadrants[QuadrantBottomRight].isCamera = (bottomRight == -1);

	if (!_quadrants[QuadrantBottomRight].isCamera)
	{
		_quadrants[QuadrantBottomRight].xyWnd = GlobalXYWnd().createEmbeddedOrthoView();
		_quadrants[QuadrantBottomRight].xyWnd->setViewType(static_cast<EViewType>(bottomRight));
	}
}
示例#19
0
void Selection_NudgeRight (void)
{
	UndoableCommand undo("nudgeSelectedRight");
	NudgeSelection(eNudgeRight, GlobalGrid().getGridSize(), GlobalXYWnd().getActiveViewType());
}
void FloatingOrthoView::onFocus(wxFocusEvent& ev)
{
	// Let the global XYWndManager know about the focus change
	GlobalXYWnd().setActiveXY(_id);
	ev.Skip();
}
示例#21
0
void XYWndManager::zoom100() {
	GlobalXYWnd().setScale(1);
}