⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wdeflvw.c

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
    }

    WdeMemFree( obj );

    return ( TRUE );
}

BOOL WdeLViewValidateAction ( WdeLViewObject *obj, ACTION *act, void *p2 )
{
    int     i;

    /* touch unused vars to get rid of warning */
    _wde_touch(p2);

    for ( i = 0; i < MAX_ACTIONS; i++ ) {
        if( WdeLViewActions[i].id == *act ) {
            return ( TRUE );
        }
    }

    return ( ValidateAction( (OBJPTR) obj->control, *act, p2 ) );
}

BOOL WdeLViewCopyObject ( WdeLViewObject *obj, WdeLViewObject **new,
                           WdeLViewObject *handle )
{
    if (new == NULL) {
        WdeWriteTrail("WdeLViewCopyObject: Invalid new object!");
        return ( FALSE );
    }

    *new = (WdeLViewObject *) WdeMemAlloc ( sizeof(WdeLViewObject) );

    if ( *new == NULL ) {
        WdeWriteTrail("WdeLViewCopyObject: Object malloc failed");
        return ( FALSE );
    }

    (*new)->dispatcher    = obj->dispatcher;
    (*new)->object_id     = obj->object_id;

    if ( handle ==  NULL ) {
        (*new)->object_handle = *new;
    } else {
        (*new)->object_handle = handle;
    }

    if (!CopyObject(obj->control, &((*new)->control), (*new)->object_handle)) {
        WdeWriteTrail("WdeLViewCopyObject: Control not created!");
        WdeMemFree ( (*new) );
        return ( FALSE );
    }

    return ( TRUE );
}

BOOL WdeLViewIdentify ( WdeLViewObject *obj, OBJ_ID *id, void *p2 )
{
    /* touch unused vars to get rid of warning */
    _wde_touch(p2);

    *id = obj->object_id;

    return ( TRUE );
}

BOOL WdeLViewGetWndProc( WdeLViewObject *obj, WNDPROC *proc, void *p2 )
{
    /* touch unused vars to get rid of warning */
    _wde_touch(obj);
    _wde_touch(p2);

    *proc = WdeLViewSuperClassProc;

    return ( TRUE );
}

BOOL WdeLViewGetWindowClass ( WdeLViewObject *obj, char **class, void *p2 )
{
    /* touch unused vars to get rid of warning */
    _wde_touch(obj);
    _wde_touch(p2);

    *class = WWC_LISTVIEW;

    return ( TRUE );
}

BOOL WdeLViewDefine ( WdeLViewObject *obj, POINT *pnt, void *p2 )
{
    WdeDefineObjectInfo  o_info;

    /* touch unused vars to get rid of warning */
    _wde_touch(pnt);
    _wde_touch(p2);

    o_info.obj       = obj->object_handle;
    o_info.obj_id    = obj->object_id;
    o_info.mask      = WS_VISIBLE | WS_DISABLED |
                        WS_TABSTOP | WS_GROUP | WS_BORDER;
    o_info.set_func  = (WdeSetProc)WdeLViewSetDefineInfo;
    o_info.get_func  = (WdeGetProc)WdeLViewGetDefineInfo;
    o_info.hook_func = WdeLViewDefineHook;
    o_info.win       = NULL;

    return ( WdeControlDefine ( &o_info ) );
}

