00001 00002 #include <qwidget.h> 00003 #include <qscrollview.h> 00004 #include <qdialog.h> 00005 #include <qlistbox.h> 00006 #include <qlineedit.h> 00007 #include <qcombobox.h> 00008 #include <qlabel.h> 00009 #include <qcheckbox.h> 00010 #include <qpopupmenu.h> 00011 00012 class QMyConnectionItem 00013 { 00014 public: 00015 QString ServerName; 00016 QString UserName; 00017 QString ServerIP; 00018 int Width; 00019 int Height; 00020 int FullScreen; 00021 }; 00022 00023 class QMyDialog: public QDialog 00024 { 00025 Q_OBJECT 00026 public: 00027 QMyDialog(QWidget*); 00028 ~QMyDialog(); 00029 public: 00030 QListBox* ListBox; 00031 QLabel* Label1; 00032 QLineEdit* ServerNameEdit; 00033 QLabel* Label2; 00034 QLineEdit* UserNameEdit; 00035 QLabel* Label3; 00036 QLineEdit* IPEdit; 00037 QLineEdit* WidthEdit; 00038 QLineEdit* HeightEdit; 00039 QComboBox* WidthHeightBox; 00040 QPushButton* AddButton; 00041 QPushButton* EditButton; 00042 QPushButton* SaveButton; 00043 QPushButton* RemoveButton; 00044 QCheckBox* FullScreenCheckBox; 00045 public slots: 00046 void ComboChanged(int); 00047 void AddClicked(); 00048 void EditClicked(); 00049 void SaveClicked(); 00050 void RemoveClicked(); 00051 void ListBoxChanged(); 00052 void ListBoxSelected(int); 00053 public: 00054 QString ServerName; 00055 QString UserName; 00056 QString ServerIP; 00057 int Width; 00058 int Height; 00059 int FullScreen; 00060 QMyConnectionItem* ConnectionList[10]; 00061 protected slots: 00062 void accept(); 00063 }; 00064 00065 class QMyScrollView: public QScrollView 00066 { 00067 Q_OBJECT 00068 public: 00069 QMyScrollView(); 00070 ~QMyScrollView(); 00071 void keyPressEvent(QKeyEvent*); 00072 void keyReleaseEvent(QKeyEvent*); 00073 void showEvent(QShowEvent*); 00074 void show(); 00075 void polish(); 00076 void timerEvent(QTimerEvent*); 00077 public: 00078 int timer_id; 00079 }; 00080 00081 class QMyMainWindow: public QWidget 00082 { 00083 Q_OBJECT 00084 public: 00085 QMyMainWindow(); 00086 ~QMyMainWindow(); 00087 void paintEvent(QPaintEvent*); 00088 void mouseMoveEvent(QMouseEvent*); 00089 void mousePressEvent(QMouseEvent*); 00090 void mouseReleaseEvent(QMouseEvent*); 00091 void wheelEvent(QWheelEvent*); 00092 void closeEvent(QCloseEvent*); 00093 void timerEvent(QTimerEvent*); 00094 public slots: 00095 void dataReceived(); 00096 void MemuClicked(int); 00097 public: 00098 QPopupMenu* PopupMenu; 00099 int timer_id; 00100 int mx; 00101 int my; 00102 }; 00103
1.4.2