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

World: r3wp

[!RebGUI] A lightweight alternative to VID

[unknown: 5]
27-Apr-2005
[614]
I remember when /view first came out it seemed there was someone 
that made a gui that was eliptical using only faces and no layout.
Vincent
27-Apr-2005
[615x6]
For VID in RebGUI, an external face widget :
x-face: make face [
    size: -1x-1
    init: does [
        pane: get data
        pane/offset: 0x0
        if negative? size/x [size/x: pane/size/x]
        if negative? size/y [size/y: pane/size/y]
    ]
]
Usage: 
my-face: layout [field "just a field" [print face/text]]

display "A RebGUI display" [
    ...
    x-face [data 'my-face action [print "Hi!"]]
   ...
]
sorry, correction (some VID widgets need a block as parent face) 
:
x-face: make face [
    size: -1x-1
    init: does [
        pane: reduce [get data]
        pane/1/offset: 0x0
        if negative? size/x [size/x: pane/1/size/x]
        if negative? size/y [size/y: pane/1/size/y]
    ]
]
(note the 'feel is replaced by 'action definition when one is specified)
shadwolf
27-Apr-2005
[621x4]
Well after one day of work on the multicolumn list  here is a little 
screen shot of what I succed to do http://shadwolf.free.fr/rebgui-list.jpg
What I need to do :
* Vertacal and Horizontal scrollers management
* Header rendering
* Column content resizing management (internal & external)

* Line Selection with a filled fill (not sure of the wanted way to 
make this work ...)
* Inseting rows 
* Deleting rows

* More widgets support (for the moment I can handle images checks 
and texts)
Actually my code is about a little less than 100 lines
Volker
27-Apr-2005
[625]
Ashley: changed %display.r to use more parse-features. Hope you like 
it. but introduced a bug, scrollers are broken now. Would now be 
easy to detect something like
 button "hello"

but then that string has it has to be merged with the attributes-block 
somehow. I let you think about it ;)

because the attributes are in a block we clash with vid-style action. 
MAybe we could put the action in parens then, like parse does?
  button "quit" [size 200x100] (quit)
Vincent
27-Apr-2005
[626]
Volker: ( ) for actions - it will be a pain to use with compose/deep 
(needed because 'display evaluation is kept to minimal).
Volker
27-Apr-2005
[627]
True.
shadwolf
27-Apr-2005
[628x3]
lastest screenshot of the listview item ... http://shadwolf.free.fr/rebgui-list2.jpg
TODO: 
* Vertacal and Horizontal scrollers management
* Column content resizing management (internal & external)

* Line Selection with a filled fill (not sure of the wanted way to 
make this work ...)
* Inseting rows 
* Deleting rows

* More widgets support (for the moment I can handle images checks 
and texts)
* Sorting ;)
Ashley
28-Apr-2005
[631]
Latest build available at: http://www.dobeash.com/files/RebGUI-021.zip

Highlights include:

	- Specification dialect is now VID compatible (and 35% slower)
	- request-color and request-date added
	- Span attribute changed from tuple to issue
	- Couple of minor fixes
	- %tour.r has an additional "Requestors" tab


I wanted to get this build out before folks went too far down the 
converting from VID to RebGUI and vice versa path. If a parse expert 
(I'm not one) could suggest performance improvements for the main 
display parse loop that would be great.
shadwolf
28-Apr-2005
[632]
I like very mutchthe requestors :)
Robert
28-Apr-2005
[633]
there is quirk with them: If you select a color, the requestor button 
keeps the highlighting frame. Should be reseted to neutral.
shadwolf
28-Apr-2005
[634x2]
I like the new way to hadle face parameters :)
I addapted my actual listview work to rebGUI 0.2.1 ;)
Vincent
28-Apr-2005
[636]
compatibilty bug with set-words in definition - investigating
Robert
28-Apr-2005
[637]
How does this line work?
	| set arg word! (

  either in widgets arg [append-widget widget: arg] [attribute-color: 
  get arg]
	)


append-widget checks for 'widget but 'widget is set after the call 
to 'append-widget


