kexi

kexiscrollview.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library 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 GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KEXISCROLLVIEW_H
22#define KEXISCROLLVIEW_H
23
24#include <tqscrollview.h>
25#include <tqtimer.h>
26
27class TQColor;
28class TQFont;
30
32
34class KEXIEXTWIDGETS_EXPORT KexiScrollView : public TQScrollView
35{
36 TQ_OBJECT
37
38
39 public:
40 KexiScrollView(TQWidget *parent, bool preview);
41 virtual ~KexiScrollView();
42
43 void setWidget(TQWidget *w);
44 void setSnapToGrid(bool enable, int gridSize=10);
45
46 void setResizingEnabled(bool enabled) { m_enableResizing = enabled; }
47 void setRecordNavigatorVisible(bool visible);
48
49 void setOuterAreaIndicatorVisible(bool visible) { m_outerAreaVisible = visible; }
50
51 void refreshContentsSizeLater(bool horizontal, bool vertical);
52 void updateNavPanelGeometry();
53
54 KexiRecordNavigator* recordNavigator() const;
55
56 inline bool preview() const { return m_preview; }
57
58 public slots:
60 virtual void refreshContentsSize();
61
62 signals:
63 void outerAreaClicked();
64 void resizingStarted();
65 void resizingEnded();
66
67 protected:
68 virtual void contentsMousePressEvent(TQMouseEvent * ev);
69 virtual void contentsMouseReleaseEvent(TQMouseEvent * ev);
70 virtual void contentsMouseMoveEvent(TQMouseEvent * ev);
71 virtual void drawContents( TQPainter * p, int clipx, int clipy, int clipw, int cliph );
72 virtual void leaveEvent( TQEvent *e );
73 virtual void setHBarGeometry( TQScrollBar & hbar, int x, int y, int w, int h );
74 void setupPixmapBuffer(TQPixmap& pixmap, const TQString& text, int lines);
75
76 bool m_resizing;
77 bool m_enableResizing;
78 TQWidget *m_widget;
79
80 int m_gridSize;
81 TQFont m_helpFont;
82 TQColor m_helpColor;
83 TQTimer m_delayedResize;
85 TQScrollView::ScrollBarMode m_vsmode, m_hsmode;
86 bool m_snapToGrid : 1;
87 bool m_preview : 1;
88 bool m_smodeSet : 1;
89 bool m_outerAreaVisible : 1;
90 KexiRecordNavigator* m_scrollViewNavPanel;
91};
92
93#endif
94
KexiRecordNavigator class provides a record navigator.
The scrollview which includes KexiDBForm.
TQScrollView::ScrollBarMode m_vsmode
for refreshContentsSizeLater()