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

World: r3wp

[View] discuss view related issues

Gabriele
25-Aug-2005
[2326x2]
context get-face panel    gives you back the  object.
(or better make template-obj get-face panel)
Chris
25-Aug-2005
[2328]
; Here's a quickie:
ctx-busy: context load http://www.ross-gill.com/r/busy-style.r

view center-face layout [backcolor snow origin 200x150 busy true 
coal]
JaimeVargas
25-Aug-2005
[2329]
Hey that came form OSX! Nice.
Henrik
25-Aug-2005
[2330]
nice :-)
Graham
25-Aug-2005
[2331]
Why not use the firefox busy style ... open source.
Geomol
25-Aug-2005
[2332]
That's really cute, Chris! :-)
BrianW
26-Aug-2005
[2333]
hrm. Having issues getting "show" to work right for me. Time to dig 
a little and see what I can find out...
james_nak
26-Aug-2005
[2334]
Ok, I've tried... I have a list of toggles with a scroller attached. 
For the life of me I can't get the "dragger" to size properly. The 
slider button is not proportional to the what is being shown in the 
list. In my case, I'm seeing about 20 of the 24 rows so the dragger 
should be about 80% the size of the panel, no? Thanks in advance 
to anyone who knows.
MikeL
27-Aug-2005
[2335]
James,  The code?
james_nak
27-Aug-2005
[2336x2]
Rebol Lesson #3:  "An object can contain variables that refer to 
functions that are defined within the context of the object." Therefore, 
don't assume an object's path leads one to having a value '"shoved 
into" it replacing the current value. In other words, sometimes all 
it takes is noticing that there isn't a ":" (colon) following the 
path. In Judeo-Christian lingo: "Thou shall not murder a function 
held in an object."  Man, I didn't notice that scroller_object/redrag 
holds a function and just requires a value to be passed to it!  When 
will I ever learn? Thanks MikeL. The phrase, "The code?" caused me 
to notice that.
Almost there. What controls the amount of scroll when the user drags 
the bar up or down. I want my bar to move in increments of one row 
at a time but it seems like I have way too fine of a value in there 
to the point where the program has to catch up to the user's movements 
after a while. I would think it would be obj/step.
Anton
28-Aug-2005
[2338x4]
The code ? :)
I'm expecting you're doing a show every time there is a scroller 
movement. What you want to do is check if the current row (ie. the 
one at the top of your list) has changed If so, show the list. If 
not, ignore. Not all the shows are necessary.
James, this example might help:

do http://www.lexicon.net/antonr/rebol/gui/iterated/demo-vid-list-scroller.r
The STEP facet is what you want to set. This snippet from the above 
script does the work:

	; arrow buttons cause the slider to move by the value of step

 scroll/step: either zero? non-visible-part [0][1 / non-visible-part]
Volker
28-Aug-2005
[2342]
Since customizing buttons comes sometimes up, i just found this link: 
http://www.rebol.com/how-to/btns-cust.html. Did not know that image 
can do that :)
james_nak
28-Aug-2005
[2343]
Oh Anton-san, you very wise. The step was set correctly but it was 
indeed the # of "shows" that were being performed. I just check the 
before and after offset and do the show if necessary. Thanks.
Geomol
29-Aug-2005
[2344]
Is there a way to draw a dot with the draw dialect? I'm looking for 
a way to do it with the draw dialect, and not just a poke in the 
image, so e.g. line-width will take effect. A line, where start- 
and end-point is the same, is not shown. A circle with radius 1 is 
not a dot, but slightly larger. Any ideas?
Ingo
29-Aug-2005
[2345]
does a circle with radius 0.5 work for you?
Anton
29-Aug-2005
[2346x9]
No, and even smaller does not work either:
view layout [i: image black effect [draw [anti-alias off  circle 
10x10 0.0001]] image (i/size * 5) (to-image i)]
This might be a way:
view layout [i: image black effect [draw [anti-alias off scale 0.1 
1 line 100x10 101x10 scale 1 1]] image (i/size * 5) (to-image i)]
Seems crazy that you can't just draw a dot, doesn't it ?
Here is another way:
view layout [i: image black effect [draw [anti-alias off shape [move 
10x10 hline 10.1]]] image (i/size * 5) (to-image i)]
Really need a SET-PIXEL or DOT command just for drawing single pixels. 
These other ways are a bit unwieldy.
I am sure Cyphre has this on his to do list already.
Henrik
29-Aug-2005
[2355]
Is there any documentation on how the windowsXP-like buttons in View1.3 
are made? They are bitmapped, right? I remember the community help 
that Carl had for making this over a year ago for the first betas. 
I will need this for some custom buttons for a project that I'm going 
to do; converting a fully graphical HTML GUI to VID while it keeps 
the same look.
Anton
30-Aug-2005
[2356]
Yes, they use an image and the EXTEND effect, indeed:
	print mold svv/vid-styles/btn/init
	? .png
	layout [b: btn "hello"]  b/effect
Henrik
30-Aug-2005
[2357]
thanks
Anton
30-Aug-2005
[2358x3]
As to making the images, Chris is into this stuff.
Here's an old script of mine you might find useful:
http://www.lexicon.net/anton/rebol/gui/button-design.r
Sorry here is the real URL:
http://www.lexicon.net/antonr/rebol/gui/button-design.r
Ashley
30-Aug-2005
[2361]
From the RebGUI button widget:

