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

World: r3wp

[!RebGUI] A lightweight alternative to VID

GiuseppeC
13-Dec-2007
[7036]
Here it is what he has written: HENRIK: I don't think it can when 
using when using RebGUI, but I honestly don't know if you can mix 
VID and RebGUI windows. LIST-VIEW only works with VID.
Steeve
13-Dec-2007
[7037]
and in separated contexts ?
BrianH
13-Dec-2007
[7038]
RebGUI redefines many words that are used by VID, afaik. They don't 
play well together - RebGUI is more of a replacement.
Ashley
13-Dec-2007
[7039]
The only words that RebGUI redefines are some of the request- functions; 
and the 3rd last line of %rebgui-ctx.r does the following:

	system/view/screen-face/feel: none


which disables the global events system (used by insert-event-func) 
... so yes, RebGUI and VID can run side-by-side; which for scripts 
run from the console is OK, but for encap stuff is a bit redundant 
(having to encap VID and RebGUI source). RebGUI was designed as a 
replacement for VID *in encapped apps*.
Luis
13-Dec-2007
[7040]
list-view in rebgui:

rebol []
do %rebgui.r
do %list-view.r
				
display "" [
	text-list data [a b c]
						b: box 50x50 sky
						button []
		]

view/new layout [
			lv: list-view with [
				data: [a b c]]]
unview

b/pane: lv	
b/pane/offset: 0x0 
show b
do-events
GiuseppeC
14-Dec-2007
[7041]
Ashley, please confirm what I am understandig: when I will release 
a commercial application I will have to include VID, RebGUI, LIST-VIEW 
source (and SQL-Lite one) inside the application but everything will 
work flawlessy.
Pekr
14-Dec-2007
[7042x2]
I think so ...
... except bugs in your own code :-)
GiuseppeC
14-Dec-2007
[7044]
I am sure there will be lots of bugs in my own code !
Pekr
14-Dec-2007
[7045x2]
iv that view/new ... unview phase needed? Isn't using layout enough 
to get similar result?
iv=is
Luis
14-Dec-2007
[7047]
Yes, view/new... unview is not needed
GiuseppeC
14-Dec-2007
[7048]
I will be rich tanks to Rebol, I am sure !
Ashley
14-Dec-2007
[7049x2]
Uploaded build#105 with new vid widget which supports in-line VID 
styles:

USAGE:
	vid 20x20 data [btn]
	vid data [btn 20x20] options [size]

DESCRIPTION:
	A container for a VID style.

OPTIONS:
	'size use VID style size.
So, to use list-view as an example, you can now write:

do %list-view.r

display "" [
	area 60x40
	vid 60x40 data [list-view with [data: [a b c]]]
]

Magic, huh?
Steeve
14-Dec-2007
[7051x2]
why did u not use the layout keyword ?
just a question
Ashley
14-Dec-2007
[7053]
vid is shorter, also layout is a verb and could cause confusion. 
The other word I was thinking of using was 'style ... which has the 
side benefit of suggesting "insert a single VID style here" (i.e. 
'vid and 'layout encorage you to think in terms of a block of styles). 
Still open to opinion/suggestions on this one
Henrik
15-Dec-2007
[7054]
LIST-VIEW uses the LAYOUT keyword to generate row faces at least 
for edit fields, possibly other places (don't have the source right 
here). Try adding:

vid 60x40 data [list-view with [data: [a b c] editable?: true]]

