# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3/QScintilla/SearchReplaceForm.ui'
#
# Created: Mon Jan 20 20:44:58 2003
#      by: The PyQt User Interface Compiler (pyuic)
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *


class SearchReplaceForm(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

        if not name:
            self.setName("SearchReplaceForm")


        SearchReplaceFormLayout = QVBoxLayout(self,6,6,"SearchReplaceFormLayout")

        Layout10 = QGridLayout(None,1,1,0,6,"Layout10")

        self.replaceTextLabel = QLabel(self,"replaceTextLabel")

        Layout10.addWidget(self.replaceTextLabel,1,0)

        self.replacetextCombo = QComboBox(0,self,"replacetextCombo")
        self.replacetextCombo.setSizePolicy(QSizePolicy(7,0,0,0,self.replacetextCombo.sizePolicy().hasHeightForWidth()))
        self.replacetextCombo.setEditable(1)
        self.replacetextCombo.setInsertionPolicy(QComboBox.AtTop)
        self.replacetextCombo.setDuplicatesEnabled(0)

        Layout10.addWidget(self.replacetextCombo,1,1)

        Layout9 = QGridLayout(None,1,1,0,6,"Layout9")

        self.wrapCheckBox = QCheckBox(self,"wrapCheckBox")

        Layout9.addWidget(self.wrapCheckBox,2,1)

        self.backwardsCheckBox = QCheckBox(self,"backwardsCheckBox")

        Layout9.addWidget(self.backwardsCheckBox,1,1)

        self.wordCheckBox = QCheckBox(self,"wordCheckBox")

        Layout9.addWidget(self.wordCheckBox,1,0)

        self.caseCheckBox = QCheckBox(self,"caseCheckBox")

        Layout9.addWidget(self.caseCheckBox,0,0)

        self.regexpCheckBox = QCheckBox(self,"regexpCheckBox")

        Layout9.addWidget(self.regexpCheckBox,2,0)

        Layout10.addLayout(Layout9,2,1)

        self.findtextCombo = QComboBox(0,self,"findtextCombo")
        self.findtextCombo.setSizePolicy(QSizePolicy(7,0,0,0,self.findtextCombo.sizePolicy().hasHeightForWidth()))
        self.findtextCombo.setEditable(1)
        self.findtextCombo.setInsertionPolicy(QComboBox.AtTop)
        self.findtextCombo.setDuplicatesEnabled(0)

        Layout10.addWidget(self.findtextCombo,0,1)

        self.TextLabel1 = QLabel(self,"TextLabel1")

        Layout10.addWidget(self.TextLabel1,0,0)
        SearchReplaceFormLayout.addLayout(Layout10)

        Layout8 = QHBoxLayout(None,0,6,"Layout8")
        spacer = QSpacerItem(16,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
        Layout8.addItem(spacer)

        self.findButton = QPushButton(self,"findButton")
        self.findButton.setEnabled(0)
        Layout8.addWidget(self.findButton)

        self.findNextButton = QPushButton(self,"findNextButton")
        self.findNextButton.setEnabled(0)
        Layout8.addWidget(self.findNextButton)

        self.replaceButton = QPushButton(self,"replaceButton")
        self.replaceButton.setEnabled(0)
        Layout8.addWidget(self.replaceButton)

        self.replaceAllButton = QPushButton(self,"replaceAllButton")
        self.replaceAllButton.setEnabled(0)
        Layout8.addWidget(self.replaceAllButton)

        self.cancelButton = QPushButton(self,"cancelButton")
        Layout8.addWidget(self.cancelButton)
        spacer_2 = QSpacerItem(16,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
        Layout8.addItem(spacer_2)
        SearchReplaceFormLayout.addLayout(Layout8)

        self.languageChange()

        self.resize(QSize(572,199).expandedTo(self.minimumSizeHint()))

        self.connect(self.cancelButton,SIGNAL("clicked()"),self,SLOT("close()"))
        self.connect(self.findButton,SIGNAL("clicked()"),self.handleFind)
        self.connect(self.findNextButton,SIGNAL("clicked()"),self.handleFindNext)
        self.connect(self.findtextCombo,SIGNAL("textChanged(const QString&)"),self.enableFindButtons)
        self.connect(self.replaceButton,SIGNAL("clicked()"),self.handleReplace)
        self.connect(self.replaceAllButton,SIGNAL("clicked()"),self.handleReplaceAll)
        self.connect(self.caseCheckBox,SIGNAL("clicked()"),self.enableFindButtons)
        self.connect(self.backwardsCheckBox,SIGNAL("clicked()"),self.enableFindButtons)
        self.connect(self.wordCheckBox,SIGNAL("clicked()"),self.enableFindButtons)
        self.connect(self.regexpCheckBox,SIGNAL("clicked()"),self.enableFindButtons)
        self.connect(self.wrapCheckBox,SIGNAL("clicked()"),self.enableFindButtons)

        self.setTabOrder(self.findtextCombo,self.replacetextCombo)
        self.setTabOrder(self.replacetextCombo,self.caseCheckBox)
        self.setTabOrder(self.caseCheckBox,self.wordCheckBox)
        self.setTabOrder(self.wordCheckBox,self.regexpCheckBox)
        self.setTabOrder(self.regexpCheckBox,self.backwardsCheckBox)
        self.setTabOrder(self.backwardsCheckBox,self.wrapCheckBox)
        self.setTabOrder(self.wrapCheckBox,self.findButton)
        self.setTabOrder(self.findButton,self.findNextButton)
        self.setTabOrder(self.findNextButton,self.replaceButton)
        self.setTabOrder(self.replaceButton,self.replaceAllButton)
        self.setTabOrder(self.replaceAllButton,self.cancelButton)

        self.replaceTextLabel.setBuddy(self.replacetextCombo)
        self.TextLabel1.setBuddy(self.findtextCombo)

    def languageChange(self):
        self.setCaption(self.tr("Find and Replace"))
        self.replaceTextLabel.setText(self.tr("Replace te&xt:"))
        self.wrapCheckBox.setText(self.tr("Wra&p around"))
        self.backwardsCheckBox.setText(self.tr("Search &backwards"))
        self.wordCheckBox.setText(self.tr("Whole &word"))
        self.caseCheckBox.setText(self.tr("&Match upper/lower case"))
        self.regexpCheckBox.setText(self.tr("Regular &Expression"))
        self.TextLabel1.setText(self.tr("Find &text:"))
        self.findButton.setText(self.tr("&Find"))
        self.findNextButton.setText(self.tr("Find &Next"))
        self.replaceButton.setText(self.tr("&Replace"))
        self.replaceAllButton.setText(self.tr("Replace &All"))
        self.cancelButton.setText(self.tr("&Cancel"))

    def enableFindButtons(self):
        print "SearchReplaceForm.enableFindButtons(): Not implemented yet"

    def handleFind(self):
        print "SearchReplaceForm.handleFind(): Not implemented yet"

    def handleFindNext(self):
        print "SearchReplaceForm.handleFindNext(): Not implemented yet"

    def handleReplace(self):
        print "SearchReplaceForm.handleReplace(): Not implemented yet"

    def handleReplaceAll(self):
        print "SearchReplaceForm.handleReplaceAll(): Not implemented yet"


if __name__ == "__main__":
    a = QApplication(sys.argv)
    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
    w = SearchReplaceForm()
    a.setMainWidget(w)
    w.show()
    a.exec_loop()
