diff --git a/qucs/qucs/dialogs/CMakeLists.txt b/qucs/qucs/dialogs/CMakeLists.txt index a96c0fee4f..9bab18f5ec 100755 --- a/qucs/qucs/dialogs/CMakeLists.txt +++ b/qucs/qucs/dialogs/CMakeLists.txt @@ -7,10 +7,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} SET(DIALOGS_SRCS changedialog.cpp packagedialog.cpp vasettingsdialog.cpp -digisettingsdialog.cpp qucssettingsdialog.cpp vtabbar.cpp -importdialog.cpp savedialog.cpp vtabbeddockwidget.cpp -labeldialog.cpp searchdialog.cpp vtabbutton.cpp -librarydialog.cpp settingsdialog.cpp vtabwidget.cpp +digisettingsdialog.cpp qucssettingsdialog.cpp +importdialog.cpp savedialog.cpp labeldialog.cpp +searchdialog.cpp librarydialog.cpp settingsdialog.cpp matchdialog.cpp simmessage.cpp newprojdialog.cpp sweepdialog.cpp exportdialog.cpp loaddialog.cpp ) @@ -34,10 +33,6 @@ simmessage.h sweepdialog.h sweepdialog.h vasettingsdialog.h -vtabbar.h -vtabbeddockwidget.h -vtabbutton.h -vtabwidget.h ) QT4_WRAP_CPP( DIALOGS_MOC_SRCS ${DIALOGS_MOC_HDRS} ) diff --git a/qucs/qucs/dialogs/Makefile.am b/qucs/qucs/dialogs/Makefile.am index b3d18a8304..22809a21e5 100644 --- a/qucs/qucs/dialogs/Makefile.am +++ b/qucs/qucs/dialogs/Makefile.am @@ -28,7 +28,6 @@ MOCHEADERS = settingsdialog.h simmessage.h qucssettingsdialog.h \ labeldialog.h changedialog.h matchdialog.h digisettingsdialog.h \ sweepdialog.h searchdialog.h librarydialog.h importdialog.h \ packagedialog.h savedialog.h vasettingsdialog.h \ - vtabbutton.h vtabbar.h vtabwidget.h vtabbeddockwidget.h \ exportdialog.h loaddialog.h newprojdialog.h MOCFILES = $(MOCHEADERS:.h=.moc.cpp) @@ -38,12 +37,11 @@ libdialogs_a_SOURCES = settingsdialog.cpp newprojdialog.cpp \ matchdialog.cpp sweepdialog.cpp digisettingsdialog.cpp searchdialog.cpp \ librarydialog.cpp importdialog.cpp packagedialog.cpp \ savedialog.cpp vasettingsdialog.cpp \ - vtabbutton.cpp vtabbar.cpp vtabwidget.cpp vtabbeddockwidget.cpp \ exportdialog.cpp loaddialog.cpp nodist_libdialogs_a_SOURCES = $(MOCFILES) -noinst_HEADERS = vtabglobal.h $(MOCHEADERS) +noinst_HEADERS = $(MOCHEADERS) AM_CPPFLAGS = $(X11_INCLUDES) $(QT_INCLUDES) -I$(top_srcdir)/qucs diff --git a/qucs/qucs/dialogs/libdialogs.ap b/qucs/qucs/dialogs/libdialogs.ap index 4a8b4fa103..55d05d52bd 100644 --- a/qucs/qucs/dialogs/libdialogs.ap +++ b/qucs/qucs/dialogs/libdialogs.ap @@ -28,15 +28,13 @@ SOURCES = savedialog.cpp settingsdialog.cpp newprojdialog.cpp \ simmessage.cpp qucssettingsdialog.cpp labeldialog.cpp \ changedialog.cpp matchdialog.cpp sweepdialog.cpp \ digisettingsdialog.cpp searchdialog.cpp librarydialog.cpp \ - importdialog.cpp packagedialog.cpp vtabbutton.cpp vtabbar.cpp \ - vtabwidget.cpp vtabbeddockwidget.cpp vasettingsdialog.cpp + importdialog.cpp packagedialog.cpp vasettingsdialog.cpp # List of special Qt files. MOCHEADERS = savedialog.h settingsdialog.h simmessage.h \ qucssettingsdialog.h labeldialog.h changedialog.h matchdialog.h \ sweepdialog.h digisettingsdialog.h searchdialog.h librarydialog.h \ - importdialog.h packagedialog.h vtabbutton.h vtabbar.h vtabwidget.h \ - vtabbeddockwidget.h vasettingsdialog.h + importdialog.h packagedialog.h vasettingsdialog.h # Additional libraries. LIBS = diff --git a/qucs/qucs/dialogs/vtabbar.cpp b/qucs/qucs/dialogs/vtabbar.cpp deleted file mode 100644 index ae5aabda75..0000000000 --- a/qucs/qucs/dialogs/vtabbar.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "vtabbutton.h" -#include "vtabbar.h" - -#include -#include -//Added by qt3to4: -#include - -VTabBar::VTabBar(VTabPosition p,QWidget* parent, const char* name): QWidget(parent, name) -{ - m_position = p; - m_layout = new Q3VBoxLayout(this); - m_layout->addStretch(800); //HACK to avoid spaces b/w buttons - m_index = 0; - m_tabsOff = true; - m_tabs.setAutoDelete( false ); - setSizePolicy( QSizePolicy::Fixed,QSizePolicy::MinimumExpanding); -} - -VTabBar::~VTabBar() -{} - -VTab* VTabBar::addTab(const QString& caption,int id) -{ - VTab *tab = new VTab(m_position,id,this); - tab->setText(caption); - m_layout->insertWidget(m_index,tab); - m_tabs.append(tab); - m_index++; - connect(tab,SIGNAL(toggled(int, bool )),this,SLOT(setTabState(int, bool ))); - updateGeometry(); - return tab; -} - -VTab* VTabBar::findTab(int _id) -{ - VTab * c = m_tabs.first(); - for ( ; c; c = m_tabs.next() ) - { - if(c->id() == _id) - return c; - } - return 0l; -} - -void VTabBar::setTabToolTip(VTab *tab,const QString &tip) -{ - QToolTip::add(tab,tip); -} - -void VTabBar::setTabToolTip(int id,const QString &tip) -{ - VTab *tab = findTab(id); - if(tab) - QToolTip::add(tab,tip); -} - -void VTabBar::removeTab(VTab *tab) -{ - VTab * c = m_tabs.first(); - for ( ; c; c = m_tabs.next() ) - { - if(c == tab) - { - m_tabs.remove(c); - return; - } - } -} -#include -using namespace std; -void VTabBar::removeTab(int _id) -{ - VTab * c = m_tabs.first(); - for ( ; c; c = m_tabs.next() ) - { - cout<id()<id() == _id) - { - m_tabs.remove(c); - return; - } - } -} - -void VTabBar::setCurrentTab(VTab *tab) -{ - setTabState(tab->id(),true); -} - -void VTabBar::setCurrentTab(int id) -{ - setTabState(id,true); -} - -void VTabBar::setTabState(int p_id,bool state) -{ - VTab *c,*current; - c = current = 0l; - for ( c = m_tabs.first(); c; c = m_tabs.next() ) - { - c->blockSignals(true); - if(c->id() == p_id && state == true) - { - current = c; - current->setOn(true); - } - else - c->setOn(false); - c->blockSignals(false); - } - if(current) - { - emit activatedTab( p_id); - emit activatedTab(current); - m_tabsOff = false; - } - else - { - m_tabsOff = true; - emit allTabsOff(); - } -} - -bool VTabBar::isAllTabsOff() -{ - return m_tabsOff; -} - -void VTabBar::switchOffAllTabs() -{ - VTab *c = m_tabs.first(); - for ( ; c; c = m_tabs.next() ) - { - c->blockSignals(true); - c->setOn(false); - c->blockSignals(false); - } - m_tabsOff = true; - emit allTabsOff(); -} - -void VTabBar::setPosition(VTabPosition p_pos) -{ - if(m_position == p_pos) - return; - m_position = p_pos; - VTab * c = m_tabs.first(); - while(c) - { - c->setPosition(m_position); - c = m_tabs.next(); - } -} diff --git a/qucs/qucs/dialogs/vtabbar.h b/qucs/qucs/dialogs/vtabbar.h deleted file mode 100644 index dbcb799bb8..0000000000 --- a/qucs/qucs/dialogs/vtabbar.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef VERTICALTABBAR_H -#define VERTICALTABBAR_H - -#include "vtabglobal.h" -#include "vtabbutton.h" -#include -#include -//Added by qt3to4: -#include - -class Q3VBoxLayout; -class VTab; - -/** - @author Gopala Krishna A -*/ -class VTabBar : public QWidget,public VTabInterface -{ - Q_OBJECT -public: - VTabBar(VTabPosition p = TabLeft,QWidget* parent = 0l, const char* name = 0l); - - virtual ~VTabBar(); - VTab* addTab(const QString& caption,int id = -1); - - VTab* findTab(int id); - void setTabToolTip(VTab *tab,const QString &tip); - void setTabToolTip(int id,const QString &tip); - void removeTab(VTab *tab); - void removeTab(int id); - bool isAllTabsOff(); - -public slots: - - void setCurrentTab(VTab *tab); - void setCurrentTab(int id); - void setPosition(VTabPosition p_pos); - void switchOffAllTabs(); - -signals: - void activatedTab(int p_id); - void activatedTab(VTab *tab); - void allTabsOff(); - -private slots: - void setTabState(int p_id,bool state); - -private: - int m_index; - bool m_tabsOff; - VTabPosition m_position; - Q3VBoxLayout* m_layout; - Q3PtrList m_tabs; - -}; - -#endif diff --git a/qucs/qucs/dialogs/vtabbeddockwidget.cpp b/qucs/qucs/dialogs/vtabbeddockwidget.cpp deleted file mode 100644 index b3a6ae7134..0000000000 --- a/qucs/qucs/dialogs/vtabbeddockwidget.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "vtabbeddockwidget.h" -#include "vtabwidget.h" -#include -#include - -VTabbedDockWidget::VTabbedDockWidget(Place p, QWidget* parent, const char* name): Q3DockWindow(p, parent, name) -{ - setOrientation(Qt::Vertical); - m_tabWidget = 0l; - setCloseMode(Q3DockWindow::Always); -} - -VTabbedDockWidget::~VTabbedDockWidget() -{} - -void VTabbedDockWidget::setWidget(QWidget *w) -{ - Q3DockWindow::setWidget(w); - if(!(w->inherits("VTabWidget"))) - return; - m_tabWidget = (VTabWidget*)w; - setResizeEnabled(false); - setHorizontallyStretchable(false); - connect(m_tabWidget,SIGNAL(widgetStackHidden()),this,SLOT(slotStackHidden())); - connect(m_tabWidget,SIGNAL(widgetStackShown()),this,SLOT(slotStackShown())); - connect(this,SIGNAL(placeChanged( Q3DockWindow::Place )),SLOT(updatePosition(Q3DockWindow::Place))); -} - -/*! - \fn VTabbedDockWidget::slotStackShown() - */ -void VTabbedDockWidget::slotStackShown() -{ - setFixedExtentWidth(m_tabWidget->sizeHint().width()); - setHorizontallyStretchable(true); - setResizeEnabled(true); -} - -/*! - \fn VTabbedDockWidget::slotStackHidden() - */ -void VTabbedDockWidget::slotStackHidden() -{ - setFixedExtentWidth(m_tabWidget->sizeHint().width()); - setHorizontallyStretchable(false); - setResizeEnabled(false); -} - -/*! - \fn VTabbedDockWidget::updatePosition() - */ -void VTabbedDockWidget::updatePosition(Q3DockWindow::Place p) -{ - if(p==OutsideDock) - return; - if(!(qApp->mainWidget()->inherits("QMainWindow"))) - return; - Q3MainWindow *mainWin = (Q3MainWindow*)(qApp->mainWidget()); - Qt::Dock dock; - int ind,eo;//Not needed really - bool nl;//Not needed really - - bool res = mainWin->getLocation ( this, dock, ind, nl, eo ); - if(res == false) - return; - if(dock == Qt::DockLeft) - m_tabWidget->setPosition(TabLeft); - else if(dock == Qt::DockRight) - m_tabWidget->setPosition(TabRight); - mainWin->lineUpDockWindows(); -} diff --git a/qucs/qucs/dialogs/vtabbeddockwidget.h b/qucs/qucs/dialogs/vtabbeddockwidget.h deleted file mode 100644 index cbfae88c5d..0000000000 --- a/qucs/qucs/dialogs/vtabbeddockwidget.h +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef VTABBEDDOCKWIDGET_H -#define VTABBEDDOCKWIDGET_H - -#include "vtabglobal.h" -#include - -class VTabWidget; - -/** - @author Gopala Krishna A -*/ -class VTabbedDockWidget : public Q3DockWindow,public VTabInterface -{ - Q_OBJECT -public: - VTabbedDockWidget(Place p=InDock, QWidget* parent=0l, const char* name=0l); - - virtual ~VTabbedDockWidget(); - - virtual void setWidget(QWidget *w); -private: - VTabWidget *m_tabWidget; - -private slots: - void slotStackShown(); - void slotStackHidden(); - void updatePosition(Q3DockWindow::Place p); -}; - -#endif diff --git a/qucs/qucs/dialogs/vtabbutton.cpp b/qucs/qucs/dialogs/vtabbutton.cpp deleted file mode 100644 index 7cc943807a..0000000000 --- a/qucs/qucs/dialogs/vtabbutton.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "vtabbutton.h" -#include -#include -#include -#include - #include -#include - -VTab::VTab(VTabPosition pos,int p_id,QWidget *p,const char* n) : QPushButton(p,n) -{ - m_position = pos; - m_id = p_id; - init(); -} - -void VTab::init() -{ - setFlat(true); - setToggleButton(true); - setAutoDefault(false); - setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); - connect(this,SIGNAL(toggled(bool )),SLOT(slotToggled(bool))); -} - -VTab::~VTab() -{} - -void VTab::setID(int p_id) -{ - m_id = p_id; -} - -void VTab::setPosition(VTabPosition p_pos) -{ - if(m_position != p_pos) - { - m_position = p_pos; - repaint(); - } -} - - -QSize VTab::sizeHint() const -{ - constPolish(); - QString _text = text(); - if(_text.isNull()) - _text = "XXX"; - QFontMetrics fm = this->fontMetrics(); - int w = fm.height()+5; - int h = 24+fm.width(_text); - QStyleOption *so= new QStyleOption(); - so->initFrom(this); - QSize sz=style()->sizeFromContents( - QStyle::CT_ToolButton, - so, QSize(w, h).expandedTo(QApplication::globalStrut())); - return sz; -} - -void VTab::drawButton(QPainter *p) -{ - p->save(); - QStyle::State st = QStyle::State_None | QStyle::State_Enabled; - if (isOn()) { - st |= QStyle::State_On; - st |= QStyle::State_DownArrow; - } - - QRect r(0, 0, height(), width()); - - if (m_position == TabLeft) { - p->translate(0, height()); - p->rotate(-90); - } - else { - p->translate(width(), 0); - p->rotate(90); - } -QStyleOption *so= new QStyleOption(); - so->initFrom(this); - style()->drawControl(QStyle::CE_PushButton, so,p);//, r);//, colorGroup(), st); - style()->drawControl(QStyle::CE_PushButtonLabel, so,p);//, colorGroup(), st); - - p->restore(); -} - -void VTab::setText(const QString &s) -{ - QPushButton::setText(s); - const QSize sz = sizeHint(); - setFixedHeight(sz.height()); - setFixedWidth(sz.width()); - updateGeometry(); -} - -void VTab::slotToggled(bool b) -{ - emit toggled(m_id,b); -} - -void VTab::paintEvent(QPaintEvent* event) -{ - Q_UNUSED(event); - QStylePainter p(this); - - p.rotate(-90); - p.translate(-height(), 0); - //p.rotate(90); - //p.translate(0, -width()); - - p.drawControl(QStyle::CE_PushButton, getStyleOption()); -} - -QStyleOptionButton VTab::getStyleOption() const -{ - QStyleOptionButton opt; - opt.initFrom(this); - - QSize size = opt.rect.size(); - size.transpose(); - opt.rect.setSize(size); - - opt.features = QStyleOptionButton::None; - if (isFlat()) - opt.features |= QStyleOptionButton::Flat; - if (menu()) - opt.features |= QStyleOptionButton::HasMenu; - if (autoDefault() || isDefault()) - opt.features |= QStyleOptionButton::AutoDefaultButton; - if (isDefault()) - opt.features |= QStyleOptionButton::DefaultButton; - if (isDown() ) - opt.state |= QStyle::State_Sunken; - if (isChecked()) - opt.state |= QStyle::State_On; - if (!isFlat() && !isDown()) - opt.state |= QStyle::State_Raised; - opt.text = text(); - opt.icon = icon(); - opt.iconSize = iconSize(); - return opt; -} diff --git a/qucs/qucs/dialogs/vtabbutton.h b/qucs/qucs/dialogs/vtabbutton.h deleted file mode 100644 index 8132c14862..0000000000 --- a/qucs/qucs/dialogs/vtabbutton.h +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef VERTICALTABBUTTON_H -#define VERTICALTABBUTTON_H - -#include -#include -#include "vtabglobal.h" - -/** - This class provides vertical button which can be used as ordinary button - - @author Gopala Krishna A -*/ -class VTab : public QPushButton,public VTabInterface -{ - Q_OBJECT - -public: - VTab(VTabPosition pos = TabLeft,int p_id = -1,QWidget *parent=0l,const char* name=0l); - VTabPosition position() const { return m_position; } - int id() const; - - virtual QSize sizeHint() const; - virtual void setText(const QString &s); - - virtual ~VTab(); - -public slots: - void setID(int p_id); - void setPosition(VTabPosition p_pos); - -signals: - void toggled(int p_id,bool p_state);// internal signal -protected: - void paintEvent(QPaintEvent* event); - -private: - QStyleOptionButton getStyleOption() const; - VTabPosition m_position; - int m_id; - - virtual void drawButton(QPainter *p); - void init(); - -private slots: - void slotToggled(bool b); -}; - -/*inline VTabPosition VTab::position() const -{ - return m_position; -}*/ - -inline int VTab::id() const -{ - return m_id; -} - -#endif diff --git a/qucs/qucs/dialogs/vtabglobal.h b/qucs/qucs/dialogs/vtabglobal.h deleted file mode 100644 index 287a702359..0000000000 --- a/qucs/qucs/dialogs/vtabglobal.h +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef __VTABGLOBAL_H -#define __VTABGLOBAL_H - -class VTabInterface -{ -public: - enum VTabPosition - { - TabLeft,TabRight - }; -}; - -#endif diff --git a/qucs/qucs/dialogs/vtabwidget.cpp b/qucs/qucs/dialogs/vtabwidget.cpp deleted file mode 100644 index 9071964ad7..0000000000 --- a/qucs/qucs/dialogs/vtabwidget.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "vtabbutton.h" -#include "vtabbar.h" -#include "vtabwidget.h" - -#include -#include -//Added by qt3to4: -#include - -VTabWidget::VTabWidget(VTabPosition p,QWidget* parent, const char* name): QWidget(parent, name) -{ - m_position = p; - Q3HBoxLayout *layout = new Q3HBoxLayout(this); - m_bar = new VTabBar(p,this); - m_wStack = new Q3WidgetStack(this); - layout->addWidget(m_bar,0); - layout->addWidget(m_wStack,5); - m_autoIndexer = 0; - m_wStack->hide(); - connect(m_bar,SIGNAL(allTabsOff()),m_wStack,SLOT(hide())); - connect(m_bar, SIGNAL(activatedTab(int)), this, SLOT(setCurrentPage(int))); - - connect(m_bar,SIGNAL(allTabsOff()),this,SIGNAL(widgetStackHidden())); - connect(m_bar,SIGNAL(activatedTab(int)),this,SIGNAL(widgetStackShown())); -} - -VTabWidget::~VTabWidget() -{} - -void VTabWidget::addPage(QWidget *w,const QString& tabCap) -{ - m_bar->addTab(tabCap,m_autoIndexer); - m_wStack->addWidget(w,m_autoIndexer); - m_autoIndexer++; -} - -QWidget* VTabWidget::page(int id) -{ - return m_wStack->widget(id); -} - -QWidget* VTabWidget::currentPage() -{ - if(m_bar->isAllTabsOff()) - return 0l; - return m_wStack->visibleWidget(); -} - -void VTabWidget::setTabToolTip(int id,const QString &tip) -{ - m_bar->setTabToolTip(id,tip); -} - -void VTabWidget::removePage(QWidget *w) -{ - int _id = m_wStack->id(w); - if(_id == -1) - return; - m_bar->removeTab(_id); - m_wStack->removeWidget(w); -} - -void VTabWidget::removePage(int id) -{ - QWidget *w = m_wStack->widget(id); - if(!w) - return; - removePage(w); -} - -int VTabWidget::id(QWidget *w) -{ - return m_wStack->id(w); -} - -QSize VTabWidget::sizeHint() const -{ - if(m_wStack->isHidden()) - return m_bar->sizeHint(); - int width = m_bar->sizeHint().width(); - int height = m_bar->sizeHint().height(); - width += m_wStack->sizeHint().width(); - height = QMAX(height,m_wStack->sizeHint().height()); - return QSize(width,height); -} - -void VTabWidget::setCurrentPage(int id) -{ - if(!m_wStack->isShown()) - { - m_wStack->setShown(true); - emit widgetStackShown(); - } - m_wStack->raiseWidget(id); - QWidget *w = m_wStack->widget(id); - if(w) - emit activatedPage(w); - VTab *const t = m_bar->findTab(id); - if(t == 0l) - { - qWarning("BUG: Tab id and widget id mismatch"); - return; - } - if(t->isOn()) - return; - //else programatically called - m_bar->blockSignals(true); - m_bar->setCurrentTab(id); - m_bar->blockSignals(false); -} - -void VTabWidget::setCurrentPage(QWidget *w) -{ - int _id = m_wStack->id(w); - if(_id != -1) - setCurrentPage(_id); -} - - -void VTabWidget::setPosition(VTabPosition p) -{ - if(m_position == p) - return; - m_position = p; - Q3HBoxLayout *l = (Q3HBoxLayout*)layout(); - if(!l) - { - qWarning( "Error layout is null"); - return; - } - l->remove(m_wStack); - l->remove(m_bar); - - m_bar->setPosition(p); - if(p == TabLeft) - { - l->addWidget(m_bar,0); - l->addWidget(m_wStack,5); - } - else - { - l->addWidget(m_wStack,5); - l->addWidget(m_bar,0); - } -} diff --git a/qucs/qucs/dialogs/vtabwidget.h b/qucs/qucs/dialogs/vtabwidget.h deleted file mode 100644 index 96c22e6fb1..0000000000 --- a/qucs/qucs/dialogs/vtabwidget.h +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Gopala Krishna A * - * * - * This is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2, or (at your option) * - * any later version. * - * * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this package; see the file COPYING. If not, write to * - * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * - * Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef VERTICALTABWIDGET_H -#define VERTICALTABWIDGET_H - -#include "vtabglobal.h" -#include - -class Q3WidgetStack; -class VTabBar; - -/** - @author Gopala Krishna A -*/ -class VTabWidget : public QWidget,public VTabInterface -{ - Q_OBJECT -public: - VTabWidget(VTabPosition p = TabLeft,QWidget* parent=0l, const char* name=0l); - - virtual ~VTabWidget(); - virtual QSize sizeHint() const; - void addPage(QWidget *w,const QString& tabCap); - - QWidget* page(int id); - QWidget* currentPage(); - void setTabToolTip(int id,const QString &tip); - void removePage(QWidget *w); - void removePage(int id); - int id(QWidget *w); - -public slots: - void setPosition(VTabPosition p); - void setCurrentPage(int id); - void setCurrentPage(QWidget *w); - -signals: - void widgetStackShown(); - void widgetStackHidden(); - void activatedPage(QWidget *w); - -private: - VTabPosition m_position; - VTabBar* m_bar; - Q3WidgetStack* m_wStack; - int m_autoIndexer; - -}; - -#endif diff --git a/qucs/qucs/qucs.cpp b/qucs/qucs/qucs.cpp index 81f3161bc0..52a34a1d7c 100644 --- a/qucs/qucs/qucs.cpp +++ b/qucs/qucs/qucs.cpp @@ -55,8 +55,6 @@ #include "dialogs/matchdialog.h" #include "dialogs/simmessage.h" #include "dialogs/exportdialog.h" -//#include "dialogs/vtabwidget.h" -//#include "dialogs/vtabbeddockwidget.h" #include "octave_window.h" #include "../qucs-lib/qucslib_common.h" @@ -241,9 +239,7 @@ void QucsApp::initView() DocumentTab->setMovable (true); #endif - //dock = new VTabbedDockWidget(Q3DockWindow::InDock, this); dock = new QDockWidget(this); - //TabView = new VTabWidget(VTabInterface::TabLeft,dock); // tabs on the left side TabView = new QTabWidget(dock); TabView->setTabPosition(QTabWidget::West); diff --git a/qucs/qucs/qucs_init.cpp b/qucs/qucs/qucs_init.cpp index 50066b7239..5216dc7eaf 100644 --- a/qucs/qucs/qucs_init.cpp +++ b/qucs/qucs/qucs_init.cpp @@ -22,7 +22,6 @@ #include "main.h" #include "qucs.h" -#include "dialogs/vtabbeddockwidget.h" #include "octave_window.h"