Exemplo n.º 1
0
BOOL WINPROC EXPORT DlgRoomDot2Dot (HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
{
    BOOL bHandled = TRUE;
    char szTemp[MAX_PATH];
    HWND hImageCtrl;

    switch (wMsg)
    {
        case WM_COMMAND:
            switch (wParam)
            {
            case HS_COVER:
				ShowControls(hWnd, TRUE);
				ShowCoverAnimatedButtons(hWnd, TRUE);
                break;
                
            case HS_SHOW_ME:
                iActiveDot = 0;
				bPlaying = FALSE;
				UpdateDot2DotImage(hWnd, NULL);
                break;
                
            case HS_COLORME_ME:
                RemoveCodedBackground();
                GoPaintApp (hWnd,szPreview);
                break;
                
            case HS_TAB1:
            case HS_TAB2:
            case HS_TAB3:
            case HS_TAB4:
            case HS_TAB5:
            case HS_TAB6:
            case HS_TAB7:
            case HS_TAB8:
                {
                    BOOL    bLoad;

					ShowCoverAnimatedButtons(hWnd, FALSE);
					ShowControls(hWnd, FALSE);
                    hImageCtrl = GetDlgItem(hWnd, IDC_HIDDEN_IMAGE);
                    
                    if (hImageCtrl)
                    {
                		wsprintf (szTemp,GetString (IDS_CIRCUS, NULL),wParam - HS_TAB1 + 1);
                        PathCat (szPreview,Control.PouchPath,szTemp);
                        bLoad = AstralImageLoad( 0, szPreview, TRUE, FALSE);
                        if (bLoad && lpImage)
                        {
							bPlaying = TRUE;
                            SetWindowLong(hImageCtrl, GWL_IMAGE,
                                (long) ImgGetBase (lpImage));
                            SetWindowLong(hImageCtrl, GWL_IMAGE_TOOLPROC,
                                (long) Dot2DotProc);
							InitPoints();
                            ImgSetPixelProc(Dot2DotPixelProc);
                            ShowWindow(hImageCtrl, SW_SHOW);
                            UpdateDot2DotImage(hWnd, NULL);
                        }
                    }
                        
                        
                } // HS_TABS
				SoundStartID(HS_XTRA_CIRCUS, FALSE, 0);
                break;
                
                default:
                    bHandled = FALSE;
            } // switch (wParam)
            break;
                          
        case WM_INITDIALOG:
            hDot2DotWnd = hWnd;
			ShowControls(hWnd, TRUE);
            bHandled = FALSE;           // allow DefRoomProc to be called.
            break;

        case WM_DESTROY:
            ImgSetPixelProc(NULL);      // make sure our proc is no longer used
            bHandled = FALSE;           // allow DefRoomProc to be called
            break;

        case WM_PAINT:
            hImageCtrl = GetDlgItem(hWnd, IDC_HIDDEN_IMAGE);
            DefRoomProc (hWnd,wMsg,wParam,lParam);
			UpdateWindow(hImageCtrl);
            PaintDot2Dots(hImageCtrl);
            break;
            
        default:
            bHandled = FALSE;    
    } // switch (wMsg)

    if (!bHandled)
        bHandled = DefRoomProc (hWnd,wMsg,wParam,lParam);
    return bHandled;
}
Exemplo n.º 2
0
BOOL WINPROC EXPORT DlgRoomMazes (HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
{
    BOOL bHandled = TRUE;
    char szTemp[MAX_PATH];
    HWND hCtl;

    switch (wMsg)
    {
    case WM_COMMAND:
        switch (wParam)
        {
        case HS_COVER:
			StopAnimation();
			ShowCoverAnimatedButtons(hWnd, TRUE);
            hCtl = GetDlgItem (hWnd,IDC_HIDDEN_IMAGE);
            ShowWindow (hCtl,SW_HIDE);
            if (idCurrentRoom == RM_MAILMAZE)
            {
                hCtl = GetDlgItem (hWnd,HS_LOGO_MAILMAZE);
                ShowWindow (hCtl,SW_SHOW);
                hCtl = GetDlgItem (hWnd,HS_XTRA_MAILMAZE);
                ShowWindow (hCtl,SW_HIDE);
                hCtl = GetDlgItem (hWnd,HS_RESTART);
                ShowWindow (hCtl,SW_HIDE);
            }
            else if (idCurrentRoom == RM_MAZES)
            {
                hCtl = GetDlgItem (hWnd,HS_LOGO_MAZES);
                ShowWindow (hCtl,SW_SHOW);
                hCtl = GetDlgItem (hWnd,HS_XTRA_MAZES);
                ShowWindow (hCtl,SW_HIDE);
                hCtl = GetDlgItem (hWnd,HS_RESTART);
                ShowWindow (hCtl,SW_HIDE);
            }
            bHandled = FALSE;
            break;
        case HS_TAB1:
        case HS_TAB2:
        case HS_TAB3:
        case HS_TAB4:
        case HS_TAB5:
        case HS_TAB6:
        case HS_TAB7:
        case HS_TAB8:
			StopAnimation();
			ShowCoverAnimatedButtons(hWnd, FALSE);
            bTrack = FALSE;
            if (idCurrentRoom == RM_MAILMAZE)
                wsprintf (szTemp,GetString (IDS_MAILMAZE,NULL),wParam - HS_TAB1 + 1);
            else if (idCurrentRoom == RM_MAZES)
                wsprintf (szTemp,GetString (IDS_MAZES,NULL),wParam - HS_TAB1 + 1);
            PathCat (szPreview,Control.PouchPath,szTemp);
            AstralImageLoad (IDN_ART,szPreview,MAYBE,NO);
            if (lpImage)
            {
                bShowSolution = bSolved = FALSE;
                ImgSetPixelProc (MazePixelProc);
                hCtl = GetDlgItem (hWnd,IDC_HIDDEN_IMAGE);
                SetWindowLong (hCtl,GWL_IMAGE,(long) ImgGetBase (lpImage));
                SetWindowLong (hCtl,GWL_IMAGE_TOOLPROC,(long)MazeToolProc);
                ShowWindow (hCtl,SW_SHOW);
                InvalidateRect (hCtl,NULL,FALSE);
                if (idCurrentRoom == RM_MAILMAZE)
                {
                    hCtl = GetDlgItem (hWnd,HS_LOGO_MAILMAZE);
                    ShowWindow (hCtl,SW_HIDE);
                    hCtl = GetDlgItem (hWnd,HS_XTRA_MAILMAZE);
                    ShowWindow (hCtl,SW_SHOW);
                    hCtl = GetDlgItem (hWnd,HS_RESTART);
                    ShowWindow (hCtl,SW_SHOW);
                }
                else if (idCurrentRoom == RM_MAZES)
                {
                    hCtl = GetDlgItem (hWnd,HS_LOGO_MAZES);
                    ShowWindow (hCtl,SW_HIDE);
                    hCtl = GetDlgItem (hWnd,HS_XTRA_MAZES);
                    ShowWindow (hCtl,SW_SHOW);
                    hCtl = GetDlgItem (hWnd,HS_RESTART);
                    ShowWindow (hCtl,SW_SHOW);
                }
                bHandled = FALSE;
            }
#ifdef STUDIO			
				SoundStartID(HS_XTRA_MAILMAZE, FALSE, 0);
#else
				SoundStartID(HS_XTRA_MAZES, FALSE, 0);
#endif			
            break;
        case HS_COLORME:
			StopAnimation();
            GoPaintApp (hWnd,szPreview);
            break;
        case HS_SHOWME:
        case HS_RESTART:
            bTrack = FALSE;
            bShowSolution = (wParam == HS_SHOWME);
            hCtl = GetDlgItem (hWnd,IDC_HIDDEN_IMAGE);
			StopAnimation();
            InvalidateRect (hCtl,NULL,FALSE);
            UpdateWindow (hCtl);
			if (wParam == HS_SHOWME)
				StartAnimation(hCtl);
            break;
        default:
            bHandled = FALSE;
        }
        break;
    case WM_INITDIALOG:
        hMazePen = CreatePen (PS_SOLID,3,RGB (0,0,255));
        bHandled = FALSE;
        break;
    case WM_DESTROY:
		StopAnimation();
        ImgSetPixelProc (NULL);
        if (hMazePen)
        {
            DeleteObject (hMazePen);
            hMazePen = 0;
        }
        bHandled = FALSE;
        break;
    default:
        bHandled = FALSE;
    }
    if (!bHandled)
        bHandled = DefRoomProc (hWnd,wMsg,wParam,lParam);
    return bHandled;
}