Page 1 of 1 1
Topic Options
#212950 - 2017-11-24 01:54 PM TextBox[HELP]
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 89
Loc: Brasil, João pessoa
[PtBr]
Olá a todos, eu gostaria de saber como faço para saber onde o cursor de digitação está dentro do texto como um todo.

[Eng]
Hello everyone, I would like to know how do I know where the typing cursor is inside the text as a whole.

 PHP:
break on $sys = createObject('kixtart.system') $frm = $sys.form() $frm.size = 450, 400 $tx = $frm.textbox $tx.dock = 5 $tx.text = 'ola1'+@crlf+'ola2'+@crlf+'ola3'+@crlf $frm.show while $frm.visible $=Execute($frm.doevents(1)) sleep 0.05 $ln = ubound(Split($tx.text, @crlf))+1 $lns = ubound(Split(substr($tx.text, 1, $tx.SelectionStart+1), @crlf))+1 $tx.SelectionStart-1? Len($tx.text)-$ln? $ln? $frm.text = "Length:"+Cstr(Len($tx.text))+ " | Lines:"+cstr($ln)+ " | Pos:"+Cstr($tx.SelectionStart+1)+ " | Line pos:"+cstr($lns) $lns = 0 $text = '' loop

Top
#213001 - 2017-11-27 01:38 PM Re: TextBox[HELP] [Re: AndreLuiz]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ola Andre,

tested your demo script and Pos: in the Forms title already shows the position for me ...
What is odd and maybe a bug is that even if I add those 2 lines in the constructor section

 Code: 
$tx.mulitline = True
$tx.WordWrap = True


the text is still displayed in one line having 2 non-displayed chacters for cr and lf.
Can someone verify this?

currently using kf 2.47.5.0 on Windows 7 Enterprise with KiXtart 4.67

here a screenshot:


Attachments
373.png
Description:


_________________________



Top
#213002 - 2017-11-27 02:03 PM Re: TextBox[HELP] [Re: Jochen]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
 Code: 
$tx.multiline = 1

Works for me.

 Code: 
break on

$sys    = createObject('kixtart.system')
$frm    = $sys.form()

$frm.size = 450, 400
$tx = $frm.textbox
$tx.dock = 5
$tx.multiline = 1
$tx.text = 'ola1'+@crlf+'ola2'+@crlf+'ola3'+@crlf

$frm.show
while $frm.visible
    $=Execute($frm.doevents(1))
    sleep 0.05
    $ln = ubound(Split($tx.text, @crlf))+1
    $lns = ubound(Split(substr($tx.text, 1, $tx.SelectionStart+1), @crlf))+1
    $tx.SelectionStart-1?
    Len($tx.text)-$ln?
    $ln?
    $frm.text =
    "Length:"+Cstr(Len($tx.text))+
    " | Lines:"+cstr($ln)+
    " | Pos:"+Cstr($tx.SelectionStart+1)+
    " | Line pos:"+cstr($lns)
    $lns = 0
    $text = ''
loop

Top
#213004 - 2017-11-27 02:41 PM Re: TextBox[HELP] [Re: Arend_]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Arend,
what Kixforms Version do you have in use?
_________________________



Top
#213005 - 2017-11-27 03:50 PM Re: TextBox[HELP] [Re: Jochen]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
 Originally Posted By: Jochen
Arend,
what Kixforms Version do you have in use?


Tested a patched version of 2.47.5 and now using 2.47.6.
I think you made a typo in "multiline"
You typed "mulitline"
Test the code I pasted.

Top
#213006 - 2017-11-27 03:53 PM Re: TextBox[HELP] [Re: Arend_]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
You used:
 Code: 
$tx.mulitline = True


I use:
 Code: 
$tx.multiline = 1

Top
#213008 - 2017-11-27 04:25 PM Re: TextBox[HELP] [Re: Arend_]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4557
Loc: USA
Mulit line.... HA! Business in the front and party in the back. \:\)
Top
#213009 - 2017-11-27 04:28 PM Re: TextBox[HELP] [Re: Allen]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Hahaha Mullet :-)
Top
#213013 - 2017-11-27 07:20 PM Re: TextBox[HELP] [Re: Arend_]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
dammit y'all that's whatcha git from ain't using y'own editar

k, let's hear Andre what the problem is ;\)
_________________________



Top
#213025 - 2017-11-29 05:02 AM Re: TextBox[HELP] [Re: Jochen]
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 89
Loc: Brasil, João pessoa
[PtBr]
Muito obrigado pela ajuda!!!
hahahh, funcionou no textbox, mas no richtextbox não funciona, veja.

