World: r3wp
[View] discuss view related issues
older newer | first last |
Ryan 15-Jan-2005 [220] | I do know a bit about selecting text. |
eFishAnt 15-Jan-2005 [221] | have you tried chainging the shape of the caret? |
Ryan 15-Jan-2005 [222] | nope, thats one level beyond me. |
eFishAnt 15-Jan-2005 [223x3] | well, for a baby step, I want to have the caret by default at the beginning of the text, without having to tap it with the mouse. |
and some keycodes to move the caret about. | |
(this might just be as simple as finding a good style to use... | |
Ryan 15-Jan-2005 [226x3] | try setfocus |
err, focus rather | |
caret position is simply the text position (series position) of the text. | |
eFishAnt 15-Jan-2005 [229] | ah, that is simple...thanks. |
Ryan 15-Jan-2005 [230x3] | there is some caret functions for decoding relative position too, but I havent used them in years. |
caret-to bla bla bla | |
bla bla bla to-caret | |
eFishAnt 15-Jan-2005 [233] | sounds like "eh, what's up, doc?" |
Ryan 15-Jan-2005 [234x2] | ahh, offset-to-caret |
and caret-to-offset | |
eFishAnt 15-Jan-2005 [236] | is that for drag-selecting text? |
Ryan 15-Jan-2005 [237x2] | you would use it to implement text dragging possibly. offset-to-caret returns the position of text relative to a graphical position x/y. |
i assume you have probably already used highlight-start and highlight-end. | |
eFishAnt 15-Jan-2005 [239x2] | no, I have just used text-area for stuff like that...now I need to change the behavior of it some. |
it's a skinny caret on the left side of the area...but thick everywhere else. | |
Ryan 15-Jan-2005 [241x2] | sel-start: does [ if none? system/view/highlight-start [return none] if (index? system/view/highlight-end) < (index? system/view/highlight-start) [ return system/view/highlight-end ] system/view/highlight-start ] sel-end: does [ if none? system/view/highlight-end [return none] if (index? system/view/highlight-start) > (index? system/view/highlight-end) [ return system/view/highlight-start ] system/view/highlight-end ] |
try para [origin: 4x4] | |
eFishAnt 15-Jan-2005 [243] | understand...but that is there already...origin: 4x4 I mean |
Ryan 15-Jan-2005 [244x2] | BTW: The above functions keep sel-start as a lower index position than sel-end. These can be either way with highlight |
cant replicate the skinny caret. view layout [area] | |
eFishAnt 15-Jan-2005 [246] | is there some old discussions on this where I can read some discussions?...I don't want to hog the channel as I play text area catch up. |
Ryan 15-Jan-2005 [247] | Dont know, I figured it out largely by examining the ctx-edit object (view editor) |
eFishAnt 15-Jan-2005 [248] | ah, cool, I will play with that some. Aren't you making an editor of some type? |
Ryan 15-Jan-2005 [249] | A rebol code editor. |
eFishAnt 15-Jan-2005 [250] | ah, one that is syntax sensitive, right? |
Ryan 15-Jan-2005 [251x3] | I have played with that, but not this one. |
it does do some code interpetation, but just for generating a manifest for function libraries. | |
halfway there. | |
eFishAnt 15-Jan-2005 [254] | cool. Thanks for the ideas, I am going to go back and bang on it for the rest of the night... |
Ryan 15-Jan-2005 [255] | same here, cya! |
Terry 16-Jan-2005 [256] | Is there someway to do this.. X: [btn: "test" [print "test"]] view layout [ X ] |
Sunanda 16-Jan-2005 [257] | View layout X should work (You probably don't want the colon on btn) |
Terry 16-Jan-2005 [258] | >> x: [btn "quit"[]] == [btn "quit" []] >> view layout [x] Unknown word or style: x >> |
Sunanda 16-Jan-2005 [259] | view layout x -- x is already a block/.....No need to put in in another one. |
Terry 16-Jan-2005 [260] | ok, but how can i form the X code and use it within a layout? |
Sunanda 16-Jan-2005 [261] | I tend to dio something like: x: copy [] append x 'btn append x "quit" Compose is useful here too for more complex layout building. |
Terry 16-Jan-2005 [262x2] | That still doesnt get my bit of view code into the layout. |
unless you're building the layout.. but I'm looking to add a word that represents some bit of view code. | |
Sunanda 16-Jan-2005 [264] | It's trickier if you've already usd layout to convert the dialect to VID objects -- then you need to read up on make-face and similar functions. Pre build, just do things like: x: [button "hi" [print "hello"]] y: [button "bye" [print "goodbye"]] z: [] append z y append z x view layout z >> |
Graham 16-Jan-2005 [265] | >> x: [ btn "quit" [] ] == [btn "quit" []] >> view layout do [ x ] |
Terry 16-Jan-2005 [266] | I"m not just doing X, i might do Y and Z as well. |
Graham 16-Jan-2005 [267] | but you didn't say that ... |
Sunanda 16-Jan-2005 [268] | Terry, you probably need a lot of Composes in that case. The Vid dialect has ti survive the Do's, so you may need to use more lit-words {'button rather than button) |
Terry 16-Jan-2005 [269] | this works >> x: [quit] == [quit] >> view layout [btn x] |
older newer | first last |