World: r3wp
[View] discuss view related issues
older newer | first last |
Robert 26-Jul-2005 [1948x2] | What I want to do is to add to AD for each day of a month (31) single panes, that have the number of the day as text and mark weekends in red. The numbers should appear top-down for numbers > 10. so like this: 1 0 |
the problem is, that the faces are added to the pane but I can't see anything... the box is blue. | |
DideC 26-Jul-2005 [1950] | You must change the offset of each face if you layout one by one. Otherwise they are all in the same "place". Better would be to add VID code to the block into the loop then use layout at the end: |
Robert 26-Jul-2005 [1951x2] | The problem is that I need to change some faces later. The days 28-31 on demand. |
That's why I wanted single faces to access them via the daynumber. pane/30/text: "" | |
DideC 26-Jul-2005 [1953x3] | view layout [ ad: box blue 280x36 with [pane: []] do [ tmp: copy [origin 0 space 0 across] start-date: to-date reduce [1 current-months/1 current-months/2] loop 31 [ append tmp reduce ['txt 9x30 to-string start-date/day 25] if start-date/weekday >= 6 [append tmp [red]] start-date: start-date + 1 ] append ad/pane layout/offset tmp 0x0 ] ] |
Should do the job | |
(remove the 25 in the block, useless) | |
Robert 26-Jul-2005 [1956x2] | Ok, but than I can access the single day texts, right? |
I think this will get me further. Thanks. | |
DideC 26-Jul-2005 [1958x3] | If you change the last line by : |
append ad/pane get in layout/offset tmp 0x0 'pane | |
then you can use: ad/pane/1 ... ad/pane/31 to access each text face | |
Ingo 27-Jul-2005 [1961] | Thanks Sunanda, that should do the trick! |
Anton 27-Jul-2005 [1962] | By the way, Robert, you can use FORM instead of TO-STRING. |
Robert 27-Jul-2005 [1963] | Is there any difference between TO-STRING and FORM? |
Anton 27-Jul-2005 [1964x2] | Not that I found. |
form and mold go together, conceptually. FORM is like "convert to human readable form", while mold is like "convert to rebol readable form". | |
Ingo 27-Jul-2005 [1966] | There are differences in the handling of blocks! >> to string! [1.0 1 "1"] == "1.011" >> form [1.0 1 "1"] == "1.0 1 1" Don't know about other differences at the moment. |
Anton 27-Jul-2005 [1967] | Ah yes, differences like that. Mmm.. |
Izkata 29-Jul-2005 [1968x4] | Hey, anyone know if there's a way to return events to a face underneat the current one? |
Like, make the checkbox here work, but keeping the box on top of it: | |
view layout [at 5x5 check 20x20 at 0x0 box 100x100 feel [detect: func [f e][e]]] | |
The best I can think of is looping through face/parent-face/pane, checking offsets, and activating the correct one... I'm hoping someone will have a nicer solution, though ^.^ | |
Gregg 29-Jul-2005 [1972] | What's the ultimate goal Izzy? That is, why do you have a face over the face? |
Anton 29-Jul-2005 [1973x3] | You mean make a face "transparent" to events ? You click right through the box, and it hits the checkbox. I did something like that once.... |
It helps to know if the covering face is the same size and offset as the face below. (then you don't have to modify the event/offset) | |
Check out this old script. It's a bit messy, but the example works. http://www.lexicon.net/antonr/rebol/gui/transparent-events.r | |
Izkata 29-Jul-2005 [1976] | See my newly uploaded package - %Entity.r - I'm looking for ways to have some unusual fun with Rebol faces, and right now I'm trying to get it to draw one top of everything, but still let buttons and such work |
Anton 29-Jul-2005 [1977] | Yes, that is something I definitely wanted to be able to do too. So I've been stuffing around on that bit. I have updated the script (still not perfect, but could help you on your way.) See above link. |
Volker 29-Jul-2005 [1978x2] | IIRC Cyphre has in his drag-drop-demo a find-face-underneath which scans the all faces, not only the ones in the parent-pane. |
and to emulate events better, you can also do this: reduce [e/1 e/2 e/3 e/4 e/5 e/6 e/7 e/8 offset e/offset ..] then poth event/1 and event/offset work | |
Anton 29-Jul-2005 [1980] | Yes, find-face-underneath is rudimentary. Needs to be a recursive search. |
Volker 29-Jul-2005 [1981] | (that means " 'offset e/offset " of course |
Anton 29-Jul-2005 [1982] | Volker, I just uploaded 1.0.1, which uses that technique. |
Volker 29-Jul-2005 [1983] | Ah, got confused. you have a 'copy-event without it, thought you used that. |
Anton 29-Jul-2005 [1984x2] | Check http://www.lexicon.net/antonr/rebol/library/window.r for find-face-deep, which recurses. |
Ah you're right. That is just remnant code from 2002. | |
Volker 29-Jul-2005 [1986x2] | reading %window.r . looks interesting. |
from reading source, 'sum-face-offsets maybe needs update: it does not add the /edge for now? | |
Anton 29-Jul-2005 [1988] | Ok, thanks, I added to todo list to check that out. |
Izkata 29-Jul-2005 [1989] | ehh.. 10kb will take a while for me to go through *and* understand - for the moment I'm sticking to transparent-events ^.^ eenyways, lunch and work meeting, then I'll start >.> |
Volker 29-Jul-2005 [1990x3] | i guess the important part in %window.r is 'find-face-deep (at the bottom). |
and from rebol 'win-offset? to find the offset in your face, to add to event/offset . that should give the face under mouse. | |
but for a start the face-finder in %transparent-events.r is enough. i would stick with that script for a while :) | |
Anton 31-Jul-2005 [1993] | Yep. First get it working using simple one-level face-finder, then when all the events are going to the right place, merge in the deep face-finder. |
Pekr 1-Aug-2005 [1994x4] | Window Face Options part of new View doc describes 'activate-on-show option. So - does it mean my app will be activated (it will flash at taskbar or eventually brought to the front), or does it provide me with always-on-top window option? |
Is it currently possible with REBOL to have always-on-top dialog box, so I can e.g. urge user to select/enter something and will not allow him/her to go back to underneath window screen? | |
one further question re new doc - does Event Flow section image displays for you in your browser? Maybe image link is incorrect? | |
... and I tend to agree with someone (do not remember now) who submitted RAMBO bug re strange behavior of 'over function. It is imo useless (try to prove me being wrong), if 'engage has to be used instead for "over" detection, when e.g. mouse button is pressed ... because, imo, it still belongs to 'over, although it is a bit "engaged" :-) | |
older newer | first last |