]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/searchdlg.C
John's FormExternal patch, Edwin's Qt2 patch and Baruch's gnome patch.
[lyx.git] / src / frontends / qt2 / searchdlg.C
1 /****************************************************************************
2 ** Form implementation generated from reading ui file 'searchdlg.ui'
3 **
4 ** Created: Sun Mar 4 21:52:22 2001
5 **      by:  The User Interface Compiler (uic)
6 **
7 ** WARNING! All changes made in this file will be lost!
8 ****************************************************************************/
9 #include "searchdlg.h"
10
11 #include <qcheckbox.h>
12 #include <qcombobox.h>
13 #include <qlabel.h>
14 #include <qpushbutton.h>
15 #include <qlayout.h>
16 #include <qvariant.h>
17 #include <qtooltip.h>
18 #include <qwhatsthis.h>
19
20 /* 
21  *  Constructs a SearchDlg which is a child of 'parent', with the 
22  *  name 'name' and widget flags set to 'f' 
23  *
24  *  The dialog will by default be modeless, unless you set 'modal' to
25  *  TRUE to construct a modal dialog.
26  */
27 SearchDlg::SearchDlg( QWidget* parent,  const char* name, bool modal, WFlags fl )
28     : QDialog( parent, name, modal, fl )
29 {
30     if ( !name )
31         setName( "SearchDlg" );
32     resize( 379, 168 ); 
33     setCaption( tr( "Form1" ) );
34     setSizeGripEnabled( TRUE );
35     SearchDlgLayout = new QGridLayout( this ); 
36     SearchDlgLayout->setSpacing( 6 );
37     SearchDlgLayout->setMargin( 11 );
38
39     findStrLabel = new QLabel( this, "findStrLabel" );
40     findStrLabel->setText( tr( "Find:" ) );
41
42     SearchDlgLayout->addWidget( findStrLabel, 0, 0 );
43
44     find = new QComboBox( FALSE, this, "find" );
45     find->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, find->sizePolicy().hasHeightForWidth() ) );
46     find->setEditable( TRUE );
47     find->setDuplicatesEnabled( TRUE );
48     find->setFocusPolicy( QComboBox::StrongFocus );
49
50     SearchDlgLayout->addMultiCellWidget( find, 0, 0, 1, 2 );
51
52     replaceLabel = new QLabel( this, "replaceLabel" );
53     replaceLabel->setText( tr( "Replace with:" ) );
54
55     SearchDlgLayout->addWidget( replaceLabel, 1, 0 );
56
57     replace = new QComboBox( FALSE, this, "replace" );
58     replace->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, replace->sizePolicy().hasHeightForWidth() ) );
59     replace->setEditable( TRUE );
60
61     SearchDlgLayout->addMultiCellWidget( replace, 1, 1, 1, 2 );
62
63     caseSensitive = new QCheckBox( this, "caseSensitive" );
64     caseSensitive->setText( tr( "&Case sensitive" ) );
65
66     SearchDlgLayout->addMultiCellWidget( caseSensitive, 2, 2, 0, 1 );
67
68     matchWord = new QCheckBox( this, "matchWord" );
69     matchWord->setText( tr( "Match whole words onl&y" ) );
70
71     SearchDlgLayout->addMultiCellWidget( matchWord, 3, 4, 0, 1 );
72     QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
73     SearchDlgLayout->addItem( spacer, 2, 2 );
74     QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
75     SearchDlgLayout->addMultiCell( spacer_2, 6, 6, 0, 1 );
76     QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
77     SearchDlgLayout->addItem( spacer_3, 6, 3 );
78
79     findPB = new QPushButton( this, "findPB" );
80     findPB->setText( tr( "Find &Next" ) );
81
82     SearchDlgLayout->addWidget( findPB, 0, 3 );
83
84     replacePB = new QPushButton( this, "replacePB" );
85     replacePB->setText( tr( "&Replace" ) );
86
87     SearchDlgLayout->addWidget( replacePB, 1, 3 );
88
89     replaceAllPB = new QPushButton( this, "replaceAllPB" );
90     replaceAllPB->setText( tr( "Replace &All " ) );
91
92     SearchDlgLayout->addMultiCellWidget( replaceAllPB, 2, 3, 3, 3 );
93
94     searchBack = new QCheckBox( this, "searchBack" );
95     searchBack->setText( tr( "Search &backwards" ) );
96
97     SearchDlgLayout->addMultiCellWidget( searchBack, 5, 5, 0, 1 );
98
99     cancelPB = new QPushButton( this, "cancelPB" );
100     cancelPB->setText( tr( "&Cancel" ) );
101
102     SearchDlgLayout->addMultiCellWidget( cancelPB, 4, 5, 3, 3 );
103
104     // signals and slots connections
105     connect( findPB, SIGNAL( clicked() ), this, SLOT( Find() ) );
106     connect( replacePB, SIGNAL( clicked() ), this, SLOT( Replace() ) );
107     connect( replaceAllPB, SIGNAL( clicked() ), this, SLOT( ReplaceAll() ) );
108     connect( cancelPB, SIGNAL( clicked() ), this, SLOT( cancel_adaptor() ) );
109
110     // tab order
111     setTabOrder( find, replace );
112     setTabOrder( replace, caseSensitive );
113     setTabOrder( caseSensitive, matchWord );
114     setTabOrder( matchWord, searchBack );
115     setTabOrder( searchBack, findPB );
116     setTabOrder( findPB, replacePB );
117     setTabOrder( replacePB, replaceAllPB );
118     setTabOrder( replaceAllPB, cancelPB );
119 }
120
121 /*  
122  *  Destroys the object and frees any allocated resources
123  */
124 SearchDlg::~SearchDlg()
125 {
126     // no need to delete child widgets, Qt does it all for us
127 }
128
129 void SearchDlg::Find()
130 {
131     qWarning( "SearchDlg::Find(): Not implemented yet!" );
132 }
133
134 void SearchDlg::Replace()
135 {
136     qWarning( "SearchDlg::Replace(): Not implemented yet!" );
137 }
138
139 void SearchDlg::ReplaceAll()
140 {
141     qWarning( "SearchDlg::ReplaceAll(): Not implemented yet!" );
142 }
143
144 void SearchDlg::cancel_adaptor()
145 {
146     qWarning( "SearchDlg::cancel_adaptor(): Not implemented yet!" );
147 }
148