Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch bug-8476b75781 Excluding Merge-Ins
This is equivalent to a diff from baec7cb8 to e6b2d0df
2019-07-01
| ||
20:00 | Fix bug [8476b75781], including the Aqua tk scrollbar. check-in: 599ab2b9 user: culler tags: core-8-6-branch | |
19:57 | Improve scrollbar and ttk::scrollbar on OSX 10.8 and earlier. Closed-Leaf check-in: e6b2d0df user: culler tags: bug-8476b75781 | |
15:09 | Fix layout bugs. check-in: b3e3fa37 user: culler tags: bug-8476b75781 | |
2019-06-30
| ||
11:51 | Fix failure to compile. check-in: 567e7aa9 user: dgp tags: core-8-6-branch | |
2019-06-29
| ||
14:58 | merge 8.6 check-in: f83ff783 user: culler tags: bug-8476b75781 | |
00:06 | Fix compiler warnings on all macOS versions. check-in: cf503476 user: culler tags: trunk | |
00:05 | Fix compiler warnings on all macOS versions. check-in: baec7cb8 user: culler tags: core-8-6-branch | |
2019-06-28
| ||
22:31 | If encoding "utf-16" exists, use it in preference to "unicode", which is deprecated since TIP #547. check-in: b1c8b86e user: jan.nijtmans tags: core-8-6-branch | |
Changes to doc/tk_mac.n.
︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + + | .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk::mac \- Access Mac-Specific Functionality on OS X from Tk .SH SYNOPSIS .nf \fB::tk::mac::DoScriptFile\fR \fB::tk::mac::DoScriptText\fR \fB::tk::mac::ShowPreferences\fR \fB::tk::mac::OpenApplication\fR \fB::tk::mac::ReopenApplication\fR \fB::tk::mac::OpenDocument \fIfile...\fR \fB::tk::mac::PrintDocument \fIfile...\fR \fB::tk::mac::Quit\fR \fB::tk::mac::OnHide\fR |
︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + + + + + + + + + + + + + | .SH "EVENT HANDLER CALLBACKS" .PP The Aqua/Mac OS X application environment defines a number of additional events that applications should respond to. These events are mapped by Tk to calls to commands in the \fB::tk::mac\fR namespace; unless otherwise noted, if the command is absent, no action will be taken. .TP \fB::tk::mac::DoScriptFile\fR . The default Apple Event handler for AEDoScriptHandler. This command, if defined, executes a Tcl file when an AppleScript sends a .QW "do script" command to Wish with a file path as a parameter. .TP \fB::tk::mac::DoScriptText\fR . The default Apple Event handler for AEDoScriptHandler. This command, if defined, executes Tcl code when an AppleScript sends a .QW "do script" command to Wish with Tcl code or a Tcl procedure as a parameter. .TP \fB::tk::mac::ShowPreferences\fR . The default Apple Event handler for kAEShowPreferences, .QW pref . The application menu .QW "Preferences" menu item is only enabled when this proc is defined. Typically this command is |
︙ |
Changes to macosx/tkMacOSXScrlbr.c.
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - + - - - + + | /* * tkMacOSXScrollbar.c -- * * This file implements the Macintosh specific portion of the scrollbar * widget. * * Copyright (c) 1996 by Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen <[email protected]> * Copyright (c) 2015 Kevin Walzer/WordTech Commununications LLC. |
︙ | |||
84 85 86 87 88 89 90 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + + | typedef struct ScrollbarMetrics { SInt32 width, minThumbHeight; int minHeight, topArrowHeight, bottomArrowHeight; NSControlSize controlSize; } ScrollbarMetrics; static ScrollbarMetrics metrics = { |
︙ | |||
156 157 158 159 160 161 162 163 164 165 166 167 168 169 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | * * Side effects: * Draws a scrollbar on the screen. * *-------------------------------------------------------------- */ #if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 /* * This stand-alone drawing function is used on macOS 10.9 and newer because * the HIToolbox does not draw the scrollbar thumb at the expected size on * those systems. The thumb is drawn too large, causing a mouse click on the * thumb to be interpreted as a mouse click in the trough. */ static void drawMacScrollbar( TkScrollbar *scrollPtr, MacScrollbar *msPtr, CGContextRef context) { MacDrawable *macWin = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin); NSView *view = TkMacOSXDrawableView(macWin); CGPathRef path; CGPoint inner[2], outer[2], thumbOrigin; CGSize thumbSize; CGRect troughBounds = msPtr->info.bounds; troughBounds.origin.y = [view bounds].size.height - (troughBounds.origin.y + troughBounds.size.height); if (scrollPtr->vertical) { thumbOrigin.x = troughBounds.origin.x + MIN_GAP; thumbOrigin.y = troughBounds.origin.y + scrollPtr->sliderFirst; thumbSize.width = troughBounds.size.width - 2*MIN_GAP + 1; thumbSize.height = scrollPtr->sliderLast - scrollPtr->sliderFirst; inner[0] = troughBounds.origin; inner[1] = CGPointMake(inner[0].x, inner[0].y + troughBounds.size.height); outer[0] = CGPointMake(inner[0].x + troughBounds.size.width - 1, inner[0].y); outer[1] = CGPointMake(outer[0].x, inner[1].y); } else { thumbOrigin.x = troughBounds.origin.x + scrollPtr->sliderFirst; thumbOrigin.y = troughBounds.origin.y + MIN_GAP; thumbSize.width = scrollPtr->sliderLast - scrollPtr->sliderFirst; thumbSize.height = troughBounds.size.height - 2*MIN_GAP + 1; inner[0] = troughBounds.origin; inner[1] = CGPointMake(inner[0].x + troughBounds.size.width, inner[0].y + 1); outer[0] = CGPointMake(inner[0].x, inner[0].y + troughBounds.size.height); outer[1] = CGPointMake(inner[1].x, outer[0].y); } CGContextSetShouldAntialias(context, false); CGContextSetGrayFillColor(context, 250.0 / 255, 1.0); CGContextFillRect(context, troughBounds); CGContextSetGrayStrokeColor(context, 232.0 / 255, 1.0); CGContextStrokeLineSegments(context, inner, 2); CGContextSetGrayStrokeColor(context, 238.0 / 255, 1.0); CGContextStrokeLineSegments(context, outer, 2); /* * Do not display the thumb unless scrolling is possible. */ if (scrollPtr->firstFraction > 0.0 || scrollPtr->lastFraction < 1.0) { CGRect thumbBounds = {thumbOrigin, thumbSize}; path = CGPathCreateWithRoundedRect(thumbBounds, 4, 4, NULL); CGContextBeginPath(context); CGContextAddPath(context, path); if (msPtr->info.trackInfo.scrollbar.pressState != 0) { CGContextSetGrayFillColor(context, 133.0 / 255, 1.0); } else { CGContextSetGrayFillColor(context, 200.0 / 255, 1.0); } CGContextSetShouldAntialias(context, true); CGContextFillPath(context); CFRelease(path); } } #endif void TkpDisplayScrollbar( ClientData clientData) /* Information about window. */ { register TkScrollbar *scrollPtr = clientData; MacScrollbar *msPtr = (MacScrollbar *) scrollPtr; register Tk_Window tkwin = scrollPtr->tkwin; |
︙ | |||
181 182 183 184 185 186 187 188 189 190 191 192 193 194 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | + + + + | if ((view == NULL) || (macWin->flags & TK_DO_NOT_DRAW) || !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) { return; } /* * Transform NSView coordinates to CoreGraphics coordinates. */ CGFloat viewHeight = [view bounds].size.height; CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, .ty = viewHeight }; |
︙ | |||
225 226 227 228 229 230 231 | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | - - + + - - - - + + + + + + + + + + + + + | * Update values and then draw the native scrollbar over the rectangle. */ UpdateControlValues(scrollPtr); if (SNOW_LEOPARD_STYLE) { HIThemeDrawTrack(&msPtr->info, 0, dc.context, |
︙ | |||
293 294 295 296 297 298 299 | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | - - + - + + + + + + + + + - - - - - - | if (fieldLength < 0) { fieldLength = 0; } scrollPtr->sliderFirst = fieldLength*scrollPtr->firstFraction; scrollPtr->sliderLast = fieldLength*scrollPtr->lastFraction; /* |
︙ | |||
507 508 509 510 511 512 513 | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | - + | frame = NSInsetRect(frame, scrollPtr->inset, scrollPtr->inset); frame.origin.y = viewHeight - (frame.origin.y + frame.size.height); contrlRect = NSRectToCGRect(frame); msPtr->info.bounds = contrlRect; width = contrlRect.size.width; |
︙ | |||
531 532 533 534 535 536 537 | 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 | - + - - + - - + | * Macintosh thumb. The Aqua scroll control works as follows. The * scrollbar's value is the position of the left (or top) side of the view * area in the content area being scrolled. The maximum value of the * control is therefore the dimension of the content area less the size of * the view area. */ |
︙ | |||
612 613 614 615 616 617 618 619 620 621 622 623 624 625 | 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 | + | msPtr->info.trackInfo.scrollbar.pressState = kThemeThumbPressed; break; case BOTTOM_GAP: msPtr->info.trackInfo.scrollbar.pressState = kThemeBottomTrackPressed; break; case TOP_ARROW: /* * This looks wrong and the docs say it is wrong but it works. */ msPtr->info.trackInfo.scrollbar.pressState = kThemeTopInsideArrowPressed; break; |
︙ | |||
643 644 645 646 647 648 649 650 651 652 653 654 655 656 | 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | + | } if (eventPtr->type == LeaveNotify) { msPtr->mouseOver = false; if (!msPtr->buttonDown) { msPtr->info.trackInfo.scrollbar.pressState = 0; } } TkScrollbarEventuallyRedraw(scrollPtr); return TCL_OK; } /* *-------------------------------------------------------------- * * ScrollbarEventProc -- |
︙ |
Changes to macosx/ttkMacOSXTheme.c.
︙ | |||
2343 2344 2345 2346 2347 2348 2349 | 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 | + - + + + + + + - - + - - - + - - - + + | int *minHeight, Ttk_Padding *paddingPtr) { ScrollbarElement *scrollbar = elementRecord; int orientation = TTK_ORIENT_HORIZONTAL; Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); if (orientation == TTK_ORIENT_VERTICAL) { |
︙ | |||
2400 2401 2402 2403 2404 2405 2406 | 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 | - + - - + - + - - + - - - - + + + + + + + + + + | thumbColor = [NSColor colorWithColorSpace: deviceRGB components: rgba count: 4]; BEGIN_DRAWING(d) SolidFillRoundedRectangle(dc.context, thumbBounds, 4, thumbColor); END_DRAWING } else { |
︙ | |||
3113 3114 3115 3116 3117 3118 3119 | 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 | - + - | Ttk_RegisterElementSpec(themePtr, "hseparator", &SeparatorElementSpec, 0); Ttk_RegisterElementSpec(themePtr, "vseparator", &SeparatorElementSpec, 0); Ttk_RegisterElementSpec(themePtr, "sizegrip", &SizegripElementSpec, 0); /* * <<NOTE-TRACKS>> |
︙ |