r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3 GUI]

Ashley
29-Jan-2010
[225x2]
system/dialects/text is handy. Seems the shortcut b, i, u and nl 
words are not yet implemented/working. 'drop is cute, and I note 
that 'drop without an argument defaults to drop 1.
Any way of using anti-alias with caret? Seems:

	[text: [anti-alias on s caret c]]


kills the caret and font/para objects don't have an anti-alias word.
Cyphre
29-Jan-2010
[227x2]
Ashley, I can't see most of your problems when using r3-a96.exe
Please try:
do http://cyphre.mysteria.cz/tests/caret-test.r

You should see it works correcty.


The only problem I was able to repro is that the shortcuts b,i,u 
and nl aren't working...probably some 'regression' in newer builds 
as I remember it worked before.
regarding the caret obect:

the CARET, HIGHLIGHT-START and HIGHLIGHT-END fields must be defined 
as block! of the following format:
[block! string!]


the first block! value must be the gob/text block! at the index position 
of the text element


the second string! value must be string of the text element at specified 
position


You cannot just copy the first block as in your example above. You 
have to set the block to the position where the text element really 
is in the dialect block(this way the text engine can use the index). 
This part is a bit tricky but it was decided after long discussion 
with Carl. I proposed to use simple integer! for the index, but Carl 
wanted it to be this way which is easier as you can manipulate the 
block index easily without the need to use INDEX? to get the integer.
Ashley
29-Jan-2010
[229]
Thanks, your example (and explanation) makes it all clear now (I 
only tested/debugged with a single string before).
Graham
3-Feb-2010
[230]
Is the lack of a table face ( or whatever the new jargon is ), a 
reflection of the difficulty of building it, or some other issues 
with the gui engine?
Henrik
3-Feb-2010
[231x2]
lack of time. building it should be fairly trivial.
the resize engine is still the main issue for troubles and so the 
best result looks something like this:

http://rebol.hmkdesign.dk/files/r3/gui/166.png
Graham
3-Feb-2010
[233]
Henrik, we can disable resizing until that is fixed!
Henrik
3-Feb-2010
[234x2]
no we can't. the layout engine depends on it for weighting elements 
at their "correct" sizes. the resize engine must be fixed in order 
to fix layout.
Weighting happens by "pushing" other elements aside, like soap bubbles 
pushing against eachother. The bigger the element is, the more it 
pushes. But space is also divided between the number of elements 
available in a given group, so a group of 5 buttons takes a little 
more space than a group of 3 buttons.


That gives the problem you see with strange spacing before and after 
the vertical scroller, because it's size is not big enough to provide 
push. and the other elements are too small to provide enough push. 
Combining the size of the face and the push factor is why resizing 
is broken.

But there are more bugs in it than that. If you push too much, the 
elements overflow and will be clipped by the right and bottom edges. 
Furthermore, the calculation of space to the right edge and bottom 
edge is also broken. It's almost impossible to predict in your head 
how the layout will look.


I'd like to replace the resize engine with something more concrete, 
perhaps with springs instead and fixed pixel sizes (oh, maybe similarly 
to what the VID Extension Kit does) or depending on whether Carl 
get's started again with his specs list (which I unfortunately can't 
locate). I hope we'll get to start this month.
Graham
3-Feb-2010
[236]
Gabriele, were you going to upload your GUI system as well?
Gabriele
3-Feb-2010
[237]
Where? It's on r3-alpha, as well as Carl's old CVS repository. Feel 
free to copy it from r3-alpha if you want, and Carl is ok.
Graham
3-Feb-2010
[238]
ok, thanks
Gabriele
3-Feb-2010
[239]
(the code is owned by RT)
Graham
3-Feb-2010
[240x2]
license attached to the code?
wow .. done 2 years ago now
BrianH
3-Feb-2010
[242x2]
Then we can ask Carl for permission to put it in a community repository 
in DevBase.
I thought Gabriele held the copyright... Work for hire?
Pekr
3-Feb-2010
[244]
Graham - shouldn't we better finish/fix Carl's VID, if that one is 
going to become official distro?
Graham
3-Feb-2010
[245x4]
I was just curious to see how Gab's systemm worked .. and I tried 
%test.r but 

>> do %test.r
Script: "Test vid" Version: none Date: none
Script: "REBOL View System Functions" Version: none Date: none
Script: "rewrite-tree function" Version: none Date: none