void WdeLViewSetDefineInfo ( WdeDefineObjectInfo *o_info, HWND hDlg )
{
#ifdef __NT__XX
    DialogStyle mask;

    // set the list view options
    mask = GETCTL_STYLE( o_info->info.c.info ) & 0x00000003;
    if ( mask == LVS_REPORT ) {
        CheckDlgButton ( hDlg, IDB_LVS_REPORT, 1);
    } else if ( mask == LVS_SMALLICON ) {
        CheckDlgButton ( hDlg, IDB_LVS_SMALLICON, 1);
    } else if ( mask == LVS_LIST ) {
        CheckDlgButton ( hDlg, IDB_LVS_LIST, 1);
    } else {
        CheckDlgButton ( hDlg, IDB_LVS_ICON, 1);
    }

    mask = GETCTL_STYLE( o_info->info.c.info ) & 0x0000ffff;

    if ( mask & LVS_SINGLESEL ) {
        CheckDlgButton ( hDlg, IDB_LVS_SINGLESEL, 1);
    }
    if ( mask & LVS_SHOWSELALWAYS ) {
        CheckDlgButton ( hDlg, IDB_LVS_SHOWSELALWAYS, 1);
    }
    if ( mask & LVS_SHAREIMAGELISTS ) {
        CheckDlgButton ( hDlg, IDB_LVS_SHAREIMAGELISTS, 1);
    }
    if ( mask & LVS_NOLABELWRAP ) {
        CheckDlgButton ( hDlg, IDB_LVS_NOLABELWRAP, 1);
    }
    if ( mask & LVS_AUTOARRANGE ) {
        CheckDlgButton ( hDlg, IDB_LVS_AUTOARRANGE, 1);
    }
    if ( mask & LVS_EDITLABELS ) {
        CheckDlgButton ( hDlg, IDB_LVS_EDITLABELS, 1);
    }
    if ( mask & LVS_ALIGNLEFT ) {
        CheckDlgButton ( hDlg, IDB_LVS_ALIGNLEFT, 1);
    }
    if ( mask & LVS_OWNERDRAWFIXED ) {
        CheckDlgButton ( hDlg, IDB_LVS_OWNERDRAWFIXED, 1);
    }
    if ( mask & LVS_NOSCROLL ) {
        CheckDlgButton ( hDlg, IDB_LVS_NOSCROLL, 1);
    }
    if ( mask & LVS_NOCOLUMNHEADER ) {
        CheckDlgButton ( hDlg, IDB_LVS_NOCOLUMNHEADER, 1);
    }
    if ( mask & LVS_NOSORTHEADER ) {
        CheckDlgButton ( hDlg, IDB_LVS_NOSORTHEADER, 1);
    }

    if ( mask & LVS_SORTDESCENDING ) {
        CheckDlgButton ( hDlg, IDB_LVS_SORTDESCENDING, 1);
    } else if ( mask & LVS_SORTASCENDING ) {
        CheckDlgButton ( hDlg, IDB_LVS_SORTASCENDING, 1);
    } else {
        CheckDlgButton ( hDlg, IDB_LVS_NOSORTING, 1);
    }

    // set the extended style controls only
    WdeEXSetDefineInfo( o_info, hDlg );
#else
    _wde_touch(o_info);
    _wde_touch(hDlg);
#endif
}

void WdeLViewGetDefineInfo ( WdeDefineObjectInfo *o_info, HWND hDlg )
{
#ifdef __NT__XX
    DialogStyle mask;

    // get the list view settings
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_ICON ) ) {
        mask = LVS_ICON;
    } else if ( IsDlgButtonChecked ( hDlg, IDB_LVS_REPORT ) ) {
        mask = LVS_REPORT;
    } else if ( IsDlgButtonChecked ( hDlg, IDB_LVS_SMALLICON ) ) {
        mask = LVS_SMALLICON;
    } else {
        mask = LVS_LIST;
    }

    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_SINGLESEL ) ) {
        mask |= LVS_SINGLESEL;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_SHOWSELALWAYS ) ) {
        mask |= LVS_SHOWSELALWAYS;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_SORTASCENDING ) ) {
        mask |= LVS_SORTASCENDING;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_SORTDESCENDING ) ) {
        mask |= LVS_SORTDESCENDING;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_SHAREIMAGELISTS ) ) {
        mask |= LVS_SHAREIMAGELISTS;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_NOLABELWRAP ) ) {
        mask |= LVS_NOLABELWRAP;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_AUTOARRANGE ) ) {
        mask |= LVS_AUTOARRANGE;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_EDITLABELS ) ) {
        mask |= LVS_EDITLABELS;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_NOSCROLL ) ) {
        mask |= LVS_NOSCROLL;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_ALIGNTOP ) ) {
        mask |= LVS_ALIGNTOP;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_ALIGNLEFT ) ) {
        mask |= LVS_ALIGNLEFT;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_OWNERDRAWFIXED ) ) {
        mask |= LVS_OWNERDRAWFIXED;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_NOCOLUMNHEADER ) ) {
        mask |= LVS_NOCOLUMNHEADER;
    }
    if ( IsDlgButtonChecked ( hDlg, IDB_LVS_NOSORTHEADER ) ) {
        mask |= LVS_NOSORTHEADER;
    }

    SETCTL_STYLE( o_info->info.c.info,
                  ( GETCTL_STYLE(o_info->info.c.info) & 0xffff0000 ) | mask );

    // get the extended control settings
    WdeEXGetDefineInfo ( o_info, hDlg );
#else
    _wde_touch(o_info);
    _wde_touch(hDlg);
#endif
}

BOOL WdeLViewDefineHook( HWND hDlg, UINT message,
                        WPARAM wParam, LPARAM lParam, DialogStyle mask )
{
    BOOL processed;

    /* touch unused vars to get rid of warning */
    _wde_touch(hDlg);
    _wde_touch(message);
    _wde_touch(wParam);
    _wde_touch(lParam);
    _wde_touch(mask);

    processed = FALSE;

    return( processed );
}

LRESULT WINEXPORT WdeLViewSuperClassProc( HWND hWnd, UINT message,
                                         WPARAM wParam,
                                         LPARAM lParam )
{
    if( !WdeProcessMouse( hWnd, message, wParam, lParam ) ) {
        return( CallWindowProc( WdeOriginalLViewProc,
                                 hWnd, message, wParam, lParam ) );
    }
    return( FALSE );
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -