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

World: r3wp

[View] discuss view related issues

Anton
18-Feb-2007
[6786x4]
A style a day keeps the doctor away:

New idea for a style: A "FLATTEN-PANEL" is a PANEL which "explodes" 
its
pane directly into the parent face's pane. eg:

A normal PANEL and resultant face hierarchy:

	layout [
		panel [
			label
			field
			check
		]
	]

	window
		panel
			label
			field
			check
	
A FLATTEN-PANEL and resultant face hierarchy:

	layout [
		flatten-panel [
			label
			field
			check
		]
	]
	
	window
		label
		field
		check

Implementation and test:

	view window: layout [
		style flatten-panel PANEL with [
			append init [
				foreach face pane compose [

     face/offset: face/offset + (do bind [where] first find second :layout 
     [new-face:])
				]

    append get in get first find second :layout [new-face:] 'pane pane
				clear pane
			]
		]
		
		at 500x200
		flatten-panel [
			label "hello"
			field
			check
		]
	]
Full document here:
http://anton.wildit.net.au/rebol/doc/flatten-panel.txt
updated.
Hmm.. not as useful as I would like.
Pekr
21-Feb-2007
[6790]
Hi, has anyone any newer version of Todo List script? My intention 
is not to replace Qtask, just having something VERY easy, kind of 
check-list, for controlling tasks - http://www.xidys.com/rebol-view/image38.jpg
Maxim
21-Feb-2007
[6791x3]
retask?
I can give you an .exe for windows if you want to test it out.
its even fully documented!


http://www.pointillistic.com/open-REBOL/moa/steel/retools/retask/index.html
Pekr
21-Feb-2007
[6794x2]
retask? what is that? liquified version of qtask? :-)
bzzzz .... loading
Maxim
21-Feb-2007
[6796x4]
nope just simple task tracker.
with presets and a bg mode which asks you what you are doing...
instead of you having to remember to fill out forms.
I've juste noticed the nice values we get for event key when pressing 
function keys !!!

in order: console listen tcp udp icmp dns local odbc oracle
Gabriele
21-Feb-2007
[6800x2]
is that 2.7? that is a bug, will be fixed in next release.
they should give f1 f2 etc of course :)
Gregg
21-Feb-2007
[6802]
Hmmm, I've always gotten f1, f2, etc., though I don't use them much, 
so this may be new.
Gabriele
21-Feb-2007
[6803]
gregg, yes, they are supposed to be f1 etc.
Gregg
21-Feb-2007
[6804]
I know they have been in the past.
Gabriele
21-Feb-2007
[6805x3]
there's a bug with 2.7 where event/key, when it should be a word, 
is wrong
that's probably because of the internal changes... probably wrong 
pointer or something like that
ins, del, home, end, pgup and pgdown have the same problem
Gregg
21-Feb-2007
[6808x2]
1.3.2 is OK.
Ah, just 2.7 then; OK.
Gabriele
21-Feb-2007
[6810]
yep. the bug was introduced in 2.7
Maxim
21-Feb-2007
[6811]
sorry... forgot to specify that its only 2.7 related... I just tought 
the values where funny... I assumed the break was that the keys didn't 
actually trigger... but then, on inspection... figured out what was 
really happening.
Anton
21-Feb-2007
[6812]
When is the next release, by the way ? I ask because we keep stumbling 
on this same bug, and I think it's an easy one to fix, judging by 
how fast those other string bugs were fixed.
Gabriele
22-Feb-2007
[6813]
i guess when Carl manages to escape from thread prison ;)
Anton
27-Feb-2007
[6814x3]
Does anyone know a way how to detect when all rebol windows are inactive 
(ie. because a non-rebol window became active) ?
I can trap inactive events sent to a rebol window, but I want to 
know whether that was because another rebol window was activated 
or a non-rebol application window was activated.
If it is a rebol window, that window gets an active event --- but 
this is *after* the previous inactive event.
Henrik
27-Feb-2007
[6817]
another window in the same rebol process or a differen rebol process?
Anton
27-Feb-2007
[6818x2]
Same process.
I need something like a "none-active" event that lets me know when 
all rebol windows are inactive.
Henrik
27-Feb-2007
[6820]
I would like to know that too. A program I'm making has a timer mechanism 
where the program must be active all the time and I want to display 
an alert if the window gets out of focus.
Anton
27-Feb-2007
[6821x2]
Maybe the system port ?
Let me dig around...
Henrik
27-Feb-2007
[6823]
never messed with it
Anton
27-Feb-2007
[6824x9]
How many windows in your program ?
If only one, it's easy - just trap inactive event.

If more than one, and since you are running a timer, you can track 
the state of all windows and react when a timer event comes along 
after an inactive event which was not followed by an active event.
Probably that's my solution too - run a timer.
excellent, time events are still running even when all rebol windows 
are inactive. This means it's possible.
active-windows: []
insert-event-func event-func: func [face event][
	;print event/type 

 if event/type = 'active [if not find active-windows event/face [append 
 active-windows event/face]] 

 if event/type = 'inactive [if find active-windows event/face [remove 
 find active-windows event/face]] 
	if event/type = 'time [
		if none-active? <> empty? active-windows [
			none-active?: empty? active-windows
			if none-active? [
				print "all windows inactive!!"
			]
		]
	]
	event
]
view/new win1: layout [size 400x250]
view/new win2: layout [size 500x200]
win1/rate: 0 show win1 ; start time events
none-active?: false
do-events
Can you see any holes in this method ? (Apart from the fact that 
it requires time events.)
I discovered a problem when closing the first window which has RATE 
set. Now time events no longer flow and so the state isn't detected. 
But it is solved by catching the close event and setting RATE in 
a second window.
do http://anton.wildit.net.au/rebol/view/detect-all-windows-inactive.r
The above seems to be working satisfactorily. It has the limitation 
of setting the window/rate, though.
Maxim
27-Feb-2007
[6833x2]
I handle this by patching the wake-event func and checking if the 
screen-face/pane has any faces within (which is the pane which holds 
the windows).  when ever this happens, it means all windows are closed. 
 and so I quit with none which disables the do-events.
obviously I verify after the part which handles any close event types, 
to make sure I trap any event which would have unviewed the last 
window or popup.
Gregg
27-Feb-2007
[6835]
Seems like it should work Anton. Another way would be to catch the 
inactive event, set a "deadman switch" timer to go off shortly. When 
a window gets an 'active event, disable that timer.