Method: QDA::GUI::FindableText#start_find

Defined in:
lib/weft/wxgui/controls/textcontrols.rb

#start_find(parent_win) ⇒ Object



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/weft/wxgui/controls/textcontrols.rb', line 190

def start_find(parent_win)
  if not @f_dialog
    @f_dialog = Wx::FindReplaceDialog.new( parent_win, @f_data,
                                           "Find text", Wx::FR_NOWHOLEWORD )
  end
  if not @hooked
    # TextCtrl doesn't receive evt_find, so route through parent
    parent_win.evt_find(-1) { | e | on_find(e) }
    parent_win.evt_find_next(-1) { | e | on_find(e) }
    parent_win.evt_find_close(-1) { | e | on_find_close(e) }
    # ensure dialog is destroyed when parent is closed
    parent_win.evt_close() { | e | on_find_close(e) }
    @hooked = parent_win
  end
  @f_dialog.show()
end