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

World: r3wp

[!RebGUI] A lightweight alternative to VID

Pekr
1-Jun-2007
[6597]
Graham - it should, but as an interim solution I welcomed even such 
hack. I refuse to visually remove buttons, according to some conditions. 
That sounds scary, when once there is button, next time there is 
not button at certain position :-)
Graham
1-Jun-2007
[6598x4]
ghosting out the buttons etcs
well, if buttons are not functional in certain states ..
perhaps better to remove them both visually and functionally?
Well, I am going to try it both ways and see what the users say
Pekr
1-Jun-2007
[6602x2]
Graham - http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=disable-face.r


i have not thought about RebGUI integration yet, not sure it is applicable 
...
Maybe Ashley could have quick look into it? It could be functions 
of RebGUI. But I agree that in fact it should be done in consistent 
way = adding such handlers to each style, so not sure Ashley would 
accept such "hack" into RebGUI ....
Graham
1-Jun-2007
[6604x2]
When you click in to a text area, the caret always appears at the 
end of the text.  Possible to have the caret to appear at the mouse 
pointer?
Otherwise have to double click
Volker
1-Jun-2007
[6606x2]
its in 'focus,
  if not caret [caret: tail face/text]
somethig with 'offset-to-caret. anyone? ;)
oops, its rebgui. may be diffferent there.
Graham
1-Jun-2007
[6608x4]
display "" [ p1: panel 20x20 green data [] false do [ show p1]] do-events

Why does this not show the panel ?
It looks like 'show does not work inside a 'do block
if the widget was hidden

This works showing text in a visible widget .. 


display "" [ p1: panel 20x20 green data [] false return f1: field 
do [ show p1 set-text f1 "panel should be the
re!" ]] do-events
Neither the field or box will display


display "" [ p1: box 20x20 green data [] false return f1: field false 
do [show [ p1 f1 ]]] do-events
Ashley
1-Jun-2007
[6612]
Trick is to remember that the do block is evaluated prior to the 
display being shown, so you just have to use:

	display "" [
		p: panel green data [] false
		f: field false
		do [p/show?: f/show?: true]
	]
	do-events
Graham
1-Jun-2007
[6613x2]
Thanks
but isn't the layout constructed first otherwise the variable names 
would not be available?
Ashley
1-Jun-2007
[6615]
Yes, but doing a show or hide prior to view doesn't work.
Graham
1-Jun-2007
[6616x3]
Ok.
in lists and tables, scroll bars appear dynamicallly
Is it feasible to do the same for area widget?
Ashley
2-Jun-2007
[6619]
The reason most UI's dont do this is you either have to reserve space 
for the slider, leaving an empty area, or dynamically readjust the 
text to fit ... which annoys users as the number of lines changes 
on them. So, no. ;)
Pekr
2-Jun-2007
[6620]
Ashley - well, how often there is the change of text size, so that 
there is, or is not the need for slider? ;-) Once?
Robert
8-Jun-2007
[6621]
How about using Chris' script to support input-patterns: http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=filtered-import.r
btiffin
9-Jun-2007
[6622]
How do you get a slider to react to the mouse wheel?
Graham
9-Jun-2007
[6623x2]
move the wheel?
I'm pretty sure mouse wheel support is implemented.
btiffin
9-Jun-2007
[6625x3]
Yeah, it's not reacting.  I've tried forcing focal-face, no effect. 
 ??
I've tried a custom widget with an  action: make default-action [ 
 but I might be missing
something simple but critical...
From what I can understand from other widget code, say area...the 
on-scroll is sent to

the area...I need it to go right to the slider for the scheme I'm 
attempting...  Umm, I think...
Ashley
9-Jun-2007
[6628]
You have to do it indirectly, as in:

display "" [
	p: panel data [slider] on-scroll [
		var: face/pane/1
		var/data: var/data + either negative? scroll/y [-.1][.1]
		show var
	]
	do [system/view/focal-face: p]
]
btiffin
9-Jun-2007
[6629x2]
Ashley;  Thanks.
Works nicely.  Need to build the boundary fences, but works nicely. 
 Thanks again.
Graham
10-Jun-2007
[6631]
New error for me ..


An error has occurred.  If this occurred with an upgrade, please 
revert to the older version for the meantime, and report the error 
message as documented below.

make object! [
    code: 501
    type: 'access
    id: 'not-open
    arg1: "Port"
    arg2: none
    arg3: none
    near: [repeat i p/cols [
            line/pane/:i/offset/x: col-offset 
            line/pane/:i/size/x: p/widths/:i - sizes/cell 
            all [
                p/pane/2/show? 
                i = p/cols 

                line/pane/:i/size/x: line/pane/:i/size/x + (p/size/x - p/pane/2/size/x 
                - (line/pane/:i/offset/x + line/pane/:i/size/x))
            ] 

            line/pane/:i/text: replace/all form pick p/data index - 1 * cols 
            + i "^/" "¶" 

            line/pane/:i/font/color: either find p/options 'no-action [
                black
            ] [
                either find picked index [white] [black]
            ] 
            col-offset: col-offset + pick widths i
        ]]
    where: 'confirm
]
Ashley
10-Jun-2007
[6632]
Well, that looks like the face-iterator logic (used by table and 
text-list) ... any idea what was being done at the time (i.e. table 
just about to be displayed, row double-clicked on, etc)?
Graham
10-Jun-2007
[6633]
None of those as I recall.
Ashley
10-Jun-2007
[6634]
Build#95 uploaded to SVN. Contains new 'on keyword and request-char 
function. 'on is used to specify multiple action handlers at once, 
as in:

	display "" [
		field
		field on [
			scroll [print scroll/y]
			focus [print "Got here!"]
		]
	]

%tour.r updated to demonstrate new request-char function.
btiffin
12-Jun-2007
[6635]
Ashley;  How hard would it be to allow set-path! for widget variables? 
 Or am I missing

something that would allow widget variables to be held in an object!? 
 I'm fairly prone
to missing things  :)
Ashley
12-Jun-2007
[6636]
You mean something like:

	b: "Bob"
	display "" [a: field b]

which is already supported, or something else?
btiffin
12-Jun-2007
[6637]
No I mean something like

fields: make object! [
   a: b: c: none
]

display "Test" [fields/a: field  fields/b: field  fields/c: field]
Ashley
13-Jun-2007
[6638x2]
No [to supporting that]. The preferred approach would be:

	obj: make object! [
		a: "Bob"
		f: does [display "" [field b]]
	]
	obj/f
typo "field b" -> "field a"
btiffin
13-Jun-2007
[6640]
Thanks Ashley.
Volker
13-Jun-2007
[6641]
Would pathes help? I think the change to support that could be small.
btiffin
13-Jun-2007
[6642]
I was looking at (and don't grasp all the implications of) the parsing 
 set-word!  occurances and how a set-path! may be inserted.  But...it 
looked too simple, so it had to be wrong.  :)  And again, I don't 
get all the implications, so I'm completely accepting of Ashley's 
nice short no.
Graham
13-Jun-2007
[6643]
make object! [
    code: 501
    type: 'access
    id: 'not-open
    arg1: "Port"
    arg2: none
    arg3: none

    near: [line/pane/:i/font/color: either find p/options 'no-action]
    where: 'confirm
]
Ashley
13-Jun-2007
[6644]
face-iterator init func as it tries to create a table ... now that 
one should be reproducable?
Graham
13-Jun-2007
[6645x2]
I'm just logging errors here as they occur!
so I can add traps around them and then log them to the rebgui.log