tyrvainen@cc.helsinki.fi (05/30/91)
Hi !
I wonder if anybody has solved this problem before. The problem is, how
to refresh the screen after closing graphics when using Turbo Vision.
Initializing graphics is not a probleb. After closing graphics the screen
should return to the state it was before entering graphics mode. So, all views
owned by TApplication object should draw themselves with their own methods.
I tried to send a broadcast to the TApplication object with message function,
but it doesn't get there ! Here is some code WITHOUT ANY DETAILS:
PROGRAM MyProgram;
USES MyUnit;
...
PROCEDURE TMyApp.HandleEvent
...
CASE Event.What OF
...
evBroadCast: IF Event.Command=cmGraphClosed THEN Draw;
...
END;
UNIT MyUnit;
INTERFACE
CONST cmGraphClose = 155;
IMPLEMENTATION
PROCEDURE MyObj.ThisProcedure;
InitGraph...
...
CloseGraph;
p:= Message(Owner, evBroadCast, cmGraphClosed, @Self);
END;
This isn't very clear, but the idea is that the application owns a dialog box
which contains MyObj. The Message should be routed to the dialog box and after
that to the desktop and so on. But nobody seems to handle it, pointer p gets
value NIL !
I'm sure there is some better solution for this. Maybe You can advice me !
Tyrvainen@cc.Helsinki.Fi
Teppo Tyrv{inen
University of Helsinkiroth@oasys.dt.navy.mil (Pete Roth) (05/30/91)
Hi! You might take a look at TVBGI.PAS (I think that's its name) which is packaged as an example in tvdemos or docdemos. It switches from Crt to Graphics and back... regards, pete - - - - - - - - - - - - - - - - - - - - - - - - - - Peter N Roth roth@oasys.dt.navy.mil Objects in this office are closer than they appear.