Drawing on Window

Drawing on Window

Post by DaveO » Mon, 05 Nov 2001 03:45:33



I am new to Palm programming, and want to write an application that draws
stuff (thats a technical term) on the screen.  It looks like the general
process is something like:

create a form
create a window
set desired draw state, saving original state to restore later
draw stuff

I see I can also draw offscreen and then make the window active so the
changes appear all at once, but I'm not worried about that yet.

Is this the basic idea?  Are there any landmines I'm about to step on that
experienced folks would like to tell me about before I plunge in?

Also, how do you respond to the user pressing the physical buttons?  I guess
these are system events, but I haven't figured out from the Palm docs how to
trap them.

thanks,
DaveO.

 
 
 

Drawing on Window

Post by Ben Combe » Mon, 05 Nov 2001 04:02:47



Quote:> I am new to Palm programming, and want to write an application that
draws
> stuff (thats a technical term) on the screen.  It looks like the
general
> process is something like:

> create a form
> create a window
> set desired draw state, saving original state to restore later
> draw stuff

Sounds good.  You get a window automatically with a form, so starting
with a totally blank form would be oK.

Quote:> Is this the basic idea?  Are there any landmines I'm about to step on
that
> experienced folks would like to tell me about before I plunge in?

Look at the Minefield sample source or SubHunt.  These both do
straight-to-screen drawing.

Note: you need to use the drawing primitives in Palm OS.  Writing to
screen memory directly is prohibited.

Quote:> Also, how do you respond to the user pressing the physical buttons?  I
guess
> these are system events, but I haven't figured out from the Palm docs
how to
> trap them.

The hard keys can be read a few different ways.  Sub source is a good
example, since it uses the hard keys to move the boat and fire depth
charges.

 
 
 

Drawing on Window

Post by DaveO » Tue, 06 Nov 2001 00:51:36


Hi Ben,
Thanks for responding.

Quote:> > Is this the basic idea?  Are there any landmines I'm about to step on
> that
> > experienced folks would like to tell me about before I plunge in?

> Look at the Minefield sample source or SubHunt.  These both do
> straight-to-screen drawing.

That's very funny.  When I referrred to stepping on landmines, I didn't mean
literally...

Where do I find these sample programs?  I looked around on the Palm site,
including search and site map, and found references to some samples
including Subhunt, but could not find the actual code.  I found a version of
Subhunt (c.1996) on a CD that came with an older demo of CW, but couldn't
get it to compile with the CW8 demo.  I will be examining the code for some
general ideas, but I don't want to get attached to specific API calls or
other stuff that may be outdated.

Thanks,
DaveO.

 
 
 

Drawing on Window

Post by Ben Combe » Tue, 06 Nov 2001 13:37:13


Quote:> Where do I find these sample programs?  I looked around on the Palm
site,
> including search and site map, and found references to some samples
> including Subhunt, but could not find the actual code.  I found a
version of
> Subhunt (c.1996) on a CD that came with an older demo of CW, but
couldn't
> get it to compile with the CW8 demo.  I will be examining the code for
some
> general ideas, but I don't want to get attached to specific API calls
or
> other stuff that may be outdated.

We omitted the examples from the CW8 Demo to reduce download times.
These can be grabbed from Palm OS's developer site.

Go to the SDK download page at http://www.palmos.com/cgi-bin/sdk40.cgi,
then click on the examples archive (its the fourth choice on the page).

 
 
 

1. Linking drawings to expanded drawing files

Hi,
I'm trying to make a flowchart that is an overview of a
system.  I would like to be able to click on the
components and have them link to expanded/more detailed
versions.  I need a separate link to each individual
component detail.  I have tried using hyperlink but it
doesn't let me link to files on my network.  I would be ok
with either linking to another page within the drawing (if
i knew how to make multiple pages) or to linking to an
entirely separate drawing.  I'm using visio professional
5.0.  Thanks in advance.

2. NR/2 crashes when I post: why?

3. Copy or moving pages form drawing to drawing

4. Network Neighborhood

5. Drawing scanning, count drawings by size

6. Replace transformer blocks?

7. Windows 4.2 / EXPOSE events and re-drawing (???)

8. HPControl Panel Crash Help!

9. How do draw lines in a window?

10. drawing graphics in data windows

11. Scrolled Drawing Window

12. extracting draw widget id from window id?

13. Can you drag and drop a Windows file into a Draw Widget?