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

World: r3wp

[!RebGUI] A lightweight alternative to VID

shadwolf
29-Mar-2005
[348x4]
the ask is do we need to specify in hard coded way the resize of 
every image ...
or do we let user size it's image be it self ?
img: to image! make face [edge: none image: img size: 22x22]
hum hum  I saying craps ... the image is hard coded sized but maybe 
to big ...
Ashley
29-Mar-2005
[352]
Previous images were 18x18, while I'm using "standard" 22x22 ones. 
Everything else needs to be resized accordingly, but it's going to 
be hard-coded so a lot of the dynamic sizing code can go. Less is 
more. ;)
shadwolf
29-Mar-2005
[353x7]
:)
hey ashkey good to see you online at the same time than me
;;)
I was looking too it ... to see if we could only deplace to left 
the text  un menu popup
graham's menu problem patch
insert tail sub/pane make item-f [;menu item
						type: 'item
						text: itm
						offset: oft
						root: sub

      font-colors: either dis? [[172.168.153 172.168.153]] [font-colors]
						font: make font [align: 'left color: font-colors/2]

      para: make para [wrap?: false origin:  22x1 + (lineh * 1x0)]
						size: 0x2 + get-tsize/fnt itm font
starting line 132 just copy the para: value of item-f
Graham
29-Mar-2005
[360]
The icons look about 20% bigger than the ones used in Trillian .. 
which I just downloaded.
shadwolf
29-Mar-2005
[361x9]
hum
with a little  modification to para:  arround line 132 you can use 
both witout any over showing of text problem
para: make para [wrap?: false origin:  22x1 + (lineh * 1x0)]
can be para: make para [wrap?: false origin:  15x1 + (lineh * 1x0)] 
if you prefer
it's the first parameteer of para/origin: that needs to be changed 
;)
know what next task is a true challenge making tables in the style 
of GUI4CLI ... I'm affraid to turn mad ;)
G4C TUT_MCListview

// ===========================================================
// A Multi Column (or Database) Listview..
// ===========================================================

WINDOW 126 90 367 373 "Listview"
	winattr style resize

xOnLoad
	// add some records to the listview & open..
	gosub #this AddRecords
	guiopen #this

xOnClose
	guiquit #this

// ===========================================================
// The listview
// - This is a normal MULTISELECT listview (the default).
// For this type to be triggered, you must double-click it.
// ===========================================================

XLISTVIEW 0 0 0 0 'The Title' "" var

	attr ID mylv
	attr resize 0022
	attr frame sunk

	// Give it a grid and allow the user to drag, drop & re-arrange
	// the lines - You can add more styles here..
	attr style grid/arrange/drag/drop/arrange

	// Add some columns. The first one we state with a '#'
	// in front to indicate we mean the 1st column.
	attr LVCOLUMN '#Item/width/120/TITLE/Description'

 attr LVCOLUMN 'Units/width/60/TITLE/Units/TYPE/number/JUSTIFY/RIGHT'

 attr LVCOLUMN 'Amount/width/60/TITLE/Amount/TYPE/number/JUSTIFY/RIGHT'

 attr LVCOLUMN 'Total/width/60/TITLE/Total/TYPE/number/JUSTIFY/RIGHT'

	// show the line double clicked..

 SetWinTitle #this 'SUM: $%Units x $%Amount = $($%Units * $%Amount)'


// ===========================================================
// This is a routine to add 100 records with various
// meaningless values to the above listview. Note how
// the fields can be used as normal variables.
// ===========================================================

xRoutine AddRecords
	local c

	use lv #this mylv

	// before we start, we HIDE the listview. This will
	// stop Gui4Cli from visually refreshing it every time
	// we add a record and will GREATLY increase the speed.
	// This will have no effect if the window is closed.
	// After we finish, we show it again..
	setevent #this mylv HIDE

	for c 0 100
		// add an empty record..
		lv add ''

		// Fill the fields with various values..
		%Item   = "This is Item $c"
		%Units  = $($c * 3)
		%Amount = $(($%Units / 2)*1000)
		%Total  = $($%Units * $%Amount)

	endfor

	// Show the listview again, refreshing the display..
	setevent #this mylv SHOW

// ===========================================================
// Right mouse button handling - Some menu choices..
// ===========================================================

xOnRMB


 QuickMenu -1 -1 'Select All/Remove selected/Add 100 records/#sepa/cancel'
	use lv #this mylv
	docase $$choice
		case = 0			// Select All
			lv select all
			break
		case = 1			// Remove selected
			lv delete selected
			break
		case = 2			// Add some records..
			gosub #this AddRecords
	endcase
this code sample show how multi column tables are treated using Gui4Cli 
;)
I think the menu code to popup menu must be retake in part to make 
the dropdown item alowing to put to it text + image icons :)
Robert
31-Mar-2005
[370x9]
area style: Is it possible to add ctrl+cursor-left/right to jump 
over words? This would be nice and makes the area style mostly complete.
tabbing: How about a tabbing for "forms" and a tabbing WRT group-boxes. 
CTRL+TAB could jump out of the group box to the next field/group 
box and SHIFT+CTRL+TAB would jump backwards.
led: IMO it would be nice to have the same click-awareness as CHECK.
splitter: adding a richt-click to reset splitter to original position. 
If users have screwed up their layout ;-))
tab: IIRC someone state it already. A scroll-able tab-heading.
BTW: I'm just posting what I recognize while playing around with 
the TOUR. Great work so far!! Really looks very nice.
tab / group: Is the DATA part realy required as a structural element? 
What about this?

