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

World: r3wp

[!RebGUI] A lightweight alternative to VID

ICarii
26-Nov-2005
[2528x4]
rebol []
stylize/master [
	agg-progress: box white "0%" with [
		pstart: pend: pfunc: none
		progress: 50
		oldprogress: 0
		update: does [
			if (self/progress <> self/oldprogress) [
				self/oldprogress: self/progress

    self/effect: compose/deep [draw [pen none fill-pen linear 0x0 0 (self/size/x) 
    25 1 1 red yellow cyan blue box 0x0 (as-pair self/size/x * (self/progress 
    / 100) self/size/y)]]
				self/text: join to-integer self/progress "%"
				show self
			]
		]
		append self/init [self/update]
	]
	rate 25
	feel [
		engage: func [face action event][
			if action = 'time [
				if (face/progress <= 100) and (face/progress >= 0) [

     face/progress: to-decimal ((face/pfunc - face/pstart) * 100 / to-decimal 
     (face/pend - face/pstart))
					face/update
				]
			]
		]
	]
]
view/title center-face layout/tight [

 agg-progress 250x11 font [size: 11 color: none shadow: none] with 
 [pstart: now/time/precise pend: pstart + 30 pfunc: does [return now/time/precise]]

 agg-progress 250x11 font [size: 11 color: none shadow: none] with 
 [pend: now/time/precise pstart: pend + 30 pfunc: does [return now/time/precise]]

 agg-progress 250x11 font [size: 11 color: none shadow: none] with 
 [pstart: 0 pend: 100 pfunc: does [random/seed now/precise return 
 random 100]]

 agg-progress 250x11 font [size: 11 color: none shadow: none] with 
 [rate: none progress: 50]
] "AGG progress bar"
;-)
stylize/master [
	agg-progress-pie: box white "0%" with [
		pstart: pend: pfunc: none
		progress: 50
		oldprogress: 0
		update: does [
			if (self/progress <> self/oldprogress) [
				self/oldprogress: self/progress

    self/effect: compose/deep [draw [pen none fill-pen conic (self/size 
    / 2) 0 (self/size/x / 2) 90 0.5 0.5 red yellow cyan blue arc (self/size 
    / 2) (self/size / 2) 0 (self/progress * 360 / 100) closed]]
				self/text: join to-integer self/progress "%"
				show self
			]
		]
		append self/init [self/update]
	]
	rate 25
	feel [
		engage: func [face action event][
			if action = 'time [
				if (face/progress <= 100) and (face/progress >= 0) [

     face/progress: to-decimal ((face/pfunc - face/pstart) * 100 / to-decimal 
     (face/pend - face/pstart))
					face/update
				]
			]
		]
	]
]
view/title center-face layout/tight [

 agg-progress-pie 100x100 font [size: 11 color: none shadow: none] 
 with [pstart: now/time/precise pend: pstart + 30 pfunc: does [return 
 now/time/precise]]

 agg-progress-pie 100x100 font [size: 11 color: none shadow: none] 
 with [pend: now/time/precise pstart: pend + 30 pfunc: does [return 
 now/time/precise]]
] "AGG progress pie"
oops.. didnt realise I still had the fill-pen scales set to 0.5 .. 
was testing effects.. :)
BrianW
26-Nov-2005
[2532]
Is there a way to do menus in RebGUI?
Graham
26-Nov-2005
[2533]
There is no menu widget, and none planned AFAIK.
Robert
27-Nov-2005
[2534x4]
Just playing around with tab-panel. The tab highlighting isn't working 
correct. The text keeps underlined (orange) even if I select an other 
panel. When moving the mouse over other panels, the highlighting 
stays. Note: I use several nested tab-panels.
It only happens in the most nested tab-panel group. So if you nest 
three tab-panels with 4-5 entries you will see the effect.
min-size: This feature is only applied after the first try to resize 
the window. Than it's used, at startup time, the window has a "default" 
size. Whereever this size comes from.
table: if a column has the width of the sort arrow, it's no longer 
possible to change sorting order after clicking once.
Ashley
27-Nov-2005
[2538]
tab-panel: will investigate
min-size: from the display users guide:

2.1.2 Min-Size

Specify a minimum OS window resize size.

display/min-size "Example" [
    tight
    text 80 blue "Some text" #W
    return
    box 80x40 #WH
] 400x400

Note


