Sha256: 0b3360a149e29337da31ec24704d81087670c71eb980333aa06274a376e72366
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
require 'Qt4' require 'clevic/qt/ui/search_dialog_ui.rb' require 'qtext/flags.rb' module Clevic class SearchDialog include QtFlags attr_reader :match_flags, :layout def initialize @layout = Ui_SearchDialog.new @dialog = Qt::Dialog.new @layout.setupUi( @dialog ) end def from_start? layout.from_start.value end def from_start=( value ) layout.from_start.value = value end def regex? layout.regex.value end def whole_words? layout.whole_words.value end def search_combo layout.search_combo end def forwards? layout.forwards.checked? end def backwards? layout.backwards.checked? end # return either :backwards or :forwards def direction return :forwards if forwards? return :backwards if backwards? raise "direction not known" end def exec( text = '' ) search_combo.edit_text = text.to_s search_combo.set_focus retval = @dialog.exec # remember previous searches if search_combo.find_text( search_combo.current_text ) == -1 search_combo.add_item( search_combo.current_text ) end retval end def search_text search_combo.current_text end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
clevic-0.13.0.b1 | lib/clevic/qt/search_dialog.rb |