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

World: r3wp

[!REBOL3 GUI]

GiuseppeC
26-Jan-2010
[205]
Nice Ashley. Waiting to see RebGUI in R3. Your project could be a 
big step forward for REBOL
Pekr
26-Jan-2010
[206]
Ashley - maybe you can "just" write a low level layer of RebGUI3 
in such a way, that upper layers (widgets) code will require no change 
to its code? Having RebGUI available for R3 could boost R3 usage 
...
Janko
26-Jan-2010
[207x2]
screenshots screenshots! :)
ok, I ran it :)
Ashley
28-Jan-2010
[209]
Reposting from R3 chat (which seems a bit quiet lately).


I've been looking at the rich text gob! functionality and it seems 
the following dialect commands are supported:

	anti-alias logic!
	bold [off]
	italic [off]
	underline [off]
	size integer!
	left|center|right
	drop integer!
	font object!
	para object!
	caret object!
	scroll pair!
	string!


Are there any I've missed? Any doco on this yet? I havn't figured 
out how to use drop or caret yet. Anyone have any working examples 
for these?


A design question: is there any reason for retaining font and para 
support given that we could move the few remaining unsupported words 
out of those objects and into the dialect itself? (e.g. have the 
dialect directly support font names and valign words).


Also, it would be nice if we had control over the default font name, 
size and alignments [at the very least]. Perhaps a system/view/text 
object?
Steeve
28-Jan-2010
[210]
drop discards the n previous pushed commands in the block stream.

[italic "italic" bold "bold+italic" drop 2 "no-more-bold-italic" 
]
Henrik
28-Jan-2010
[211]
there is something regarding 'drop that may cause crashes. this will 
be fixed, when cyphre gets around to it.
Steeve
28-Jan-2010
[212]
The CARET object is tricky (it handles the cursor position and the 
selected area (for hilighting), see gui.r for more infos.
Cyphre
28-Jan-2010
[213]
Ashley, all current keywords of the richtext dialect can be found 
in system/dialects/text. There is not much docs about it yet but 
I'll tyr to gather some examples and post here.

I'm open to discuss the design improvements as so far not much people 
used the dialect so I'm sure we can enhance it for some useful things.

Does anyone know if there is R3 rich text group already on this world? 
Or should we create new one?
Steeve
28-Jan-2010
[214]
!area enhanced text ?
Henrik
28-Jan-2010
[215]
I think that's a product, so it's better with an R3 specific group.
Pekr
28-Jan-2010
[216]
this group is imo ok, no? Or - REBOL 3 View, if we want to separate 
low-level engine from the GUI one ... but I see no reason for it 
...
Gabriele
29-Jan-2010
[217]
Ashley, my VID had examples of using caret for fields etc. I assume 
Carl's one too...
Henrik
29-Jan-2010
[218]
Gabriele, maybe you should upload your old GUI to R3 chat for reference.
Pekr
29-Jan-2010
[219]
I think R3-alpha is still alive as well, so Gab's GUI should be there 
too. It was many files IIRC. The question also is, if it will work 
with new R3 releases. So maybe it is easier for ppl to just get to 
r3-alpha ... I think each of us has access there :-) (note: I understand 
your message, why you want it in R3 chat, I just tried to point out, 
it is already available)
Gabriele
29-Jan-2010
[220]
Henrik: that would surely increase confusion by many levels. a great 
idea :P
Henrik
29-Jan-2010
[221]
Gabriele, no it wouldn't. Don't upload to the same header.
BrianH
29-Jan-2010
[222]
Create a subheading of Community/Libraries (621) and upload it there.
Ashley
29-Jan-2010
[223x4]
Got caret working, but it's overly complex IMHO, as in:

s: "A bit of text."

c: make object! compose/deep [
	caret: copy [[(s)] (tail s)]
	start: copy [[(s)] (at s 3)]
	end: copy [[(s)] (at s 6)]
]


show append clear system/view/screen-gob make gob! [text: [s caret 
c]]
Any other dialect word (e.g. scroll, size, bold, color) prevents 
caret from working (i.e. if you use caret you are forced to use font 
and para objects).

Also, it seems the caret object could be simplified down to:

	caret: make object [
		caret: start: end: none
	]


Are the blocks (caret/1 start/1 end/1) supposed to have any other 
values in them? (e.g. color tuple, 2nd string!, etc)
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
[254]
Glad of that, since if one showed as a false positive based on a 
signiature scan it's likely that they all would.