The min-size limit will only be enforced upon a window resize, and 
the size is inclusive of an OS specific number of border / title 
pixels. Also note that if any widgets are resizeable (#H and #W) 
and min-size has not been specified then RebGUI will assign a default 
value equal to the initial window size.


table: Already noted by Graham (arrow does not share label feel) 
- will add to list
Robert
28-Nov-2005
[2539x2]
min-size: Ok, RTFM. I did but not the whole paragraph ;-) But, is 
this the best way to handle it? IMO the startup size should be min-size.
table: Ok, thanks.
Pekr
3-Dec-2005
[2541x2]
Graham - what RebGUI is your app based upon? It shows UI defects, 
which are way too much easily to get into - resizing destroys some 
parts of UI, table keyboard scrolling does not work - it moves hilight 
off of the screen, pop-up system is not fixed either, which is pretty 
annoying ...
Graham - btw - VID - Video Interface Dialect - shouldn't it be Visual 
instead of Video? :-)
Ashley
3-Dec-2005
[2543]
Most of those issues are with RebGUI / View itself not Graham's application. 
Next release of RebGUI, which corrects a large number of outstanding 
issues, is waiting on the imminent release of View 1.3.2 (which among 
other things fixes the 'parent option).
Graham
4-Dec-2005
[2544x3]
Pekr, yes, I need to fix that.  Visual is correct.
As for the GUI issues, I am confident that Ashley and contributors 
will fix those issues and so I have released it as is.  I don't resize 
anyway.
I am primarily interested in functionality at present.
Pekr
4-Dec-2005
[2547]
Ashley - I know, that is why I posted reply in this group, to actually 
see the reaction of when next RebGUI release is planned, and what 
it will address :-)
Robert
4-Dec-2005
[2548x2]
Ashley, View 1.3.2? We are already at 1.3.61 or am I missing something?
Seems I have lost track of all the version numbering... just wondering.
shadwolf
4-Dec-2005
[2550x4]
erg  .... treeview – data structure should be simple & consistent 
with other widgets ... sub-blocks are the obvious way to go but I'll 
leave the implementation choices to you ;)
we discussed this point  at the treview begining  ...  we have  [[ 
widgets desc ] [  datas to apply to widgets ]] this struct allows 
dynamic datas changes and sortings with low cpu use. treeeview is 
over  code is tiny and all is there to add more dynamic widgets  
but as  we  want to make a grid widget i don't see the meaning of 
adding to treeview the capability to get edit fields  -> note: actual 
fields can be turned as editable on a certain  key + mouse shortcut 
instead of have a special editable widget. Last source are on  http://www.rebolfrance.info/articles/regui-cooking-widgs
Ashley my ask to see those widgets implemented in REbGUI retail as 
it is not to bother you on the contrary the return i get on those 
widget was pretty low... So i think adding them to  retail RebGUI 
 will allow all REGUI fans to see the code to learn some tricks and 
to propose some new things  or bug correcting  ^^ So my ask is more 
 to dynamise and  relaunch the RebGUI process than to be bad with 
you ^^
actually i'm fulltime dedicated to get a job so i'm not a lot around 
there anymore  but i stay tunned time to times and if you get major 
problems you can yeld me by mail etc...
Graham
4-Dec-2005
[2554x2]
shadwolf, it's easier for us to see them integrated into the rebgui 
distro to try them out.
Perhaps Ashley could include them and mark those not fully complete 
as such?
Ashley
4-Dec-2005
[2556]
shadwolf, I'm having a bit of trouble integrating listview52. Copying 
the code and removing all "ctx-rebgui/widgets/" paths gives the following 
error:

** Script Error: Invalid path value: edge
** Where: view
** Near: show face/pane/1/pane


which is odd as your code never explicitly refers to edge. As you 
are more familiar with the code, could you have a quick look at merging 
it into your copy of %rebgui-widgets.r (v 0.3.7) and upload the working 
result.
Robert
5-Dec-2005
[2557x6]
How do I use the offset for a widget? Where to put it? I want to 
do the following:
wid1 50x50
return
wid2 50x50
return
wid3 50x50


and now I want to place the next widget right to wid1 and inline 
with wid1.
And wid4 has the heigth from wid1 to wid3.
tab-panel: Is it possible to specify a color for the tab text?
label / field: How to create labels and fields that are all the same 
size, automatically? I want all labels to have the width of the widest 
label and all fields to aligan left. For creating pretty input-forms.
Something like guide but more intuitive to use.
How is the default size for a group-box determined? IMO it should 
default to the min-size to include all contained widgets.
Graham
5-Dec-2005
[2563x3]
there's some config settings in rebgui.r I think
I don't think there's a guide
to get all the field sizes the same, use compose

eg compose [ label "First Name" field (fieldsize) ]
Robert
5-Dec-2005
[2566]
And for the labels? Is there a trick too?
Ashley
5-Dec-2005
[2567]
Robert, in answer to your first question:

display "" [
	field 50x50
	return
	field 50x50
	return
	field 50x50
	at 52x0
	field 50x154
]

display "" [
	field 50x50
	field 50x154
	at 0x52
	field 50x50
	return
	field 50x50
]


(the later does not work correctly under 0.3.7 - adding a simple 
"max-height: 0" to the 'at rule in rebgui-layout.r fixes this under 
0.3.8).
Graham
5-Dec-2005
[2568]
same "trick" can be applied to labels
Robert
5-Dec-2005
[2569x2]
docs: tab-panel and action word isn't very clear to understand. Better 
to provide an example:
	tab-panel data [
		action []
		...
	]
tab-panel: Is there a way to add an action block that's executed 
before switching to a new tab? IMO this would be very handy. For 
example I want to show/hide screen elementes depending on which tab 
the user clicked.
Graham
5-Dec-2005
[2571x3]
tab-panel data [
action [ print "displaying tab1" ] [ label "Tab 1" ]
]
if you want to change the layout of a tab in the action block .. 
you can.
action [ hide [ btn1 btn2 bttn .. ] show [ btn3 btn4 btnn+1 ] [ ...layout 
... ]
Robert
5-Dec-2005
[2574x3]
Yes, but this makes a bit complicated. I need to show two tables 
if the user clicks two specific tabs. And hide them if the user clicks 
ANY other tab. And I want to avoid adding an action [hide tab1 hide 
tab2] to all other tabs.
Because if I have a change, I need to touch a lot of code to keep 
this in sync.
I know, I can write a function and just add action [hide-tab] but 
even this needs to be added to all tabs.
Graham
5-Dec-2005
[2577]
that's how I am doing it in my app