Class: VRText

Inherits:
VREdit show all
Defined in:
lib/vr/vrcontrol.rb

Direct Known Subclasses

VRRichedit

Constant Summary collapse

WINCLASSINFO =

VRText

Mutiline Editbox. Parent class is ((<VREdit>))

Methods

— scrollTo(line.col)

Scrolls ((|line|)) lines vertically and ((|col|)) columns horizontally.

— visibleStartLine

Returns line number of the first visible line in the editbox.

— countLines

Returns max line number.

— getLineLengthOf(ln)

Returns length of the ((|ln|))-th line.

— getLineTextOf(ln,maxlen)

Returns text of ((|ln|))-th line. If maxlen is specified, returned text is
limited in its length.

— scrollup

Scrolls line up in the editbox.

— scrolldown

Scrolls line down in the editbox.

— scrollupPage

Scrolls page up in the editbox.

— scrolldownPage

Scrolls page down in the editbox.

— scrolltocaret

Scrolls the caret into view in the editbox.

— char2line(ptr)

Returns the index of the line that contains the specified character index.

— line2char(ln)

Returns the character index of a line.

— getCurrentLine

Returns the current line index.
["EDIT",
 WStyle::ES_MULTILINE|WStyle::ES_AUTOVSCROLL,WExStyle::WS_EX_CLIENTEDGE
]

Constants inherited from VREdit

VREdit::VR_REGEXPNEWLINE

Instance Attribute Summary

Attributes inherited from VRControl

#handlers, #name, #parent

Attributes inherited from VRWinComponent

#parent, #screen

Instance Method Summary collapse

Methods inherited from VREdit

#clear, #copy, #cut, #getSel, #limit, #limit=, #modified, #modified=, #paste, #readonly=, #replaceSel, #setCaret, #setSel, #text, #text=, #undo, #vrinit, #vrinitnew

Methods inherited from VRStdControl

#_vr_cmdhandlers, #addCommandHandler, #deleteCommandHandler

Methods inherited from VRControl

Controltype, #add_parentcall, #call_parenthandler, #create, #setFont

Methods inherited from VRWinComponent

#_init, #create, #exwinstyle, #hide, #maximizebox, #maximizebox=, #minimizebox, #minimizebox=, #setscreen, #sizebox, #sizebox=, #tabstop, #tabstop=, #vrinit, #winstyle

Instance Method Details

#char2line(ptr) ⇒ Object



506
507
508
# File 'lib/vr/vrcontrol.rb', line 506

def char2line(ptr)
  sendMessage 0xc9,ptr.to_i,0        #LINEFROMCHAR
end

#countLinesObject



477
478
479
# File 'lib/vr/vrcontrol.rb', line 477

def countLines
  sendMessage 0x00BA,0,0
end

#getCurrentLineObject



512
513
514
# File 'lib/vr/vrcontrol.rb', line 512

def getCurrentLine
  char2line(-1)
end

#getLineLengthOf(l) ⇒ Object



488
489
490
# File 'lib/vr/vrcontrol.rb', line 488

def getLineLengthOf(l)
  sendMessage 0xc1,l.to_i,0          #GETLINELENGTH
end

#getLineTextOf(l, textsize = getLineLengthOf(l)) ⇒ Object



491
492
493
494
495
# File 'lib/vr/vrcontrol.rb', line 491

def getLineTextOf(l,textsize=getLineLengthOf(l))
  r=pack("Ia",textsize," "*textsize)
  len=sendMessage 0xc4,l.to_i,r
  r[0,len]
end

#line2char(l) ⇒ Object



509
510
511
# File 'lib/vr/vrcontrol.rb', line 509

def line2char(l)
  sendMessage 0xbb,l.to_i,0          #LINEINDEX
end

#scrolldownObject



498
# File 'lib/vr/vrcontrol.rb', line 498

def scrolldown() c_scroll 1; end

#scrolldownPageObject



500
# File 'lib/vr/vrcontrol.rb', line 500

def scrolldownPage() c_scroll 3; end

#scrollTo(line, col) ⇒ Object



481
482
483
# File 'lib/vr/vrcontrol.rb', line 481

def scrollTo(line,col)
  sendMessage 0x00B6,0,MAKELPARAM(line,col)    #LINESCROLL
end

#scrolltocaretObject



502
503
504
# File 'lib/vr/vrcontrol.rb', line 502

def scrolltocaret
  sendMessage 0xb7,0,0               #SCROLLCARET
end

#scrollupObject



497
# File 'lib/vr/vrcontrol.rb', line 497

def scrollup() c_scroll 0; end

#scrollupPageObject



499
# File 'lib/vr/vrcontrol.rb', line 499

def scrollupPage() c_scroll 2; end

#visibleStartLineObject



484
485
486
# File 'lib/vr/vrcontrol.rb', line 484

def visibleStartLine()
  sendMessage 0x00CE,0,0             #GETFIRSTVISIBLELINE
end