Further, in the parse-rule the above line comes last. But it parses 
the widget words. When do the parameters get parsed? I would have 
expected this rule to be the first after the keyword rules.
shadwolf
28-Apr-2005
[638]
0.2.1 i see the memory use growing up from 5976 kB to 7090 KB then 
it's stable is it normal ?
Vincent
28-Apr-2005
[639]
bug found:
line 243 in display.r : 
| set arg set-word! (append-widget word: arg)
arg should be a get-word :
| set arg set-word! (append-widget word: :arg)
to work with 1.2.1
Robert
28-Apr-2005
[640]
speed: Ashley, the parse spec looks very much like a degenerated 
'switch statement to me. You are not doing anything wild that requires 
parse. Have you tried to loop through the spec block and use a switch 
statement instead? It might require a bit state handling but could 
be faster.
Vincent
28-Apr-2005
[641]
Robert, not that simple : we have selection on both datatypes and 
keywords, with optional parameter of various datatypes. The 'switch 
wouldn't be trivial

There is a room for improvements in the parse loop, as a set-word! 
is always followed by a word!, and file!, string!, issue! (and others) 
are never alone.
Robert
28-Apr-2005
[642]
the datatypes are unique. Each on only shows up once. I don't see 
any optional parameters. The parameters can either be of type A or 
B, ok. But that can be handled in the action block of the matching 
switch. And there we can reposition the spec block to skip those 
handled cases.
shadwolf
28-Apr-2005
[643]
I make a sample data table of 5 by 100 entries to allow me to test 
the resizing / scrollings issues ;)
Robert
28-Apr-2005
[644]
Shadwolf, did you consider to specify names for the columns so that 
I can provide a name/value block? With this the name/value block 
can contain much more values than the grid should handle. Very handy 
feature.
shadwolf
28-Apr-2005
[645x2]
robert yes this feature was yet passed to me by cr8825 on french 
forum for non visible data what I plan to do Is hadding a special 
flag like hid for example:)
I figured out a little problem when I ste up the scrolling has the 
header and is in the same countainer as the column and row scrooling 
make desapear the header buttons :)
Robert
28-Apr-2005
[647]
shadwolf: Adding a hide flag requires me to alter all my data. Just 
wrap it around, if the grid doesn't know about it, just skip it.
Vincent
28-Apr-2005
[648]
Robert: on switch version : trying - but some difficulties. A rebgui 
declaration is of kind :
any [ global-parameter | global-parameter-with-arg argument | 

         opt set-word! word! any [integer! | pair! | ...  | keyword [integer! 
         | pair! | ...] ] ]

the problem with that is a) the optional set-word!, b) for widgets, 
both values and keyword/values are allowed

with 'switch it's far less readable (for arguments, we have to separate 
keywords and datatypes and use "switch/default [] [swtich []]"), 
and takes more code
shadwolf
28-Apr-2005
[649x4]
I solved the problem with  the scrolling ;)
?? don't understand ...  but we have lot of time to have me understanding...
you want to be able to join directly the column is this what you 
want  ?
or being able to make formula like in Excel  = AA:01 + AB:02
Volker
28-Apr-2005
[653x2]
n: 100'000
bench: func [code] [t1: now/precise loop n code
	print [difference now/precise t1 mold code]
]
bench [switch 'f [a [] b [] c [] d [] e [] f [] g [] h []]]

bench [parse [f] ['a () | 'b () | 'c () | 'd () | 'f () | 'g () | 
'h ()]]
parse is 3* faster here.
Vincent
28-Apr-2005
[655]
parse loop in display.r needs some work, as a lot of wrong combinaisons 
are allowed like [s: 10x20 #1010 button] and not easy to trap.
Volker
28-Apr-2005
[656x2]
tuning parse: first thing would be to put the frequent things first. 
like string! and block!. and soemthing like 'rate last. if parse 
is the slowdown.
its a sequential search.
Ashley
28-Apr-2005
[658]
A related improvement (if possible) is to group all the word tests, 
something like:

	set arg word! (
		switch arg [
			return [...]
			at [...]
			"a color" [...]
			"a widget" [...]
			...
		]
	)
shadwolf
28-Apr-2005
[659x2]
to see my advance on list-view widget report to the first working 
sample http://shadwolf.free.fr/rebgui-list2.r
I redone it completely ;) changing the way data was handled ...After 
a little chat with Vinxent it appears that sort algorithms would 
be easier to write if the data was handled by rows instead of beeing 
handled by row ;)
Volker
28-Apr-2005
[661x2]
I expect switch is slower.
maybe the native case can compete.
shadwolf
28-Apr-2005
[663]
volker I just made a 1ko lesser more opimized version  ;)