Ignore:
Timestamp:
Dec 28, 2023, 3:58:08 AM (20 months ago)
Author:
ataylor
Message:

Add system modal handling logic to TForm class and update NewView.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Sibyl/SPCC/FORMS.PAS

    r7 r492  
    77 º                                                                          º
    88 ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍŒ}
    9                              
     9
    1010Unit Forms;
    1111
     
    20572057         FOnCreate:TNotifyEvent;
    20582058         FOnDestroy:TNotifyEvent;
     2059         FSysModalWin:HWnd;      // [ALT 2023-12-27]
    20592060         Procedure CMRelease(Var Msg:TMessage); Message CM_RELEASE;
    20602061         Procedure CMEndModalState(Var Msg:TMessage); Message CM_ENDMODALSTATE;
     
    24642465// This is not functionally needed but prevents unnecessary GpiDeleteSetId calls
    24652466// which fail and therefore make it more difficult to test for real problems.
    2466 // Probably not safe to leave in due to incompatibility between components 
     2467// Probably not safe to leave in due to incompatibility between components
    24672468// and IDE  - AaronL
    24682469//         FFontSet:boolean;
     
    54165417          Begin
    54175418               FFont.Destroy;
    5418                FFont := nil; // AaronL - need to set ffont to nil 
     5419               FFont := nil; // AaronL - need to set ffont to nil
    54195420          End;
    54205421     End;
     
    62136214   CurrentModalFrame:HWND=0;
    62146215   DesktopHWND:HWND=0;
    6215    ModalList:TList=NIL;   
     6216   ModalList:TList=NIL;
    62166217
    62176218{$HINTS OFF}
     
    62746275Begin
    62756276     MyPID := GetCurrentProcessID;
    6276      
     6277
    62776278     // Get the count of switch list items
    62786279     SwitchListCount := WinQuerySwitchList( AppHandle, nil, 0 );
     
    62816282     // Allocate buffer
    62826283     GetMem( pSwitchListInfo, BufferSize );
    6283      
     6284
    62846285     // Call WinQuerySwitchList again to get the switch list items
    62856286     WinQuerySwitchList( AppHandle, pSwitchListInfo^, BufferSize );
    6286      
     6287
    62876288     for i := 0 to SwitchListCount - 1 do
    62886289     begin
     
    62936294                    // This switch entry is for this application
    62946295                    if swctl.hwnd = Exclude.FFrame.Handle then
    6295                          continue;                   
     6296                         continue;
    62966297                    // so show/hide it
    62976298                    if Show then
     
    63016302                    WinChangeSwitchEntry( hswitch,
    63026303                                          swctl );
    6303                                          
     6304
    63046305               end;
    63056306          end;
     
    79657966          If OnDismissDlg <> Nil Then OnDismissDlg(Self);
    79667967          If FModalResult <> cmNull Then EndModalState;
     7968
     7969          // [20231227 ALT] Restore any previous system-modal window
     7970          if FSysModalWin <> NULLHANDLE then
     7971              WinSetSysModalWindow( HWND_DESKTOP, FSysModalWin );
    79677972     End;
    79687973End;
     
    85088513     Show;
    85098514     BringToFront;
     8515
     8516     // [ALT 20231227]
     8517     FSysModalWin := WinQuerySysModalWindow( HWND_DESKTOP );
     8518     if FSysModalWin <> NULLHANDLE then
     8519          WinSetSysModalWindow( HWND_DESKTOP, Frame.Handle );
    85108520
    85118521again:
Note: See TracChangeset for help on using the changeset viewer.