コード例 #1
0
WINEXPORT BOOL CALLBACK WRSelectImageProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    WRSelectImageInfo   *info;
    BOOL                ret;

    ret = FALSE;

    switch( message ) {
    case WM_DESTROY:
        WRUnregisterDialog( hDlg );
        break;

    case WM_INITDIALOG:
        info = (WRSelectImageInfo *)lParam;
        if( info == NULL ) {
            EndDialog( hDlg, FALSE );
        }
        SET_DLGDATA( hDlg, (LONG_PTR)info );
        WRRegisterDialog( hDlg );
        if( !WRSetWinInfo( hDlg, info ) ) {
            EndDialog( hDlg, FALSE );
        }
        ret = TRUE;
        break;

    case WM_SYSCOLORCHANGE:
        WRCtl3dColorChange();
        break;

    case WM_COMMAND:
        info = (WRSelectImageInfo *)GET_DLGDATA( hDlg );
        switch( LOWORD( wParam ) ) {
        case IDM_SELIMGHELP:
            if( info != NULL && info->hcb != NULL ) {
                (*info->hcb)();
            }
            break;

        case IDOK:
            if( info == NULL ) {
                EndDialog( hDlg, FALSE );
                ret = TRUE;
            } else if( WRGetWinInfo( hDlg, info ) ) {
                EndDialog( hDlg, TRUE );
                ret = TRUE;
            }
            break;

        case IDCANCEL:
            EndDialog( hDlg, FALSE );
            ret = TRUE;
            break;

        case IDM_SELIMGBMP:
            if( GET_WM_COMMAND_CMD( wParam, lParam ) != BN_CLICKED ) {
                break;
            }
            if( info->type != (uint_16)(pointer_int)RT_BITMAP ) {
                info->type = (uint_16)(pointer_int)RT_BITMAP;
                WRSetEntries( hDlg, info );
            }
            break;

        case IDM_SELIMGCUR:
            if( GET_WM_COMMAND_CMD( wParam, lParam ) != BN_CLICKED ) {
                break;
            }
            if( info->type != (uint_16)(pointer_int)RT_GROUP_CURSOR ) {
                info->type = (uint_16)(pointer_int)RT_GROUP_CURSOR;
                WRSetEntries( hDlg, info );
            }
            break;

        case IDM_SELIMGICO:
            if( GET_WM_COMMAND_CMD( wParam, lParam ) != BN_CLICKED ) {
                break;
            }
            if( info->type != (uint_16)(pointer_int)RT_GROUP_ICON ) {
                info->type = (uint_16)(pointer_int)RT_GROUP_ICON;
                WRSetEntries( hDlg, info );
            }
            break;
        }
        break;
    }

    return( ret );
}
コード例 #2
0
void WdeCtl3dColorChange ( void )
{
#if defined(WDE_USE_3D)
    WRCtl3dColorChange ();
#endif
}
コード例 #3
0
ファイル: wrselft.c プロジェクト: bhanug/open-watcom-v2
WINEXPORT BOOL CALLBACK WRSelectFileTypeProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    WRSFT       *sft;
    BOOL        ret;

    ret = FALSE;

    switch( message ) {
    case WM_DESTROY:
        WRUnregisterDialog( hDlg );
        break;

    case WM_INITDIALOG:
        sft = (WRSFT *)lParam;
        SET_DLGDATA( hDlg, sft );
        WRRegisterDialog( hDlg );
        WRSetWinInfo( hDlg, sft );
        ret = TRUE;
        break;

    case WM_SYSCOLORCHANGE:
        WRCtl3dColorChange();
        break;

    case WM_COMMAND:
        switch( LOWORD( wParam ) ) {
        case IDM_SFTHELP:
            sft = (WRSFT *)GET_DLGDATA( hDlg );
            if( sft != NULL && sft->hcb != NULL ) {
                (*(void (*)(void))sft->hcb)();
            }
            break;

        case IDOK:
            sft = (WRSFT *)GET_DLGDATA( hDlg );
            if( sft == NULL ) {
                EndDialog( hDlg, FALSE );
                ret = TRUE;
            } else if( WRGetWinInfo( hDlg, sft ) ) {
                EndDialog( hDlg, TRUE );
                ret = TRUE;
            } else {
                WRDisplayErrorMsg( WR_INVALIDSELECTION );
            }
            break;

        case IDCANCEL:
            EndDialog( hDlg, FALSE );
            ret = TRUE;
            break;

        case IDM_TSWINNT:
            if( GET_WM_COMMAND_CMD( wParam, lParam ) != BN_CLICKED ) {
                break;
            }
            if( !IsDlgButtonChecked( hDlg, IDM_FTRES ) ) {
                break;
            }
            if( IsDlgButtonChecked( hDlg, LOWORD( wParam ) ) ) {
                EnableWindow( GetDlgItem( hDlg, IDM_RFMS ), FALSE );
                CheckDlgButton( hDlg, IDM_RFMS, BST_UNCHECKED );
                CheckDlgButton( hDlg, IDM_RFWAT, BST_CHECKED );
            } else {
                EnableWindow( GetDlgItem( hDlg, IDM_RFMS ), TRUE );
            }
            break;

        case IDM_TSWIN:
            if( GET_WM_COMMAND_CMD( wParam, lParam ) != BN_CLICKED ) {
                break;
            }
            if( !IsDlgButtonChecked( hDlg, IDM_FTRES ) ) {
                break;
            }
            if( IsDlgButtonChecked( hDlg, LOWORD( wParam ) ) ) {
                EnableWindow( GetDlgItem( hDlg, IDM_RFMS ), TRUE );
            }
            break;

        case IDM_FTEXE:
        case IDM_FTDLL:
            if( GET_WM_COMMAND_CMD( wParam, lParam ) != BN_CLICKED ) {
                break;
            }
            if( IsDlgButtonChecked( hDlg, LOWORD( wParam ) ) ) {
                EnableWindow( GetDlgItem( hDlg, IDM_RFWAT ), FALSE );
                EnableWindow( GetDlgItem( hDlg, IDM_RFMS ), FALSE );
                CheckDlgButton( hDlg, IDM_RFWAT, BST_UNCHECKED );
                CheckDlgButton( hDlg, IDM_RFMS, BST_UNCHECKED );
            }
            break;

        case IDM_FTRES:
            if( GET_WM_COMMAND_CMD( wParam, lParam ) != BN_CLICKED ) {
                break;
            }
            if( IsDlgButtonChecked( hDlg, LOWORD( wParam ) ) ) {
                EnableWindow( GetDlgItem( hDlg, IDM_RFWAT ), TRUE );
                if( IsDlgButtonChecked( hDlg, IDM_TSWINNT ) ) {
                    EnableWindow( GetDlgItem( hDlg, IDM_RFMS ), FALSE );
                    CheckDlgButton( hDlg, IDM_RFMS, BST_UNCHECKED );
                    CheckDlgButton( hDlg, IDM_RFWAT, BST_CHECKED );
                } else {
                    EnableWindow( GetDlgItem( hDlg, IDM_RFMS ), TRUE );
                    CheckDlgButton( hDlg, IDM_RFMS, BST_UNCHECKED );
                    CheckDlgButton( hDlg, IDM_RFWAT, BST_CHECKED );
                }
            }
            break;
        }
        break;
    }

    return( ret );
}