From a1e953f20641a76dadd94f452fd0a1938803d47d Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 13 Mar 2008 11:56:35 +0000 Subject: [PATCH] This commit was generated by cvs2git to create tag 'CTH_V1_3_2p1'. Sprout from For_CTH_V12 2008-03-13 11:56:34 UTC sln 'Dump view. View is dumped before showing dialog because sometimes dialog is dumped together with view (CTH19141)' Delete: doc/salome/gui/Makefile.in src/ObjBrowser/OB_FindDlg.cxx src/ObjBrowser/OB_FindDlg.h src/ObjBrowser/OB_ObjSearch.cxx src/ObjBrowser/OB_ObjSearch.h --- doc/salome/gui/Makefile.in | 48 -------------- src/ObjBrowser/OB_FindDlg.cxx | 92 --------------------------- src/ObjBrowser/OB_FindDlg.h | 34 ---------- src/ObjBrowser/OB_ObjSearch.cxx | 107 -------------------------------- src/ObjBrowser/OB_ObjSearch.h | 39 ------------ 5 files changed, 320 deletions(-) delete mode 100644 doc/salome/gui/Makefile.in delete mode 100644 src/ObjBrowser/OB_FindDlg.cxx delete mode 100644 src/ObjBrowser/OB_FindDlg.h delete mode 100644 src/ObjBrowser/OB_ObjSearch.cxx delete mode 100644 src/ObjBrowser/OB_ObjSearch.h diff --git a/doc/salome/gui/Makefile.in b/doc/salome/gui/Makefile.in deleted file mode 100644 index 926f14922..000000000 --- a/doc/salome/gui/Makefile.in +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# File : Makefile.in -# Author : Vasily Rusyaev (Open Cascade NN) -# Module : doc - -top_srcdir=@top_srcdir@ -top_builddir=../../.. -srcdir=@srcdir@ -VPATH=.:@srcdir@ - -@COMMENCE@ - -usr_docs: - cp -fr $(srcdir)/GUI ./ - -find $(PWD) -name CVS -prune -exec rm -rf {} \; - -docs: usr_docs - -clean: - rm -fr `ls | grep -v "Makefile"` - -distclean: clean - rm -fr GUI - -install: - mkdir -p $(docdir)/gui - cp -rf GUI $(docdir)/gui - -find $(PWD) -name CVS -prune -exec rm -rf {} \; - -uninstall: - rm -rf $(docdir)/gui/GUI diff --git a/src/ObjBrowser/OB_FindDlg.cxx b/src/ObjBrowser/OB_FindDlg.cxx deleted file mode 100644 index 07ed30dd5..000000000 --- a/src/ObjBrowser/OB_FindDlg.cxx +++ /dev/null @@ -1,92 +0,0 @@ - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -OB_FindDlg::OB_FindDlg( QWidget* parent ) -: QGroupBox( 1, Qt::Horizontal, tr( "FIND" ), parent ), - mySearch( 0 ) -{ - QFrame *btns = new QFrame( this ), *checks = new QFrame( this ); - - myData = new QLineEdit( btns ); - myToFirst = new QPushButton( "|<<", btns ); - myToLast = new QPushButton( ">>|", btns ); - myNext = new QPushButton( ">>", btns ); - myPrev = new QPushButton( "<<", btns ); - myClose = new QPushButton( tr( "CLOSE" ), checks ); - myIsCaseSens = new QCheckBox( tr( "CASE_SENSITIVE" ), checks ); - myIsRegExp = new QCheckBox( tr( "IS_REG_EXP" ), checks ); - int w = 30, h = myToFirst->height(); - myToFirst->setMaximumSize( w, h ); - myToLast->setMaximumSize( w, h ); - myNext->setMaximumSize( w, h ); - myPrev->setMaximumSize( w, h ); - - QHBoxLayout* l = new QHBoxLayout( btns, 5, 5 ); - l->addWidget( myToFirst, 0 ); - l->addWidget( myPrev, 0 ); - l->addWidget( myData, 1 ); - l->addWidget( myNext, 0 ); - l->addWidget( myToLast, 0 ); - - QHBoxLayout* c = new QHBoxLayout( checks, 5, 5 ); - c->addWidget( myIsCaseSens, 0 ); - c->addWidget( myIsRegExp, 0 ); - c->addWidget( myClose, 0 ); - - connect( myToFirst, SIGNAL( clicked() ), this, SLOT( onFind() ) ); - connect( myToLast, SIGNAL( clicked() ), this, SLOT( onFind() ) ); - connect( myNext, SIGNAL( clicked() ), this, SLOT( onFind() ) ); - connect( myPrev, SIGNAL( clicked() ), this, SLOT( onFind() ) ); - connect( myClose, SIGNAL( clicked() ), this, SLOT( onClose() ) ); -} - -OB_FindDlg::~OB_FindDlg() -{ -} - -void OB_FindDlg::onClose() -{ - hide(); -} - -void OB_FindDlg::onFind() -{ - OB_ListItem* it = 0; - mySearch->setPattern( myData->text(), myIsRegExp->isChecked(), myIsCaseSens->isChecked() ); - if( sender()==myToFirst ) - it = mySearch->findFirst(); - else if( sender()==myNext ) - it = mySearch->findNext(); - else if( sender()==myPrev ) - it = mySearch->findPrev(); - else if( sender()==myToLast ) - it = mySearch->findLast(); - if( it ) - { - mySearch->browser()->setSelected( it->dataObject(), false ); - mySearch->browser()->listView()->ensureItemVisible( it ); - } - else - SUIT_MessageBox::info1( this, tr( "FIND" ), tr( "NOT_FOUND" ), tr( "OK" ) ); -} - -OB_ObjSearch* OB_FindDlg::getSearch() const -{ - return mySearch; -} - -void OB_FindDlg::setSearch( OB_ObjSearch* s ) -{ - mySearch = s; -} diff --git a/src/ObjBrowser/OB_FindDlg.h b/src/ObjBrowser/OB_FindDlg.h deleted file mode 100644 index 4c8230d81..000000000 --- a/src/ObjBrowser/OB_FindDlg.h +++ /dev/null @@ -1,34 +0,0 @@ - -#ifndef OBJECT_BROWSER_FIND_DIALOG_HEADER -#define OBJECT_BROWSER_FIND_DIALOG_HEADER - -#include - -class OB_ObjSearch; -class QLineEdit; -class QPushButton; -class QCheckBox; - -class OB_FindDlg : public QGroupBox -{ - Q_OBJECT - -public: - OB_FindDlg( QWidget* = 0 ); - virtual ~OB_FindDlg(); - - OB_ObjSearch* getSearch() const; - void setSearch( OB_ObjSearch* ); - -private slots: - void onFind(); - void onClose(); - -private: - QLineEdit* myData; - QPushButton *myToFirst, *myToLast, *myNext, *myPrev, *myClose; - QCheckBox *myIsCaseSens, *myIsRegExp; - OB_ObjSearch* mySearch; -}; - -#endif diff --git a/src/ObjBrowser/OB_ObjSearch.cxx b/src/ObjBrowser/OB_ObjSearch.cxx deleted file mode 100644 index 84d9c2c61..000000000 --- a/src/ObjBrowser/OB_ObjSearch.cxx +++ /dev/null @@ -1,107 +0,0 @@ - -#include -#include -#include - -#include - -OB_ObjSearch::OB_ObjSearch( OB_Browser* b ) -: myBrowser( b ) -{ -} - -OB_ObjSearch::~OB_ObjSearch() -{ -} - -OB_ListItem* OB_ObjSearch::tail( const bool first ) const -{ - QListView* lv = myBrowser->listView(); - return dynamic_cast( first ? lv->firstChild() : lv->lastItem() ); -} - -OB_ListItem* OB_ObjSearch::next( OB_ListItem* i, const bool forward ) const -{ - QListViewItemIterator it( i ); - if( forward ) - it++; - else - it--; - return dynamic_cast( *it ); -} - -SUIT_DataObject* OB_ObjSearch::data( OB_ListItem* i ) const -{ - return i ? i->dataObject() : 0; -} - -void OB_ObjSearch::setPattern( const QString& data, const bool is_reg_exp, const bool is_case_sens ) -{ - myData = data; - myIsRegExp = is_reg_exp; - myIsCaseSens = is_case_sens; -} - -bool OB_ObjSearch::matches( SUIT_DataObject* obj ) const -{ - if( !obj ) - return false; - - QString txt = obj->name(); - if( myIsRegExp ) - { - QRegExp re( myData ); - re.setCaseSensitive( myIsCaseSens ); - return txt.contains( re ); - } - else - return txt.contains( myData, myIsCaseSens ); -} - -OB_Browser* OB_ObjSearch::browser() const -{ - return myBrowser; -} - -OB_ListItem* OB_ObjSearch::findFirst() const -{ - return find( tail( true ), true, false, false ); -} - -OB_ListItem* OB_ObjSearch::findLast() const -{ - return find( tail( false ), false, false, false ); -} - -OB_ListItem* OB_ObjSearch::findNext() const -{ - return find( current(), true, true, true ); -} - -OB_ListItem* OB_ObjSearch::findPrev() const -{ - return find( current(), false, true, true ); -} - -OB_ListItem* OB_ObjSearch::find( OB_ListItem* i, const bool forward, - const bool ignore_first, const bool cyclic ) const -{ - if( !i ) - i = tail( forward ); - - if( ignore_first ) - i = next( i, forward ); - - while( i && !matches( data( i ) ) ) - i = next( i, forward ); - - if( !i && cyclic ) - return find( tail( forward ), forward, false, false ); - - return i; -} - -OB_ListItem* OB_ObjSearch::current() const -{ - return dynamic_cast( myBrowser->listView()->currentItem() ); -} diff --git a/src/ObjBrowser/OB_ObjSearch.h b/src/ObjBrowser/OB_ObjSearch.h deleted file mode 100644 index 6106d9fef..000000000 --- a/src/ObjBrowser/OB_ObjSearch.h +++ /dev/null @@ -1,39 +0,0 @@ - -#ifndef OBJECT_BROWSER_OBJECT_SEARCH_HEADER -#define OBJECT_BROWSER_OBJECT_SEARCH_HEADER - -#include - -class OB_ListItem; -class OB_Browser; -class SUIT_DataObject; - -class OB_ObjSearch -{ -public: - OB_ObjSearch( OB_Browser* ); - virtual ~OB_ObjSearch(); - - void setPattern( const QString&, const bool, const bool ); - OB_Browser* browser() const; - - OB_ListItem* findFirst() const; - OB_ListItem* findLast() const; - OB_ListItem* findNext() const; - OB_ListItem* findPrev() const; - -protected: - virtual OB_ListItem* current() const; - virtual OB_ListItem* tail( const bool ) const; - virtual OB_ListItem* next( OB_ListItem*, const bool ) const; - virtual SUIT_DataObject* data( OB_ListItem* ) const; - virtual bool matches( SUIT_DataObject* ) const; - OB_ListItem* find( OB_ListItem*, const bool, const bool, const bool ) const; - -private: - OB_Browser* myBrowser; - QString myData; - bool myIsRegExp, myIsCaseSens; -}; - -#endif -- 2.39.2