Line Wrap
Moderators: Susan Smith, admin, Gabriel
This was changed in 4.2 because CURROW and CURCOL are needed to identify which control a user is in at the time control is returned to a program. I know, we have CURFLD available, but that, along with NXTFLD, is restricted to the currently active INPUT operation. It does nothing for the situation where someone clicks on a hot window and you need to know which control they clicked on. Now you may argue that NXTROW/NXTFLD could also be character position variable, but that immensely complicates control identification in the clicked on window.
But wait I hear something coming to the rescue...
Ahh it's OPTION 59... Use cursor position instead of field position for CURROW, etc. This can be toggled on and off as needed.
But wait I hear something coming to the rescue...
Ahh it's OPTION 59... Use cursor position instead of field position for CURROW, etc. This can be toggled on and off as needed.
Well so far nobody could quite get the editable multiline textbox working to begin with.John wrote:Okay - so now I have a mutlilined text box with text that wraps at the correct spots FABULOUS. Now what I'd like to do is make little pieces of that text hot and perhaps underline it. Is there any chance this might be possible?
Gabriel
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
I can't imagine how you'd get PART of a field to be hot unless you REPRINT the hot text portion on top of the existing text in order for that to happen, but that would be based on screen position. The minute they edit the field, moving the hot text from it's original position, your hot text would change.
Are you trying to add hyperlinks to PART of a EDITABLE multi-line input field control?
It might be possible in a non-editable field, but I'm not seeing how you could do it in an editable field.
-- Susan
Are you trying to add hyperlinks to PART of a EDITABLE multi-line input field control?
It might be possible in a non-editable field, but I'm not seeing how you could do it in an editable field.
-- Susan
ok awesome:
00002 let cr$=chr$(13) : let lf$=chr$(10) : let crlf$=cr$&lf$
00005 dim a$*1000
00010 open #1: 'srow=5,scol=5,name=tom,rows=10,cols=20,parent=none,relative',display,output
00012 do
00020 let a$='try'&cr$&'this'&lf$&'and this'&crlf$&'and this but really long stuff will auto wrap around and \n does nothing'
00022 print #1,fields "1,1,C "&str$(len(a$))&',S': a$
00024 !
00030 open #2: 'srow=2,scol=2,rows=1,cols=5,parent=1,border=none',d,o
00040 pr #2,fields '1,1,Cc 5,[Button],B5':'hot'
00050 !
00800 input #1,fields '10,20,Cc 1': pause$
00900 loop until fkey=99 or fkey=5
01900 pr 'fkey=';fkey
this will put a button over one section of text in the multiline text box. It just opens up a child window over the right spot and prints a hot button in it. simple. I'd would like to make it just a hair shorter so it didn't cover up the top of the next line... maybe 4.3 will let me do that... for now maybe when i detect these i'll just auto add another blank line.
Anyway - it's not the most elegant solution, but I think it will work for me.
-John
00002 let cr$=chr$(13) : let lf$=chr$(10) : let crlf$=cr$&lf$
00005 dim a$*1000
00010 open #1: 'srow=5,scol=5,name=tom,rows=10,cols=20,parent=none,relative',display,output
00012 do
00020 let a$='try'&cr$&'this'&lf$&'and this'&crlf$&'and this but really long stuff will auto wrap around and \n does nothing'
00022 print #1,fields "1,1,C "&str$(len(a$))&',S': a$
00024 !
00030 open #2: 'srow=2,scol=2,rows=1,cols=5,parent=1,border=none',d,o
00040 pr #2,fields '1,1,Cc 5,[Button],B5':'hot'
00050 !
00800 input #1,fields '10,20,Cc 1': pause$
00900 loop until fkey=99 or fkey=5
01900 pr 'fkey=';fkey
this will put a button over one section of text in the multiline text box. It just opens up a child window over the right spot and prints a hot button in it. simple. I'd would like to make it just a hair shorter so it didn't cover up the top of the next line... maybe 4.3 will let me do that... for now maybe when i detect these i'll just auto add another blank line.
Anyway - it's not the most elegant solution, but I think it will work for me.
-John
If you do not want the button to appear, but want the functionality that you are getting you could:
Create a small totally trnasparent graphic
Put the graphic name in a variable$
Do a rinput of the graphic over your print field - s using the P format with help text, with or without a wait
You would not see the grphic, but if your user moused over the graphic area the tool tip would appear and the mouse pointer would go to a finger. Clisking would produce the Fkey.
Create a small totally trnasparent graphic
Put the graphic name in a variable$
Do a rinput of the graphic over your print field - s using the P format with help text, with or without a wait
You would not see the grphic, but if your user moused over the graphic area the tool tip would appear and the mouse pointer would go to a finger. Clisking would produce the Fkey.
- Attachments
-
- Transparent GIF
- Blank.gif (941 Bytes) Viewed 10706 times
00002 let cr$=chr$(13) : let lf$=chr$(10) : let crlf$=cr$&lf$
00005 dim a$*1000
02000 open #1: 'srow=5,scol=5,name=tom,rows=10,cols=20,parent=none,relative',display,output
02200 do
02400 let a$=''
02600 let a$(inf:0)='try'&cr$
02800 let a$(inf:0)='this'&cr$
03000 let a$(inf:0)='and this'&cr$
03200 let a$(inf:0)='and this but really long stuff will auto wrap around and \n does nothing'&cr$
03400 let a$(inf:0)='c:\cls\work\tmp.txt'
03600 print #1,fields "1,1,C "&str$(len(a$))&',S': a$
03800 !
04000 open #2: 'srow=2,scol=2,rows=1,cols=5,parent=1,border=none',d,o
04200 ! pr #2,fields '1,1,Cc 5,[Button],B5':'hot'
04400 open #h_child:=3: 'Parent=1,Border=None,SRow=5,SCol=17,Rows=1,Cols=2',display,output
04600 print #h_child,fields '1,1,P 1/2,[W],2001',help '2R;c:\cls\work\tmp.txt\nClick to copy.;': 'Open.png:isotropic'
04800 !
05000 input #1,fields '10,20,Cc 1': pause$
05200 loop until fkey=99 or fkey=5
05400 pr 'fkey=';fkey
Well - it kinda works - the problem lies in resizing. you'll need a picture called open.png to use this example.
I wouldn't mind the line wrap changing at wierd sizes so much - if I could just keep the little folder pic on the same line as the text that is the filename.
Any ideas?
00005 dim a$*1000
02000 open #1: 'srow=5,scol=5,name=tom,rows=10,cols=20,parent=none,relative',display,output
02200 do
02400 let a$=''
02600 let a$(inf:0)='try'&cr$
02800 let a$(inf:0)='this'&cr$
03000 let a$(inf:0)='and this'&cr$
03200 let a$(inf:0)='and this but really long stuff will auto wrap around and \n does nothing'&cr$
03400 let a$(inf:0)='c:\cls\work\tmp.txt'
03600 print #1,fields "1,1,C "&str$(len(a$))&',S': a$
03800 !
04000 open #2: 'srow=2,scol=2,rows=1,cols=5,parent=1,border=none',d,o
04200 ! pr #2,fields '1,1,Cc 5,[Button],B5':'hot'
04400 open #h_child:=3: 'Parent=1,Border=None,SRow=5,SCol=17,Rows=1,Cols=2',display,output
04600 print #h_child,fields '1,1,P 1/2,[W],2001',help '2R;c:\cls\work\tmp.txt\nClick to copy.;': 'Open.png:isotropic'
04800 !
05000 input #1,fields '10,20,Cc 1': pause$
05200 loop until fkey=99 or fkey=5
05400 pr 'fkey=';fkey
Well - it kinda works - the problem lies in resizing. you'll need a picture called open.png to use this example.
I wouldn't mind the line wrap changing at wierd sizes so much - if I could just keep the little folder pic on the same line as the text that is the filename.
Any ideas?