summaryrefslogtreecommitdiffstats
path: root/SidebarManager.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-12-24 01:04:02 +0100
committerneoraider <devnull@localhost>2007-12-24 01:04:02 +0100
commit953a6ff48ac6c46a0d81bedb0fbdafe5d637666e (patch)
tree2e918dd669dd5c34f59a4aed3cb3a71b1c0d2a3a /SidebarManager.cpp
parent9b5296b04eef553dba951fa13936184b0f30cded (diff)
downloadzoomedit-953a6ff48ac6c46a0d81bedb0fbdafe5d637666e.tar
zoomedit-953a6ff48ac6c46a0d81bedb0fbdafe5d637666e.zip
zoomedit: Use tools for event handling and rendering
Diffstat (limited to 'SidebarManager.cpp')
-rw-r--r--SidebarManager.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/SidebarManager.cpp b/SidebarManager.cpp
index 0eb1f7b..393d748 100644
--- a/SidebarManager.cpp
+++ b/SidebarManager.cpp
@@ -3,10 +3,9 @@
SidebarManager::SidebarManager(Window *window)
- : sidebarToolbox(window), sidebarView(&window->getEditManager()),
- sidebarAdd(&window->getEditManager()), toolAddPolygon(&window->getEditManager())
+ : sidebarToolbox(window), toolAddPolygon(&window->getEditManager())
{
- this->editor = &window->getEditManager();
+ this->window = window;
activeSidebar = NULL;
sidebar = gtk_vbox_new(FALSE, 0);
@@ -16,7 +15,7 @@ SidebarManager::SidebarManager(Window *window)
gtk_box_pack_start(GTK_BOX(sidebar), gtk_hseparator_new(), FALSE, FALSE, 5);
- toolLabel = gtk_label_new(sidebarToolbox.getActiveTool()->getName());
+ toolLabel = gtk_label_new(sidebarToolbox.getActiveTool().getName());
gtk_box_pack_start(GTK_BOX(sidebar), toolLabel, FALSE, FALSE, 0);
@@ -40,13 +39,7 @@ SidebarManager::~SidebarManager() {
void SidebarManager::update() {
Sidebar *newSidebar = activeSidebar;
- switch(editor->getMode()) {
- case EditManager::VIEW:
- newSidebar = &sidebarView;
- break;
- case EditManager::ADD:
- newSidebar = &sidebarAdd;
- }
+ newSidebar = window->getActiveTool()->getSidebar();
if(activeSidebar != newSidebar) {
if(activeSidebar)
@@ -57,7 +50,7 @@ void SidebarManager::update() {
activeSidebar = newSidebar;
}
- gtk_label_set_text(GTK_LABEL(toolLabel), sidebarToolbox.getActiveTool()->getName());
+ gtk_label_set_text(GTK_LABEL(toolLabel), sidebarToolbox.getActiveTool().getName());
sidebarToolbox.update();
activeSidebar->update();