Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Backout [15e322ca]: Eliminate the use of Tcl_GetPathType(), somehow doesn't work correctly |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | main |
Files: | files | file ages | folders |
SHA3-256: |
f37a004d2ce179e9d9dd68894e3525b5 |
User & Date: | jan.nijtmans 2024-05-01 09:05:12 |
Context
2024-05-01
| ||
17:26 | Widget Demo: added demo script for ttk::spinbox widgets. check-in: 60e60666 user: csaba tags: trunk, main | |
09:05 | Backout [15e322ca]: Eliminate the use of Tcl_GetPathType(), somehow doesn't work correctly check-in: f37a004d user: jan.nijtmans tags: trunk, main | |
2024-04-30
| ||
12:26 | Fix [a84de1a4d3]: Documentation errors, last remaining errors (after all Harold's fixes!) check-in: 1eb1db5c user: jan.nijtmans tags: trunk, main | |
08:44 | Eliminate the use of Tcl_GetPathType() check-in: 15e322ca user: jan.nijtmans tags: core-8-branch | |
Changes
Changes to win/tkWinDialog.c.
︙ | ︙ | |||
586 587 588 589 590 591 592 | Tcl_DString *dsPtr, Tcl_Obj *initialPtr, int *indexPtr); static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam); static void SetTkDialog(void *clientData); static const char *ConvertExternalFilename(LPCWSTR, Tcl_DString *); | < | | 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | Tcl_DString *dsPtr, Tcl_Obj *initialPtr, int *indexPtr); static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam); static void SetTkDialog(void *clientData); static const char *ConvertExternalFilename(LPCWSTR, Tcl_DString *); /* *------------------------------------------------------------------------- * * EatSpuriousMessageBugFix -- * * In the file open/save dialog, double clicking on a list item causes * the dialog box to close, but an unwanted WM_LBUTTONUP message is sent |
︙ | ︙ | |||
1401 1402 1403 1404 1405 1406 1407 | for (dw = 0; dw < count; ++dw) { hr = multiIf->lpVtbl->GetItemAt(multiIf, dw, &itemIf); if (FAILED(hr)) break; hr = itemIf->lpVtbl->GetDisplayName(itemIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { | | | | > > > > > | > > > | 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 | for (dw = 0; dw < count; ++dw) { hr = multiIf->lpVtbl->GetItemAt(multiIf, dw, &itemIf); if (FAILED(hr)) break; hr = itemIf->lpVtbl->GetDisplayName(itemIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { Tcl_DString fnds; ConvertExternalFilename(wstr, &fnds); CoTaskMemFree(wstr); Tcl_ListObjAppendElement( interp, multiObj, Tcl_NewStringObj(Tcl_DStringValue(&fnds), Tcl_DStringLength(&fnds))); Tcl_DStringFree(&fnds); } itemIf->lpVtbl->Release(itemIf); if (FAILED(hr)) break; } } multiIf->lpVtbl->Release(multiIf); if (SUCCEEDED(hr)) resultObj = multiObj; else Tcl_DecrRefCount(multiObj); } } else { IShellItem *resultIf; hr = fdlgIf->lpVtbl->GetResult(fdlgIf, &resultIf); if (SUCCEEDED(hr)) { hr = resultIf->lpVtbl->GetDisplayName(resultIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { Tcl_DString fnds; ConvertExternalFilename(wstr, &fnds); resultObj = Tcl_NewStringObj(Tcl_DStringValue(&fnds), Tcl_DStringLength(&fnds)); CoTaskMemFree(wstr); Tcl_DStringFree(&fnds); } resultIf->lpVtbl->Release(resultIf); } } if (SUCCEEDED(hr)) { if (filterPtr && optsPtr->typeVariableObj) { UINT ftix; |
︙ | ︙ | |||
1678 1679 1680 1681 1682 1683 1684 | while (*files != '\0') { while (*files != '\0') { files++; } files++; if (*files != '\0') { Tcl_Obj *fullnameObj; | | | | > | | 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 | while (*files != '\0') { while (*files != '\0') { files++; } files++; if (*files != '\0') { Tcl_Obj *fullnameObj; Tcl_DString filenameBuf; count++; ConvertExternalFilename(files, &filenameBuf); fullnameObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_AppendToObj(fullnameObj, "/", TCL_INDEX_NONE); Tcl_AppendToObj(fullnameObj, Tcl_DStringValue(&filenameBuf), Tcl_DStringLength(&filenameBuf)); gotFilename = 1; Tcl_DStringFree(&filenameBuf); Tcl_ListObjAppendElement(NULL, returnList, fullnameObj); } } if (count == 0) { /* * Only one file was returned. |
︙ | ︙ | |||
1937 1938 1939 1940 1941 1942 1943 | } else { /* * Replace directory terminating NULL with a with a backslash, * but only if not an absolute path. */ | > | | | | 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 | } else { /* * Replace directory terminating NULL with a with a backslash, * but only if not an absolute path. */ Tcl_DString tmpfile; ConvertExternalFilename(buffer, &tmpfile); if (TCL_PATH_ABSOLUTE == Tcl_GetPathType(Tcl_DStringValue(&tmpfile))) { /* re-get the full path to the start of the buffer */ buffer = ofnData->dynFileBuffer; SendMessageW(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer); } else { *(buffer-1) = '\\'; } buffer[selsize] = '\0'; /* Second NULL terminator. */ Tcl_DStringFree(&tmpfile); } } else { /* * Nothing is selected, so just empty the string. */ if (buffer != NULL) { |
︙ | ︙ | |||
2515 2516 2517 2518 2519 2520 2521 | /* * Change the pathname to the Tcl "normalized" pathname, where back * slashes are used instead of forward slashes */ Tcl_ResetResult(interp); if (*path) { | > > | > > | 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 | /* * Change the pathname to the Tcl "normalized" pathname, where back * slashes are used instead of forward slashes */ Tcl_ResetResult(interp); if (*path) { Tcl_DString ds; Tcl_SetObjResult(interp, Tcl_NewStringObj( ConvertExternalFilename(path, &ds), TCL_INDEX_NONE)); Tcl_DStringFree(&ds); } CleanupOFNOptions(&ofnOpts); return TCL_OK; } /* |
︙ | ︙ | |||
2977 2978 2979 2980 2981 2982 2983 | if (*p == '\\') { *p = '/'; } } return Tcl_DStringValue(dsPtr); } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 | if (*p == '\\') { *p = '/'; } } return Tcl_DStringValue(dsPtr); } /* * ---------------------------------------------------------------------- * * GetFontObj -- * * Convert a windows LOGFONT into a Tk font description. |
︙ | ︙ |