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