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

World: r3wp

[View] discuss view related issues

Brock
2-Nov-2006
[6021x6]
hilight-colour: 255.0.0 ;0.112.99	;request-color


font-style: make face/font [style: 'bold  name: "font-sans-serif" 
 size: 26]

hilights: [
	transform 0 1 1 0x0 0x0
	fill-pen snow pen snow	;white circle
	circle 10x10 9
	fill-pen black pen black	;black circle
	circle 13x13 9
	fill-pen hilight-colour	;0.112.99
	pen hilight-colour	;serve dark green - 0.112.99
	circle 11x11 9
	fill-pen snow pen snow
	font font-style
	text 1 6x0 "*"
]

view center-face out: layout [
	origin 0
	bx: box 23x23 50.50.50 effect [draw hilights effect []][ 
		file: request-file/only/save/file %hilight.png
		if not file [exit]
		if not find file ".png" [append file ".png"]
		save/png file to-image bx
		img: load file
		colour: pick img 1x1

  repeat i length? img [if colour = pick img i [poke img i 0.0.0.255]]
		save/png file img
	]
]
this is a stripped down version (this time one that works without 
error)
clicking on the image brings up the save requestor
Using Gabriel's method creates a clean image without the fringing....
hilight-colour: 255.0.0 ;0.112.99	;request-color


font-style: make face/font [style: 'bold  name: "font-sans-serif" 
 size: 26]

img: make image! 23x23
img/alpha: 255	;make bg transparent


draw img [
	transform 0 1 1 0x0 0x0
	fill-pen snow pen snow	;white circle
	circle 10x10 9
	fill-pen black pen black	;black circle
	circle 13x13 9
	fill-pen hilight-colour	;0.112.99
	pen hilight-colour	;serve dark green - 0.112.99
	circle 11x11 9
	fill-pen snow pen snow
	font font-style
	text 1 6x0 "*"
]

file: request-file/only/save/file %hilight.png
if not file [exit]
if not find file ".png" [append file ".png"]
save/png file img
Thanks all for your input/suggestions.
Anton
3-Nov-2006
[6027]
The "bulk-set alpha" method as shown by Gabriele should evaluate 
quite a lot faster, too.
Brock
3-Nov-2006
[6028]
I had problems with his version for resizine the image on the fly. 
 I didn't look at it very long.  I'm rethinking whether I need the 
resize feature as I will likely build a small GUI where are the parameters 
are set.
Graham
5-Nov-2006
[6029]
I have access to the F1 - F12 keys .. but what about the Alt-F1 - 
F12, or other modifiers?
Maxim
5-Nov-2006
[6030x4]
in the event you have alt/shift/ctrl members.	
event/shift  for example.
when set to true the modifier was pressed when you pressed the key.
combinations exist.
the Alt key is sometimes consumed by the OS, same for the Tab... 
I think someone mentionned that tab + shift is never sent to REBOL.
Graham
5-Nov-2006
[6034]
I have to see if rebgui allows me all of this ...
Louis
5-Nov-2006
[6035x2]
I'm looking for a script to allow communication between users on 
a lan. rim.r looks like it would work, but the cgi script that ties 
it together is missing. Does anyone have it?
Is something even better available?
Anton
6-Nov-2006
[6037x2]
There is only event/control and event/shift,   nothing to detect 
Alt key.
Tab and Shift+Tab  can be trapped by Rebol.  But Ctrl+Tab cannot 
be caught by Rebol because Windows consumes this key event before 
it is sent to the application window (eg. Rebol's window).
Maxim
6-Nov-2006
[6039]
wasn't there the Alt support in a prior version.  I am almost shure 
I used to support it in an old app of mine...
Anton
6-Nov-2006
[6040]
nope
Pekr
6-Nov-2006
[6041]
but it can be surelly overriden, or can't it?
Maxim
6-Nov-2006
[6042x3]
events are a datatype not objects, you cannot set any values in them.
which is why Anton reversed enginerred the do-face mechanism... but 
in any case, the events are generated by the internal REBOL HAL which 
accepts some (but not all) OS events and feeds the event port with 
them.
it has been a long standing request that more OS events been sent 
to scripts...
Pekr
6-Nov-2006
[6045x2]
and that was my point. It could accept even ctrl+tab, as that is 
trappable. But, I remember how Holger argued with me about cross-platform 
issues ....
as long as Cyphre is on View part of R3, I believe the situation 
will be corrected :-)
Maxim
6-Nov-2006
[6047x5]
ahh cross platform is a moot point for many of us. really... the 
fact that REBOL runs on all platforms is very good.
the fact that OUR apps run on all apps is not needed in many/most 
cases
especialy in corp env.  and in any case, we will adapt our apps to 
use any os features REBOL gives us :-)
that's the point for a user to use Apple or windows... why strip 
their power from them.?
example... why no OS icon drag support in apple and window.
Anton
6-Nov-2006
[6052]
Rebol gives you all the OS features you can digest... via the External 
Library Interface.
Maxim
7-Nov-2006
[6053x3]
yes, just like following 3 years of mechanics will allow me to change 
my pistons in my car myself... the question. is... do I want to? 
 when the whole platform is the one taking away those events!  for 
