Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TxqListDlog.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 //
00003 // File:    TxqListDlog.h
00004 //
00005 // Purpose: This class is a QDialog which holds a QListBox
00006 //           which can list text and set the text to bold when highlighted.
00007 //
00008 // Version: $Id: TxqListDlog.h,v 1.7 2002/03/21 23:16:48 kgl Exp $
00009 //
00010 // Copyright (c) 2002 by Tech-X Corporation.  All rights reserved.
00011 //
00012 // Author:  Kelly G. Luetkemeyer
00013 //
00014 //--------------------------------------------------------------------
00015 
00016 #ifndef TXQ_LIST_DLOG_H
00017 #define TXQ_LIST_DLOG_H
00018 
00019 // tx includes
00020 #include <txc_map.h>
00021 
00022 // Qt includes
00023 #include <qlistbox.h>
00024 #include <qdialog.h>
00025 #include <qlayout.h>
00026 #include <qpushbutton.h>
00027 #include <qwhatsthis.h>
00028 
00029 // Txq includes
00030 #include <TxqListBoxText.h>
00031 
00040 class TxqListDlog : public QDialog
00041 { 
00042     Q_OBJECT
00043 
00044 public:
00045 
00060    TxqListDlog(  QWidget* parent = 0, 
00061                  const QString& okButtonText="&Ok",
00062                  const QString& applyButtonText="&Apply",
00063                  const QString& cancelButtonText="&Cancel",
00064                  const char* name = 0, 
00065                  bool modal = FALSE, WFlags fl = 0 );
00066 
00070    ~TxqListDlog();
00071 
00076   void insertItem(const QString s, bool bold=false);
00077 
00084   void selectItem(int idNumber, bool bold=false);
00085 
00091   void sort(bool order=true);
00092 
00093 signals:
00094 
00099   virtual void itemSelected(int idNumber);
00100 
00104    virtual void cancelButtonPressed();
00105 
00109    virtual void okButtonPressed();
00110 
00114    virtual void applyButtonPressed();
00115 
00120    virtual void applyButtonPressed(int);
00121 
00122 
00123 public slots:
00124 
00128   virtual bool close( bool alsoDelete );
00129 
00130 protected slots:
00131 
00136   virtual void selectItem(QListBoxItem* listItem);
00137 
00141    virtual void okClicked();
00142 
00146    virtual void applyClicked();
00147 
00151    virtual void cancelClicked();
00152 
00156    virtual void closeWindow();
00157 
00158 protected:
00159 
00164   QListBox* getListBox() {return listBox;}
00165 
00169    QVBoxLayout* dlogLayout;
00170 
00174    QHBoxLayout* buttonLayout;
00175 
00179    QListBox *listBox;
00180 
00184    QPushButton* buttonCancel;
00185 
00189    QPushButton* buttonOk;
00190 
00194    QPushButton* buttonApply;
00195 
00196 private:
00197 
00202   TXSTD::map<QString, int, less<QString> > nameMap;
00203 
00208   TXSTD::map<int, int> idMap;
00209 
00213   int masterIdNumber;
00214 
00219   bool sorted;
00220 
00221 };
00222 
00223 #endif 
Copyright Tech-X Corporation, all rights reserved.