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

World: r3wp

[!RebGUI] A lightweight alternative to VID

james_nak
31-May-2005
[1092]
Ashley, very nice work. I have probably asked everyone in this group 
at one time or another about how VID works (or doesn't seem to). 
I really appreciate that you are working on something like this. 
I had all but given up trying to get my interfaces to function the 
way I wanted them to. At some point one has to just give in and focus 
on the actual program. Now I'm thinking I can have my cake and eat 
it too. Thanks big guy.
Anton
1-Jun-2005
[1093x2]
Ashley, I felt the need for this kind of validation / masking as 
well. Just never got around to it.  It's not simple.
Simplest widget ever
: you got it. :-)   That saves a lot of time getting started.
james_nak
1-Jun-2005
[1095]
What is the mechanism to know which line in a table has been selected?
Ashley
1-Jun-2005
[1096]
Not implemented yet.
james_nak
1-Jun-2005
[1097]
Thanks.
Ashley
2-Jun-2005
[1098]
Latest build available at: http://www.dobeash.com/files/RebGUI-024.zip

Highlights include:


 - New edit object / feel added in a separate file, %rebgui-edit.r

 - Documentation on above at: http://www.dobeash.com/it/rebgui/edit.html
	- Face redefinition localised to widgets object
	- Radio-group color toned down from green to leaf

Known issues:

	- auto-fill broken for the time being

 - edit feel needs to support tab / shift+tab into and out of "grouping" 
 widgets

 - cursor down goes to end of text instead of next line?! (yell if 
 you know the answer as I'm stumped on this one)

On the drawing board

	- area widget needs a scroller added to it by default
	- field format / validation masks
	- inline spell-checker
Allen
2-Jun-2005
[1099]
ashley I'll take a look at auto-fill on the weekend, and try and 
get it to behave like the VID version does. anything to look out 
for?
shadwolf
3-Jun-2005
[1100x3]
request-color

** Script Error: in expected object argument of type: object port
** Where: wake-event

** Near: if in pop-face/feel 'pop-detect [event: pop-face/feel/pop-detect 
pop-face event]
>>
drop-list

** Script Error: in expected object argument of type: object port
** Where: wake-event

** Near: if in pop-face/feel 'pop-detect [event: pop-face/feel/pop-detect 
pop-face event]
>>
with rebol/VM 1.2.116.3.1 and windows XP SP2 ( i don't experiment 
those bugs by my own there where submitted in the Form of rebolfrance.org 
website by cr8825.)
Ashley
3-Jun-2005
[1103]
Allen: Thanks, should be a bit easier now that we have a [relatively] 
complete feel / focus system that is similar to VID's. ;)


shadwolf: these occur with latest View releases. They'll be corrected 
once View 1.3 is released.
ChristianE
3-Jun-2005
[1104x3]
Regarding use of color in RebGUI:


I don't think color choices for LEDs in RebGUI are good, which is 
namely because the default colors are red and green.

That not only excludes the color blinds, but even the red-green-blinds 
(sort of lesser color blinds), which applies to even more people 
(mainly male ones). 


Using blue and yellow would make things slightly better, but would 
still be a hurdle for full color blinds. Probably different shapes 
would be more usefull here, as they'd give an additional clue.


And, finally, the colours are named wrong in the LED group: check-group 
60x4 data ["Red" true "Green" false "Blue" none]

Believe me, I had to measure the valve values to find that out ;-)
And personally, I find the visuals of the sliders and draggering 
irritating, too.


The gradient in the sliders container IMHO doesn't integrate in the 
overall RebGUI appearence - since it's (button left aside) nearly 
the only pseudo-3d effect - and the visual contrast between dragger 
an container IMHO isn't very strong. I usually find me clicking in 
the container when I expected to grab the dragger.


