FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

WINDOWS

Deactivate a window


I made a paint soft using PG, but I found the following problem. When my app is deactivate, the front most window of it is still active. How can I improve this problem? My app use palette (floater window), too. I want to hide when my app send back.

Osamu Shigematsu


There's a Tech Note (#11) about this at the Staz web site. It's a bug in the way FB handles floating windows. The code at the web site fixes most of the problems, but it's still a little ugly when you switch layers.

Greg


Thanks for your advice. I could improve the problem.
The following code works well. (Save it as a FixDocWnd.FLTR and the include it in your project Main file)

INCLUDE FILE _aplIncl
GLOBALS "Runtime.GLBL"
COMPILE 0,_pGproject_dimmedVarsOnly
END GLOBALS
GOTO "Start"
LOCAL FN fixDocWindows(Hilite%)
  DIM doc%,wDocPtr&
  DIM plt%,wPltPtr&
  DIM Modal%

  doc% = WINDOW(_ActiveDoc)
  LONG IF doc%
    plt% = WINDOW(_ActivePlt)
    LONG IF plt%
      GET WINDOW plt%,wPltPtr&
      Hilite% = Hilite% AND (PEEK(@wPltPtr&.wHilited%))<>0
      Modal% = wPltPtr&.wRefCon& AND 32768
      LONG IF Modal%
        Hilite% = _False
      END IF
    END IF

    GET WINDOW doc%,wDocPtr&
    LONG IF (PEEK(@wDocPtr&.wHilited%)<>0) <> Hilite%
      CALL HILITEWINDOW (wDocPtr&,Hilite%)
      CALL DRAWGROWICON (wDocPtr&)
    END IF
  END IF
END FN
'------------ Main Entry
"Start"
SELECT gLongAction&
  CASE _oSwitch
    FN fixDocWindows(gInBackground% = _false)
END SELECT
IF 0 THEN RETURN

Osamu Shigematsu