Page 1 of 1

[Implemented] DisableWindow(Window.l,State.b)

Posted: Mon Sep 05, 2005 2:14 pm
by Flype
Hello,
DisableGadget() is usefull, i think DisableWindow() would be nice to.
I think there's the equivalent function on linux and mac os, isn't it ?

Code: Select all

;-
;- Enable/Disable a window, just like the DisableGadget() function does...
;-

Procedure.l DisableWindow(Window.l,State.b)
  
  If IsWindow(Window)
    EnableWindow_(WindowID(Window),#True-State)
  EndIf
  
EndProcedure

Enumeration
  #WndParent
  #WndChild
EndEnumeration

If OpenWindow(#WndParent,0,0,680,480,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Parent Window")
  
  If OpenWindow(#WndChild,0,0,400,300,#PB_Window_WindowCentered|#PB_Window_SystemMenu,"Child Window",WindowID(#WndParent))
    DisableWindow(#WndParent,#True)
    Repeat
      If WaitWindowEvent() = #PB_Event_CloseWindow
        CloseWindow(#WndChild) : Break
      EndIf
    ForEver
    DisableWindow(#WndParent,#False)
  EndIf
  
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf
And maybe, the parent window could be automatically disabled when we set the ParentWindowID of OpenWindow(), and automatically re-enabled when closing the child window. Just a suggestion... :roll:

Best regards.

Posted: Mon Sep 05, 2005 3:58 pm
by freak
We have not found a function for this on MacOSX so far.
Maybe it can be emulated with other commands though.

Posted: Mon Sep 05, 2005 4:07 pm
by Flype
humm, astonishing :? !
and what's happened on mac os when opening a MessageRequester() ?
the parent window should be locked, i suppose, so...
well, that's not a big problem.

[EDIT]
@freak: is your tool < IETool > available for Firefox ?