Class: QDA::GUI::DocTextViewer
- Inherits:
-
HighlightingTextCtrl
- Object
- Wx::TextCtrl
- TrueSelectionTextCtrl
- HighlightingTextCtrl
- QDA::GUI::DocTextViewer
- Includes:
- FindableText
- Defined in:
- lib/weft/wxgui/controls/textcontrols.rb
Constant Summary collapse
- DOCTEXT_STYLE =
Wx::TE_MULTILINE|Wx::TE_READONLY| Wx::TE_RICH|Wx::TE_NOHIDESEL
Constants included from HighlightingTextCtrl::TextColourHighlighter
HighlightingTextCtrl::TextColourHighlighter::HIGHLIGHTED_STYLE, HighlightingTextCtrl::TextColourHighlighter::NORMAL_STYLE
Constants inherited from TrueSelectionTextCtrl
TrueSelectionTextCtrl::NEWLINE_CORRECTION_FACTOR
Instance Attribute Summary collapse
-
#docid ⇒ Object
readonly
Returns the value of attribute docid.
Instance Method Summary collapse
-
#highlight_codeset(codeset) ⇒ Object
highlight all the passages found.
- #highlight_codingtable(codes) ⇒ Object
-
#initialize(parent, docid) ⇒ DocTextViewer
constructor
A new instance of DocTextViewer.
-
#selection_to_fragments ⇒ Object
in this case simply returns a single code, representing the extent of the document currently highlighted.
Methods included from FindableText
#get_subject, #on_find, #on_find_close, #searching_down?, #searching_up?, #start_find
Methods included from HighlightingTextCtrl::TextColourHighlighter
#clear, #highlight, #unhighlight
Methods included from HighlightingTextCtrl::NullHighlighter
Methods inherited from TrueSelectionTextCtrl
#save_position, #true_index_to_pos, #true_insertion_point, #true_point, #true_selection
Constructor Details
#initialize(parent, docid) ⇒ DocTextViewer
Returns a new instance of DocTextViewer.
278 279 280 281 282 283 |
# File 'lib/weft/wxgui/controls/textcontrols.rb', line 278 def initialize(parent, docid) super( parent, -1, '', Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, DOCTEXT_STYLE) @docid = docid end |
Instance Attribute Details
#docid ⇒ Object (readonly)
Returns the value of attribute docid.
273 274 275 |
# File 'lib/weft/wxgui/controls/textcontrols.rb', line 273 def docid @docid end |
Instance Method Details
#highlight_codeset(codeset) ⇒ Object
highlight all the passages found
299 300 301 302 303 304 305 306 |
# File 'lib/weft/wxgui/controls/textcontrols.rb', line 299 def highlight_codeset(codeset) save_position do unhighlight() codeset.each do | area | highlight( area.offset, area.end ) end end end |
#highlight_codingtable(codes) ⇒ Object
294 295 296 |
# File 'lib/weft/wxgui/controls/textcontrols.rb', line 294 def highlight_codingtable(codes) highlight_codeset( codes[@docid] ) end |
#selection_to_fragments ⇒ Object
in this case simply returns a single code, representing the extent of the document currently highlighted.
287 288 289 290 291 292 |
# File 'lib/weft/wxgui/controls/textcontrols.rb', line 287 def selection_to_fragments() start, finish = true_selection() length = finish - start return [] if length == 0 QDA::CodeSet[ QDA::Code.new(@docid, start, length) ] end |