The gradient in itself is somewhat unsual, too, since it makes the 
container appear standing out of screen, if one assumes that light 
falls from upper left corner (which is how most pseudo-3d screen 
elements are designed).
draggering = draggers
Brock
3-Jun-2005
[1107]
I second Christian's thoughts on the dragger and gradient.  I also 
found myself reaching for the gradient section thinking it was the 
dragger.  Because it has more graphic detail, it attracts the eye 
first... that should be left for the dragger/button itself in my 
opinion.  The background of the slider area should be flat.
Robert
4-Jun-2005
[1108]
Yep. And the current style doesn't fit to the rest of RebGUI.
Anton
4-Jun-2005
[1109]
I think the slider and scroller were quite quickly implemented and 
are not expected to be perfect at this stage. Having said that, I 
am now wondering if anyone else is working on new ones. It's the 
scroller widget I noticed yesterday needs some work and I thought 
I might contribute a new one.
Ashley
4-Jun-2005
[1110]
By all means, please do. With regards to, "... wondering if anyone 
else is working on ...", I am in the process of putting together 
a dependency / project plan that shows how everything is related 
and what stage each widget / functional area is at (along with who 
is currently working on it). It's the first step to a more cooperative 
development model, but I'll implement it as a static web page until 
REBOL/Services is out.
Anton
4-Jun-2005
[1111x3]
Ok, so I'll do slider and scroller.
Good idea about the plan.
Here's another issue:
rebgui 0.2.4 defines a new global word 'edit

  This interfered with my custom edit function, which I use to launch 
  my favourite editor.
  I'm not changing it for you ! :)

  This is an example of the problem of adding words to the global context 
  without doing
  an environmental impact study first.

  The user should be given the choice whether to export your words 
  to the global context or not.
  But probably most of them don't need to be out there at all.

  My advice is to add only these words to the global context: [

 ctx-rebgui display show-text show-data show-title splash request-color 
 request-date request-file
  ]
  
  --- rebgui.r ---
  
	CTX-REBGUI: context [

		...

		edit: none
		widgets: none
		requestors: none
		display: none

		foreach [word file][
			edit		%rebgui-edit.r
			widgets		%rebgui-widgets.r
			requestors	%rebgui-requestors.r
			display		%rebgui-display.r
		][
			if none? word [set word do file]
		]
	]

	;if not value? 'edit [do %rebgui-edit.r]
	;if not value? 'widgets [do %rebgui-widgets.r]
	;if not value? 'requestors [do %rebgui-requestors.r]
	;if not value? 'display [do %rebgui-display.r]

	; export DISPLAY and the accessor functions to global context
	foreach word [display show-text show-data show-title splash][
		set word get in ctx-rebgui word
	]


  And each file no longer has a *named* context:

  --- edit.r ---

	REBOL [...]
	
	context [...]


  The above changes should mean few changes to the rebgui code. For 
  example, the body

  of the display function refers to the widgets context, but this is 
  still accessible
  because both DISPLAY and WIDGETS are inside ctx-rebgui.
Ashley
4-Jun-2005
[1114]
ChristianE

 1) LED color / design choices. Agreed. Can anyone point me to where 
 this has been solved? Or suggest a design alternative?

 2) Red, Green, Blue. These were example LED titles (much like the 
 previous "One Two Three" example) *not* a statement about the actual 
 LED colors. ;) If the example's that confusing I'll change it.

 3) Sliders / Scrollers. Agreed. The priority has been to get a complete 
 set of widgets, *then* ensure each is functionally complete, and 
 *then* ensure they are aesthetically pleasing as a whole and in their 
 own right. As I'm no graphics artist, I've taken the easy approach 
 at first by mimicking what I'm familiar with: Windows XP.
Anton
4-Jun-2005
[1115]
The words I don't think need to be global are: [sld slm slc slw edit 
widgets requestors]
(and even the ones I have set out above I would scrutinize more.)
Ashley
4-Jun-2005
[1116]
Excellent suggestion and far better than the approach I was going 
to use to solve this problem! ;) I'll incorporate it in the next 
build.
Anton
4-Jun-2005
[1117]
cool :)
Ashley
4-Jun-2005
[1118]
One consideration though; how would this scheme be extended to handle 
SDK use of #include's (as folks using the SDK won't want to ship 
rebgui-*.r files with their executables)? Oh for a #do-include command! 
;)
Anton
4-Jun-2005
[1119x4]
edit:
#include %edit.r
? dunno, don't have SDK myself.
I think this may work (not sure, can't test):
sdk?: is-this-sdk? ; <--- need to find out a real flag

set 'edit	do #either [sdk?][#include %rebgui-edit.r][%reb-gui-edit.r]

set 'widgets	do #either [sdk?][#include %rebgui-widgets.r][%rebgui-widgets.r]

set 'requestors do #either [sdk?][#include %rebgui-requestors.r][%rebgui-requestors.r]

set 'display	do #either [sdk?][#include %rebgui-display.r][%rebgui-display.r]
sdk?: #do [true] false
ChristianE
4-Jun-2005
[1123]
Ashley, you may have a look at this modified LED stuff:
Anton
4-Jun-2005
[1124]
ah heck, that won't work....
ChristianE
4-Jun-2005
[1125x3]
;	15-Mar-2005 Pascal Lefevre
	;	27-Apr-2005 Pascal Lefevre

    ;    4-Jun-2005 Christian Ensel (minor color and shape suggestions)
	led: make face [
		size:	-1x4

  effect:	[draw [pen edge-color fill-pen window-color box 0x0 0x0]]
		font:	default-font
		para:	make default-para [origin: as-pair base-size 2]
		feel:	make default-feel [
			redraw: func [face act pos /local colors] [
				if act = 'show [
                    colors: reduce case [
						any [face/data = 1 face/data = true]  [
                            [btn-text-color btn-text-color]
                        ]
                        any [face/data = 0 face/data = false] [
                            [edge-color btn-up-color]
                        ]
                        true [
                            [edge-color white]
                        ]
                    ]
                    face/effect/draw/2: colors/1
                    face/effect/draw/4: colors/2
				]
			]
		]
		init:	does [
			if word? data [data: to logic! data]

   if negative? size/x [size/x: 1000000 size/x: 4 + para/origin/x + 
   first size-text self]
			effect/draw/6/y: unit-size 
			effect/draw/7: as-pair unit-size * 3 unit-size * 2,5
		]
	]
