QDockWindow* CGLWin::_createDockWidgetBar(QWidget *parent, const QString& appdir) { QDockWindow* p = new QDockWindow( QDockWindow::InDock, this ); p->setResizeEnabled(true); p->setCloseMode(QDockWindow::Always); addToolBar( p, Qt::DockLeft ); QToolBox* pToolBox = new QToolBox(p); p->setWidget(pToolBox); p->setFixedExtentWidth( 200 ); p->setCaption("Object List"); setDockEnabled( p, Qt::DockTop, FALSE ); setDockEnabled( p, Qt::DockBottom, FALSE ); //first node m_pListViews = new CObjectListView(m_pGLUIWin->m_SceneGraph, pToolBox); pToolBox->addItem(m_pListViews, "Objects"); /* //second node m_pMaterialTree = new CMaterialTree(appdir, pActiveSceneNode, pToolBox); pToolBox->addItem(m_pMaterialTree, "Materials"); */ return p; }
MsgEdit::MsgEdit(QWidget *parent, UserWnd *userWnd) : QMainWindow(parent, NULL, 0) { m_userWnd = userWnd; m_msg = NULL; m_bTyping = false; m_type = NO_TYPE; m_flags = 0; m_retry.msg = NULL; m_bReceived = false; m_processor = NULL; m_recvProcessor = NULL; m_cmd.param = NULL; connect(CorePlugin::m_plugin, SIGNAL(modeChanged()), this, SLOT(modeChanged())); m_frame = new QFrame(this); setCentralWidget(m_frame); m_layout = new QVBoxLayout(m_frame); m_edit = new MsgTextEdit(this, m_frame); m_edit->setBackground(QColor(CorePlugin::m_plugin->getEditBackground() & 0xFFFFFF)); m_edit->setForeground(QColor(CorePlugin::m_plugin->getEditForeground() & 0xFFFFFF), true); m_edit->setFont(CorePlugin::m_plugin->editFont); m_edit->setCtrlMode(!CorePlugin::m_plugin->getSendOnEnter()); setFocusProxy(m_edit); QStyleSheet *style = new QStyleSheet(m_edit); QStyleSheetItem *style_p = style->item("p"); // Disable top and bottom margins for P tags. This will make sure // paragraphs have no more spacing than regular lines, thus matching // RTFs defaut look for paragraphs. style_p->setMargin(QStyleSheetItem::MarginTop, 0); style_p->setMargin(QStyleSheetItem::MarginBottom, 0); m_edit->setStyleSheet(style); connect(m_edit, SIGNAL(lostFocus()), this, SLOT(editLostFocus())); connect(m_edit, SIGNAL(textChanged()), this, SLOT(editTextChanged())); connect(m_edit, SIGNAL(ctrlEnterPressed()), this, SLOT(editEnterPressed())); connect(m_edit, SIGNAL(colorsChanged()), this, SLOT(colorsChanged())); connect(m_edit, SIGNAL(finished()), this, SLOT(editFinished())); connect(m_edit, SIGNAL(fontSelected(const QFont&)), this, SLOT(editFontChanged(const QFont&))); QFontMetrics fm(m_edit->font()); m_edit->setMinimumSize(QSize(fm.maxWidth(), fm.height() + 10)); m_layout->addWidget(m_edit); BarShow b; b.bar_id = ToolBarMsgEdit; b.parent = this; Event e(EventShowBar, &b); m_bar = (CToolBar*)(e.process()); m_bar->setParam(this); if (CorePlugin::m_plugin->getContainerMode() == 0) showCloseSend(false); setDockEnabled(m_bar, Left, false); setDockEnabled(m_bar, Right, false); }
//создание тулбара void MainForm::createToolBars() { topicToolBar = new QToolBar(tr("Тема"), this); setDockEnabled(topicToolBar, DockLeft, false); setDockEnabled(topicToolBar, DockRight, false); setDockEnabled(topicToolBar, DockBottom, false); addTopicAct->addTo(topicToolBar); editTopicAct->addTo(topicToolBar); removeTopicAct->addTo(topicToolBar); }
MainWindow() { QToolBar *toolBar = new QToolBar(this); toolBar->setFixedHeight(80); #if QT_VERSION < 0x040000 setDockEnabled(TornOff, true); setRightJustification(true); #else toolBar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea); #endif QWidget *hBox = new QWidget(toolBar); QLabel *label = new QLabel("Timer Interval", hBox); QwtCounter *counter = new QwtCounter(hBox); counter->setRange(-1.0, 100.0, 1.0); QHBoxLayout *layout = new QHBoxLayout(hBox); layout->addWidget(label); layout->addWidget(counter); layout->addWidget(new QWidget(hBox), 10); // spacer); #if QT_VERSION >= 0x040000 toolBar->addWidget(hBox); #endif addToolBar(toolBar); DataPlot *plot = new DataPlot(this); setCentralWidget(plot); connect(counter, SIGNAL(valueChanged(double)), plot, SLOT(setTimerInterval(double)) ); counter->setValue(20.0); }
void Frame::setCategories( const QPtrList<CategoryInterface> &l ) { categories = l; QDockWindow *dw = new QDockWindow( QDockWindow::InDock, this ); dw->setResizeEnabled( TRUE ); dw->setVerticalStretchable( TRUE ); addDockWindow( dw, DockLeft ); setDockEnabled( dw, DockTop, FALSE ); setDockEnabled( dw, DockBottom, FALSE ); dw->setCloseMode( QDockWindow::Always ); toolBox = new QToolBox( dw ); dw->setWidget( toolBox ); dw->setCaption( tr( "Demo Categories" ) ); for ( int i = 0; i < categories.count(); ++i ) toolBox->addItem( createCategoryPage( categories.at(i) ), categories.at(i)->icon(), categories.at(i)->name() ); categories.first()->setCurrentCategory( 0 ); }
void QMainWindow::addToolBar( QToolBar * toolBar, const char * label, ToolBarDock edge, bool nl ) { if ( !toolBar ) return; setDockEnabled( edge, TRUE ); QMainWindowPrivate::ToolBarDock * dl = 0; if ( edge == Top ) { dl = d->top; toolBar->setOrientation( QToolBar::Horizontal ); toolBar->installEventFilter( this ); } else if ( edge == Left ) { dl = d->left; toolBar->setOrientation( QToolBar::Vertical ); toolBar->installEventFilter( this ); } else if ( edge == Bottom ) { dl = d->bottom; toolBar->setOrientation( QToolBar::Horizontal ); toolBar->installEventFilter( this ); } else if ( edge == Right ) { dl = d->right; toolBar->setOrientation( QToolBar::Vertical ); toolBar->installEventFilter( this ); } else if ( edge == TornOff ) { dl = d->tornOff; } else if ( edge == Unmanaged ) { dl = d->unmanaged; } if ( !dl ) return; dl->append( new QMainWindowPrivate::ToolBar( toolBar, label, nl ) ); triggerLayout(); }
HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() { readHistory(); readBookmarks(); browser = new QTextBrowser( this ); browser->mimeSourceFactory()->setFilePath( _path ); browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); setCentralWidget( browser ); if ( !home_.isEmpty() ) browser->setSource( home_ ); connect( browser, SIGNAL( highlighted( const QString&) ), statusBar(), SLOT( message( const QString&)) ); resize( 640,700 ); QPopupMenu* file = new QPopupMenu( this ); file->insertItem( tr("&New Window"), this, SLOT( newWindow() ), ALT | Key_N ); file->insertItem( tr("&Open File"), this, SLOT( openFile() ), ALT | Key_O ); file->insertItem( tr("&Print"), this, SLOT( print() ), ALT | Key_P ); // The same three icons are used twice each. QIconSet icon_back( QPixmap("textdrawing/previous.png") ); QIconSet icon_forward( QPixmap("textdrawing/next.png") ); QIconSet icon_home( QPixmap("textdrawing/home.png") ); QPopupMenu* go = new QPopupMenu( this ); backwardId = go->insertItem( icon_back, tr("&Backward"), browser, SLOT( backward() ), ALT | Key_Left ); forwardId = go->insertItem( icon_forward, tr("&Forward"), browser, SLOT( forward() ), ALT | Key_Right ); go->insertItem( icon_home, tr("&Home"), browser, SLOT( home() ) ); hist = new QPopupMenu( this ); QStringList::Iterator it = history.begin(); for ( ; it != history.end(); ++it ) mHistory[ hist->insertItem( *it ) ] = *it; connect( hist, SIGNAL( activated( int ) ), this, SLOT( histChosen( int ) ) ); bookm = new QPopupMenu( this ); bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); bookm->insertSeparator(); QStringList::Iterator it2 = bookmarks.begin(); for ( ; it2 != bookmarks.end(); ++it2 ) mBookmarks[ bookm->insertItem( *it2 ) ] = *it2; connect( bookm, SIGNAL( activated( int ) ), this, SLOT( bookmChosen( int ) ) ); menuBar()->insertItem( tr("&File"), file ); menuBar()->insertItem( tr("&Go"), go ); menuBar()->insertItem( tr( "History" ), hist ); menuBar()->insertItem( tr( "Bookmarks" ), bookm ); menuBar()->setItemEnabled( forwardId, FALSE); menuBar()->setItemEnabled( backwardId, FALSE); connect( browser, SIGNAL( backwardAvailable( bool ) ), this, SLOT( setBackwardAvailable( bool ) ) ); connect( browser, SIGNAL( forwardAvailable( bool ) ), this, SLOT( setForwardAvailable( bool ) ) ); QToolBar* toolbar = new QToolBar( this ); addToolBar( toolbar, "Toolbar"); QToolButton* button; button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar ); connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar ); connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar ); toolbar->addSeparator(); pathCombo = new QComboBox( TRUE, toolbar ); connect( pathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( pathSelected( const QString & ) ) ); toolbar->setStretchableWidget( pathCombo ); setRightJustification( TRUE ); setDockEnabled( DockLeft, FALSE ); setDockEnabled( DockRight, FALSE ); pathCombo->insertItem( home_ ); browser->setFocus(); }
FLHelpWindow::FLHelpWindow(const QString &home_, const QString &_path, QWidget *parent, const char *name) : QMainWindow(parent, name, WDestructiveClose), pathCombo(0), selectedURL() { readHistory(); readBookmarks(); browser = new QTextBrowser(this); browser->mimeSourceFactory() ->setFilePath(_path); browser->setFrameStyle(QFrame::Panel | QFrame::Sunken); connect(browser, SIGNAL(textChanged()), this, SLOT(textChanged())); setCentralWidget(browser); if (!home_.isEmpty()) browser->setSource(home_); connect(browser, SIGNAL(highlighted(const QString &)), statusBar(), SLOT(message(const QString &))); resize(640, 700); QPopupMenu *file = new QPopupMenu(this); file->insertItem(tr("&Imprimir"), this, SLOT(print()), CTRL + Key_I); file->insertSeparator(); file->insertItem(tr("&Cerrar"), this, SLOT(close()), Key_Escape); // The same three icons are used twice each. QIconSet icon_back(QPixmap::fromMimeSource("previous.png")); QIconSet icon_forward(QPixmap::fromMimeSource("next.png")); QIconSet icon_home(QPixmap::fromMimeSource("home.png")); QPopupMenu *go = new QPopupMenu(this); backwardId = go->insertItem(icon_back, tr("&Atrás"), browser, SLOT(backward()), CTRL + Key_Left); forwardId = go->insertItem(icon_forward, tr("&Adelante"), browser, SLOT(forward()), CTRL + Key_Right); go->insertItem(icon_home, tr("&Inicio"), browser, SLOT(home())); QPopupMenu *help = new QPopupMenu(this); help->insertItem(tr("&Acerca ..."), this, SLOT(about())); help->insertItem(tr("Acerca de &Qt ..."), this, SLOT(aboutQt())); hist = new QPopupMenu(this); QStringList::Iterator it = history.begin(); for (; it != history.end(); ++it) mHistory[ hist->insertItem(*it)] = *it; connect(hist, SIGNAL(activated(int)), this, SLOT(histChosen(int))); bookm = new QPopupMenu(this); bookm->insertItem(tr("Agregar Favorito"), this, SLOT(addBookmark())); bookm->insertSeparator(); QStringList::Iterator it2 = bookmarks.begin(); for (; it2 != bookmarks.end(); ++it2) mBookmarks[ bookm->insertItem(*it2)] = *it2; connect(bookm, SIGNAL(activated(int)), this, SLOT(bookmChosen(int))); menuBar() ->insertItem(tr("&Archivo"), file); menuBar() ->insertItem(tr("&Ir"), go); menuBar() ->insertItem(tr("Historial"), hist); menuBar() ->insertItem(tr("Favoritos"), bookm); menuBar() ->insertSeparator(); menuBar() ->insertItem(tr("&Ayuda"), help); menuBar() ->setItemEnabled(forwardId, FALSE); menuBar() ->setItemEnabled(backwardId, FALSE); connect(browser, SIGNAL(backwardAvailable(bool)), this, SLOT(setBackwardAvailable(bool))); connect(browser, SIGNAL(forwardAvailable(bool)), this, SLOT(setForwardAvailable(bool))); QToolBar *toolbar = new QToolBar(this); addToolBar(toolbar, "Toolbar"); QToolButton *button; button = new QToolButton(icon_back, tr("Atrás"), "", browser, SLOT(backward()), toolbar); connect(browser, SIGNAL(backwardAvailable(bool)), button, SLOT(setEnabled(bool))); button->setEnabled(FALSE); button = new QToolButton(icon_forward, tr("Adelante"), "", browser, SLOT(forward()), toolbar); connect(browser, SIGNAL(forwardAvailable(bool)), button, SLOT(setEnabled(bool))); button->setEnabled(FALSE); button = new QToolButton(icon_home, tr("Inicio"), "", browser, SLOT(home()), toolbar); toolbar->addSeparator(); pathCombo = new QComboBox(TRUE, toolbar); connect(pathCombo, SIGNAL(activated(const QString &)), this, SLOT(pathSelected(const QString &))); toolbar->setStretchableWidget(pathCombo); setRightJustification(TRUE); setDockEnabled(DockLeft, FALSE); setDockEnabled(DockRight, FALSE); pathCombo->insertItem(home_); browser->setFocus(); }
HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name) : Q3MainWindow( parent, name, Qt::WDestructiveClose ), pathCombo( 0 ), selectedURL() { DigitDebug::ctor(QString("helpwindow " + QString::number((ulong) this, 16))); readHistory(); readBookmarks(); browser = new Q3TextBrowser( this ); CHECK_PTR_ENGAUGE(browser); browser->mimeSourceFactory()->setFilePath( _path ); browser->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); setCentralWidget( browser ); if ( !home_.isEmpty() ) browser->setSource( home_ ); connect( browser, SIGNAL( highlighted( const QString&) ), statusBar(), SLOT( message( const QString&)) ); // display help window in previous position with same size DefaultSettings& rSettings = DefaultSettings::instance(); move(rSettings.getWindowHelpPosition()); resize(rSettings.getWindowHelpSize()); QMenu* file = new QMenu( this ); CHECK_PTR_ENGAUGE(file); file->insertItem( tr("&Open File"), this, SLOT( openFile() ), Qt::CTRL+Qt::Key_O ); file->insertItem( tr("&Print"), this, SLOT( print() ), Qt::CTRL+Qt::Key_P ); file->insertSeparator(); file->insertItem( tr("&Close"), this, SLOT( close() ), Qt::CTRL+Qt::Key_Q ); //file->insertItem( tr("E&xit"), qApp, SLOT( closeAllWindows() ), Qt::CTRL+Qt::Key_X ); // The same three icons are used twice each. QPixmap helpback (helpback_xpm); QPixmap helpforward (helpforward_xpm); QPixmap helphome (helphome_xpm); QIcon icon_back (helpback); QIcon icon_forward (helpforward); QIcon icon_home (helphome); QMenu* go = new QMenu( this ); CHECK_PTR_ENGAUGE(go); backwardId = go->insertItem( icon_back, tr("&Backward"), browser, SLOT( backward() ), Qt::CTRL+Qt::Key_Left ); forwardId = go->insertItem( icon_forward, tr("&Forward"), browser, SLOT( forward() ), Qt::CTRL+Qt::Key_Right ); go->insertItem( icon_home, tr("&Home"), browser, SLOT( home() ) ); hist = new QMenu( this ); CHECK_PTR_ENGAUGE(hist); QStringList::Iterator it = history.begin(); for ( ; it != history.end(); ++it ) mHistory[ hist->insertItem( *it ) ] = *it; connect( hist, SIGNAL( activated( int ) ), this, SLOT( histChosen( int ) ) ); bookm = new QMenu( this ); CHECK_PTR_ENGAUGE(bookm); bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); bookm->insertSeparator(); QStringList::Iterator it2 = bookmarks.begin(); for ( ; it2 != bookmarks.end(); ++it2 ) mBookmarks[ bookm->insertItem( *it2 ) ] = *it2; connect( bookm, SIGNAL( activated( int ) ), this, SLOT( bookmChosen( int ) ) ); menuBar()->insertItem( tr("&File"), file ); menuBar()->insertItem( tr("&Go"), go ); menuBar()->insertItem( tr( "History" ), hist ); menuBar()->insertItem( tr( "Bookmarks" ), bookm ); menuBar()->setItemEnabled( forwardId, FALSE); menuBar()->setItemEnabled( backwardId, FALSE); connect( browser, SIGNAL( backwardAvailable( bool ) ), this, SLOT( setBackwardAvailable( bool ) ) ); connect( browser, SIGNAL( forwardAvailable( bool ) ), this, SLOT( setForwardAvailable( bool ) ) ); Q3ToolBar* toolbar = new Q3ToolBar( this ); CHECK_PTR_ENGAUGE(toolbar); addToolBar( toolbar, "Toolbar"); QToolButton* button; button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar ); CHECK_PTR_ENGAUGE(button); connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar ); CHECK_PTR_ENGAUGE(button); connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar ); CHECK_PTR_ENGAUGE(button); toolbar->addSeparator(); pathCombo = new QComboBox( TRUE, toolbar ); CHECK_PTR_ENGAUGE(pathCombo); connect( pathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( pathSelected( const QString & ) ) ); toolbar->setStretchableWidget( pathCombo ); setRightJustification( TRUE ); setDockEnabled( Qt::DockLeft, FALSE ); setDockEnabled( Qt::DockRight, FALSE ); pathCombo->insertItem( home_ ); browser->setFocus(); }
FilterWindow::FilterWindow() { id = 0; QToolBar *toolBar = new QToolBar(this); QToolBar *lowerToolBar = new QToolBar(this); //lowerToolBar->setFixedHeight(80); toolBar->setFixedHeight(80); #if QT_VERSION < 0x040000 setDockEnabled(TornOff, true); setRightJustification(true); #else toolBar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea); lowerToolBar->setAllowedAreas(Qt::BottomToolBarArea); #endif QWidget *hBox = new QWidget(toolBar); QWidget *lowerBox = new QWidget(lowerToolBar); QLabel *label = new QLabel("Frequency", hBox); QLabel *clabel = new QLabel("Range Max", hBox); QLabel *mlabel = new QLabel("Range Min", hBox); QwtCounter *counter = new QwtCounter(hBox); QwtCounter *rangeCounter = new QwtCounter(hBox); QwtCounter *minCounter = new QwtCounter(hBox); QPushButton *scaleButton = new QPushButton("&Autoscale", hBox); QPushButton *mgxButton = new QPushButton("MG&x", lowerBox); QPushButton *avgButton = new QPushButton("Local Avg", lowerBox); QPushButton *eButton = new QPushButton("e", lowerBox); QPushButton *fButton = new QPushButton("f[n]", lowerBox); QPushButton *mavgButton = new QPushButton("Moving Avg", lowerBox); QwtKnob *rcKnob = new QwtKnob(lowerBox); rcKnob->setRange(0,5,.1,0); rcKnob->setScaleMaxMajor(10); rcKnob->setValue(5.0); QLabel *rcLabel = new QLabel("RC", rcKnob); rcLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter); QwtKnob *dtKnob = new QwtKnob(lowerBox); dtKnob->setRange(0,5,.1,0); dtKnob->setScaleMaxMajor(10); dtKnob->setValid(1.0); QLabel *dtLabel = new QLabel("Dt", dtKnob); dtLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter); QwtKnob *duKnob = new QwtKnob(lowerBox); duKnob->setRange(0,5000,10,1); duKnob->setScaleMaxMajor(10); duKnob->setValid(1.0); QLabel *duLabel = new QLabel("Du", duKnob); duLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter); // Sets the range and increment of the widgets counter->setRange(-1.0, 2000.0, 10.0); rangeCounter->setRange(-1048576.0,INT_MAX,100.0); minCounter->setRange(-1048576.0, INT_MAX, 100.0); QHBoxLayout *layout = new QHBoxLayout(hBox); layout->addWidget(label); layout->addWidget(counter); layout->addWidget(clabel); layout->addWidget(rangeCounter); layout->addWidget(mlabel); layout->addWidget(minCounter); layout->addWidget(scaleButton); QHBoxLayout *lowerLayout = new QHBoxLayout(lowerBox); lowerLayout->addWidget(mgxButton); lowerLayout->addWidget(avgButton); lowerLayout->addWidget(eButton); lowerLayout->addWidget(fButton); lowerLayout->addWidget(mavgButton); lowerLayout->addWidget(rcKnob); lowerLayout->addWidget(dtKnob); lowerLayout->addWidget(duKnob); // layout->addWidget(new QWidget(hBox), 10); // spacer); #if QT_VERSION >= 0x040000 toolBar->addWidget(hBox); lowerToolBar->addWidget(lowerBox); #endif addToolBar(toolBar); // Instantiates the plot, this being the parent widget plot = new FilteredDataPlot(this); setCentralWidget(plot); addToolBarBreak(Qt::TopToolBarArea); addToolBar(lowerToolBar); // Connect signals connect(counter, SIGNAL(valueChanged(double)), plot, SLOT(setTimerInterval(double)) ); connect(rangeCounter, SIGNAL(valueChanged(double)), plot, SLOT(setRange(double))); connect(minCounter, SIGNAL(valueChanged(double)), plot, SLOT(setMinRange(double))); connect(mgxButton, SIGNAL(clicked()), plot, SLOT(detachMgx())); connect(avgButton, SIGNAL(clicked()), plot, SLOT(detachAvg())); connect(eButton,SIGNAL(clicked()), plot, SLOT(detachE())); connect(fButton, SIGNAL(clicked()), plot, SLOT(detachF())); connect(mavgButton, SIGNAL(clicked()), plot, SLOT(detachMavg())); connect(scaleButton, SIGNAL(clicked()), plot, SLOT(autoScale())); connect(scaleButton, SIGNAL(clicked()), plot->getDataFilter(), SLOT(resetLocalMax())); connect(rcKnob, SIGNAL(valueChanged(double)), plot->getDataFilter(), SLOT(setRc(double)) ); connect(dtKnob, SIGNAL(valueChanged(double)), plot->getDataFilter(), SLOT(setDt(double)) ); connect(duKnob, SIGNAL(valueChanged(double)), plot->getDataFilter(), SLOT(setU(double))); counter->setValue(50.0); rangeCounter->setValue(10000.0); minCounter->setValue(2000); }
/* * Constructs a KoalaStatus which is a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ KoalaStatus::KoalaStatus( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { (void)statusBar(); if ( !name ) setName( "KoalaStatus" ); resize( 600, 480 ); setCaption( trUtf8( "KoalaMUD Status" ) ); // actions Quit = new QAction( this, "Quit" ); Quit->setText( trUtf8( "Quit" ) ); StartNetwork = new QAction( this, "StartNetwork" ); StartNetwork->setText( trUtf8( "StartNetwork" ) ); PlayerDockAct = new QAction( this, "Players" ); PlayerDockAct->setToggleAction(true); PlayerDockAct->setOn(true); PlayerDockAct->setText( trUtf8( "Players" ) ); ListenDockAct = new QAction( this, "Listens" ); ListenDockAct->setToggleAction(true); ListenDockAct->setOn(true); ListenDockAct->setText( trUtf8( "Listens" ) ); // toolbars // menubar menubar = new QMenuBar( this, "menubar" ); System = new QPopupMenu( this ); StartNetwork->addTo( System ); System->insertSeparator(); Quit->addTo( System ); menubar->insertItem( trUtf8( "System" ), System ); Status = new QPopupMenu( this ); PlayerDockAct->addTo( Status ); ListenDockAct->addTo( Status ); menubar->insertItem( trUtf8( "Status" ), Status ); // Dock Windows PlayerStatusDock = new QDockWindow(QDockWindow::InDock, this, "PlrStat"); PlayerStatusList = new QListView(PlayerStatusDock, "PlrStatList"); PlayerStatusList->addColumn("Player"); PlayerStatusList->addColumn("Level"); PlayerStatusList->addColumn("State"); PlayerCountItem = new QListViewItem(PlayerStatusList, "Total", "0", ""); PlayerStatusDock->setWidget(PlayerStatusList); PlayerStatusDock->setResizeEnabled(true); moveDockWindow(PlayerStatusDock, DockLeft); setDockEnabled(PlayerStatusDock, DockTop, false); setDockEnabled(PlayerStatusDock, DockBottom, false); PlayerStatusDock->show(); ListenStatusDock = new QDockWindow(QDockWindow::InDock, this, "ListenStat"); ListenStatusList = new QListView(ListenStatusDock, "ListenStatList"); ListenStatusList->addColumn("Listen Port"); ListenStatusList->addColumn("Listener Status"); ListenCountItem = new QListViewItem(ListenStatusList, "Total Listeners", "0"); ListenStatusDock->setWidget(ListenStatusList); ListenStatusDock->setResizeEnabled(true); moveDockWindow(ListenStatusDock, DockLeft); setDockEnabled(ListenStatusDock, DockTop, false); setDockEnabled(ListenStatusDock, DockBottom, false); ListenStatusDock->show(); // signals and slots connections connect( Quit, SIGNAL( activated() ), this, SLOT( close() ) ); connect(StartNetwork, SIGNAL( activated() ), this, SLOT( portdialog() ) ); connect(PlayerDockAct, SIGNAL(toggled(bool)), this, SLOT(playerstoggled(bool))); connect(ListenDockAct, SIGNAL(toggled(bool)), this, SLOT(listentoggled(bool))); }
QTERuputer::QTERuputer(Frame *_frame, Directory *_sddir, Option *option, UFilerIni *ini) : QMainWindow(NULL, "Aurex"), Ruputer(_frame, _sddir, option, ini) { // qteruputer=this; // palette = NULL; #if 1 /* configure menu */ openFileMenu = new QPopupMenu(this); menuBar()->insertItem(tr("File"), openFileMenu); openAction = new QAction("Open", "Open", 0, this); openAction->addTo(openFileMenu); connect(openAction, SIGNAL(activated()), this, SLOT(openFile(void))); connect(openFileMenu, SIGNAL(aboutToShow()), this, SLOT(pauseEmulate(void))); connect(openFileMenu, SIGNAL(aboutToHide()), this, SLOT(resumeEmulate(void))); /* configure tool button */ enterAction = new QAction("enter", "enter", 0, this); QPixmap enterPixmap( (const char **)enter ); QIconSet enterIconSet( enterPixmap, QIconSet::Small ); enterAction->setIconSet(enterIconSet); elAction = new QAction("el", "el", 0, this); QPixmap elPixmap( (const char **)el ); QIconSet elIconSet( elPixmap , QIconSet::Small ); elAction->setIconSet(elIconSet); menuAction = new QAction("menu", "menu", 0, this); QPixmap menuPixmap( (const char **)menu ); QIconSet menuIconSet( menuPixmap , QIconSet::Small); menuAction->setIconSet(menuIconSet); filerAction = new QAction("filer", "filer", 0, this); QPixmap filerPixmap( (const char **)filer ); QIconSet filerIconSet( filerPixmap , QIconSet::Small ); filerAction->setIconSet(filerIconSet); upAction = new QAction("up", "up", 0, this); QPixmap upPixmap( (const char **)up_arrow_xpm ); QIconSet upIconSet( upPixmap , QIconSet::Small ); upAction->setIconSet(upIconSet); rightAction = new QAction("right", "right", 0, this); QPixmap rightPixmap( (const char **)right_arrow_xpm ); QIconSet rightIconSet( rightPixmap , QIconSet::Small ); rightAction->setIconSet(rightIconSet); leftAction = new QAction("left", "left", 0, this); QPixmap leftPixmap( (const char **)left_arrow_xpm ); QIconSet leftIconSet( leftPixmap , QIconSet::Small ); leftAction->setIconSet(leftIconSet); downAction = new QAction("down", "down", 0, this); QPixmap downPixmap( (const char **)down_arrow_xpm ); QIconSet downIconSet( downPixmap , QIconSet::Small ); downAction->setIconSet(downIconSet); connect(enterAction, SIGNAL(activated()), this, SLOT(pushPaletteEnter(void))); connect(elAction, SIGNAL(activated()), this, SLOT(pushPaletteEl(void))); connect(menuAction, SIGNAL(activated()), this, SLOT(pushPaletteMenu(void))); connect(filerAction, SIGNAL(activated()), this, SLOT(pushPaletteFiler(void))); connect(upAction, SIGNAL(activated()), this, SLOT(pushPaletteUp(void))); connect(downAction, SIGNAL(activated()), this, SLOT(pushPaletteDown(void))); connect(leftAction, SIGNAL(activated()), this, SLOT(pushPaletteLeft(void))); connect(rightAction, SIGNAL(activated()), this, SLOT(pushPaletteRight(void))); palette = new QToolBar(this, "Palette"); // palette->setVerticalStretchable( true ); // palette->setHorizontalStretchable( true ); enterAction->addTo(palette); menuAction->addTo(palette); upAction->addTo(palette); downAction->addTo(palette); leftAction->addTo(palette); rightAction->addTo(palette); elAction->addTo(palette); filerAction->addTo(palette); setDockEnabled(palette, Bottom, true); moveToolBar(palette, Bottom); qtelcd=new QTELcd(getSystemAddress(), this, getCMLcd(), menuBar()->height(), palette->height(), palette->width()); setSDLcd(qtelcd); #endif setCaption("Aurex"); }
void FileMainWindow::setup() { QSplitter *splitter = new QSplitter( this ); dirlist = new DirectoryView( splitter, "dirlist", TRUE ); dirlist->addColumn( "Name" ); dirlist->addColumn( "Type" ); Directory *root = new Directory( dirlist, "/" ); root->setOpen( TRUE ); splitter->setResizeMode( dirlist, QSplitter::KeepSize ); fileview = new QtFileIconView( "/", splitter ); fileview->setSelectionMode( QIconView::Extended ); setCentralWidget( splitter ); QToolBar *toolbar = new QToolBar( this, "toolbar" ); setRightJustification( TRUE ); (void)new QLabel( tr( " Path: " ), toolbar ); pathCombo = new QComboBox( TRUE, toolbar ); pathCombo->setAutoCompletion( TRUE ); toolbar->setStretchableWidget( pathCombo ); connect( pathCombo, SIGNAL( activated( const QString & ) ), this, SLOT ( changePath( const QString & ) ) ); toolbar->addSeparator(); QPixmap pix; pix = QPixmap( cdtoparent_xpm ); upButton = new QToolButton( pix, "One directory up", QString::null, this, SLOT( cdUp() ), toolbar, "cd up" ); pix = QPixmap( newfolder_xpm ); mkdirButton = new QToolButton( pix, "New Folder", QString::null, this, SLOT( newFolder() ), toolbar, "new folder" ); connect( dirlist, SIGNAL( folderSelected( const QString & ) ), fileview, SLOT ( setDirectory( const QString & ) ) ); connect( fileview, SIGNAL( directoryChanged( const QString & ) ), this, SLOT( directoryChanged( const QString & ) ) ); connect( fileview, SIGNAL( startReadDir( int ) ), this, SLOT( slotStartReadDir( int ) ) ); connect( fileview, SIGNAL( readNextDir() ), this, SLOT( slotReadNextDir() ) ); connect( fileview, SIGNAL( readDirDone() ), this, SLOT( slotReadDirDone() ) ); setDockEnabled( DockLeft, FALSE ); setDockEnabled( DockRight, FALSE ); label = new QLabel( statusBar() ); statusBar()->addWidget( label, 2, TRUE ); progress = new QProgressBar( statusBar() ); statusBar()->addWidget( progress, 1, TRUE ); connect( fileview, SIGNAL( enableUp() ), this, SLOT( enableUp() ) ); connect( fileview, SIGNAL( disableUp() ), this, SLOT( disableUp() ) ); connect( fileview, SIGNAL( enableMkdir() ), this, SLOT( enableMkdir() ) ); connect( fileview, SIGNAL( disableMkdir() ), this, SLOT( disableMkdir() ) ); }