tab-panel [
	size 1000x300
	"Tab1" [...]
	"Tab2" [...]

The idea is to implicitly add a tab for each STRING! BLOCK! pair.
]
I never really like the implicit usage of FACE and other words in 
VID. Especially if not documented and those words are not very obvious 
to guess. I see that RebGUI uses the same approach:
	slider	[action [show-data p face/data]]

What about this?
	slider	[action [show-data p slider/data]]

This shows what kind of object we (implicitly) use.
slightly OT: With all those widgets now. Where is VID still "better" 
than RebGUI? Are we are missing anything?
Maarten
31-Mar-2005
[379]
Robert: VID isn't better imho.
Robert
31-Mar-2005
[380]
:-) Ok, now I know what to use for my "new" projects.
Pekr
31-Mar-2005
[381x4]
Isolation/encapsulation of particular styles (widgets) functionality 
may mean simplyfying the situation, as we can see with RebGUI, althought 
it is not as feature (widget) complete as VID is ...
Rebol is so much free-form, that with something like VID, componentised 
(shared) feels, etc., you can get yourself into trouble and VID starts 
to look like a bit bloated, although it is really to say such thing 
about anything rebol related ...
What I am really pedant upon is proper system-like "behavior". I 
mean mainly keyboard .... I would like RebGUI having good tabbing 
functionality, even nested one (although now I don't know if other 
IDEs you program your apps in allow it, but imo yes) - imagine having 
table/grid on your screen, but also few fields and buttons. I want 
to shift focus to grid, and then I want arrow keys, insert, delete 
key to work in terms of grid, not whole form. Then there should be 
kind of "escape key", which will jump-off the grid and focus will 
be on whole form ...
Dunno if I am clear about what do I mean, but maybe ability of getting 
focus to group-box should be enough, it it provides focus isolation 
described above ....
Ashley
31-Mar-2005
[385]
Robert

 1) Widget observations: all noted. LED is the read-only functional 
 equivalent of 'check used for things like system status displays, 
 etc

 2) Tabbing (basic version) is slated for 0.1.8, more advanced features 
 will have to wait until the base widget set is complete.

 3) DATA is a required structural element to ensure widget specific 
 initialization is performed by init *not* the display function.

 4) Implicit face usage has two big advantages: a) allows you to cut 
 and paste code between widgets; b) different widgets can share the 
 same code.

 5) RebGUI still lacks a few of the more complex list / table / menu 
 / treeview type widgets.

 6) Re: new projects. RebGUI is still ALPHA and the basic design may 
 fluctuate as the requirements of more complex widgets becomes clearer. 
 I wouldn't be building any commercial applications based on it quite 
 yet (not until it goes beta at least).

Pekr

 1) Also remember that VID was created against a much earlier version 
 of View, and that it is only recently that View functionality has 
 stabilized. One example of this is the extensive use of 'draw by 
 RebGUI compared to VID.

 2) Tabbing, like key mapping, is less of a technical issue than a 
 convention issue; but my aim is to be able to "drive" all RebGUI 
 widgets both with and without a mouse (although the priority is to 
 get the mouse behavior right first).
Pekr
31-Mar-2005
[386]
Once widgets get more complex, will they share any code, or will 
there be strict encapsulation, so that each style is fully self-contained?
Geomol
31-Mar-2005
[387x2]
I see a funny behaviour with the check widget. Left-clicking, as 
fast as I can, is no problem. Right-clicking fails sometimes. It 
seems, a fast double-click isn't noticed.
Nice job though! :-)
Ashley
31-Mar-2005
[389]
Pekr: code will be shared where it makes sense, and it will be made 
obvious (i.e. no hidden or subtle dependencies).


Geomol: It's a windows specific problem (probably trying to access 
a context menu or something first). I noticed this a while back when 
mapping left / right mouse clicks to zoom in / out ... works fine 
on Linux though.
shadwolf
31-Mar-2005
[390x4]
in all cases REBGUI is a good enhancement yet to VID :)
it includes yet more usefull widgets and less memory usage than VID
but it's a 1 month alive project Ashley and Vincent have done most 
of the work alone so if ppl will give a hand and help ashley concretly 
by apporting code things could advance faster
apporting code to any project is hard I understand this but a first 
step (what I try to do ) is to apport yet existing bunch of code 
that are fitted to REBGUI Ashley takes then the role of merger and 
last adapter. I hope this free some time for him  to focus on work 
of the engine.
Ammon
31-Mar-2005
[394]
So do we want to use the global event system so that we can have 
modal and auto-closing dialogs or does someone know another way to 
accomplish it?
shadwolf
31-Mar-2005
[395]
you can't at the same time search for yet existent widget try to 
adapt them and in the same time try to work on the enhancement of 
the engine ;)
Ammon
31-Mar-2005
[396]
Ah, come on!  Haven't you ever heard of multi-tasking? ;~>
shadwolf
31-Mar-2005
[397]
Ammon messaging (LNS) but that means LNS yet is disponnible and to 
redo profundly the main system of exchange