I specifically did not go into why rects are
not showing in your solution, because it had a few
issues: using overlapped canvases and treatment of
paint event and repainting.

It's been common in all GUI, esp. noted with
emergence of Java Swing that there are heavyweight
controls provided by the system and lightweight
controls maintained with application API. There are
certain things that are known about them. In particular,
that heavyweight controls are expensive, have
problems with overlapping, typically rectangular,
etc.

So it is common to express custom complex views
and controls with lightweight controls which are
arranged on a single large heavyweight control,
which acts as a container and delegates its events 
and painting to the "soft" lightweight controls.

Examples of such behavior are the Grid component
with controls such as checkboxes; and recently
the media/paint addon, whose toolbar, colorwell,
etc. are lightweight controls on single canvas.
Your thumbnail view with selection frames can
be done as the toolbar there, which also uses
image files to draw buttons.

Although the distinction of light and heavy controls 
is found at least as early as Petzold book on
Windows 3.0, it gained momentum with Java Swing,
which in turn is based on Internet Foundation Classes 
by Nescape who sought cross-platfomness through
drawing its own GUI. Internet Explorer drew its
own controls, except frames until v5.0 and comboboxes
until v7.0. This can be observed with Spy++ tool.

Interestingly, on Mac OS X most GUI is heavyweight,
even Safari keeps all its elements, not only controls,
as separate system controls, which can be observed
with Accesibility Inspector. This can explained as
their GUI as a whole being run as single compossited
Quartz window server in which system components are 
lightweight. However, Firefox on Mac uses its own 
single canvas.

Windows Vista follows Quartz with its new WPF GUI
described with XAML language, etc. Silverlight,
Flash and OpenGL are also examples of single canvas GUI.

Java AWT: Lightweight UI Framework
http://java.sun.com/j2se/1.3/docs/guide/awt/designspec/lightweights.html

Painting in AWT and Swing
http://java.sun.com/products/jfc/tsc/articles/painting/


--- Brian Schott <[EMAIL PROTECTED]> wrote:

        I need to study your solution to see how I can use
it. What I am really trying to do is highlight one of (say)
three thumbnail pictures at a time when that thumbnail is
selected, so my idea was to put a red picture frame around
the highlighted thumbnail and erase the one that was
highlighted. I thought the glrects could be placed directly
under each thumbnail and with the 3 rectangles just a little
larger than the 3 thumbnails, when the rectangles were not
background colored, they would look like a picture frame. I
can probably do that with your scheme; I will see.

        It may not have been clear from my previous post
that no matter what order I execute the 3 paint commands,
only the one for 0{rects works. That is really a surprise
for me. That is, in the demo below, the order of the paint's
does not matter; only 255 0 0 paint 0 produces a rectangle.


> Bill,
> 
>       I especially appreciate your attempt to explain the
> conversion between units and pixels. I will look further
> into your examples and explanations.
> 
>       I don't quite understand your following point,
> because I thought glrect *was* a gl2 command. I am dealing
> with pictures differently -- not with the glrects, as I
> explain a little in my response to Oleg.
> 
> 
> + As Oleg already explained, this the way that gl2 work. An
> + isigraph does not have a permanent picture. If you do not
> + want to deal with a state machine, a possible workaround
> + is to use gl2 commands to draw the picture and save it to
> + a picture file, then assign this picture to an owner-draw
> + button.
> +
> 
>       Please see my comments to Oleg regarding the order
> of the paint commands NOT mattering.
> 




 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to