kivio

mousetoolaction.cpp
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2005 Peter Simonsson
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#include "mousetoolaction.h"
20
21#include <tdetoolbar.h>
22#include <tdetoolbarbutton.h>
23#include <kdebug.h>
24
25namespace Kivio {
26
27MouseToolAction::MouseToolAction(const TQString& text, const TDEShortcut& cut,
28 TQObject* parent, const char* name)
29 : TDERadioAction(text, cut, parent, name)
30{
31}
32
33MouseToolAction::MouseToolAction(const TQString& text, const TDEShortcut& cut,
34 const TQObject* receiver, const char* slot,
35 TQObject* parent, const char* name)
36 : TDERadioAction(text, cut, receiver, slot, parent, name)
37{
38}
39
40MouseToolAction::MouseToolAction(const TQString& text, const TQIconSet& pix,
41 const TDEShortcut& cut,
42 TQObject* parent, const char* name)
43 : TDERadioAction(text, pix, cut, parent, name)
44{
45}
46
47MouseToolAction::MouseToolAction(const TQString& text, const TQString& pix,
48 const TDEShortcut& cut,
49 TQObject* parent, const char* name)
50 : TDERadioAction(text, pix, cut, parent, name)
51{
52}
53
54MouseToolAction::MouseToolAction(const TQString& text, const TQIconSet& pix,
55 const TDEShortcut& cut,
56 const TQObject* receiver, const char* slot,
57 TQObject* parent, const char* name)
58 : TDERadioAction(text, pix, cut, receiver, slot, parent, name)
59{
60}
61
62MouseToolAction::MouseToolAction(const TQString& text, const TQString& pix,
63 const TDEShortcut& cut,
64 const TQObject* receiver, const char* slot,
65 TQObject* parent, const char* name)
66 : TDERadioAction(text, pix, cut, receiver, slot, parent, name)
67{
68}
69
70MouseToolAction::MouseToolAction(TQObject* parent, const char* name)
71 : TDERadioAction(parent, name)
72{
73}
74
75MouseToolAction::~MouseToolAction()
76{
77}
78
79int MouseToolAction::plug(TQWidget* widget, int index)
80{
81 int usedIndex = TDERadioAction::plug(widget, index);
82
83 if(usedIndex == -1) {
84 return usedIndex;
85 }
86
87 if(::tqt_cast<TDEToolBar*>(widget)) {
88 TDEToolBar* toolBar = static_cast<TDEToolBar*>(widget);
89 TDEToolBarButton* button = toolBar->getButton(itemId(usedIndex));
90 connect(button, TQ_SIGNAL(doubleClicked(int)), this, TQ_SIGNAL(doubleClicked()));
91 }
92
93 return usedIndex;
94}
95
96}
97
98#include "mousetoolaction.moc"