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

chatpage.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Form implementation generated from reading ui file 'chatpage.ui'
00003 **
00004 ** Created: Mon Jan 6 19:27:11 2003
00005 **      by: The User Interface Compiler ($Id: chatpage.cpp,v 1.4 2003/05/06 07:11:36 Sigma Exp $)
00006 **
00007 ** WARNING! All changes made in this file will be lost!
00008 ****************************************************************************/
00009 
00010 #include "chatpage.h"
00011 
00012 #include <qvariant.h>
00013 #include <qlistbox.h>
00014 #include <qtextedit.h>
00015 #include <qlayout.h>
00016 #include <qtooltip.h>
00017 #include <qwhatsthis.h>
00018 #include <qimage.h>
00019 #include <qpixmap.h>
00020 
00021 #include <qsplitter.h>
00022 #include <qvaluelist.h>
00023 
00024 #include "mtpbrowser.h"
00025 
00026 /* 
00027  *  Constructs a ChatPage as a child of 'parent', with the 
00028  *  name 'name' and widget flags set to 'f'.
00029  */
00030 ChatPage::ChatPage( QWidget* parent, const char* name, WFlags fl )
00031     : Master( parent, name, fl )
00032 {
00033     if ( !name )
00034   setName( "ChatPage" );
00035         
00036     ChatPageLayout = new QGridLayout( this, 1, 1, 6, 6, "ChatPageLayout");
00037     
00038     QSplitter *vsplit = new QSplitter(Qt::Vertical,this);
00039     QSplitter *hsplit = new QSplitter(Qt::Horizontal,vsplit);
00040   
00041  
00042     chat_view = new MtpBrowser(hsplit,"chat_view");
00043     users_box = new QListBox(hsplit,"users_box");
00044 
00045     users_box->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)7, 0, 0, users_box->sizePolicy().hasHeightForWidth() ) );
00046     users_box->setMinimumSize( QSize( 75, 200 ) );
00047 
00048     chat_edit = new QTextEdit(vsplit,"chat_edit");
00049 
00050     chat_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, chat_edit->sizePolicy().hasHeightForWidth() ) );
00051     chat_edit->setMinimumSize( QSize( 300, 50 ) );
00052     chat_edit->setFrameShape( QTextEdit::LineEditPanel );
00053 
00054    
00055     QValueList<int> list = vsplit->sizes();
00056     int tmp = list[1];
00057     list[1] = 0; // Strange things happend here...
00058     list[0] += tmp-list[1];
00059     vsplit->setSizes(list);
00060     
00061     list = hsplit->sizes();
00062     tmp = list[1];
00063     list[1] = 0; // Strange things happend here...
00064     list[0] += tmp-list[1];
00065     hsplit->setSizes(list);  
00066     
00067        ChatPageLayout->addWidget(vsplit,0,0);
00068        /* 
00069     ChatPageLayout = new QGridLayout( this, 1, 1, 6, 6, "ChatPageLayout"); 
00070 
00071     chat_edit = new QTextEdit( this, "chat_edit" );
00072     chat_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, chat_edit->sizePolicy().hasHeightForWidth() ) );
00073     chat_edit->setMaximumSize( QSize( 32767, 50 ) );
00074     chat_edit->setFrameShape( QTextEdit::LineEditPanel );
00075 
00076     ChatPageLayout->addMultiCellWidget( chat_edit, 1, 1, 0, 1 );
00077 
00078     users_box = new QListBox( this, "users_box" );
00079     users_box->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)7, 0, 0, users_box->sizePolicy().hasHeightForWidth() ) );
00080     users_box->setMaximumSize( QSize( 75, 32767 ) );
00081 
00082     ChatPageLayout->addWidget( users_box, 0, 1 );
00083 
00084     chat_view = new MtpBrowser( this, "chat_view" );
00085 
00086     ChatPageLayout->addWidget( chat_view, 0, 0 );
00087     languageChange();
00088     */
00089     resize( QSize(573, 361).expandedTo(minimumSizeHint()) );
00090     repaint();
00091 }
00092 
00093 /*
00094  *  Destroys the object and frees any allocated resources
00095  */
00096 ChatPage::~ChatPage()
00097 {
00098     // no need to delete child widgets, Qt does it all for us
00099 }
00100 
00101 /*
00102  *  Sets the strings of the subwidgets using the current
00103  *  language.
00104  */
00105 void ChatPage::languageChange()
00106 {
00107     setCaption( tr( "Form1" ) );
00108     QToolTip::add( chat_edit, tr( "SHIFT+UP/DOWN for history - CTRL+ENTER to insert a new line" ) );
00109 }
00110 
00111 void ChatPage::returnPressed()
00112 {
00113     qWarning( "ChatPage::returnPressed(): Not implemented yet" );
00114 }
00115 

Generated on Sat May 10 15:09:26 2003 for qnet by doxygen1.3