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 
44 class aListBox:public QListBox
45 {
46  Q_OBJECT
47 public:
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;};
57 public slots:
58  virtual void setFocus();
59 
60 protected:
61 
62  virtual void keyPressEvent ( QKeyEvent *e );
63  void focusOutEvent ( QFocusEvent *e );
64 protected slots:
65  void doubleClickHandler(QListBoxItem *i);
66  // QVBoxLayout* layout1;
67 // QLabel * statusBar;
68 signals:
69  void keyArrowLRPressed();
70  void keyArrowLRPressed(const QString&);
71  void keyEnterPressed();
72  void lostFocus();
73  void sendMessage(const QString &);
74 private:
75  QListBox* listPrivate;
76 };
77 
78 
79 class aLineEdit:public QLineEdit
80 {
81  Q_OBJECT
82 public:
83  aLineEdit( QWidget* parent, const char* name = 0 );
84  ~aLineEdit();
85 
86 protected:
87  virtual void keyPressEvent ( QKeyEvent *e );
88 
89 private:
90  QTimer *timer;
91 
92 public slots:
93  void stopTimer();
94  virtual void setFocus();
95 protected slots:
96  void timerDone();
97  void timerRestart(const QString & s);
98 
99 signals:
100  void keyArrowPressed();
101  void delayTextChanged(const QString &);
102  void keyEnterPressed();
103  void sendMessage(const QString &);
104 };
105 
106 class aListView : public QListView
107 {
108  Q_OBJECT
109 public:
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();
116 protected:
117  virtual void keyPressEvent ( QKeyEvent *e );
118 
119 public 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 
131 protected slots:
132  void doubleClickHandler( QListViewItem *, const QPoint&, int col);
133 
134 signals:
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);
144 private:
145  QListViewItem* parentItem;
146  int columnClicked;
147  bool toSelect;
148 };
149 #endif
150 
virtual void keyPressEvent(QKeyEvent *e)
Definition: catalogformwidgets.cpp:92
aListView(QWidget *parent=0, const char *name=0, WFlags f=0)
Definition: catalogformwidgets.cpp:239
virtual void keyPressEvent(QKeyEvent *e)
Definition: catalogformwidgets.cpp:340
void show(QWidget *w, QFrame *fr)
Definition: catalogformwidgets.cpp:67
void clear()
Definition: catalogformwidgets.cpp:137
Definition: catalogformwidgets.h:44
void showMenu(QListViewItem *item, const QPoint &p, int)
Definition: catalogformwidgets.cpp:266
aListBox(QWidget *parent=0, const char *name=0, WFlags f=0)
Definition: catalogformwidgets.cpp:38
virtual void keyPressEvent(QKeyEvent *e)
Definition: catalogformwidgets.cpp:195
void insertItem(const QString &s, long idx, int index=-1)
Definition: catalogformwidgets.cpp:128
Definition: catalogformwidgets.h:106
void focusOutEvent(QFocusEvent *e)
Definition: catalogformwidgets.cpp:147
Definition: catalogformwidgets.h:79
~aListBox()
Definition: catalogformwidgets.cpp:56