specialising WorldspaceWdiget into paged and unpaged subclasses

actorid
Marc Zinnschlag 11 years ago
parent 7386d3eb0b
commit 397921e457

@ -64,7 +64,7 @@ opencs_units (view/world
)
opencs_units (view/render
scenewidget worldspacewidget
scenewidget worldspacewidget pagedworldspacewidget unpagedworldspacewidget
)
opencs_units_noqt (view/render

@ -0,0 +1,6 @@
#include "pagedworldspacewidget.hpp"
CSVRender::PagedWorldspaceWidget::PagedWorldspaceWidget (QWidget *parent)
: WorldspaceWidget (parent)
{}

@ -0,0 +1,18 @@
#ifndef OPENCS_VIEW_PAGEDWORLDSPACEWIDGET_H
#define OPENCS_VIEW_PAGEDWORLDSPACEWIDGET_H
#include "worldspacewidget.hpp"
namespace CSVRender
{
class PagedWorldspaceWidget : public WorldspaceWidget
{
Q_OBJECT
public:
PagedWorldspaceWidget (QWidget *parent);
};
}
#endif

@ -0,0 +1,6 @@
#include "unpagedworldspacewidget.hpp"
CSVRender::UnpagedWorldspaceWidget::UnpagedWorldspaceWidget (QWidget *parent)
: WorldspaceWidget (parent)
{}

@ -0,0 +1,18 @@
#ifndef OPENCS_VIEW_UNPAGEDWORLDSPACEWIDGET_H
#define OPENCS_VIEW_UNPAGEDWORLDSPACEWIDGET_H
#include "worldspacewidget.hpp"
namespace CSVRender
{
class UnpagedWorldspaceWidget : public WorldspaceWidget
{
Q_OBJECT
public:
UnpagedWorldspaceWidget (QWidget *parent);
};
}
#endif

@ -9,7 +9,8 @@
#include "../filter/filterbox.hpp"
#include "../render/worldspacewidget.hpp"
#include "../render/pagedworldspacewidget.hpp"
#include "../render/unpagedworldspacewidget.hpp"
#include "tablebottombox.hpp"
#include "creator.hpp"
@ -33,7 +34,10 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D
SceneToolbar *toolbar = new SceneToolbar (48, this);
mScene = new CSVRender::WorldspaceWidget (this);
if (id.getId()[0]=='#')
mScene = new CSVRender::PagedWorldspaceWidget (this);
else
mScene = new CSVRender::UnpagedWorldspaceWidget (this);
SceneToolMode *tool = mScene->makeNavigationSelector (toolbar);
toolbar->addTool (tool);

Loading…
Cancel
Save