data:	reduce [
	#[image! 7x14 64#{

  AAAAREREREREREREREREREREAAAARERERERE////////////RERERERERERE////

  +vr6+vr6+vr69/f3RERERERE+vr69/f39/f38vLy7u7uRERERERE9/f39/f39/f3

  7u7u6enpRERERERE9/f38vLy8vLy6enp4eHhRERERERE7u7u7u7u7u7u4eHh0tLS

  RERERERE7u7u7u7u6enp4eHh0tLSRERERERE6enp6enp6enp4eHh0tLSRERERERE

  6enp5eXl5eXl4eHh0tLSRERERERE4eHh4eHh4eHh0tLS0tLSRERERERE0tLS0tLS

  0tLSs7Ozs7OzREREREREREREs7Ozs7Ozs7OzREREREREAAAARERERERERERERERE
		REREAAAA
	} 64#{

  /wAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAAAA
		AP8=
	}]
	#[image! 7x14 64#{

  AAAAREREREREREREREREREREAAAAREREREREs7Ozs7Ozs7OzREREREREREREs7Oz

  s7Ozs7Ozs7Ozs7OzREREREREs7Ozs7Oz0tLS4eHh4eHhREREREREs7Oz0tLS0tLS

  4eHh4eHhREREREREs7Oz0tLS0tLS4eHh4eHhREREREREs7Oz0tLS0tLS4eHh4eHh

  REREREREs7Oz0tLS0tLS4eHh4eHhREREREREs7Oz0tLS0tLS0tLS4eHhRERERERE

  s7Ozs7Oz0tLS0tLS0tLSREREREREs7Oz0tLS0tLS4eHh4eHhREREREREs7Oz4eHh

  4eHh6enp4eHhRERERERERERE6enp6enp6enpREREREREAAAARERERERERERERERE
		REREAAAA
	} 64#{

  /wAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAAAA
		AP8=
	}]
	#[image! 7x14 64#{

  AAAAREREREREREREREREREREAAAARERERERE/t+a/t+a/t+aRERERERERERE/t+a

  /NJ6/NJ6/NJ6/t+aRERERERE/t+a/NJ69/f3/NJ6/t+aRERERERE/t+a/NJ69/f3

  /NJ6/t+aRERERERE/NJ6/NJ68vLy/NJ6/NJ6RERERERE+sdh+sdh7u7u+sdh+sdh

  RERERERE+b5L+b5L6enp+b5L+b5LRERERERE+b5L+b5L6enp+b5L+b5LRERERERE

  +LQ1+LQ15eXl+LQ1+LQ1RERERERE+LQ1+LQ14eHh+LQ1+LQ1RERERERE+LQ1+LQ1

  +LQ1+LQ1+LQ1RERERERERERE5ZcA5ZcA5ZcAREREREREAAAARERERERERERERERE
		REREAAAA
	} 64#{

  /wAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAAAA
		AP8=
	}]
]

then just use:

	image:	first data
	effect:	[mix extend 3x7 1x1]
Gabriele
30-Aug-2005
[2362]
a dot? view layout [box 50x50 effect [draw [pen none fill-pen white 
box 25x25 26x26]]]
Geomol
30-Aug-2005
[2363]
A single dot is not a problem. I would like line-width to take effect. 
Thanks for the input, but these are all work-arounds. I think, we 
need a dot command in draw. I've started work on a DeLuxe Paint like 
paint program. Lines, boxes, circles and so works ok, but if the 
user just make a dot, I have a problem. It should work with line-width 
> 1 too.
Gabriele
30-Aug-2005
[2364x2]
what is a dot with line-width > 1 like?
i guess, you just want a filled circle?
Geomol
30-Aug-2005
[2366x2]
yes
But I want it to be pixel-correct, so if I extend that dot (filled 
circle) to a line, it should look correct.
Gabriele
30-Aug-2005
[2368x2]
AGG is sub-pixel correct ;)
view layout [box 400x400 white effect [draw [pen black line-width 
10 line-cap round line 30x30 300x30 line 50x100 70x100 translate 
0.5 0.5 pen none fill-pen black circle 30x100 5]]]
Geomol
30-Aug-2005
[2370x6]
That might be a good way to do it. Let's see...
view layout [i: image black effect [draw [pen white line-width 10 
line-cap round line 20x

20 80x20 line 40x40 70x40 line-width 3 line 30x60 80x60 line-width 
1 line 25x80 80x80 transl

ate 0.5 0.5 pen none fill-pen white circle 20x40 5 circle 20x60 1.5 
circle 20x80 0.5]] image
 (i/size * 5) (to-image i)]
Yes, looking good. Just a bit irritating with the need of translate. 
A dot command at the same position as the start of a line would be 
desireable.
I hope, I make sense! :-D
Sorry, linebreaks.
view layout [i: image black effect [draw [pen white line-width 10 
line-cap round line 20x20 80x20 line 40x40 70x40 line-width 3 line 
30x60 80x60 line-width 1 line 25x80 80x80 translate 0.5 0.5 pen none 
fill-pen white circle 20x40 5 circle 20x60 1.5 circle 20x80 0.5]] 
image (i/size * 5) (to-image i)]