compatibilitie's sake?
and even then... that means I have to try and make it work for apple... 
hum.. I dont' own one, how can I make it work.
(sorry if I sound negative here, its not against you... I'm just 
a bit tired these days...)
Anton
7-Nov-2006
[6056]
You just gotta relax and focus a bit.
Maxim
7-Nov-2006
[6057x2]
hehe
but Anton, is it really possible to add icon drag events in a rebol 
window?  how will I receive my events within the wake-event?  AFAICT... 
its not dooable.
Anton
7-Nov-2006
[6059x5]
You mean from the OS ? Yes, it is, I far as I remember.
http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=sys-port-drag-accept.r
The above works for Windows.
the whole platform is the one taking away those events!

  -- that's kind of saying it the other way around. The platform (rebol) 
  has not provided us with an OS-independant way of trapping drag events, 
  yet.
You could express everything that you want but do not have as something 
"taken away" from you. That's the "glass half-empty" way of looking 
at things. Are you a programmer or not ? If you want something, just 
make it !  If it's hard, work hard !  The whole art of programming 
is to make something previously difficult, easy.
Maxim
7-Nov-2006
[6064x2]
I don' t have the time to take a week getting my hands in MS window's 
dev stuff just to implement icon support. (for one platform)  That's 
one feature out of SOOOOOOO many.  I am happy if you have the time 
to implement such tricks.  But then only some of the hard core will 
benefit.. since OS-lib interface is not free!


We need a second, (and compatible) lower-level API  (like amiga has 
vanilla and direct).  then its just up to RT to provide a switch 
case of all supported features it can take from a host OS.  and let 
us pick out of that.


I use REBOL cause its more productive.  I want to stay in REBOL. 
 and I just wish VIEW where less limiting.
VIEW is the one deciding for me what is usefull or not... yes it 
takes a raw freedom away from me.  It is deciding in my place what 
events IT listens to.  There are ways for it to allow us to decide. 
 and this would allow us to take advantage of some OS features.


I remember reading a chat between Jaime and Carl where they where 
talking about OSX events and stuff...  basically they where looking 
at WHAT events to handle and in what apis... so what I (and sooo 
many others have asked) is possible.
Pekr
7-Nov-2006
[6066x2]
I agree with Maxim - I don't want Rebol to contain just and only 
features, available on all platforms ...
I know it can be problematic, I do remember some hot discussions 
with Holger about e.g. why some key events are not trapped by REBOL. 
What do we do, if e.g. Mac keyboard does not support Alt, or Win-Keys? 
:-)
Maxim
7-Nov-2006
[6068x3]
Holger was pretty anal about making REBOL the next christ... I love 
everyone... but we ended up with Rael.  ;-)
who loves everyone (with certain peculiar attributes l wont name 
here  ;-)
its funny, cause I have a list of rants I never send out about REBOL. 
 I just accumulated them and see how over the years... they are similar. 
 Things in REBOL have not changed a lot.  R3 is the first really 
profound change since v1.2 core.  and its very welcome IMHO.