Script: "Simple dialect to create/resize gobs" Version: none Date: 
none

Script: "REBOL VID 3: Definition of FACE prototype object" Version: 
none Date: n
one
Script: "REBOL VID 3: Functions" Version: none Date: none
Script: "REBOL VID 3: Events Handling" Version: none Date: none
Script: "REBOL VID 3: Styles" Version: none Date: none
** Script error: cannot MAKE/TO map! from: none!

** Where: make either make handler parse parse-set-dialect make-styles 
catch eit
her either applier do catch either either applier do
** Near: make map! style-spec/options
I see R3-gui has a gob called 'code-area which uses a monospaced 
font.
I could use text-list instead of table if that can be used with a 
monospaced font.
Also, I've read thru the docs ( but not the sources ) and it's not 
documented on how to create a GUI event
Pekr
3-Feb-2010
[249x3]
Graham - there are scripts that work ... you need to have some older 
alphas ... There is e.g. nice demo of effect lab ....
hmm, but now AVG is reporting virus ifection for old A30 release 
....
must be once again false positive ...
BrianH
3-Feb-2010
[252]
That's the false positive I was complaininbg about in Advocacy. You 
can't dispute it without paying them money. If anyone has a commercial 
AVG support contract, please dispute that.
Pekr
3-Feb-2010
[253]
strange that new alphas don't show any such problems ...
BrianH
3-Feb-2010
[254x2]
Glad of that, since if one showed as a false positive based on a 
signiature scan it's likely that they all would.
It's possible that the compressed mezzanine data cooincidentally 
included a sequence of bytes that matched some signiature of someone 
else's code, which wouldn't matter to us since that code is decompressed, 
not executed.
Rebolek
3-Feb-2010
[256]
I may try to ask a friend who works at AVG, but I cannot promise 
anything.
Graham
4-Feb-2010
[257]
no-edit: [
        #"^H" left
        #"^X" #"^C"
        #"^V" ignore
        #"^M" ignore
        delete deslect
        delete-end deselect
    ]

filed as ticket 1455 ...
Graham
5-Feb-2010
[258x3]
It looks I can use a monospaced font in a text list by changing the 
text-list-box face/text-style to 'code instead of 'list-item ... 
but quite unclear to me how one does this easily
Is there an easier way to do this than this?

    code-text-list: tight [

        about: "List of selectable text lines with scrollbar using a monospaced 
        font."
        facets: [
            max-size: 150x3000
        ]
        options: [
            list-data: [block!]
        ]
        content: [

            text-list-box :list-data :area-color options [ text-style: 'code 
            ]
            scroller
        ]
        actors: [
            on-init: [
                if select face 'reactors [
                    extend face/faces/1 'reactors face/reactors
                ]
            ]
            on-set: [
                set-face/list face/faces/1 arg
            ]
            on-get: [
                get-face face/faces/1
            ]
        ]
    ]
I think it's a little potentially confusing that 'options in a style 
refers to the stuff that follows a widget when it is used, but the 
options keyword following the widget refers to the facets
Henrik
5-Feb-2010
[261]
parameters
 instead?
Graham
5-Feb-2010
[262]
sure
Pekr
5-Feb-2010
[263]
pars or params, to make it shorter to write :-)
Graham
5-Feb-2010
[264x2]
you wouldn't need to write it often!  Unless you were writing a lot 
of your own styles
so, above it would be 

parameters: [
	list-data: [block!]
]
Pekr
5-Feb-2010
[266x2]
vocabulary shows that param, parm, is a regular english word ....
but other than that, anything is ok with me :-)
Graham
5-Feb-2010
[268]
so that you know that text-list takes a block
Henrik
5-Feb-2010
[269x2]
Make sure the word is not used anywhere else in the R3 GUI. Font 
changing, AFAIR is a little cumbersome. In the R3 GUI, fonts are 
a resource, similar to colors, certain draw blocks or materials.
So first you have to define the resource if it doesn't already exist, 
and then ask for it by name.
Graham
5-Feb-2010
[271]
hence my preference to use long names :)
Pekr
5-Feb-2010
[272]
we had one other word to "options" IIRC. I just can't remember it 
now. It was used for top gob (window) parameters ... then we unified 
to options ... what was it?
Graham
5-Feb-2010
[273]
There is no occurence of the word 'parameter in the r3 source
Pekr
5-Feb-2010
[274]
ah, forget it, it was "flags" ... but that is something different 
...