and double click to edit
amacleod
15-Dec-2007
[7055]
Where do you find the latest version. I tried the website and rebol 
desktop demo but both are older versions
Graham
15-Dec-2007
[7056x2]
use an svn client
details are on Ashley's website on how to use an svn client to download 
the latest sources
Ashley
16-Dec-2007
[7058]
http://trac.geekisp.com/rebgui
Kai
17-Dec-2007
[7059]
Ashley ~ contratry to what you state in the User Guide, multiple 
returns do not seem to work at all - can you confirm tthis? Anything 
I am missing?
Ashley
17-Dec-2007
[7060]
Good spot, the documentation is incorrect.
Robert
18-Dec-2007
[7061]
Or the code?
Kai
18-Dec-2007
[7062]
Ashley - what is the method of choice to temporarily disable/re-enable 
input widgets (fields, drop-lists, checks)  in code ?  Disable as 
in: do not allow focus or content manipulation.
Ashley
18-Dec-2007
[7063]
There isn't. These things are set when the widget is created. In 
the rare cases I've had to do this I just unview and redisplay ... 
not elegant but it works.
Graham
18-Dec-2007
[7064x3]
I just put widgets I need to disable into a sep panel and just hide 
the whole panel
or, just hide a set of widgets as needed
ghosting is not possible ... is it better?  who knows
btiffin
18-Dec-2007
[7067]
Umm, re disable;  Doesn't  on-focus [false]  do what Kaj wants here 
- kinda - mostly?   The widget is still on screen but you can't click 
on or tab to it.
Graham
18-Dec-2007
[7068]
I think it's preferable to have some type of visual clue that the 
behaviour has changed.
btiffin
18-Dec-2007
[7069]
The code that determines true/false focus could also change the color 
perhaps.  But on-focus does not write-protect the contents from code 
re the "content manipulation' part, so you'd need to write a modifier 
layer (and promise yourself to not use direct  access ... ever) that 
also honoured the focus flag.


Being me, I probably didn't think up and down the affect chain, but 
I use the on-focus for user entered key fields.  Once set and verified 
ok you can't enter the field anymore (with the background color change). 
 I played with on-unfocus locking but found the behaviour of getting 
stuck in a field as too irritating so that logic had to move to become 
an extra step in another func.


Umm, not a dis or anything Ashley;  on-unfocus is just one of those 
features I'd need a strong reason to include in a user interface 
- nice that it is there and all.  :)
Kai
19-Dec-2007
[7070x3]
Brian ~ do you have a snippet for me demonstrating how you do things?
How can I determine the type of a widget (i.e. field vs button) in 
code? I don't see a 'kind or 'type attribute...
Oops - disregard that last one -just found it
Ashley
19-Dec-2007
[7073]
This code shows how to implement dynamic 'info for 'field and 'area:

display "" [
	a: field
	b: field
	button [
		alter b/options 'info
		b/color: either find b/options 'info [
			b/action: make b/action [
				on-focus: make function! [face] [false]
			]
			ctx-rebgui/colors/widget
		][
			b/action: make b/action [
				on-focus: make function! [face] [true]
			]
			ctx-rebgui/colors/edit
		]
		show b
	]
]
Pekr
19-Dec-2007
[7074]
Ashley - any news on Robert's RebGUI enhancements integration?
Kai
19-Dec-2007
[7075x2]
Is there a spot where I can store values I want to restore later 
- like user-data in VID?
per widget that is...
Ashley
19-Dec-2007
[7077x2]
widget/init ... which is set to none! after the widget is displayed 
and is not referenced again.
grid integration ... perhaps over Xmas; all depends how easy it is.
Kai
19-Dec-2007
[7079]
Ashley - thanks for the snippet. What would I use for buttons? Setting 
on-focus and on-click does not give usable results...
Ashley
19-Dec-2007
[7080]
display "" [
	a: button [print "a"]
	b: button [print "b"]
	button [
		alter b/options 'info
		either find b/options 'info [
			show b
		][
			b/feel/over b false 0x0
		]
	]
]
Kai
19-Dec-2007
[7081]
Thanks!
Ashley
19-Dec-2007
[7082x3]
Uploaded build#106 with new set-state function:

USAGE:
    SET-STATE face /info /edit

DESCRIPTION:
     Toggle and show widget state.
     SET-STATE is a function value.

ARGUMENTS:
     face -- (Type: object)

REFINEMENTS:
     /info -- Exit if already info.
     /edit -- Exit if already edit.
Used like this:

display "" [
	field
	f: field
	button [set-state f]
]
Only works with:

	area
	field
	edit-list
	button

widgets at this time.
Kai
19-Dec-2007
[7085]
awesome - any ideas when drop-lists & checks will be supported?