Changeset 27 for trunk/mainwin.cpp


Ignore:
Timestamp:
Mar 13, 2018, 6:34:46 PM (7 years ago)
Author:
Gregg Young
Message:

Remove mmio code; Ticet #5 Get gotcha "quiet" version working Tickets #1 #7 #9 Dialog changes related to both "quiet" and regular modes ( dialogs still need to be split in order to build both; only "quite can be bult from this) See Ticket #9 for a more complete list of changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mainwin.cpp

    r10 r27  
    2222HWND CreateMainWindow (VOID)
    2323{
     24//#ifdef _QUIET_
     25#if 1
     26    hwndFrame = WinLoadDlg (HWND_OBJECT, NULLHANDLE, NULL, GETMODULE,
     27                            ID_DLG_MAIN, NULL);
     28#else
    2429    hwndFrame = WinLoadDlg (HWND_DESKTOP, NULLHANDLE, NULL, GETMODULE,
    2530                            ID_DLG_MAIN, NULL);
     31#endif
    2632    OldFrameWP = WinSubclassWindow (hwndFrame, FrameProcedure);
    2733
     
    7076}
    7177
    72 // ** Drag **************************************************************** /*fold00*/
     78// ** Drag **************************************************************** /*FOLD00*/
    7379
    7480VOID Drag (HWND hwnd)
     
    110116}
    111117
    112 // ** FrameProcedure ****************************************************** /*fold00*/
     118// ** FrameProcedure ****************************************************** /*FOLD00*/
    113119
    114120MRESULT EXPENTRY FrameProcedure (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     
    270276
    271277        case WID_PB_SETTINGS:
     278            _DebugHereIAm();
    272279            pset->Dialog ();
     280            break;
     281
     282        case WID_PB_SETCAPTURETYPE:
     283            //int capType;
     284
     285            switch (pset->QuerySSWCaptureType ())
     286            {
     287            case CAP_WINDOWINT:
     288                WinSendMsg (hwndFrame, WM_COMMAND,
     289                            MPFROM2SHORT (WID_PB_WINDOWINTERIOR,0), 0);
     290            case CAP_SCREENREGION:
     291                WinSendMsg (hwndFrame, WM_COMMAND,
     292                            MPFROM2SHORT (WID_PB_SCREENREGION,0), 0);
     293            case CAP_WINDOW:
     294                WinSendMsg (hwndFrame, WM_COMMAND,
     295                            MPFROM2SHORT (WID_PB_WINDOW,0), 0);
     296            default:
     297               WinSendMsg (hwndFrame, WM_COMMAND,
     298                            MPFROM2SHORT (WID_PB_SCREEN,0), 0);
     299            }
    273300            break;
    274301
    275302        case WID_PB_SCREEN:
    276303            usCap = CAP_SCREEN;
     304//#ifdef _Quiet_
     305#if 1
     306            WinShowWindow (g_hwndSettingsDialog, FALSE);
     307            // WinSendMsg (g_hwndSettingsDialog, WM_CLOSE, 0,0); //Needs to go to the setting dialog
     308            // Replace current global with pset->GetSettingDialogHwnd () or such
     309            // Need for all 4 cases;
     310#endif
    277311            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    278312            break;
     
    280314        case WID_PB_SCREENREGION:
    281315            usCap = CAP_SCREENREGION;
     316//#ifdef _Quiet_
     317#if 1
     318            WinShowWindow (g_hwndSettingsDialog, FALSE);
     319#endif
    282320            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    283321            break;
     
    285323        case WID_PB_WINDOWINTERIOR:
    286324            usCap = CAP_WINDOWINT;
     325//#ifdef _Quiet_
     326#if 1
     327            WinShowWindow (g_hwndSettingsDialog, FALSE);
     328#endif
    287329            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    288330            break;
     
    290332        case WID_PB_WINDOW:
    291333            usCap = CAP_WINDOW;
     334//#ifdef _Quiet_
     335#if 1
     336            WinShowWindow (g_hwndSettingsDialog, FALSE);
     337#endif
    292338            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    293339            break;
     
    314360
    315361        usState = STATE_WAITFORHIDE;
     362
     363        if (usCap == CAP_SCREENREGION || usCap == CAP_SCREEN)
     364            hwndParent = WinQueryFocus(HWND_DESKTOP);
     365//#ifndef _QUIET_
     366#if 0
    316367        if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW))
    317368            WinShowWindow (WinQueryWindow (hwnd, QW_PARENT), FALSE);
    318369        else
     370#endif
    319371            WinSendMsg (hwnd, UM_WINDOWHIDDEN, 0,0);
    320372        return MRESULT (FALSE);
     
    346398            {
    347399                usState = STATE_WINDOWSELECTED;
    348                 WinPostMsg (hwnd, UM_WINDOWSELECTED,
    349                             MPFROMHWND (HWND_DESKTOP),
    350                             MPFROMHWND (HWND_DESKTOP));
     400                int rc = saymsg2(1, hwnd,  "Capture", "Do you wish to continue?");
     401                _DebugHereIAm();
     402                if (rc == 1)
     403                    WinPostMsg (hwnd, UM_WINDOWSELECTED,
     404                                MPFROMHWND (HWND_DESKTOP),
     405                                MPFROMHWND (HWND_DESKTOP));
     406                if (rc == 2)
     407                    WinSendMsg (hwnd, UM_ABORT, 0,0);
     408                if (rc == 3) {
     409                    pset->Dialog ();
     410                    WinPostMsg (hwnd, UM_WINDOWSELECTED,
     411                                MPFROMHWND (HWND_DESKTOP),
     412                                MPFROMHWND (HWND_DESKTOP));
     413                }
    351414            }
    352415            else
     
    417480                                                             FALSE));
    418481            hwndCap = HWND (mp1);
    419             hwndParent = HWND (mp2);
     482            if (usCap != CAP_SCREENREGION && usCap != CAP_SCREEN)
     483                hwndParent = HWND (mp2);
    420484            if (pset->SerialCapture ())
    421485            {
     
    478542            // capture the window to a bitmap and save this
    479543            if (usCap == CAP_SCREENREGION)
    480                 hbm = CaptureWindow (hwndCap, hwndParent, &rcl, TRUE);
     544                hbm = CaptureWindow (hwndCap, hwndParent, &rcl, FALSE);
     545            else if (usCap == CAP_SCREEN)
     546                hbm = CaptureWindow (hwndCap, hwndParent, NULL, FALSE);
    481547            else
    482548                hbm = CaptureWindow (hwndCap, hwndParent, NULL, TRUE);
     
    512578            WinSetCapture (HWND_DESKTOP, NULLHANDLE);
    513579
     580        pset->Load ();
     581
    514582        WinSendMsg (hwndSnapshot, UM_STOPCAPTURE, 0,0);
    515583        WinStopTimer (hab, hwnd, ulTimer);
    516 
     584//#ifdef _QUIET_
     585#if 1
     586        // ? FIXME to give option to reshow window.
     587        if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW))
     588            WinSendMsg (g_hwndSettingsDialog, WM_CLOSE, 0,0);
     589        else if (WinIsWindow ( hab, g_hwndSettingsDialog) &&
     590            ! WinIsWindowVisible (g_hwndSettingsDialog))
     591            WinShowWindow (g_hwndSettingsDialog, TRUE);
     592        pset->HideWindow (TRUE);
     593#else
    517594        // re-show the windows if they are hidden
    518595        // FIXME using global hwndFrame is pretty yukki
     
    521598        if (! WinIsWindowVisible (hwndSnapshot) && pset->SnapshotWindow ())
    522599            WinShowWindow (hwndSnapshot, TRUE);
    523 
     600#endif
    524601        WinEnableWindow (hwnd, TRUE);
    525602        WinSetActiveWindow (HWND_DESKTOP, hwnd);
Note: See TracChangeset for help on using the changeset viewer.