[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some tricky prblems.......



Hi , 
	At the moment I'm working on creating an object graphics environment
which uses direct graphics. So you plot objects and you can set the
properties using a Set_Property method and it remembers everything. I
then have line, or Oplot, objects so you can have as many lines as you
want and the plot object auto-scales. I then have a window object, a
compound widget (based on a bit of code by DWF), which you add objects
to and when the window object is resized etc., it calls all its draw
methods of the objects, which are stored in a linked list. That part was
pretty straightforward. I now also have the ability to select objects,
much like you would in an object graphics environment and they can then
be moved around. The most recent addition is the ability to resize the
plots in a windows way. When the cursor appears on the edge of the plot,
it changes to the relevant arrow and then when the cursor presses the
left mouse button, they can resize the plot window which updates
automatically. There's the background - now for the problems.

1. The next ablility I would like to have for the compound widget is to
have popup menus when you click the right mouse button. e.g. You click
the right mouse button over a graph and a menu pops up which has move,
properties.. things like that. The move would simply select the object
and let the user move the graph, and properties would send an event to
the main program to bring up a big properties window. Then when the
right mouse button was clicked over no graph, a base menu would appear
with things like new > plot, contour etc.
I just can't for the life think how to go about it, short of creating
from base building blocks. There must be some easier way of doing this
using the pull down menus or something.
Any ideas?

2. Can you change the cursor type while the user has a button pressed
down. At the moment if the user goes over an edge and then presses the
right mouse button, he can then move the mouse around freely and the
cursor only changes when he lets go of the button. It's not the program,
in the sense that my program knows he's not over an edge and tries to
reset the cursor, using Device, /CURSOR_ORIGINAL. 

3. Does anyone know where windows stores its cursor bitmaps, is it in
dll which I could load into visual studio. At the moment I'm simply
changing the cursor shape using Device, Cursor_Standard=xxxx but since
this program is also going to be running under x windows, it would be
far more satisfactory to use the actual bitmaps.

4. Finally when I am redrawing things, for example when the user is
moving a graph around the screen, I am having to redraw the entire
screen which is causing flashing. I've been trying to think of the best
way to do it using pixmaps, but it's quite tricky, because it's quite
possible that two graphs might be over each other or something. One
thought I did have  
was that when an object is selected I could draw every object except the
selected one and then Device, COPY that pixmap every time the object is
moved. But I'm still not sure about the best way.


	Thanks in advance,
			Phil Aldis