kivio_stackbar.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
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#ifndef KIVIO_STACK_BAR_H
20#define KIVIO_STACK_BAR_H
21
22#include <tqdockwindow.h>
23#include <tqptrdict.h>
24
25namespace Kivio {
26 class DragBarButton;
27}
28
29class KivioView;
30
31using namespace Kivio;
32
33class KivioStackBar : public TQDockWindow
34{
35 TQ_OBJECT
36
37 public:
38 KivioStackBar(KivioView* view, TQWidget* parent=0, const char* name=0);
39 ~KivioStackBar();
40
41 TQWidget* findPage(const TQString& name);
42 TQWidget* findPage(DragBarButton*);
43 void insertPage(TQWidget*, const TQString&);
44 void removePage(TQWidget*);
45 void deletePageAndButton(DragBarButton*);
46 void showPage(TQWidget*);
47
48 TQWidget* visiblePage() const { return m_visiblePage; }
49
50 KivioView* view() const { return m_view; }
51
52 signals:
53 void aboutToShow(TQWidget*);
54 void beginDragPage(DragBarButton*);
55 void finishDragPage(DragBarButton*);
56 void deleteButton(DragBarButton*, TQWidget*, KivioStackBar*);
57
58 protected:
59 virtual void closeEvent(TQCloseEvent*);
60
61 protected slots:
62 void showButtonPage();
63 void buttonBeginDrag();
64 void buttonFinishDrag();
65 void slotDeleteButton(DragBarButton*);
66 void newPlace(TQDockWindow::Place place);
67
68 private:
69 TQPtrDict<TQWidget> m_data;
70 TQWidget* m_visiblePage;
71 KivioView* m_view;
72};
73
74#endif