Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | indenting/formatting (backported from 8.7) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-6-branch |
Files: | files | file ages | folders |
SHA3-256: |
8d130ca8a6acf127a8561e496586a45b |
User & Date: | jan.nijtmans 2024-04-29 13:44:32 |
Context
2024-04-29
| ||
14:24 | Fix gcc warning seen with gcc 11.4: tkConfig.c: In function ‘GetObjectForOption’: tkConfig.c:1934:71: warning: ‘value’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1934 | objPtr = Tcl_NewStringObj(((char **) optionPtr->specPtr->clientData)[ | ^ check-in: 8cd97ba3 user: jan.nijtmans tags: core-8-6-branch | |
13:44 | indenting/formatting (backported from 8.7) check-in: 8d130ca8 user: jan.nijtmans tags: core-8-6-branch | |
2024-04-21
| ||
11:03 | Fix [ab839efc5f]: text edit undo: clearing text instead of restoring. check-in: d842b155 user: fvogel tags: core-8-6-branch | |
Changes
Changes to win/tkWinDialog.c.
︙ | ︙ | |||
564 565 566 567 568 569 570 | */ static UINT APIENTRY ChooseDirectoryValidateProc(HWND hdlg, UINT uMsg, LPARAM wParam, LPARAM lParam); static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static void CleanupOFNOptions(OFNOpts *optsPtr); | | | | | 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | */ static UINT APIENTRY ChooseDirectoryValidateProc(HWND hdlg, UINT uMsg, LPARAM wParam, LPARAM lParam); static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static void CleanupOFNOptions(OFNOpts *optsPtr); static int ParseOFNOptions(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], enum OFNOper oper, OFNOpts *optsPtr); static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper); static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper); static int GetFileName(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], enum OFNOper oper); static int MakeFilterVista(Tcl_Interp *interp, OFNOpts *optsPtr, DWORD *countPtr, TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, DWORD *defaultFilterIndexPtr); static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr); static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr, 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 *); static void LoadShellProcs(void); /* Definitions of dynamically loaded Win32 calls */ typedef HRESULT (STDAPICALLTYPE SHCreateItemFromParsingNameProc)( PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv); |
︙ | ︙ | |||
742 743 744 745 746 747 748 | * application invokes the "tk_chooseColor" command. * *------------------------------------------------------------------------- */ int Tk_ChooseColorObjCmd( | | | 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 | * application invokes the "tk_chooseColor" command. * *------------------------------------------------------------------------- */ int Tk_ChooseColorObjCmd( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData, parent; HWND hWnd; int i, oldMode, winCode, result; |
︙ | ︙ | |||
950 951 952 953 954 955 956 | * A dialog window is created the first this function is called. * *---------------------------------------------------------------------- */ int Tk_GetOpenFileObjCmd( | | | 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 | * A dialog window is created the first this function is called. * *---------------------------------------------------------------------- */ int Tk_GetOpenFileObjCmd( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { return GetFileName(clientData, interp, objc, objv, OFN_FILE_OPEN); } |
︙ | ︙ | |||
977 978 979 980 981 982 983 | * Same as Tk_GetOpenFileObjCmd. * *---------------------------------------------------------------------- */ int Tk_GetSaveFileObjCmd( | | | 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 | * Same as Tk_GetOpenFileObjCmd. * *---------------------------------------------------------------------- */ int Tk_GetSaveFileObjCmd( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { return GetFileName(clientData, interp, objc, objv, OFN_FILE_SAVE); } |
︙ | ︙ | |||
1024 1025 1026 1027 1028 1029 1030 | * Returns option values in *optsPtr. Note these may include string * pointers into objv[] *---------------------------------------------------------------------- */ static int ParseOFNOptions( | | | 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | * Returns option values in *optsPtr. Note these may include string * pointers into objv[] *---------------------------------------------------------------------- */ static int ParseOFNOptions( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ enum OFNOper oper, /* 1 for Open, 0 for Save */ OFNOpts *optsPtr) /* Output, uninitialized on entry */ { int i; |
︙ | ︙ | |||
1137 1138 1139 1140 1141 1142 1143 | &optsPtr->utfDirString) == NULL) goto error_return; break; case FILE_INITFILE: if (Tcl_TranslateFileName(interp, string, &ds) == NULL) goto error_return; Tcl_UtfToExternal(NULL, TkWinGetUnicodeEncoding(), | | | < | 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 | &optsPtr->utfDirString) == NULL) goto error_return; break; case FILE_INITFILE: if (Tcl_TranslateFileName(interp, string, &ds) == NULL) goto error_return; Tcl_UtfToExternal(NULL, TkWinGetUnicodeEncoding(), Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), 0, NULL, (char *)&optsPtr->file[0], sizeof(optsPtr->file), NULL, NULL, NULL); Tcl_DStringFree(&ds); break; case FILE_PARENT: optsPtr->tkwin = Tk_NameToWindow(interp, string, (Tk_Window)clientData); if (optsPtr->tkwin == NULL) goto error_return; break; |
︙ | ︙ | |||
1865 1866 1867 1868 1869 1870 1871 | * See user documentation. * *---------------------------------------------------------------------- */ static int GetFileName( | | | 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 | * See user documentation. * *---------------------------------------------------------------------- */ static int GetFileName( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ enum OFNOper oper) /* 1 to call GetOpenFileName(), 0 to call * GetSaveFileName(). */ { OFNOpts ofnOpts; |
︙ | ︙ | |||
2034 2035 2036 2037 2038 2039 2040 | } else if (uMsg == WM_WINDOWPOSCHANGED) { /* * This message is delivered at the right time to enable Tk to set the * debug information. Unhooks itself so it won't set the debug * information every time it gets a WM_WINDOWPOSCHANGED message. */ | | | 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 | } else if (uMsg == WM_WINDOWPOSCHANGED) { /* * This message is delivered at the right time to enable Tk to set the * debug information. Unhooks itself so it won't set the debug * information every time it gets a WM_WINDOWPOSCHANGED message. */ ofnPtr = (OPENFILENAME *)TkWinGetUserData(hdlg); if (ofnPtr != NULL) { ofnData = (OFNData *) ofnPtr->lCustData; if (ofnData->interp != NULL) { hdlg = GetParent(hdlg); tsdPtr->debugInterp = ofnData->interp; Tcl_DoWhenIdle(SetTkDialog, hdlg); } |
︙ | ︙ | |||
2200 2201 2202 2203 2204 2205 2206 | * characters. */ *p++ = '\0'; *p = '\0'; } | | | 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 | * characters. */ *p++ = '\0'; *p = '\0'; } Tcl_DStringAppend(dsPtr, filterStr, p - filterStr); ckfree(filterStr); TkFreeFileFilters(&flist); return TCL_OK; } /* |
︙ | ︙ | |||
2422 2423 2424 2425 2426 2427 2428 | * - -title is really -message. * *---------------------------------------------------------------------- */ int Tk_ChooseDirectoryObjCmd( | | | 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 | * - -title is really -message. * *---------------------------------------------------------------------- */ int Tk_ChooseDirectoryObjCmd( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { WCHAR path[MAX_PATH]; int oldMode, result; LPCITEMIDLIST pidl; /* Returned by browser */ |
︙ | ︙ | |||
2780 2781 2782 2783 2784 2785 2786 | * returns. * *---------------------------------------------------------------------- */ int Tk_MessageBoxObjCmd( | | | 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 | * returns. * *---------------------------------------------------------------------- */ int Tk_MessageBoxObjCmd( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData, parent; HWND hWnd; Tcl_Obj *messageObj, *titleObj, *detailObj, *tmpObj; |
︙ | ︙ | |||
3014 3015 3016 3017 3018 3019 3020 | * the test command 'tkwinevent debug 1'. * * ---------------------------------------------------------------------- */ static void SetTkDialog( | | | 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 | * the test command 'tkwinevent debug 1'. * * ---------------------------------------------------------------------- */ static void SetTkDialog( void *clientData) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); char buf[32]; snprintf(buf, sizeof(buf), "0x%" TCL_Z_MODIFIER "x", (size_t)clientData); Tcl_SetVar2(tsdPtr->debugInterp, "tk_dialog", NULL, buf, TCL_GLOBAL_ONLY); |
︙ | ︙ | |||
3285 3286 3287 3288 3289 3290 3291 | * Per-interp data structure may be modified * * ---------------------------------------------------------------------- */ static int FontchooserConfigureCmd( | | > | | 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 | * Per-interp data structure may be modified * * ---------------------------------------------------------------------- */ static int FontchooserConfigureCmd( void *clientData, /* Main window */ Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tk_Window tkwin = (Tk_Window)clientData; HookData *hdPtr = NULL; int i; int r = TCL_OK; static const char *const optionStrings[] = { "-parent", "-title", "-font", "-command", "-visible", NULL }; hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); /* |
︙ | ︙ | |||
3428 3429 3430 3431 3432 3433 3434 | * additional state. * * ---------------------------------------------------------------------- */ static int FontchooserShowCmd( | | | 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 | * additional state. * * ---------------------------------------------------------------------- */ static int FontchooserShowCmd( void *clientData, /* Main window */ Tcl_Interp *interp, TCL_UNUSED(int), TCL_UNUSED(Tcl_Obj *const *)) { Tcl_DString ds; Tk_Window tkwin = (Tk_Window)clientData, parent; CHOOSEFONTW cf; |
︙ | ︙ |