Re: [Visualoberon-win32] Port of XCal to new VO
Status: Beta
Brought to you by:
tteuling
|
From: Tim T. <ti...@ed...> - 2001-06-05 20:26:42
|
Hallo!
> Not yet. I'm still trying to learn my way around VO.
OK :-)
> For your amusement, here a Model/View for displaying graphs. As an
> experiment, I ported some of my code from Blackbox. Its not finished, but
> you'll get the idea.
I will do some comments to your code, so perhaps you might understand
some concepts better, but first of all: It is c00l (I should write it
in fat letters: *c00l*). It already looks very nice. Since it is ported
code (anotehr language another visualisation system). Was it difficult?
OK. The code:
VO uses parmeterless Init methods. I like them better. So for
Graphodel one should initialise later on. The same for GraphView. But
that is just style... You do not need to hand an instance of
VO:Base:Diplay.Display to controls. There is only one instance and it
always exists (but may of coure not always valid). So you can access it
directly. Of couse you do not need to call Draw for a refresh you can
make your own optimized version for updates and model changes. This
will give you a cleaner and smoother refresh.
There is also functionality for double buffering. So WireFrame for
that. You just allocate a bitmap of the specified size, draw into it
(the bitmap has a DrawInfo instance) and then copy it back to the
window. This will avoid flickerr even more.
The rest is OK fromt he first view (to much code to look into detail
yet). It seems like already deep into VO :-) IF you have any comments
regarding implementation details, nice or not that nice stuff, feel
free to speak.
> Have fun. It works for me under Win32.
X11 uses INTEGER for XPoint (you know that point stuff in
VO:Base:Display) so I had to add six SHORT casts for Unix. But we have
to fix that nevertheless (also open for solutions/implementations for
that part).
--
Gru=DF...
Tim.
|