I gave the LEDs a slightly different shape to make them look different 
from the check boxes, to make it clearer that they are informative 
only and not meant to accept user interaction.

I dropped my previous color suggestions in favour of using only colors 
you've allready featured.
The "one color - different shades" approach really should do for 
most users, I think.
Anton
4-Jun-2005
[1128x2]
CTX-REBGUI: context [

	...

	edit: none
	widgets: none
	requestors: none
	display: none
		
	#do [edit: do #include %rebgui-edit.r]
	if none? edit [edit: do %rebgui-edit.r]
	#do [widgets: do #include %rebgui-widgets.r]
	if none? widgets [widgets: do %rebgui-widgets.r]
	#do [requestors: do #include %rebgui-requestors.r]
	if none? requestors [requestors: do %rebgui-requestors.r]
	#do [display: do #include %rebgui-display.r]
	if none? display [display: do %rebgui-display.r]
	...

]


CTX-REBGUI: context [

	...

	edit: none
	widgets: none
	requestors: none
	display: none
		
	smart-do: func ["helper function to reduce repetition"
		ignored [issue!] block [block!]
	][
		if none? get first block [do replace copy block [#include][]]
	]
	smart-do #do [edit: do #include %rebgui-edit.r]
	smart-do #do [widgets: do #include %rebgui-widgets.r]
	smart-do #do [requestors: do #include %rebgui-requestors.r]
	smart-do #do [display: do #include %rebgui-display.r]
	...

]
Oops! I think smart-do will not work (because preprocessor lines 
are removed ?) Ugg.. Anyway try the first way...
BrianH
4-Jun-2005
[1130]
The preprocessor is freely available, even to those that don't license 
the SDK. You could just have everybody use it whether they use the 
SDK or not, and have one code base.
Colin
4-Jun-2005
[1131]
Very impressive demo. When I run it from rebview1247031.exe, then 
I fill the  Field\Password box, like just type in lots of characters, 
as I move the cursor over the field labels, they disappear. I can 
do this to all the tab field labels.  The words wont reappear until 
I start deleting the password characters and I move the cursor over 
the labels again.
Graham
4-Jun-2005
[1132x7]
Is there any reason why the text in a password field can not be selected 
with the mouse?
Nor, can it be restored with ctrl-z
Where's this memory leak arising from?
Running latest view .. and tour.r reports 6766kbs when I start it 
.. and doing nothing at all, memory use keeps climbing.  HIt 10000kbs 
at 30 mins or so before I killed it.
jumps up 8 or 9 kbs each time
not related to this leak is it .. http://www.rebol.net/cgi-bin/rambo.r?id=3593&
 which is apparently fixed in the latest releases ( according to 
Gab )
though I still see it as per  this http://www.rebol.net/cgi-bin/rambo.r?id=3557&
Ashley
4-Jun-2005
[1139]
Earlier builds of RebGUI used the following code to minimise the 
problem:

	context [
		show*: :show
		set 'show func [face [object! block!]] [show* face recycle]
	]

which kind of points to the GC as the problem.
Graham
4-Jun-2005
[1140]
I see.. so if you wait long enough, it gets collected
Vincent
4-Jun-2005
[1141]
On GC/memory leak : the events system allocates this memory - disabling 
events stop this leak, and changing the timers rate change the allocation 
rate. The trigger to release the memory is quite high, so it's takes 
a long time to be collected. Regardless of 'stats memory usage indication, 
it seems that Windows only gets the memory back when the REBOL windows 
are minimized.