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

World: r3wp

[!RebGUI] A lightweight alternative to VID

btiffin
24-Sep-2007
[6818x2]
Code at http://peoplecards.ca/rebol/ld2-rebgui.rUse it just like 
a tab-panel.  I use the text that would go  on a tab for a comment. 
 Use show widget/select-tab n  to switch between overlays.  The code 
 conditionally loads rebgui and the widget; so if you are modifiying 
anything, you'll have to unset ctx-rebgui for each test load.
Sorry, don't call show with select-tab
Graham
24-Sep-2007
[6820x4]
I'll give it a go .. thanks.
Ashley I'm still seeing the dbl click on an edit-list bug
Brian, the advantage for a true tab panel style is that the currently 
selected panel keeps the button highlighted.
So, this is more of a button panel style :)
btiffin
25-Sep-2007
[6824]
I use it to emulate the overlays in the Desktop Library, but I thought 
you might use it like 

overlay data [ "1" [tab-panel  data [ ]] "2" [tab-panel data [ ]] 
 with a couple of arrows, or buttons :) or menu options to determine 
what bank of tabs are shown.  As with many things, I may not be getting 
what you are really looking for, but I've grown fond of having overlays 
in RebGUI.
Graham
25-Sep-2007
[6825]
Ahhh... never thought of that!
Ashley
25-Sep-2007
[6826x2]
Build#97 uploaded with a 'no-tabs option for tab-panel. Works exactly 
as per Brian's overlay widget as described above.
re: dbl-click problem. I can't reproduce this one. I assume this 
occurs on Windows? What is the dbl-click speed set to? (Control Panel|Mouse 
Properties|Buttons) Is it a mouse or pen (i.e. TabletPC) that generates 
the dbl-click in question?
btiffin
25-Sep-2007
[6828]
Re: build 97...Very nice.  I get to dump a hack.  Thanks Ashley.
Graham
25-Sep-2007
[6829x3]
Yes, windows ... and a mouse.  Speed is set to just to the right 
of middle.
Is there something I can do to trap the error at the widget level 
so it doesn't propagate upwards?
and yes, it's not easily reproducible
Ashley
26-Sep-2007
[6832]
I think adding the dbl-action facet to the choose function in ctx-widgets.r 
will 'fix' the problem, as in:

	choose: make function! [
		...
	][
		...
		popup: make face-iterator [
			...
			alt-action:	none
			dbl-action:	none
		]
		...
	]
Graham
26-Sep-2007
[6833x2]
ok, I'll give that a go
rebgui-widgets.r ?
Ashley
26-Sep-2007
[6835]
Yes
Graham
26-Sep-2007
[6836]
thanks
Graham
30-Sep-2007
[6837]
How does one reset a radio-group to it's unselected state?  I tried 
rg/init, and rg/select 0 ( which crashes )
Brock
30-Sep-2007
[6838x3]
Graham, I haven't ventured into the world of RebGUI other than the 
demos, but in View the data attribute of the radio button is none 
until selected, true when selected, then false when the selection 
is changed.
ie.  Radio5/data: none
I hope RebGUI works the same way.
Ashley
30-Sep-2007
[6841x2]
No, the value of face/picked contains the current selection and is 
set by clicking a radio button or using the select-item function 
which simulates a click. By default it is not possible to simulate 
a null click.
Build#99 uploaded with fix to above. You can now do:

	rg/select-item 0

or:

	rg/select-item none
Graham
1-Oct-2007
[6843]
thanks
Graham
6-Oct-2007
[6844x3]
display "" [ radio-group data [ "one" "two" ] [set-focus fld ] fld: 
field ] do-events

shows the focus and then loses it
display "" [ ck: check data none [ print "checked" ] button "Change" 
[ set-data ck true ]] do-events

doesn't trigger the action on the check
Do we need a 'set-action function that triggers an action associated 
with a widget?
Ashley
6-Oct-2007
[6847]
That's not a trivial thing to do with the current design ... and 
then add the complexity of action types (single, double or alt-clicks; 
combined with various on-* triggers ... it gets messy very quickly).
Graham
6-Oct-2007
[6848]
so, how to trigger the action?
Ashley
6-Oct-2007
[6849]
It should just work, I'll take a look at it later today.
Graham
6-Oct-2007
[6850x3]
table/set-row does a trigger on the action
so, there is some inconsistency
/select-row ?
Ashley
6-Oct-2007
[6853]
The action in that case is a by-product of the primary purpose ... 
select a row. select-item (radio-group) does tha same. I can't recall 
whether there's a select-state for check though.
Graham
6-Oct-2007
[6854]
I guess I should not put complicated code inside the action block 
... and just factor it all out.
Ashley
6-Oct-2007
[6855]
Depends, you can call action functions directly, as in:

	s: button "Save" [...]
	button "Do A then save" [... s/action/on-click s]
	button "Do B then save" [... s/action/on-click s]
Graham
7-Oct-2007
[6856x2]
rebol []

do %rebgui.r

pu: does [ display/parent "" [

 table 20x20 options [ multi "item" left .9 ] data [ "a" "b" "c" ] 
 return
	button "close" [ unview/only face/parent-face ] 
]]

display "test" [
	text "Try multi selecting with control" return
	button "test" [ pu ]
]

do-events
multi-select fails the second time round.
Ashley
7-Oct-2007
[6858x2]
Build#100 uploaded with fix to above problem.
The "set focus" problem cannot be fixed given the order of calls 
to 'show within the widget. The check trigger issue can be addressed 
with code similar to that given above for the save button sample.
Graham
8-Oct-2007
[6860x2]
Yep, fixed.
Is there a way to program a drop/edit-list to drop the list without 
having to click on it?
btiffin
8-Oct-2007
[6862]
Ashley;  Congrats on hiiting the RebGUI century mark.  Deserving 
of kudos.   Hip hip hooray!  :)
Ashley
8-Oct-2007
[6863]
Thanks.

Graham, how about something like:

	display "test" [
		d: drop-list data [1 2 3]
		button [d/pane/action/on-click d/pane]
	]
Graham
8-Oct-2007
[6864]
that works :)
Graham
11-Oct-2007
[6865]
Ashely, any way to get the caret appear at the click point of an 
area instead of always defaulting to the end of the text??
Ashley
11-Oct-2007
[6866]
Hmm, I'm sure it never used to do that ... I think a bug has been 
introduced along the way. Need to fix that one.
Graham
11-Oct-2007
[6867]
it has done this for as long as I can remember