Home | Ruby | Ruby Graphical User Interface |     Share This Page

Listing: regexp_tester_ui.rb


Click here to download original file.

# Form implementation generated from reading ui file 'regexp_tester.ui'
#
# Created: Sun Aug 20 09:12:25 2006
#      by: The QtRuby User Interface Compiler (rbuic)
#
# WARNING! All changes made in this file will be lost!
require 'Qt'
class RegExpTesterUI < Qt::MainWindow
    slots 'languageChange()',
    'regexExecute()',
    'exitAction_activated()',
    'fileReadAction_activated()',
    'fileAbout_activated()',
    'regexReplace_returnPressed()',
    'regexSearch_returnPressed()'
    attr_reader :groupBox1
    attr_reader :textInput
    attr_reader :textLabel1
    attr_reader :regexSearch
    attr_reader :textLabel2
    attr_reader :regexReplace
    attr_reader :groupBox2
    attr_reader :textOutput
    attr_reader :globalCheckBox
    attr_reader :caseCheckBox
    attr_reader :extendedCheckBox
    attr_reader :multilineCheckBox
    attr_reader :regexExecute
    def initialize(parent = nil, name = nil, fl = WType_TopLevel)
        super
        statusBar()
        if name.nil?
        	setName("RegExpTesterUI")
        end
        setCentralWidget(Qt::Widget.new(self, "qt_central_widget"))
        @RegExpTesterUILayout = Qt::GridLayout.new(centralWidget(), 1, 1, 11, 6, 'RegExpTesterUILayout')
        @groupBox1 = Qt::GroupBox.new(centralWidget(), "groupBox1")
        @groupBox1.setColumnLayout( 0, Qt::Vertical )
        @groupBox1.layout().setSpacing(6)
        @groupBox1.layout().setMargin(11)
        @groupBox1Layout = Qt::GridLayout.new(@groupBox1.layout() )
        @groupBox1Layout.setAlignment( AlignTop )
        @textInput = Qt::TextEdit.new(@groupBox1, "textInput")
        @textInput_font = Qt::Font.new(@textInput.font())
        @textInput_font.setFamily("Monospace")
        @textInput.setFont(@textInput_font)
        @groupBox1Layout.addWidget(@textInput, 0, 0)
        @RegExpTesterUILayout.addWidget(@groupBox1, 0, 0)
        @layout6 = Qt::HBoxLayout.new(nil, 0, 6, 'layout6')
        @textLabel1 = Qt::Label.new(centralWidget(), "textLabel1")
        @layout6.addWidget(@textLabel1)
        @regexSearch = Qt::LineEdit.new(centralWidget(), "regexSearch")
        @layout6.addWidget(@regexSearch)
        @textLabel2 = Qt::Label.new(centralWidget(), "textLabel2")
        @layout6.addWidget(@textLabel2)
        @regexReplace = Qt::LineEdit.new(centralWidget(), "regexReplace")
        @layout6.addWidget(@regexReplace)
        @RegExpTesterUILayout.addLayout(@layout6, 1, 0)
        @groupBox2 = Qt::GroupBox.new(centralWidget(), "groupBox2")
        @groupBox2.setColumnLayout( 0, Qt::Vertical )
        @groupBox2.layout().setSpacing(6)
        @groupBox2.layout().setMargin(11)
        @groupBox2Layout = Qt::GridLayout.new(@groupBox2.layout() )
        @groupBox2Layout.setAlignment( AlignTop )
        @textOutput = Qt::TextEdit.new(@groupBox2, "textOutput")
        @textOutput_font = Qt::Font.new(@textOutput.font())
        @textOutput_font.setFamily("Monospace")
        @textOutput.setFont(@textOutput_font)
        @textOutput.setWordWrap( Qt::TextEdit::WidgetWidth )
        @textOutput.setReadOnly( true )
        @groupBox2Layout.addWidget(@textOutput, 0, 0)
        @RegExpTesterUILayout.addWidget(@groupBox2, 3, 0)
        @layout4 = Qt::HBoxLayout.new(nil, 0, 6, 'layout4')
        @globalCheckBox = Qt::CheckBox.new(centralWidget(), "globalCheckBox")
        @globalCheckBox.setChecked( true )
        @layout4.addWidget(@globalCheckBox)
        @caseCheckBox = Qt::CheckBox.new(centralWidget(), "caseCheckBox")
        @caseCheckBox.setChecked( false )
        @layout4.addWidget(@caseCheckBox)
        @extendedCheckBox = Qt::CheckBox.new(centralWidget(), "extendedCheckBox")
        @extendedCheckBox.setChecked( false )
        @layout4.addWidget(@extendedCheckBox)
        @multilineCheckBox = Qt::CheckBox.new(centralWidget(), "multilineCheckBox")
        @multilineCheckBox.setChecked( false )
        @layout4.addWidget(@multilineCheckBox)
        @regexExecute = Qt::PushButton.new(centralWidget(), "regexExecute")
        @layout4.addWidget(@regexExecute)
        @RegExpTesterUILayout.addLayout(@layout4, 2, 0)
        @exitAction= Qt::Action.new(self, "exitAction")
        @fileReadAction= Qt::Action.new(self, "fileReadAction")
        @fileAboutAction= Qt::Action.new(self, "fileAboutAction")
        @qt_dead_widget_MenuBarEditor = Qt::MenuBar.new( self, "qt_dead_widget_MenuBarEditor" )
        @File = Qt::PopupMenu.new( self )
        @fileReadAction.addTo( @File )
        @fileAboutAction.addTo( @File )
        @exitAction.addTo( @File )
        @qt_dead_widget_MenuBarEditor.insertItem( "", @File, 1 )
        @unnamed = Qt::PopupMenu.new( self )
        @qt_dead_widget_MenuBarEditor.insertItem( "", @unnamed, 2 )
        languageChange()
        resize( Qt::Size.new(595, 469).expandedTo(minimumSizeHint()) )
        clearWState( WState_Polished )
        Qt::Object.connect(@regexExecute, SIGNAL("pressed()"), self, SLOT("regexExecute()") )
        Qt::Object.connect(@exitAction, SIGNAL("activated()"), self, SLOT("exitAction_activated()") )
        Qt::Object.connect(@fileReadAction, SIGNAL("activated()"), self, SLOT("fileReadAction_activated()") )
        Qt::Object.connect(@fileAboutAction, SIGNAL("activated()"), self, SLOT("fileAbout_activated()") )
        Qt::Object.connect(@regexReplace, SIGNAL("returnPressed()"), self, SLOT("regexReplace_returnPressed()") )
        Qt::Object.connect(@regexSearch, SIGNAL("returnPressed()"), self, SLOT("regexSearch_returnPressed()") )
    end
    #
    #  Sets the strings of the subwidgets using the current
    #  language.
    #
    def languageChange()
        setCaption(trUtf8("RegExpTester"))
        @groupBox1.setTitle( trUtf8("Input") )
        Qt::ToolTip.add( @textInput, trUtf8("Load or paste sample text here.") )
        @textLabel1.setText( trUtf8("Find:") )
        Qt::ToolTip.add( @regexSearch, trUtf8("Type search argument here.") )
        @textLabel2.setText( trUtf8("Replace With:") )
        Qt::ToolTip.add( @regexReplace, trUtf8("Type replacement argument here.") )
        @groupBox2.setTitle( trUtf8("Output") )
        Qt::ToolTip.add( @textOutput, trUtf8("The processed text will appear here.") )
        @globalCheckBox.setText( trUtf8("&Global") )
        @globalCheckBox.setAccel( Qt::KeySequence.new(trUtf8("Alt+G")) )
        Qt::ToolTip.add( @globalCheckBox, trUtf8("Select if search is to be global.") )
        @caseCheckBox.setText( trUtf8("Case Sensitive") )
        @caseCheckBox.setAccel( Qt::KeySequence.new(nil) )
        Qt::ToolTip.add( @caseCheckBox, trUtf8("Select case sensitive.") )
        @extendedCheckBox.setText( trUtf8("Whitespace") )
        @extendedCheckBox.setAccel( Qt::KeySequence.new(nil) )
        Qt::ToolTip.add( @extendedCheckBox, trUtf8("Select to ignore whitespace in regexp.") )
        @multilineCheckBox.setText( trUtf8("Multiline") )
        @multilineCheckBox.setAccel( Qt::KeySequence.new(nil) )
        Qt::ToolTip.add( @multilineCheckBox, trUtf8("Select to treat newlines as normal character.") )
        @regexExecute.setText( trUtf8("E&xecute") )
        @regexExecute.setAccel( Qt::KeySequence.new(trUtf8("Alt+X")) )
        Qt::ToolTip.add( @regexExecute, trUtf8("Click to carry out search and replacement.") )
        @exitAction.setText(trUtf8("Exit"))
        @exitAction.setMenuText(trUtf8("Exit"))
        @fileReadAction.setText(trUtf8("Read"))
        @fileReadAction.setMenuText(trUtf8("Read"))
        @fileAboutAction.setText(trUtf8("About"))
        @fileAboutAction.setMenuText(trUtf8("About"))
        if !@qt_dead_widget_MenuBarEditor.findItem(1).nil?
                @qt_dead_widget_MenuBarEditor.findItem(1).setText( trUtf8("File") )
        end
        if !@qt_dead_widget_MenuBarEditor.findItem(2).nil?
                @qt_dead_widget_MenuBarEditor.findItem(2).setText( nil )
        end
    end
    protected :languageChange
    def regexExecute(*k)
        print("RegExpTesterUI.regexExecute(): Not implemented yet.\n")
    end
    def exitAction_activated(*k)
        print("RegExpTesterUI.exitAction_activated(): Not implemented yet.\n")
    end
    def fileReadAction_activated(*k)
        print("RegExpTesterUI.fileReadAction_activated(): Not implemented yet.\n")
    end
    def fileAbout_activated(*k)
        print("RegExpTesterUI.fileAbout_activated(): Not implemented yet.\n")
    end
    def regexReplace_returnPressed(*k)
        print("RegExpTesterUI.regexReplace_returnPressed(): Not implemented yet.\n")
    end
    def regexSearch_returnPressed(*k)
        print("RegExpTesterUI.regexSearch_returnPressed(): Not implemented yet.\n")
    end
end
    

Home | Ruby | Ruby Graphical User Interface |     Share This Page