|
Home > Archive > Programming with dBASE > November 2005 > Editor's lineno & Columnno
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Editor's lineno & Columnno
|
|
| Agbeniga David 2005-11-21, 9:23 am |
| in dbase plus help, it is reported that, with the editor control properties of lineno and columnno, the character currently at the cursor can be determined by indexing into the value property of the editor. is there anyone that knows how this can be done
because i cant get how to index the value property of this control using the lineno and columnno property of this control
| |
| Marko Mihorko [dBVIPS] 2005-11-23, 11:23 am |
| Hello Agbeniga!
"Agbeniga David" je napisal v sporočilo...
> in dbase plus help, it is reported that, with the editor control properties
> of lineno and columnno, the character currently at the cursor can be
> determined by indexing into the value property of the editor. is there anyone
> that knows how this can be done because i cant get how to index the value
> property of this control using the lineno and columnno property of this
> control
As usual mark/copy/paste/save everything below to a file named f.e.
<agbeniga.wfm> and later on doubleclick on it under the <Forms> tab of the
<Navigator> window.
Then keep clicking wherever in the editor object and at the same time check
also the contents of the textlabel object where six characters, which follow
the current cursor position, should be shown every time...
Marko Mihorko [dBVIPS]
** END HEADER -- do not remove this line
//
// Generated on 23.11.2005
//
parameter bModal
local f
f = new AgbenigaForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class AgbenigaForm of FORM
with (this)
text = "Agbeniga - Editor's lineno & Columnno"
endwith
this.EDITOR1 = new EDITOR(this)
with (this.EDITOR1)
onLeftMouseDown = class::EDITOR1_ONLEF
TMOUSEDOWN
height = 15
left = 1
top = 0.5
width = 38
value = "in dbase plus help, it is reported that, with " + ;
"the editor control properties of lineno and " + ;
"columnno, the character currently at the " + ;
"cursor can be determined by indexing into " + ;
"the value property of the editor. is there " + ;
"anyone that knows how this can be done " + ;
"because i cant get how to index the value " + ;
"property of this control using the lineno "+;
"and columnno property of this control"
endwith
this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
left = 15
top = 10
width = 10
text = ""
fontBold = true
alignHorizontal = 1
endwith
function EDITOR1_onLeftMouseD
own(flags, col, row)
posX = this.lineNo
posY = this.columnNo
this.lineNo = 1
this.keyboard("{End}")
pos_clicked = 0
for i = 1 to posX - 1
pos_clicked += this.columnNo - 1
this.keyboard("{DnArrow}")
endfor
pos_clicked += posY
this.keyboard("{Home}")
this.columnNo = posY
form.textlabel1.text = this.value;
. substring(pos_clicke
d - 1, pos_clicked + 5)
return
endclass
|
|
|
|
|