summaryrefslogtreecommitdiffstats
path: root/ToolSelector.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 /ToolSelector.cpp
parent9b5296b04eef553dba951fa13936184b0f30cded (diff)
downloadzoomedit-953a6ff48ac6c46a0d81bedb0fbdafe5d637666e.tar
zoomedit-953a6ff48ac6c46a0d81bedb0fbdafe5d637666e.zip
zoomedit: Use tools for event handling and rendering
Diffstat (limited to 'ToolSelector.cpp')
-rw-r--r--ToolSelector.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/ToolSelector.cpp b/ToolSelector.cpp
index 2b61dee..46ee6d2 100644
--- a/ToolSelector.cpp
+++ b/ToolSelector.cpp
@@ -1,7 +1,7 @@
#include "ToolSelector.h"
-ToolSelector::ToolSelector(EditManager *editManager) {
+ToolSelector::ToolSelector(EditManager *editManager) : sidebar(editManager) {
this->editManager = editManager;
image = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_BUTTON);
@@ -11,3 +11,15 @@ ToolSelector::ToolSelector(EditManager *editManager) {
ToolSelector::~ToolSelector() {
g_object_unref(G_OBJECT(image));
}
+
+bool ToolSelector::buttonPress(unsigned int button) {
+ if(button != 1)
+ return false;
+
+ editManager->setSelectedObject(editManager->getHoveredObject());
+
+ editManager->redraw();
+ sidebar.update();
+
+ return true;
+}