[Eng]
Thanks a lot for the help!!!
hahahh, it ran in the textbox, but the richtextbox does not work, see.

 Code: 
break on

$sys    = createObject('kixtart.system')
$frm    = $sys.form()

$frm.size = 450, 400
$tx = $frm.Richtextbox
$tx.dock = 5
$tx.multiline = 1
$tx.text = 'ola1'+@crlf+'ola2'+@crlf+'ola3'+@crlf

$frm.show
while $frm.visible
    $=Execute($frm.doevents(1))
    sleep 0.05
    $ln = ubound(Split($tx.text, @crlf))+1
    $lns = ubound(Split(substr($tx.text, 1, $tx.SelectionStart+1), @crlf))+1
    $tx.SelectionStart-1?
    Len($tx.text)-$ln?
    $ln?
    $frm.text =
    "Length:"+Cstr(Len($tx.text))+
    " | Lines:"+cstr($ln)+
    " | Pos:"+Cstr($tx.SelectionStart+1)+
    " | Line pos:"+cstr($lns)
    $lns = 0
    $text = ''
loop

Top
#213026 - 2017-11-29 11:30 AM Re: TextBox[HELP] [Re: AndreLuiz]
Arend_ Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Works fine here.
What is it exactly that does not work for you?

Top
#213075 - 2017-12-15 01:33 PM Re: TextBox[HELP] [Re: Arend_]
AndreLuiz Offline
Getting the hang of it

Registered: 2015-10-07
Posts: 89
Loc: Brasil, João pessoa
[Eng(Translate)]
Hello, pardon me for the delay.
The error is displayed automatically by an image, notice a column where it is and tell what it should actually have there.

[PtBr]
Olá perdoe-me pela demora.
O erro estará autoexplicativo ao ver a imagem, repare a coluna onde está e conte o que deveria ter ali de fato.



[Eng(Translate)]
I hope they get an algorithm that works with richtextbox, it would be very useful for me, thank you in advance!! \:D

[PtBr]
Espero que consigam um algorítimo que funcione com ritchtextbox, seria muito útil para mim, obrigado desde já!! \:D

Top
Page 1 of 1 1


Moderator:  ShaneEP, Mart, Radimus, Jochen, Allen, Glenn Barnas 
Hop to:
Shout Box
2023-12-29 [BradV] Happy new year!
2024-02-09 [RSLHA] No access possible!
2024-02-09 [RSLHA] Database Error!
2024-02-18 [Dr_Rick] What happened to Bruno
2024-03-08 [mole] Thanks for getting the posts back again.
2024-04-17 [MarineV] db errors
2024-04-18 [MarineV] will the db errors get fixed????
2024-04-26 [Tonny] database error, please!
2024-05-09 [NTDOC] I'm not seeing any errors
2024-05-31 [chojin] DB is down again \:\(
2024-06-04 [selsner] Still no access, please help!
2024-06-07 [mole] Looks like DB is back again. Thanks.
2024-06-17 [It_took_my_meds] We encountered a problem. The reason reported was Database error only visible to forum administrators Please click back to return to the previous page.
2024-07-04 [Armin73] There is still a database error 🤷‍♂️
2024-07-09 [0neZero] There is still a database error 🤷‍♂️
2024-07-10 [Allen] DB working a few times in between the messages above. Working again as of 7/10. Thanks Doc
2024-08-31 [NetGnostic] Bummer, the Database error is back.
2024-09-04 [NTDOC] Fourms are back up without error for the moment
2024-10-02 [Arend_] Wll still have database errors ;-)
2024-10-03 [Allen] Thanks to Doc... it's back.
2024-12-09 [chojin] could we move kixtart to a new place in order to keep it living ? maybe create a github page and a subreddit?
2024-12-10 [Allen] do know about moving it, but I know Doc is aware of the DB issue. Should be back online soon.
2024-12-10 [Allen] don't know...
2025-02-09 [Comet] Greetings. I installed KiX on my new Windows 11 computer, and joined this foum. Hello World!
2025-02-10 [Allen] Welcome
2025-02-15 [Glenn Barnas] Discord? Reddit? New URL?
2025-03-07 [Comet] UBB Error We encountered a problem. The reason reported was Database error only visible to forum administrators
2025-06-30 [mole] Thanks for getting this working again.
2025-07-28 [mole] UBB Error We encountered a problem. The reason reported was Database error only visible to forum administrators
2025-08-01 [Arend_] I think it's fixed, I don't have the problem.

Who's Online
0 registered and 581 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.066 seconds in which 0.026 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org