Ananas Library 0.9.5
catalogformwidgets.h
1/****************************************************************************
2** $Id: catalogformwidgets.h,v 1.12 2005/12/19 12:41:27 gr Exp $
3**
4** Catalogue metadata object implementation file of
5** Ananas application library
6**
7** Created : 20031201
8**
9** Copyright (C) 2003-2004 Grigory Panov, Yoshkar-Ola.
10**
11** This file is part of the Designer application of the Ananas
12** automation accounting system.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21**
22** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
23** See http://www.leaderit.ru/gpl/ for GPL licensing information.
24**
25** Contact org@leaderit.ru if any conditions of this licensing are
26** not clear to you.
27**
28**********************************************************************/
29#ifndef CATALOGFORMWIDGET_H
30#define CATALOGFORMWIDGET_H
31
32#include <stdlib.h>
33#include <qwidget.h>
34#include <qtimer.h>
35#include <qlistbox.h>
36#include <qlineedit.h>
37#include <qlistview.h>
38#include <qlayout.h>
39#include <qlabel.h>
40#include <qevent.h>
41#include <qpopupmenu.h>
42//class QVBoxLayout;
43
44class aListBox:public QListBox
45{
46 Q_OBJECT
47public:
48 aListBox(QWidget *parent = 0, const char* name = 0, WFlags f = 0);
49 ~aListBox();
50 void insertItem(const QString &s, long idx, int index = -1);
51 void show(QWidget *w, QFrame *fr);//, QLabel *lb);
52
53 long getId(int ind) { return atol(listPrivate->text(ind).ascii()); };
54
55 void clear();
56 //void setId(long idx) {id = idx;};
57public slots:
58 virtual void setFocus();
59
60protected:
61
62 virtual void keyPressEvent ( QKeyEvent *e );
63 void focusOutEvent ( QFocusEvent *e );
64protected slots:
65 void doubleClickHandler(QListBoxItem *i);
66 // QVBoxLayout* layout1;
67// QLabel * statusBar;
68signals:
69 void keyArrowLRPressed();
70 void keyArrowLRPressed(const QString&);
71 void keyEnterPressed();
72 void lostFocus();
73 void sendMessage(const QString &);
74private:
75 QListBox* listPrivate;
76};
77
78
79class aLineEdit:public QLineEdit
80{
81 Q_OBJECT
82public:
83 aLineEdit( QWidget* parent, const char* name = 0 );
84 ~aLineEdit();
85
86protected:
87 virtual void keyPressEvent ( QKeyEvent *e );
88
89private:
90 QTimer *timer;
91
92public slots:
93 void stopTimer();
94 virtual void setFocus();
95protected slots:
96 void timerDone();
97 void timerRestart(const QString & s);
98
99signals:
100 void keyArrowPressed();
101 void delayTextChanged(const QString &);
102 void keyEnterPressed();
103 void sendMessage(const QString &);
104};
105
106class aListView : public QListView
107{
108 Q_OBJECT
109public:
110 aListView(QWidget* parent = 0, const char* name = 0, WFlags f = 0);
111 ~aListView();
112
113 QPopupMenu *menu;
114 void setDestination(const bool dest);
115 bool getDestination();
116protected:
117 virtual void keyPressEvent ( QKeyEvent *e );
118
119public slots:
120
121 void showMenu( QListViewItem* item, const QPoint& p, int);
122 void newItem();
123 void newGroup();
124 void delItem();
125 void markDeleted();
126 void undoMarkDeleted();
127 void edit();
128 void select();
129 virtual void setFocus();
130
131protected slots:
132 void doubleClickHandler( QListViewItem *, const QPoint&, int col);
133
134signals:
135
136 void sendMessage(const QString &);
137 void newItemRequest(QListViewItem* parentItem);
138 void newGroupRequest(QListViewItem* parentItem);
139 void delItemRequest(QListViewItem* item);
140 void markDeletedRequest(QListViewItem* item);
141 void undoMarkDeletedRequest(QListViewItem* item);
142 void editRequest(QListViewItem* item, int columnClicked);
143 void selectRequest(QListViewItem* item);
144private:
145 QListViewItem* parentItem;
146 int columnClicked;
147 bool toSelect;
148};
149#endif
150
virtual void keyPressEvent(QKeyEvent *e)
Definition catalogformwidgets.cpp:195
void insertItem(const QString &s, long idx, int index=-1)
Definition catalogformwidgets.cpp:128
void clear()
Definition catalogformwidgets.cpp:137
virtual void keyPressEvent(QKeyEvent *e)
Definition catalogformwidgets.cpp:92
void focusOutEvent(QFocusEvent *e)
Definition catalogformwidgets.cpp:147
~aListBox()
Definition catalogformwidgets.cpp:56
aListBox(QWidget *parent=0, const char *name=0, WFlags f=0)
Definition catalogformwidgets.cpp:38
void show(QWidget *w, QFrame *fr)
Definition catalogformwidgets.cpp:67
void showMenu(QListViewItem *item, const QPoint &p, int)
Definition catalogformwidgets.cpp:266
virtual void keyPressEvent(QKeyEvent *e)
Definition catalogformwidgets.cpp:340
aListView(QWidget *parent=0, const char *name=0, WFlags f=0)
Definition catalogformwidgets.cpp:239