[futurebasic] Re: [FB] System Color Palette

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Derek Smith <dereksmi@...>
Date: Sat, 9 Oct 1999 23:36:51 -1000
On Sat, 9 Oct 1999, Charlie Dickman wrote:

> Fellow FBers,
> Does anyone know a straightforward way to restore the "standard" 
> system color palette after a not-very-user-friendly program like 
> Virtual PC leaves its changed palette in place when it terminates? I 
> know restarting will do it but that seems a bit drastic just for 
> having executed a program. I think I can tackle turning the num lock 
> keyboard light off myself.

For FB2, this will repair the system palette..its basically a fancy call
to RestoreDeviceClut along with a forced update of the desktop.

LOCAL FN RestoreScreen
  `     CLR.L    -(A7)
  `     MOVEQ  #$02,D0
  `     DC.W     $AAA2
  `     CLR.L    -(A7)
  `     DC.W     $2F38,$09EE
  `     _PaintBehind
  `     _DrawMenuBar

For FutureBasic^3 I use this.

local fn RestoreScreen
compile long if cpu68k
beginassem cpu68k
     clr.l    -(sp);result of paldispatch.
     moveq     #02,D0;selector(RestoreDeviceClut)
     dc.w     $AAA2;_PaletteDispatch
     clr.l     -(sp);Ignore result, push more space
     dc.w     $2F38,$09EE;dunno, don' care
     _PaintBehind;what it says
     _DrawMenuBar;what it says
compile xelse
RestoreDeviceClut(FN GetMainDevice)
PaintBehind(FN FrontWindow,0)
compile end if
end fn

(It'll look nicer once you paste it in :-)

The code doesn't take into account multiple monitor setups though.