Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/oledb32/dslocator.c | 53 +++++++++++++++++++++++++++++++++++++++- dlls/oledb32/resource.h | 6 +++++ dlls/oledb32/version.rc | 12 +++++++++ 3 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/dlls/oledb32/dslocator.c b/dlls/oledb32/dslocator.c index d33d637264..11ee76cddb 100644 --- a/dlls/oledb32/dslocator.c +++ b/dlls/oledb32/dslocator.c @@ -436,11 +436,57 @@ static LRESULT CALLBACK data_link_advanced_dlg_proc(HWND hwnd, UINT msg, WPARAM return 0; }
+static void create_page_all_columns(HWND lv) +{ + RECT rc; + WCHAR buf[256]; + LVCOLUMNW column; + + SendMessageW(lv, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); + GetWindowRect(lv, &rc); + LoadStringW(instance, IDS_COL_NAME, buf, ARRAY_SIZE(buf)); + column.mask = LVCF_WIDTH | LVCF_TEXT; + column.cx = (rc.right / 2); + column.pszText = buf; + SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column); + + LoadStringW(instance, IDS_COL_VALUE, buf, ARRAY_SIZE(buf)); + column.mask = LVCF_WIDTH | LVCF_TEXT; + column.cx = (rc.right / 2); + column.pszText = buf; + SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column); +} + +static LRESULT CALLBACK data_link_all_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) +{ + TRACE("(%p, %08x, %08lx, %08lx)\n", hwnd, msg, wp, lp); + + switch (msg) + { + case WM_INITDIALOG: + { + HWND lv = GetDlgItem(hwnd, IDC_LST_PROPERTIES); + create_page_all_columns(lv); + break; + } + case WM_COMMAND: + { + if (LOWORD(wp) == IDC_BTN_EDIT) + { + /* TODO: Implement Connection dialog */ + MessageBoxA(hwnd, "Not implemented yet.", "Error", MB_OK | MB_ICONEXCLAMATION); + } + } + } + + return 0; + } + static HRESULT WINAPI dslocator_PromptNew(IDataSourceLocator *iface, IDispatch **connection) { DSLocatorImpl *This = impl_from_IDataSourceLocator(iface); PROPSHEETHEADERW hdr; - PROPSHEETPAGEW pages[3]; + PROPSHEETPAGEW pages[4]; INT_PTR ret;
FIXME("(%p, %p) Semi-stub\n", iface, connection); @@ -467,6 +513,11 @@ static HRESULT WINAPI dslocator_PromptNew(IDataSourceLocator *iface, IDispatch * pages[2].u.pszTemplate = MAKEINTRESOURCEW(IDD_ADVANCED); pages[2].pfnDlgProc = data_link_advanced_dlg_proc;
+ pages[3].dwSize = sizeof(pages[0]); + pages[3].hInstance = instance; + pages[3].u.pszTemplate = MAKEINTRESOURCEW(IDD_ALL); + pages[3].pfnDlgProc = data_link_all_dlg_proc; + memset(&hdr, 0, sizeof(hdr)); hdr.dwSize = sizeof(hdr); hdr.hwndParent = This->hwnd; diff --git a/dlls/oledb32/resource.h b/dlls/oledb32/resource.h index 99d3595d4a..5a4c9a2a71 100644 --- a/dlls/oledb32/resource.h +++ b/dlls/oledb32/resource.h @@ -57,3 +57,9 @@ #define IDC_GRP_NETWORK 4005 #define IDC_LBL_LEVEL 4006 #define IDC_LBL_PROTECTION 4007 + +#define IDD_ALL 5010 +#define IDC_BTN_EDIT 5011 +#define IDC_LST_PROPERTIES 5012 +#define IDS_COL_NAME 5013 +#define IDS_COL_VALUE 5014 diff --git a/dlls/oledb32/version.rc b/dlls/oledb32/version.rc index 33ef916b83..e6bcadd256 100644 --- a/dlls/oledb32/version.rc +++ b/dlls/oledb32/version.rc @@ -35,6 +35,8 @@ STRINGTABLE { IDS_PROPSHEET_TITLE "Data Link Properties" IDS_COL_PROVIDER "OLE DB Provider(s)" + IDS_COL_NAME "Name" + IDS_COL_VALUE "Value"
IDS_PERM_READ "Read" IDS_PERM_READWRITE "ReadWrite" @@ -98,3 +100,13 @@ BEGIN LTEXT "A&ccess:",-1,14,91,100,8 CONTROL "",IDC_LST_PERMISSIONS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_NOLABELWRAP | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,83,91,131,55 END + +IDD_ALL DIALOG 0, 0, 227, 225 +STYLE DS_SETFONT | WS_CHILD | WS_CAPTION +CAPTION "All" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List1",IDC_LST_PROPERTIES,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,33,213,155 + LTEXT "These are the initialization properties for this type of data. To edit a value, select a property, then choose Edit Value below.",-1,7,7,213,23 + PUSHBUTTON "&Edit Value...",IDC_BTN_EDIT,7,194,60,14 +END