00001 //-------------------------------------------------------------------- 00002 // 00003 // File: TxqActionItem.h 00004 // 00005 // Purpose: Class to create a QComboBox widget with a list of actions 00006 // to insert into a TxqEditTable 00007 // 00008 // Version: $Id: TxqActionItem.h,v 1.2 2001/11/04 16:54:17 kgl Exp $ 00009 // 00010 // Copyright (c) 2001 by Tech-X Corporation. All rights reserved. 00011 // 00012 // Author: Kelly G. Luetkemeyer 00013 // 00014 //-------------------------------------------------------------------- 00015 00016 #ifndef TXQ_ACTION_ITEM_H 00017 #define TXQ_ACTION_ITEM_H 00018 00019 // Txq includes 00020 #include <txc_map.h> 00021 00022 // Qt includes 00023 #include <qtable.h> 00024 #include <qcombobox.h> 00025 00026 00032 class TxqActionItem: public QObject, public QTableItem 00033 { 00034 Q_OBJECT 00035 public: 00036 00043 TxqActionItem( QTable *t, EditType e , const QString s); 00044 00049 QWidget *createEditor() const; 00050 00055 void setContentFromEditor( QWidget *w ); 00056 00061 void setText( const QString &newText ); 00062 00067 void setActionMap( const TXSTD::map<int, QString> &m, int action =0) { 00068 actionMap = m; 00069 setText(actionMap[action]); 00070 } 00071 00076 TXSTD::map<int, QString> getActionMap() {return actionMap;} 00077 00082 void setActionItem(int action); 00083 00088 void setActionItem(QString action); 00089 00093 int getActionItem() {return comboBox->currentItem();} 00094 00098 QString getActionItemName() {return comboBox->currentText();} 00099 00100 signals: 00101 00105 void actionChanged(QString); 00106 00107 public slots: 00108 00113 void activated(int action); 00114 00115 protected: 00119 TXSTD::map<int , QString> actionMap; 00120 00121 private: 00122 00126 QComboBox *comboBox; 00127 00128 00129 }; 00130 00131 00132 #endif
Copyright Tech-X Corporation, all rights reserved.