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

World: r3wp

[View] discuss view related issues

Ashley
13-Feb-2005
[388x2]
Q. On Windows you can define a func as:

maximize-face: func [
	"Maximizes a face on screen."
	obj [object!]
][
	obj/changes: [maximize]
	obj
]

which lets you do:

	view maximize-face layout [text "Hello world!"]


but this is of limited use when you want to know how big the [maximized] 
screen will be *prior* to layout.

	help system/view/screen-face/size

isn't quite what we want, so I cobbled up the following:

max-win-size?: has [scr-face view-face] [
	scr-face: system/view/screen-face
	view-face: make face []
	view-face/changes: [maximize]
	;	view the face
	insert tail scr-face/pane view-face
	show scr-face
	wait .001
	;	unview the face
	remove back tail scr-face/pane
	show scr-face
	view-face/size
]

which has two drawbacks:

1) It requires the face to be shown (screen flickers briefly)
2) It doesn't work on Linux

Anyone else mucked around with this sort of stuff?
3) It dosen't work on IOS (1.0.6)
Guest
14-Feb-2005
[390x2]
help !! Scrolling panel
plis source code ?
Anton
14-Feb-2005
[392x3]
do http://www.lexicon.net/antonr/rebol/gui/demo-scroll-panel.r
You must use Rebol/View 1.2.1 < version <= 1.2.29    (I am sorry, 
for so small range of versions... can be fixed...)
Source for scroll-panel style:  http://www.lexicon.net/antonr/rebol/gui/scroll-panel.r
Guest
15-Feb-2005
[395]
plis sample code append panel
DideC
15-Feb-2005
[396]
Guest: why don't you claim an account for Altme in the "Accounts" 
group ??
Guest
15-Feb-2005
[397]
how I have this to make ?
Vincent
22-Feb-2005
[398x3]
What is the /away
refinement in show-popup for?
I can't find it in any doc.
shadwolf
22-Feb-2005
[401x3]
I have the impression that the /away efinement on show-popup function 
 will let the focus to the parent window .. but not sure
>> source show-popup

show-popup: func [face [object!] /window window-face [object!] /away][
    if find pop-list face [exit]
    window: either window [window-face] [
        if none? face/options [face/options: copy []]
        if not find face/options 'parent [
            append face/options compose [parent (none)]]
        system/view/screen-face]
    face/action: away
    insert pop-list pop-face: face
    append window/pane face
    show window]
face/action: away
[unknown: 5]
22-Feb-2005
[404]
Yeah I never seen that one either.  Someone should get Carl to throw 
that in the docs
Anton
22-Feb-2005
[405x2]
It is used in wake-event.
write clipboard:// mold get in system/view 'wake-event
Romano
22-Feb-2005
[407]
the away refinement try to create modal face which are closed when 
the user click outside the face (like in menu)
Vincent
22-Feb-2005
[408]
Thanks Romano - I was trying to document it in french, but wasn't 
satisfied with the official description "/away - the away refinement"...
Romano
22-Feb-2005
[409]
hehe
Rondon
23-Feb-2005
[410]
Hi Folks. Where can I find vid-styles to look like and feel a XP? 
I know that SurfDetect uses something like that.. Any tips ?
Pekr
23-Feb-2005
[411x5]
Today I was asked by my friend to help him with View. I did not know 
he still uses Rebol at all ;-)
He has following "problem" - imagine two faces. First one, container, 
of size 50x50, featuring scrollers etc. Second one, inside the container, 
of size 100x100. Now he tries to get image of the larger face, so 
he does something like to-image container-face/pane ...
The result is image of 100x100 correct size, but the image is cut-off 
of content hidden by parent face ....
the strange thing is, that when he does 'unview, followed by the 
same command, then the image is full, not cutt-off ... anyone?
btw - he uses imo 1.2.10, as he told me he want to use last "stable" 
version .... once again - we should probably do something with View 
release, or ppl will still use old stuff, even if new one is stable 
enough to use ...
Rebolek
23-Feb-2005
[416]
I think if you 'view face and then you use 'to-image rendered bitmaps 
are taken - so it's just 100x100. If the face is not viewed at all 
or unviewed, all faces and subfaces must be completely rendered, 
so you get full bitmap....just my thoughts
Pekr
23-Feb-2005
[417x2]
hmm, so no chance of getting image of 100x100 face?
I have thought that "unview" "destroys" rendered faces? So I am surprised 
he got correct result?
Rebolek
23-Feb-2005
[419x2]
'unview probably "clears" "bitmapcache" so all faces and subfaces 
must be rendered again if you use 'to-face. and 'view probably composes 
all bitmaps together, so everything overlayed is lost when using 
'to-image...but that's just what I think, I don't know how it really 
works internaly
'to-face --- it should be 'to-image
Pekr
23-Feb-2005
[421]
hmm, and once he is in View layout = rendered state, he simply wants 
to press a button and get resulting image ... Maybe he could render 
it once again in the background somehow? But how?
Rebolek
23-Feb-2005
[422]
mh, probably make new face (without 'view-ing it) with the content 
of the subface
Volker
23-Feb-2005
[423]
has he tried "show container-face/pane" before to-image? maybe that 
helps.
Pekr
23-Feb-2005
[424]
why would there be show needed? IMO it is correct that container-face 
clips the image .... hmm, although maybe not, becase the image is 
still 100X100, just content is 50x50 :-)
Volker
23-Feb-2005
[425]
the buffer is 100x100, but /view knews only the 50x50-part is needed, 
so draws only that in the buffer.
Pekr
23-Feb-2005
[426]
I will send him email to try ...
Volker
23-Feb-2005
[427x2]
you must somehow tell the image its not clipped. when you show the 
container, it thinks it is. when you show itself, maybe it renders 
full.
i guess faces remember if they are already rendered or not. but they 
don't remember that they are only rendered partly. 'unview tells 
them they are unrendered. hmm, maybe a 'hide does the same. would 
only flicker, not unview the whole window.
Pekr
23-Feb-2005
[429x2]
I just tried show and it does not seem to work ... but maybe my code 
is buggy :-)
>> container-face: layout [b: box 50x50 red button "to-image" [show 
b/pane r: to-image b/pane]]

>> subface: layout/size/offset [at 0x0 box 100x100 blue] 100x100 
0x0  b/pane: subface
>> view container-face
>> view layout [image r]
Volker
23-Feb-2005
[431x3]
No, your code is ok, only rebol is - ahem ;)
b/pane: none show subface ; and then restore b/pane
rebol[]

container-face: layout [b: box 50x50 red button "to-image" [b/pane: 
none show subface r: to-image subface b/pane: subface show b view/new 
layout [backdrop black image r] ]]

subface: layout/size/offset [at 0x0 box 100x100 blue] 100x100 0x0 
 b/pane: subface
view container-face
Pekr
23-Feb-2005
[434x3]
why b/pane: none?
do you think there is something strange with face rendering/composition/refresh?
actually - if you set b/pane to none, where will subface be shown/rendered? 
:-)
Volker
23-Feb-2005
[437]
its rendered in its buffer. you must tell /view that the parent-face 
of subface is invalid. thus b/pane: none. now b/pane does not know 
subface and subface must re-render itself and then it goes full size. 
else it knows only the 50x50 is visible. should be fixed in to-image 
to force a full redraw.