| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#include "tkPort.h" |
| 15 |
#include "default.h" |
| 16 |
#include "tkInt.h" |
| 17 |
#include "tkUnixInt.h" |
| 18 |
#include "tkMenu.h" |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#define MENU_MARGIN_WIDTH 2 |
| 25 |
#define MENU_DIVIDER_HEIGHT 2 |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#define ENTRY_HELP_MENU ENTRY_PLATFORM_FLAG1 |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
static void SetHelpMenu _ANSI_ARGS_((TkMenu *menuPtr)); |
| 38 |
static void DrawMenuEntryAccelerator _ANSI_ARGS_(( |
| 39 |
TkMenu *menuPtr, TkMenuEntry *mePtr, |
| 40 |
Drawable d, GC gc, Tk_Font tkfont, |
| 41 |
CONST Tk_FontMetrics *fmPtr, |
| 42 |
Tk_3DBorder activeBorder, int x, int y, |
| 43 |
int width, int height, int drawArrow)); |
| 44 |
static void DrawMenuEntryBackground _ANSI_ARGS_(( |
| 45 |
TkMenu *menuPtr, TkMenuEntry *mePtr, |
| 46 |
Drawable d, Tk_3DBorder activeBorder, |
| 47 |
Tk_3DBorder bgBorder, int x, int y, |
| 48 |
int width, int heigth)); |
| 49 |
static void DrawMenuEntryIndicator _ANSI_ARGS_(( |
| 50 |
TkMenu *menuPtr, TkMenuEntry *mePtr, |
| 51 |
Drawable d, GC gc, GC indicatorGC, |
| 52 |
Tk_Font tkfont, |
| 53 |
CONST Tk_FontMetrics *fmPtr, int x, int y, |
| 54 |
int width, int height)); |
| 55 |
static void DrawMenuEntryLabel _ANSI_ARGS_(( |
| 56 |
TkMenu * menuPtr, TkMenuEntry *mePtr, Drawable d, |
| 57 |
GC gc, Tk_Font tkfont, |
| 58 |
CONST Tk_FontMetrics *fmPtr, int x, int y, |
| 59 |
int width, int height)); |
| 60 |
static void DrawMenuSeparator _ANSI_ARGS_((TkMenu *menuPtr, |
| 61 |
TkMenuEntry *mePtr, Drawable d, GC gc, |
| 62 |
Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, |
| 63 |
int x, int y, int width, int height)); |
| 64 |
static void DrawTearoffEntry _ANSI_ARGS_((TkMenu *menuPtr, |
| 65 |
TkMenuEntry *mePtr, Drawable d, GC gc, |
| 66 |
Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, |
| 67 |
int x, int y, int width, int height)); |
| 68 |
static void DrawMenuUnderline _ANSI_ARGS_((TkMenu *menuPtr, |
| 69 |
TkMenuEntry *mePtr, Drawable d, GC gc, |
| 70 |
Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, int x, |
| 71 |
int y, int width, int height)); |
| 72 |
static void GetMenuAccelGeometry _ANSI_ARGS_((TkMenu *menuPtr, |
| 73 |
TkMenuEntry *mePtr, Tk_Font tkfont, |
| 74 |
CONST Tk_FontMetrics *fmPtr, int *widthPtr, |
| 75 |
int *heightPtr)); |
| 76 |
static void GetMenuLabelGeometry _ANSI_ARGS_((TkMenuEntry *mePtr, |
| 77 |
Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, |
| 78 |
int *widthPtr, int *heightPtr)); |
| 79 |
static void GetMenuIndicatorGeometry _ANSI_ARGS_(( |
| 80 |
TkMenu *menuPtr, TkMenuEntry *mePtr, |
| 81 |
Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, |
| 82 |
int *widthPtr, int *heightPtr)); |
| 83 |
static void GetMenuSeparatorGeometry _ANSI_ARGS_(( |
| 84 |
TkMenu *menuPtr, TkMenuEntry *mePtr, |
| 85 |
Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, |
| 86 |
int *widthPtr, int *heightPtr)); |
| 87 |
static void GetTearoffEntryGeometry _ANSI_ARGS_((TkMenu *menuPtr, |
| 88 |
TkMenuEntry *mePtr, Tk_Font tkfont, |
| 89 |
CONST Tk_FontMetrics *fmPtr, int *widthPtr, |
| 90 |
int *heightPtr)); |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
int |
| 112 |
TkpNewMenu(menuPtr) |
| 113 |
TkMenu *menuPtr; |
| 114 |
{ |
| 115 |
SetHelpMenu(menuPtr); |
| 116 |
return TCL_OK; |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
void |
| 137 |
TkpDestroyMenu(menuPtr) |
| 138 |
TkMenu *menuPtr; |
| 139 |
{ |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
} |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
void |
| 163 |
TkpDestroyMenuEntry(mEntryPtr) |
| 164 |
TkMenuEntry *mEntryPtr; |
| 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 |
int |
| 191 |
TkpConfigureMenuEntry(mePtr) |
| 192 |
register TkMenuEntry *mePtr; |
| 193 |
|
| 194 |
|
| 195 |
{ |
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
if ((mePtr->type == CASCADE_ENTRY) && (mePtr->namePtr != NULL)) { |
| 202 |
TkMenuReferences *menuRefPtr; |
| 203 |
|
| 204 |
menuRefPtr = TkFindMenuReferencesObj(mePtr->menuPtr->interp, |
| 205 |
mePtr->namePtr); |
| 206 |
if ((menuRefPtr != NULL) && (menuRefPtr->menuPtr != NULL)) { |
| 207 |
SetHelpMenu(menuRefPtr->menuPtr); |
| 208 |
} |
| 209 |
} |
| 210 |
return TCL_OK; |
| 211 |
} |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
int |
| 233 |
TkpMenuNewEntry(mePtr) |
| 234 |
TkMenuEntry *mePtr; |
| 235 |
{ |
| 236 |
return TCL_OK; |
| 237 |
} |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
void |
| 256 |
TkpSetWindowMenuBar(tkwin, menuPtr) |
| 257 |
Tk_Window tkwin; |
| 258 |
TkMenu *menuPtr; |
| 259 |
{ |
| 260 |
if (menuPtr == NULL) { |
| 261 |
TkUnixSetMenubar(tkwin, NULL); |
| 262 |
} else { |
| 263 |
TkUnixSetMenubar(tkwin, menuPtr->tkwin); |
| 264 |
} |
| 265 |
} |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
void |
| 286 |
TkpSetMainMenubar(interp, tkwin, menuName) |
| 287 |
Tcl_Interp *interp; |
| 288 |
Tk_Window tkwin; |
| 289 |
char *menuName; |
| 290 |
{ |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
} |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
static void |
| 316 |
GetMenuIndicatorGeometry(menuPtr, mePtr, tkfont, fmPtr, widthPtr, heightPtr) |
| 317 |
TkMenu *menuPtr; |
| 318 |
TkMenuEntry *mePtr; |
| 319 |
Tk_Font tkfont; |
| 320 |
CONST Tk_FontMetrics *fmPtr; |
| 321 |
int *widthPtr; |
| 322 |
int *heightPtr; |
| 323 |
{ |
| 324 |
if ((mePtr->type == CHECK_BUTTON_ENTRY) |
| 325 |
|| (mePtr->type == RADIO_BUTTON_ENTRY)) { |
| 326 |
if (!mePtr->hideMargin && mePtr->indicatorOn) { |
| 327 |
if ((mePtr->image != NULL) || (mePtr->bitmapPtr != NULL)) { |
| 328 |
*widthPtr = (14 * mePtr->height) / 10; |
| 329 |
*heightPtr = mePtr->height; |
| 330 |
if (mePtr->type == CHECK_BUTTON_ENTRY) { |
| 331 |
mePtr->platformEntryData = |
| 332 |
(TkMenuPlatformEntryData) ((65 * mePtr->height) |
| 333 |
/ 100); |
| 334 |
} else { |
| 335 |
mePtr->platformEntryData = |
| 336 |
(TkMenuPlatformEntryData) ((75 * mePtr->height) |
| 337 |
/ 100); |
| 338 |
} |
| 339 |
} else { |
| 340 |
*widthPtr = *heightPtr = mePtr->height; |
| 341 |
if (mePtr->type == CHECK_BUTTON_ENTRY) { |
| 342 |
mePtr->platformEntryData = (TkMenuPlatformEntryData) |
| 343 |
((80 * mePtr->height) / 100); |
| 344 |
} else { |
| 345 |
mePtr->platformEntryData = (TkMenuPlatformEntryData) |
| 346 |
mePtr->height; |
| 347 |
} |
| 348 |
} |
| 349 |
} else { |
| 350 |
int borderWidth; |
| 351 |
|
| 352 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, |
| 353 |
menuPtr->borderWidthPtr, &borderWidth); |
| 354 |
*heightPtr = 0; |
| 355 |
*widthPtr = borderWidth; |
| 356 |
} |
| 357 |
} else { |
| 358 |
int borderWidth; |
| 359 |
|
| 360 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, |
| 361 |
&borderWidth); |
| 362 |
*heightPtr = 0; |
| 363 |
*widthPtr = borderWidth; |
| 364 |
} |
| 365 |
} |
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
static void |
| 385 |
GetMenuAccelGeometry(menuPtr, mePtr, tkfont, fmPtr, widthPtr, heightPtr) |
| 386 |
TkMenu *menuPtr; |
| 387 |
TkMenuEntry *mePtr; |
| 388 |
Tk_Font tkfont; |
| 389 |
CONST Tk_FontMetrics *fmPtr; |
| 390 |
int *widthPtr; |
| 391 |
int *heightPtr; |
| 392 |
{ |
| 393 |
*heightPtr = fmPtr->linespace; |
| 394 |
if (mePtr->type == CASCADE_ENTRY) { |
| 395 |
*widthPtr = 2 * CASCADE_ARROW_WIDTH; |
| 396 |
} else if ((menuPtr->menuType != MENUBAR) |
| 397 |
&& (mePtr->accelPtr != NULL)) { |
| 398 |
char *accel = Tcl_GetStringFromObj(mePtr->accelPtr, NULL); |
| 399 |
|
| 400 |
*widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength); |
| 401 |
} else { |
| 402 |
*widthPtr = 0; |
| 403 |
} |
| 404 |
} |
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
static void |
| 424 |
DrawMenuEntryBackground(menuPtr, mePtr, d, activeBorder, bgBorder, x, y, |
| 425 |
width, height) |
| 426 |
TkMenu *menuPtr; |
| 427 |
TkMenuEntry *mePtr; |
| 428 |
Drawable d; |
| 429 |
Tk_3DBorder activeBorder; |
| 430 |
Tk_3DBorder bgBorder; |
| 431 |
int x; |
| 432 |
int y; |
| 433 |
int width; |
| 434 |
int height; |
| 435 |
{ |
| 436 |
if (mePtr->state == ENTRY_ACTIVE) { |
| 437 |
int relief; |
| 438 |
int activeBorderWidth; |
| 439 |
|
| 440 |
bgBorder = activeBorder; |
| 441 |
|
| 442 |
if ((menuPtr->menuType == MENUBAR) |
| 443 |
&& ((menuPtr->postedCascade == NULL) |
| 444 |
|| (menuPtr->postedCascade != mePtr))) { |
| 445 |
relief = TK_RELIEF_FLAT; |
| 446 |
} else { |
| 447 |
relief = TK_RELIEF_RAISED; |
| 448 |
} |
| 449 |
|
| 450 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, |
| 451 |
menuPtr->activeBorderWidthPtr, &activeBorderWidth); |
| 452 |
Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, |
| 453 |
activeBorderWidth, relief); |
| 454 |
} else { |
| 455 |
Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, |
| 456 |
0, TK_RELIEF_FLAT); |
| 457 |
} |
| 458 |
} |
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
static void |
| 478 |
DrawMenuEntryAccelerator(menuPtr, mePtr, d, gc, tkfont, fmPtr, activeBorder, |
| 479 |
x, y, width, height, drawArrow) |
| 480 |
TkMenu *menuPtr; |
| 481 |
TkMenuEntry *mePtr; |
| 482 |
Drawable d; |
| 483 |
GC gc; |
| 484 |
Tk_Font tkfont; |
| 485 |
CONST Tk_FontMetrics *fmPtr; |
| 486 |
Tk_3DBorder activeBorder; |
| 487 |
int x; |
| 488 |
int y; |
| 489 |
int width; |
| 490 |
int height; |
| 491 |
int drawArrow; |
| 492 |
{ |
| 493 |
XPoint points[3]; |
| 494 |
int borderWidth, activeBorderWidth; |
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
if (menuPtr->menuType == MENUBAR) { |
| 501 |
return; |
| 502 |
} |
| 503 |
|
| 504 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, |
| 505 |
&borderWidth); |
| 506 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, |
| 507 |
&activeBorderWidth); |
| 508 |
if ((mePtr->type == CASCADE_ENTRY) && drawArrow) { |
| 509 |
points[0].x = x + width - borderWidth - activeBorderWidth |
| 510 |
- CASCADE_ARROW_WIDTH; |
| 511 |
points[0].y = y + (height - CASCADE_ARROW_HEIGHT)/2; |
| 512 |
points[1].x = points[0].x; |
| 513 |
points[1].y = points[0].y + CASCADE_ARROW_HEIGHT; |
| 514 |
points[2].x = points[0].x + CASCADE_ARROW_WIDTH; |
| 515 |
points[2].y = points[0].y + CASCADE_ARROW_HEIGHT/2; |
| 516 |
Tk_Fill3DPolygon(menuPtr->tkwin, d, activeBorder, points, 3, |
| 517 |
DECORATION_BORDER_WIDTH, |
| 518 |
(menuPtr->postedCascade == mePtr) |
| 519 |
? TK_RELIEF_SUNKEN : TK_RELIEF_RAISED); |
| 520 |
} else if (mePtr->accelPtr != NULL) { |
| 521 |
char *accel = Tcl_GetStringFromObj(mePtr->accelPtr, NULL); |
| 522 |
int left = x + mePtr->labelWidth + activeBorderWidth |
| 523 |
+ mePtr->indicatorSpace; |
| 524 |
|
| 525 |
if (menuPtr->menuType == MENUBAR) { |
| 526 |
left += 5; |
| 527 |
} |
| 528 |
Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel, |
| 529 |
mePtr->accelLength, left, |
| 530 |
(y + (height + fmPtr->ascent - fmPtr->descent) / 2)); |
| 531 |
} |
| 532 |
} |
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
static void |
| 552 |
DrawMenuEntryIndicator(menuPtr, mePtr, d, gc, indicatorGC, tkfont, fmPtr, |
| 553 |
x, y, width, height) |
| 554 |
TkMenu *menuPtr; |
| 555 |
TkMenuEntry *mePtr; |
| 556 |
Drawable d; |
| 557 |
GC gc; |
| 558 |
GC indicatorGC; |
| 559 |
Tk_Font tkfont; |
| 560 |
CONST Tk_FontMetrics *fmPtr; |
| 561 |
int x; |
| 562 |
int y; |
| 563 |
int width; |
| 564 |
int height; |
| 565 |
{ |
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
if ((mePtr->type == CHECK_BUTTON_ENTRY) && mePtr->indicatorOn) { |
| 571 |
int dim, top, left; |
| 572 |
int activeBorderWidth; |
| 573 |
Tk_3DBorder border; |
| 574 |
|
| 575 |
dim = (int) mePtr->platformEntryData; |
| 576 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, |
| 577 |
menuPtr->activeBorderWidthPtr, &activeBorderWidth); |
| 578 |
left = x + activeBorderWidth + (mePtr->indicatorSpace - dim)/2; |
| 579 |
if (menuPtr->menuType == MENUBAR) { |
| 580 |
left += 5; |
| 581 |
} |
| 582 |
top = y + (height - dim)/2; |
| 583 |
border = Tk_Get3DBorderFromObj(menuPtr->tkwin, |
| 584 |
menuPtr->borderPtr); |
| 585 |
Tk_Fill3DRectangle(menuPtr->tkwin, d, border, left, top, dim, |
| 586 |
dim, DECORATION_BORDER_WIDTH, TK_RELIEF_SUNKEN); |
| 587 |
left += DECORATION_BORDER_WIDTH; |
| 588 |
top += DECORATION_BORDER_WIDTH; |
| 589 |
dim -= 2*DECORATION_BORDER_WIDTH; |
| 590 |
if ((dim > 0) && (mePtr->entryFlags |
| 591 |
& ENTRY_SELECTED)) { |
| 592 |
XFillRectangle(menuPtr->display, d, indicatorGC, left, top, |
| 593 |
(unsigned int) dim, (unsigned int) dim); |
| 594 |
} |
| 595 |
} |
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
|
| 601 |
if ((mePtr->type == RADIO_BUTTON_ENTRY) && mePtr->indicatorOn) { |
| 602 |
XPoint points[4]; |
| 603 |
int radius; |
| 604 |
Tk_3DBorder border; |
| 605 |
|
| 606 |
border = Tk_Get3DBorderFromObj(menuPtr->tkwin, |
| 607 |
menuPtr->borderPtr); |
| 608 |
radius = ((int) mePtr->platformEntryData)/2; |
| 609 |
points[0].x = x + (mePtr->indicatorSpace |
| 610 |
- (int) mePtr->platformEntryData)/2; |
| 611 |
points[0].y = y + (height)/2; |
| 612 |
points[1].x = points[0].x + radius; |
| 613 |
points[1].y = points[0].y + radius; |
| 614 |
points[2].x = points[1].x + radius; |
| 615 |
points[2].y = points[0].y; |
| 616 |
points[3].x = points[1].x; |
| 617 |
points[3].y = points[0].y - radius; |
| 618 |
if (mePtr->entryFlags & ENTRY_SELECTED) { |
| 619 |
XFillPolygon(menuPtr->display, d, indicatorGC, points, 4, |
| 620 |
Convex, CoordModeOrigin); |
| 621 |
} else { |
| 622 |
Tk_Fill3DPolygon(menuPtr->tkwin, d, border, points, 4, |
| 623 |
DECORATION_BORDER_WIDTH, TK_RELIEF_FLAT); |
| 624 |
} |
| 625 |
Tk_Draw3DPolygon(menuPtr->tkwin, d, border, points, 4, |
| 626 |
DECORATION_BORDER_WIDTH, TK_RELIEF_SUNKEN); |
| 627 |
} |
| 628 |
} |
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
|
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
static void |
| 648 |
DrawMenuSeparator(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height) |
| 649 |
TkMenu *menuPtr; |
| 650 |
TkMenuEntry *mePtr; |
| 651 |
Drawable d; |
| 652 |
GC gc; |
| 653 |
Tk_Font tkfont; |
| 654 |
CONST Tk_FontMetrics *fmPtr; |
| 655 |
int x; |
| 656 |
int y; |
| 657 |
int width; |
| 658 |
int height; |
| 659 |
{ |
| 660 |
XPoint points[2]; |
| 661 |
Tk_3DBorder border; |
| 662 |
|
| 663 |
if (menuPtr->menuType == MENUBAR) { |
| 664 |
return; |
| 665 |
} |
| 666 |
|
| 667 |
points[0].x = x; |
| 668 |
points[0].y = y + height/2; |
| 669 |
points[1].x = width - 1; |
| 670 |
points[1].y = points[0].y; |
| 671 |
border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr); |
| 672 |
Tk_Draw3DPolygon(menuPtr->tkwin, d, border, points, 2, 1, |
| 673 |
TK_RELIEF_RAISED); |
| 674 |
} |
| 675 |
|
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
|
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
static void |
| 694 |
DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height) |
| 695 |
TkMenu *menuPtr; |
| 696 |
TkMenuEntry *mePtr; |
| 697 |
Drawable d; |
| 698 |
GC gc; |
| 699 |
Tk_Font tkfont; |
| 700 |
CONST Tk_FontMetrics *fmPtr; |
| 701 |
int x; |
| 702 |
int y; |
| 703 |
int width; |
| 704 |
int height; |
| 705 |
{ |
| 706 |
int indicatorSpace = mePtr->indicatorSpace; |
| 707 |
int activeBorderWidth; |
| 708 |
int leftEdge; |
| 709 |
int imageHeight, imageWidth; |
| 710 |
int textHeight = 0, textWidth = 0; |
| 711 |
int haveImage = 0, haveText = 0; |
| 712 |
int imageXOffset = 0, imageYOffset = 0; |
| 713 |
int textXOffset = 0, textYOffset = 0; |
| 714 |
|
| 715 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, |
| 716 |
&activeBorderWidth); |
| 717 |
leftEdge = x + indicatorSpace + activeBorderWidth; |
| 718 |
if (menuPtr->menuType == MENUBAR) { |
| 719 |
leftEdge += 5; |
| 720 |
} |
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
|
| 725 |
|
| 726 |
if (mePtr->image != NULL) { |
| 727 |
Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight); |
| 728 |
haveImage = 1; |
| 729 |
} else if (mePtr->bitmapPtr != NULL) { |
| 730 |
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr); |
| 731 |
Tk_SizeOfBitmap(menuPtr->display, bitmap, &imageWidth, &imageHeight); |
| 732 |
haveImage = 1; |
| 733 |
} |
| 734 |
if (!haveImage || (mePtr->compound != COMPOUND_NONE)) { |
| 735 |
if (mePtr->labelLength > 0) { |
| 736 |
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL); |
| 737 |
textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength); |
| 738 |
textHeight = fmPtr->linespace; |
| 739 |
haveText = 1; |
| 740 |
} |
| 741 |
} |
| 742 |
|
| 743 |
|
| 744 |
|
| 745 |
|
| 746 |
|
| 747 |
if (haveImage && haveText) { |
| 748 |
int fullWidth = (imageWidth > textWidth ? imageWidth : textWidth); |
| 749 |
switch ((enum compound) mePtr->compound) { |
| 750 |
case COMPOUND_TOP: { |
| 751 |
textXOffset = (fullWidth - textWidth)/2; |
| 752 |
textYOffset = imageHeight/2 + 2; |
| 753 |
imageXOffset = (fullWidth - imageWidth)/2; |
| 754 |
imageYOffset = -textHeight/2; |
| 755 |
break; |
| 756 |
} |
| 757 |
case COMPOUND_BOTTOM: { |
| 758 |
textXOffset = (fullWidth - textWidth)/2; |
| 759 |
textYOffset = -imageHeight/2; |
| 760 |
imageXOffset = (fullWidth - imageWidth)/2; |
| 761 |
imageYOffset = textHeight/2 + 2; |
| 762 |
break; |
| 763 |
} |
| 764 |
case COMPOUND_LEFT: { |
| 765 |
textXOffset = imageWidth + 2; |
| 766 |
textYOffset = 0; |
| 767 |
imageXOffset = 0; |
| 768 |
imageYOffset = 0; |
| 769 |
break; |
| 770 |
} |
| 771 |
case COMPOUND_RIGHT: { |
| 772 |
textXOffset = 0; |
| 773 |
textYOffset = 0; |
| 774 |
imageXOffset = textWidth + 2; |
| 775 |
imageYOffset = 0; |
| 776 |
break; |
| 777 |
} |
| 778 |
case COMPOUND_CENTER: { |
| 779 |
textXOffset = (fullWidth - textWidth)/2; |
| 780 |
textYOffset = 0; |
| 781 |
imageXOffset = (fullWidth - imageWidth)/2; |
| 782 |
imageYOffset = 0; |
| 783 |
break; |
| 784 |
} |
| 785 |
case COMPOUND_NONE: {break;} |
| 786 |
} |
| 787 |
} else { |
| 788 |
textXOffset = 0; |
| 789 |
textYOffset = 0; |
| 790 |
imageXOffset = 0; |
| 791 |
imageYOffset = 0; |
| 792 |
} |
| 793 |
|
| 794 |
|
| 795 |
|
| 796 |
|
| 797 |
|
| 798 |
if (mePtr->image != NULL) { |
| 799 |
if ((mePtr->selectImage != NULL) |
| 800 |
&& (mePtr->entryFlags & ENTRY_SELECTED)) { |
| 801 |
Tk_RedrawImage(mePtr->selectImage, 0, 0, |
| 802 |
imageWidth, imageHeight, d, leftEdge + imageXOffset, |
| 803 |
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset)); |
| 804 |
} else { |
| 805 |
Tk_RedrawImage(mePtr->image, 0, 0, imageWidth, |
| 806 |
imageHeight, d, leftEdge + imageXOffset, |
| 807 |
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset)); |
| 808 |
} |
| 809 |
} else if (mePtr->bitmapPtr != None) { |
| 810 |
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr); |
| 811 |
XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0, |
| 812 |
(unsigned) imageWidth, (unsigned) imageHeight, |
| 813 |
leftEdge + imageXOffset, |
| 814 |
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset), 1); |
| 815 |
} |
| 816 |
if ((mePtr->compound != COMPOUND_NONE) || !haveImage) { |
| 817 |
int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2; |
| 818 |
if (mePtr->labelLength > 0) { |
| 819 |
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL); |
| 820 |
Tk_DrawChars(menuPtr->display, d, gc, tkfont, label, |
| 821 |
mePtr->labelLength, leftEdge + textXOffset, |
| 822 |
baseline + textYOffset); |
| 823 |
DrawMenuUnderline(menuPtr, mePtr, d, gc, tkfont, fmPtr, |
| 824 |
x + textXOffset, y + textYOffset, |
| 825 |
width, height); |
| 826 |
} |
| 827 |
} |
| 828 |
|
| 829 |
if (mePtr->state == ENTRY_DISABLED) { |
| 830 |
if (menuPtr->disabledFgPtr == NULL) { |
| 831 |
XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y, |
| 832 |
(unsigned) width, (unsigned) height); |
| 833 |
} else if ((mePtr->image != NULL) |
| 834 |
&& (menuPtr->disabledImageGC != None)) { |
| 835 |
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC, |
| 836 |
leftEdge + imageXOffset, |
| 837 |
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset), |
| 838 |
(unsigned) imageWidth, (unsigned) imageHeight); |
| 839 |
} |
| 840 |
} |
| 841 |
} |
| 842 |
|
| 843 |
|
| 844 |
|
| 845 |
|
| 846 |
|
| 847 |
|
| 848 |
|
| 849 |
|
| 850 |
|
| 851 |
|
| 852 |
|
| 853 |
|
| 854 |
|
| 855 |
|
| 856 |
|
| 857 |
|
| 858 |
|
| 859 |
|
| 860 |
|
| 861 |
static void |
| 862 |
DrawMenuUnderline(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height) |
| 863 |
TkMenu *menuPtr; |
| 864 |
TkMenuEntry *mePtr; |
| 865 |
Drawable d; |
| 866 |
GC gc; |
| 867 |
Tk_Font tkfont; |
| 868 |
CONST Tk_FontMetrics *fmPtr; |
| 869 |
int x; |
| 870 |
int y; |
| 871 |
int width; |
| 872 |
int height; |
| 873 |
{ |
| 874 |
int indicatorSpace = mePtr->indicatorSpace; |
| 875 |
|
| 876 |
if (mePtr->underline >= 0) { |
| 877 |
int activeBorderWidth; |
| 878 |
int leftEdge; |
| 879 |
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL); |
| 880 |
CONST char *start = Tcl_UtfAtIndex(label, mePtr->underline); |
| 881 |
CONST char *end = Tcl_UtfNext(start); |
| 882 |
|
| 883 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, |
| 884 |
menuPtr->activeBorderWidthPtr, &activeBorderWidth); |
| 885 |
leftEdge = x + indicatorSpace + activeBorderWidth; |
| 886 |
if (menuPtr->menuType == MENUBAR) { |
| 887 |
leftEdge += 5; |
| 888 |
} |
| 889 |
|
| 890 |
Tk_UnderlineChars(menuPtr->display, d, gc, tkfont, label, |
| 891 |
leftEdge, y + (height + fmPtr->ascent - fmPtr->descent) / 2, |
| 892 |
start - label, end - label); |
| 893 |
} |
| 894 |
} |
| 895 |
|
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
|
| 901 |
|
| 902 |
|
| 903 |
|
| 904 |
|
| 905 |
|
| 906 |
|
| 907 |
|
| 908 |
|
| 909 |
|
| 910 |
|
| 911 |
|
| 912 |
int |
| 913 |
TkpPostMenu(interp, menuPtr, x, y) |
| 914 |
Tcl_Interp *interp; |
| 915 |
TkMenu *menuPtr; |
| 916 |
int x; |
| 917 |
int y; |
| 918 |
{ |
| 919 |
return TkPostTearoffMenu(interp, menuPtr, x, y); |
| 920 |
} |
| 921 |
|
| 922 |
|
| 923 |
|
| 924 |
|
| 925 |
|
| 926 |
|
| 927 |
|
| 928 |
|
| 929 |
|
| 930 |
|
| 931 |
|
| 932 |
|
| 933 |
|
| 934 |
|
| 935 |
|
| 936 |
|
| 937 |
|
| 938 |
static void |
| 939 |
GetMenuSeparatorGeometry(menuPtr, mePtr, tkfont, fmPtr, widthPtr, |
| 940 |
heightPtr) |
| 941 |
TkMenu *menuPtr; |
| 942 |
TkMenuEntry *mePtr; |
| 943 |
Tk_Font tkfont; |
| 944 |
CONST Tk_FontMetrics *fmPtr; |
| 945 |
int *widthPtr; |
| 946 |
int *heightPtr; |
| 947 |
{ |
| 948 |
*widthPtr = 0; |
| 949 |
*heightPtr = fmPtr->linespace; |
| 950 |
} |
| 951 |
|
| 952 |
|
| 953 |
|
| 954 |
|
| 955 |
|
| 956 |
|
| 957 |
|
| 958 |
|
| 959 |
|
| 960 |
|
| 961 |
|
| 962 |
|
| 963 |
|
| 964 |
|
| 965 |
|
| 966 |
|
| 967 |
|
| 968 |
static void |
| 969 |
GetTearoffEntryGeometry(menuPtr, mePtr, tkfont, fmPtr, widthPtr, heightPtr) |
| 970 |
TkMenu *menuPtr; |
| 971 |
TkMenuEntry *mePtr; |
| 972 |
Tk_Font tkfont; |
| 973 |
CONST Tk_FontMetrics *fmPtr; |
| 974 |
int *widthPtr; |
| 975 |
int *heightPtr; |
| 976 |
{ |
| 977 |
if (menuPtr->menuType != MASTER_MENU) { |
| 978 |
*heightPtr = 0; |
| 979 |
*widthPtr = 0; |
| 980 |
} else { |
| 981 |
*heightPtr = fmPtr->linespace; |
| 982 |
*widthPtr = Tk_TextWidth(tkfont, "W", 1); |
| 983 |
} |
| 984 |
} |
| 985 |
|
| 986 |
|
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
|
| 993 |
|
| 994 |
|
| 995 |
|
| 996 |
|
| 997 |
|
| 998 |
|
| 999 |
|
| 1000 |
|
| 1001 |
|
| 1002 |
|
| 1003 |
|
| 1004 |
|
| 1005 |
void |
| 1006 |
TkpComputeMenubarGeometry(menuPtr) |
| 1007 |
TkMenu *menuPtr; |
| 1008 |
{ |
| 1009 |
Tk_Font tkfont; |
| 1010 |
Tk_FontMetrics menuMetrics, entryMetrics, *fmPtr; |
| 1011 |
int width, height; |
| 1012 |
int i, j; |
| 1013 |
int x, y, currentRowHeight, maxWidth; |
| 1014 |
int maxWindowWidth; |
| 1015 |
int lastRowBreak = 0; |
| 1016 |
int helpMenuIndex = -1; |
| 1017 |
TkMenuEntry *mePtr; |
| 1018 |
int lastEntry; |
| 1019 |
Tk_Font menuFont; |
| 1020 |
int borderWidth; |
| 1021 |
int activeBorderWidth; |
| 1022 |
int lastSeparator = -1; |
| 1023 |
int maxEWidth = 0; |
| 1024 |
int maxEHeight = 0; |
| 1025 |
int totalWidth = 0; |
| 1026 |
int rightWidth = 0; |
| 1027 |
int helpWidth = 0; |
| 1028 |
int multiColumn = 0; |
| 1029 |
|
| 1030 |
if (menuPtr->tkwin == NULL) { |
| 1031 |
return; |
| 1032 |
} |
| 1033 |
|
| 1034 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, |
| 1035 |
&borderWidth); |
| 1036 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, |
| 1037 |
&activeBorderWidth); |
| 1038 |
maxWidth = 0; |
| 1039 |
if (menuPtr->numEntries == 0) { |
| 1040 |
height = 0; |
| 1041 |
} else { |
| 1042 |
int borderWidth; |
| 1043 |
|
| 1044 |
maxWindowWidth = Tk_Width(menuPtr->tkwin); |
| 1045 |
if (maxWindowWidth == 1) { |
| 1046 |
maxWindowWidth = 0x7ffffff; |
| 1047 |
} |
| 1048 |
currentRowHeight = 0; |
| 1049 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, |
| 1050 |
&borderWidth); |
| 1051 |
x = y = borderWidth; |
| 1052 |
lastRowBreak = 0; |
| 1053 |
|
| 1054 |
|
| 1055 |
|
| 1056 |
|
| 1057 |
|
| 1058 |
|
| 1059 |
|
| 1060 |
|
| 1061 |
|
| 1062 |
|
| 1063 |
menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr); |
| 1064 |
Tk_GetFontMetrics(menuFont, &menuMetrics); |
| 1065 |
|
| 1066 |
for (i = 0; i < menuPtr->numEntries; i++) { |
| 1067 |
mePtr = menuPtr->entries[i]; |
| 1068 |
mePtr->entryFlags &= ~ENTRY_LAST_COLUMN; |
| 1069 |
if (mePtr->fontPtr != NULL) { |
| 1070 |
tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr); |
| 1071 |
Tk_GetFontMetrics(tkfont, &entryMetrics); |
| 1072 |
fmPtr = &entryMetrics; |
| 1073 |
} else { |
| 1074 |
tkfont = menuFont; |
| 1075 |
fmPtr = &menuMetrics; |
| 1076 |
} |
| 1077 |
|
| 1078 |
|
| 1079 |
|
| 1080 |
|
| 1081 |
|
| 1082 |
|
| 1083 |
|
| 1084 |
|
| 1085 |
|
| 1086 |
if ((mePtr->type == SEPARATOR_ENTRY) |
| 1087 |
|| (mePtr->type == TEAROFF_ENTRY)) { |
| 1088 |
mePtr->height = mePtr->width = 0; |
| 1089 |
if (mePtr->type == SEPARATOR_ENTRY) { |
| 1090 |
lastSeparator = i; |
| 1091 |
rightWidth = 0; |
| 1092 |
} |
| 1093 |
} else { |
| 1094 |
GetMenuLabelGeometry(mePtr, tkfont, fmPtr, &width, &height); |
| 1095 |
mePtr->height = height + 2 * activeBorderWidth + 10; |
| 1096 |
mePtr->width = width; |
| 1097 |
|
| 1098 |
GetMenuIndicatorGeometry(menuPtr, mePtr, tkfont, fmPtr, |
| 1099 |
&width, &height); |
| 1100 |
mePtr->indicatorSpace = width; |
| 1101 |
if (width > 0) { |
| 1102 |
mePtr->width += width; |
| 1103 |
} |
| 1104 |
mePtr->width += 2 * activeBorderWidth + 10; |
| 1105 |
if (mePtr->entryFlags & ENTRY_HELP_MENU) { |
| 1106 |
helpMenuIndex = i; |
| 1107 |
helpWidth = mePtr->width; |
| 1108 |
} else { |
| 1109 |
if (mePtr->width > maxEWidth) |
| 1110 |
maxEWidth = mePtr->width; |
| 1111 |
if (mePtr->height > maxEHeight) |
| 1112 |
maxEHeight = mePtr->height; |
| 1113 |
if (lastSeparator != -1) |
| 1114 |
rightWidth += mePtr->width; |
| 1115 |
} |
| 1116 |
} |
| 1117 |
} |
| 1118 |
|
| 1119 |
|
| 1120 |
|
| 1121 |
|
| 1122 |
if (2*borderWidth + totalWidth > maxWindowWidth) { |
| 1123 |
multiColumn = 1; |
| 1124 |
lastSeparator = -1; |
| 1125 |
} |
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
x = borderWidth; |
| 1130 |
y = borderWidth; |
| 1131 |
maxWidth = x; |
| 1132 |
for (i = 0; i < menuPtr->numEntries; i++) { |
| 1133 |
mePtr = menuPtr->entries[i]; |
| 1134 |
if (i == lastSeparator) { |
| 1135 |
x = maxWindowWidth - borderWidth - rightWidth - helpWidth; |
| 1136 |
} |
| 1137 |
if ((mePtr->type == SEPARATOR_ENTRY) || (mePtr->type == TEAROFF_ENTRY)) { |
| 1138 |
continue; |
| 1139 |
} |
| 1140 |
if (mePtr->entryFlags & ENTRY_HELP_MENU) { |
| 1141 |
continue; |
| 1142 |
} |
| 1143 |
if (multiColumn) { |
| 1144 |
mePtr->width = maxEWidth; |
| 1145 |
} |
| 1146 |
if (x + mePtr->width + borderWidth > maxWindowWidth - helpWidth) { |
| 1147 |
y += currentRowHeight; |
| 1148 |
x = borderWidth; |
| 1149 |
currentRowHeight = 0; |
| 1150 |
} |
| 1151 |
mePtr->y = y; |
| 1152 |
mePtr->x = x; |
| 1153 |
x += mePtr->width; |
| 1154 |
if (mePtr->height > currentRowHeight) { |
| 1155 |
currentRowHeight = mePtr->height; |
| 1156 |
} |
| 1157 |
if (x > maxWidth) { |
| 1158 |
maxWidth = x; |
| 1159 |
} |
| 1160 |
} |
| 1161 |
height = y + currentRowHeight; |
| 1162 |
|
| 1163 |
if (helpMenuIndex != -1) { |
| 1164 |
mePtr = menuPtr->entries[helpMenuIndex]; |
| 1165 |
mePtr->x = maxWindowWidth - borderWidth - mePtr->width; |
| 1166 |
mePtr->y = borderWidth; |
| 1167 |
if (mePtr->y + mePtr->height > height) { |
| 1168 |
height = mePtr->y + mePtr->height; |
| 1169 |
} |
| 1170 |
} |
| 1171 |
} |
| 1172 |
width = Tk_Width(menuPtr->tkwin); |
| 1173 |
|
| 1174 |
|
| 1175 |
|
| 1176 |
|
| 1177 |
|
| 1178 |
|
| 1179 |
if (width <= 0) { |
| 1180 |
width = 1; |
| 1181 |
} |
| 1182 |
if (height <= 0) { |
| 1183 |
height = 1; |
| 1184 |
} |
| 1185 |
menuPtr->totalWidth = maxWidth + helpWidth + borderWidth; |
| 1186 |
menuPtr->totalHeight = height + borderWidth; |
| 1187 |
} |
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
|
| 1192 |
|
| 1193 |
|
| 1194 |
|
| 1195 |
|
| 1196 |
|
| 1197 |
|
| 1198 |
|
| 1199 |
|
| 1200 |
|
| 1201 |
|
| 1202 |
|
| 1203 |
|
| 1204 |
|
| 1205 |
|
| 1206 |
static void |
| 1207 |
DrawTearoffEntry(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height) |
| 1208 |
TkMenu *menuPtr; |
| 1209 |
TkMenuEntry *mePtr; |
| 1210 |
Drawable d; |
| 1211 |
GC gc; |
| 1212 |
Tk_Font tkfont; |
| 1213 |
CONST Tk_FontMetrics *fmPtr; |
| 1214 |
int x; |
| 1215 |
int y; |
| 1216 |
int width; |
| 1217 |
int height; |
| 1218 |
{ |
| 1219 |
XPoint points[2]; |
| 1220 |
int segmentWidth, maxX; |
| 1221 |
Tk_3DBorder border; |
| 1222 |
|
| 1223 |
if (menuPtr->menuType != MASTER_MENU) { |
| 1224 |
return; |
| 1225 |
} |
| 1226 |
|
| 1227 |
points[0].x = x; |
| 1228 |
points[0].y = y + height/2; |
| 1229 |
points[1].y = points[0].y; |
| 1230 |
segmentWidth = 6; |
| 1231 |
maxX = width - 1; |
| 1232 |
border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr); |
| 1233 |
|
| 1234 |
while (points[0].x < maxX) { |
| 1235 |
points[1].x = points[0].x + segmentWidth; |
| 1236 |
if (points[1].x > maxX) { |
| 1237 |
points[1].x = maxX; |
| 1238 |
} |
| 1239 |
Tk_Draw3DPolygon(menuPtr->tkwin, d, border, points, 2, 1, |
| 1240 |
TK_RELIEF_RAISED); |
| 1241 |
points[0].x += 2 * segmentWidth; |
| 1242 |
} |
| 1243 |
} |
| 1244 |
|
| 1245 |
|
| 1246 |
|
| 1247 |
|
| 1248 |
|
| 1249 |
|
| 1250 |
|
| 1251 |
|
| 1252 |
|
| 1253 |
|
| 1254 |
|
| 1255 |
|
| 1256 |
|
| 1257 |
|
| 1258 |
|
| 1259 |
|
| 1260 |
|
| 1261 |
|
| 1262 |
|
| 1263 |
|
| 1264 |
void |
| 1265 |
TkpInitializeMenuBindings(interp, bindingTable) |
| 1266 |
Tcl_Interp *interp; |
| 1267 |
Tk_BindingTable bindingTable; |
| 1268 |
{ |
| 1269 |
|
| 1270 |
|
| 1271 |
|
| 1272 |
} |
| 1273 |
|
| 1274 |
|
| 1275 |
|
| 1276 |
|
| 1277 |
|
| 1278 |
|
| 1279 |
|
| 1280 |
|
| 1281 |
|
| 1282 |
|
| 1283 |
|
| 1284 |
|
| 1285 |
|
| 1286 |
|
| 1287 |
|
| 1288 |
|
| 1289 |
|
| 1290 |
|
| 1291 |
|
| 1292 |
static void |
| 1293 |
SetHelpMenu(menuPtr) |
| 1294 |
TkMenu *menuPtr; |
| 1295 |
{ |
| 1296 |
TkMenuEntry *cascadeEntryPtr; |
| 1297 |
|
| 1298 |
for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr; |
| 1299 |
cascadeEntryPtr != NULL; |
| 1300 |
cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) { |
| 1301 |
if ((cascadeEntryPtr->menuPtr->menuType == MENUBAR) |
| 1302 |
&& (cascadeEntryPtr->menuPtr->masterMenuPtr->tkwin != NULL) |
| 1303 |
&& (menuPtr->masterMenuPtr->tkwin != NULL)) { |
| 1304 |
TkMenu *masterMenuPtr = cascadeEntryPtr->menuPtr->masterMenuPtr; |
| 1305 |
char *helpMenuName = ckalloc(strlen(Tk_PathName( |
| 1306 |
masterMenuPtr->tkwin)) + strlen(".help") + 1); |
| 1307 |
|
| 1308 |
strcpy(helpMenuName, Tk_PathName(masterMenuPtr->tkwin)); |
| 1309 |
strcat(helpMenuName, ".help"); |
| 1310 |
if (strcmp(helpMenuName, |
| 1311 |
Tk_PathName(menuPtr->masterMenuPtr->tkwin)) == 0) { |
| 1312 |
cascadeEntryPtr->entryFlags |= ENTRY_HELP_MENU; |
| 1313 |
} else { |
| 1314 |
cascadeEntryPtr->entryFlags &= ~ENTRY_HELP_MENU; |
| 1315 |
} |
| 1316 |
ckfree(helpMenuName); |
| 1317 |
} |
| 1318 |
} |
| 1319 |
} |
| 1320 |
|
| 1321 |
|
| 1322 |
|
| 1323 |
|
| 1324 |
|
| 1325 |
|
| 1326 |
|
| 1327 |
|
| 1328 |
|
| 1329 |
|
| 1330 |
|
| 1331 |
|
| 1332 |
|
| 1333 |
|
| 1334 |
|
| 1335 |
|
| 1336 |
|
| 1337 |
|
| 1338 |
void |
| 1339 |
TkpDrawMenuEntry(mePtr, d, tkfont, menuMetricsPtr, x, y, width, height, |
| 1340 |
strictMotif, drawArrow) |
| 1341 |
TkMenuEntry *mePtr; |
| 1342 |
Drawable d; |
| 1343 |
Tk_Font tkfont; |
| 1344 |
CONST Tk_FontMetrics *menuMetricsPtr; |
| 1345 |
|
| 1346 |
int x; |
| 1347 |
int y; |
| 1348 |
int width; |
| 1349 |
int height; |
| 1350 |
int strictMotif; |
| 1351 |
int drawArrow; |
| 1352 |
|
| 1353 |
|
| 1354 |
{ |
| 1355 |
GC gc, indicatorGC; |
| 1356 |
TkMenu *menuPtr = mePtr->menuPtr; |
| 1357 |
Tk_3DBorder bgBorder, activeBorder; |
| 1358 |
CONST Tk_FontMetrics *fmPtr; |
| 1359 |
Tk_FontMetrics entryMetrics; |
| 1360 |
int padY = (menuPtr->menuType == MENUBAR) ? 3 : 0; |
| 1361 |
int adjustedY = y + padY; |
| 1362 |
int adjustedHeight = height - 2 * padY; |
| 1363 |
|
| 1364 |
|
| 1365 |
|
| 1366 |
|
| 1367 |
|
| 1368 |
if ((mePtr->state == ENTRY_ACTIVE) && !strictMotif) { |
| 1369 |
gc = mePtr->activeGC; |
| 1370 |
if (gc == NULL) { |
| 1371 |
gc = menuPtr->activeGC; |
| 1372 |
} |
| 1373 |
} else { |
| 1374 |
TkMenuEntry *cascadeEntryPtr; |
| 1375 |
int parentDisabled = 0; |
| 1376 |
|
| 1377 |
for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr; |
| 1378 |
cascadeEntryPtr != NULL; |
| 1379 |
cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) { |
| 1380 |
if (cascadeEntryPtr->namePtr != NULL) { |
| 1381 |
char *name = Tcl_GetStringFromObj(cascadeEntryPtr->namePtr, |
| 1382 |
NULL); |
| 1383 |
|
| 1384 |
if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) { |
| 1385 |
if (cascadeEntryPtr->state == ENTRY_DISABLED) { |
| 1386 |
parentDisabled = 1; |
| 1387 |
} |
| 1388 |
break; |
| 1389 |
} |
| 1390 |
} |
| 1391 |
} |
| 1392 |
|
| 1393 |
if (((parentDisabled || (mePtr->state == ENTRY_DISABLED))) |
| 1394 |
&& (menuPtr->disabledFgPtr != NULL)) { |
| 1395 |
gc = mePtr->disabledGC; |
| 1396 |
if (gc == NULL) { |
| 1397 |
gc = menuPtr->disabledGC; |
| 1398 |
} |
| 1399 |
} else { |
| 1400 |
gc = mePtr->textGC; |
| 1401 |
if (gc == NULL) { |
| 1402 |
gc = menuPtr->textGC; |
| 1403 |
} |
| 1404 |
} |
| 1405 |
} |
| 1406 |
indicatorGC = mePtr->indicatorGC; |
| 1407 |
if (indicatorGC == NULL) { |
| 1408 |
indicatorGC = menuPtr->indicatorGC; |
| 1409 |
} |
| 1410 |
|
| 1411 |
bgBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin, |
| 1412 |
(mePtr->borderPtr == NULL) |
| 1413 |
? menuPtr->borderPtr : mePtr->borderPtr); |
| 1414 |
if (strictMotif) { |
| 1415 |
activeBorder = bgBorder; |
| 1416 |
} else { |
| 1417 |
activeBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin, |
| 1418 |
(mePtr->activeBorderPtr == NULL) |
| 1419 |
? menuPtr->activeBorderPtr : mePtr->activeBorderPtr); |
| 1420 |
} |
| 1421 |
|
| 1422 |
if (mePtr->fontPtr == NULL) { |
| 1423 |
fmPtr = menuMetricsPtr; |
| 1424 |
} else { |
| 1425 |
tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr); |
| 1426 |
Tk_GetFontMetrics(tkfont, &entryMetrics); |
| 1427 |
fmPtr = &entryMetrics; |
| 1428 |
} |
| 1429 |
|
| 1430 |
|
| 1431 |
|
| 1432 |
|
| 1433 |
|
| 1434 |
|
| 1435 |
|
| 1436 |
DrawMenuEntryBackground(menuPtr, mePtr, d, activeBorder, |
| 1437 |
bgBorder, x, y, width, height); |
| 1438 |
|
| 1439 |
if (mePtr->type == SEPARATOR_ENTRY) { |
| 1440 |
DrawMenuSeparator(menuPtr, mePtr, d, gc, tkfont, |
| 1441 |
fmPtr, x, adjustedY, width, adjustedHeight); |
| 1442 |
} else if (mePtr->type == TEAROFF_ENTRY) { |
| 1443 |
DrawTearoffEntry(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, adjustedY, |
| 1444 |
width, adjustedHeight); |
| 1445 |
} else { |
| 1446 |
DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, adjustedY, |
| 1447 |
width, adjustedHeight); |
| 1448 |
DrawMenuEntryAccelerator(menuPtr, mePtr, d, gc, tkfont, fmPtr, |
| 1449 |
activeBorder, x, adjustedY, width, adjustedHeight, drawArrow); |
| 1450 |
if (!mePtr->hideMargin) { |
| 1451 |
DrawMenuEntryIndicator(menuPtr, mePtr, d, gc, indicatorGC, tkfont, |
| 1452 |
fmPtr, x, adjustedY, width, adjustedHeight); |
| 1453 |
} |
| 1454 |
} |
| 1455 |
} |
| 1456 |
|
| 1457 |
|
| 1458 |
|
| 1459 |
|
| 1460 |
|
| 1461 |
|
| 1462 |
|
| 1463 |
|
| 1464 |
|
| 1465 |
|
| 1466 |
|
| 1467 |
|
| 1468 |
|
| 1469 |
|
| 1470 |
|
| 1471 |
|
| 1472 |
|
| 1473 |
|
| 1474 |
static void |
| 1475 |
GetMenuLabelGeometry(mePtr, tkfont, fmPtr, widthPtr, heightPtr) |
| 1476 |
TkMenuEntry *mePtr; |
| 1477 |
Tk_Font tkfont; |
| 1478 |
CONST Tk_FontMetrics *fmPtr; |
| 1479 |
int *widthPtr; |
| 1480 |
|
| 1481 |
int *heightPtr; |
| 1482 |
|
| 1483 |
{ |
| 1484 |
TkMenu *menuPtr = mePtr->menuPtr; |
| 1485 |
int haveImage = 0; |
| 1486 |
|
| 1487 |
if (mePtr->image != NULL) { |
| 1488 |
Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr); |
| 1489 |
haveImage = 1; |
| 1490 |
} else if (mePtr->bitmapPtr != NULL) { |
| 1491 |
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr); |
| 1492 |
Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr); |
| 1493 |
haveImage = 1; |
| 1494 |
} else { |
| 1495 |
*heightPtr = 0; |
| 1496 |
*widthPtr = 0; |
| 1497 |
} |
| 1498 |
|
| 1499 |
if (haveImage && (mePtr->compound == COMPOUND_NONE)) { |
| 1500 |
|
| 1501 |
} else { |
| 1502 |
|
| 1503 |
if (mePtr->labelPtr != NULL) { |
| 1504 |
int textWidth; |
| 1505 |
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL); |
| 1506 |
textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength); |
| 1507 |
|
| 1508 |
if ((mePtr->compound != COMPOUND_NONE) && haveImage) { |
| 1509 |
switch ((enum compound) mePtr->compound) { |
| 1510 |
case COMPOUND_TOP: |
| 1511 |
case COMPOUND_BOTTOM: { |
| 1512 |
if (textWidth > *widthPtr) { |
| 1513 |
*widthPtr = textWidth; |
| 1514 |
} |
| 1515 |
|
| 1516 |
*heightPtr += fmPtr->linespace + 2; |
| 1517 |
break; |
| 1518 |
} |
| 1519 |
case COMPOUND_LEFT: |
| 1520 |
case COMPOUND_RIGHT: { |
| 1521 |
if (fmPtr->linespace > *heightPtr) { |
| 1522 |
*heightPtr = fmPtr->linespace; |
| 1523 |
} |
| 1524 |
|
| 1525 |
*widthPtr += textWidth + 2; |
| 1526 |
break; |
| 1527 |
} |
| 1528 |
case COMPOUND_CENTER: { |
| 1529 |
if (fmPtr->linespace > *heightPtr) { |
| 1530 |
*heightPtr = fmPtr->linespace; |
| 1531 |
} |
| 1532 |
if (textWidth > *widthPtr) { |
| 1533 |
*widthPtr = textWidth; |
| 1534 |
} |
| 1535 |
break; |
| 1536 |
} |
| 1537 |
case COMPOUND_NONE: {break;} |
| 1538 |
} |
| 1539 |
} else { |
| 1540 |
|
| 1541 |
*heightPtr = fmPtr->linespace; |
| 1542 |
*widthPtr = textWidth; |
| 1543 |
} |
| 1544 |
} else { |
| 1545 |
|
| 1546 |
*heightPtr = fmPtr->linespace; |
| 1547 |
} |
| 1548 |
} |
| 1549 |
*heightPtr += 1; |
| 1550 |
} |
| 1551 |
|
| 1552 |
|
| 1553 |
|
| 1554 |
|
| 1555 |
|
| 1556 |
|
| 1557 |
|
| 1558 |
|
| 1559 |
|
| 1560 |
|
| 1561 |
|
| 1562 |
|
| 1563 |
|
| 1564 |
|
| 1565 |
|
| 1566 |
|
| 1567 |
|
| 1568 |
|
| 1569 |
|
| 1570 |
|
| 1571 |
void |
| 1572 |
TkpComputeStandardMenuGeometry( |
| 1573 |
menuPtr) |
| 1574 |
TkMenu *menuPtr; |
| 1575 |
{ |
| 1576 |
Tk_Font tkfont, menuFont; |
| 1577 |
Tk_FontMetrics menuMetrics, entryMetrics, *fmPtr; |
| 1578 |
int x, y, height, width, indicatorSpace, labelWidth, accelWidth; |
| 1579 |
int windowWidth, windowHeight, accelSpace; |
| 1580 |
int i, j, lastColumnBreak = 0; |
| 1581 |
TkMenuEntry *mePtr; |
| 1582 |
int borderWidth, activeBorderWidth; |
| 1583 |
|
| 1584 |
if (menuPtr->tkwin == NULL) { |
| 1585 |
return; |
| 1586 |
} |
| 1587 |
|
| 1588 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, |
| 1589 |
&borderWidth); |
| 1590 |
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, |
| 1591 |
&activeBorderWidth); |
| 1592 |
x = y = borderWidth; |
| 1593 |
indicatorSpace = labelWidth = accelWidth = 0; |
| 1594 |
windowHeight = windowWidth = 0; |
| 1595 |
|
| 1596 |
|
| 1597 |
|
| 1598 |
|
| 1599 |
|
| 1600 |
|
| 1601 |
|
| 1602 |
|
| 1603 |
|
| 1604 |
|
| 1605 |
|
| 1606 |
|
| 1607 |
menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr); |
| 1608 |
Tk_GetFontMetrics(menuFont, &menuMetrics); |
| 1609 |
accelSpace = Tk_TextWidth(menuFont, "M", 1); |
| 1610 |
|
| 1611 |
for (i = 0; i < menuPtr->numEntries; i++) { |
| 1612 |
mePtr = menuPtr->entries[i]; |
| 1613 |
if (mePtr->fontPtr == NULL) { |
| 1614 |
tkfont = menuFont; |
| 1615 |
fmPtr = &menuMetrics; |
| 1616 |
} else { |
| 1617 |
tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr); |
| 1618 |
Tk_GetFontMetrics(tkfont, &entryMetrics); |
| 1619 |
fmPtr = &entryMetrics; |
| 1620 |
} |
| 1621 |
|
| 1622 |
if ((i > 0) && mePtr->columnBreak) { |
| 1623 |
if (accelWidth != 0) { |
| 1624 |
labelWidth += accelSpace; |
| 1625 |
} |
| 1626 |
for (j = lastColumnBreak; j < i; j++) { |
| 1627 |
menuPtr->entries[j]->indicatorSpace = indicatorSpace; |
| 1628 |
menuPtr->entries[j]->labelWidth = labelWidth; |
| 1629 |
menuPtr->entries[j]->width = indicatorSpace + labelWidth |
| 1630 |
+ accelWidth + 2 * activeBorderWidth; |
| 1631 |
menuPtr->entries[j]->x = x; |
| 1632 |
menuPtr->entries[j]->entryFlags &= ~ENTRY_LAST_COLUMN; |
| 1633 |
} |
| 1634 |
x += indicatorSpace + labelWidth + accelWidth |
| 1635 |
+ 2 * activeBorderWidth; |
| 1636 |
windowWidth = x; |
| 1637 |
indicatorSpace = labelWidth = accelWidth = 0; |
| 1638 |
lastColumnBreak = i; |
| 1639 |
y = borderWidth; |
| 1640 |
} |
| 1641 |
|
| 1642 |
if (mePtr->type == SEPARATOR_ENTRY) { |
| 1643 |
GetMenuSeparatorGeometry(menuPtr, mePtr, tkfont, |
| 1644 |
fmPtr, &width, &height); |
| 1645 |
mePtr->height = height; |
| 1646 |
} else if (mePtr->type == TEAROFF_ENTRY) { |
| 1647 |
GetTearoffEntryGeometry(menuPtr, mePtr, tkfont, |
| 1648 |
fmPtr, &width, &height); |
| 1649 |
mePtr->height = height; |
| 1650 |
labelWidth = width; |
| 1651 |
} else { |
| 1652 |
|
| 1653 |
|
| 1654 |
|
| 1655 |
|
| 1656 |
|
| 1657 |
|
| 1658 |
|
| 1659 |
|
| 1660 |
|
| 1661 |
|
| 1662 |
|
| 1663 |
GetMenuLabelGeometry(mePtr, tkfont, fmPtr, &width, |
| 1664 |
&height); |
| 1665 |
mePtr->height = height; |
| 1666 |
if (!mePtr->hideMargin) { |
| 1667 |
width += MENU_MARGIN_WIDTH; |
| 1668 |
} |
| 1669 |
if (width > labelWidth) { |
| 1670 |
labelWidth = width; |
| 1671 |
} |
| 1672 |
|
| 1673 |
GetMenuAccelGeometry(menuPtr, mePtr, tkfont, |
| 1674 |
fmPtr, &width, &height); |
| 1675 |
if (height > mePtr->height) { |
| 1676 |
mePtr->height = height; |
| 1677 |
} |
| 1678 |
if (!mePtr->hideMargin) { |
| 1679 |
width += MENU_MARGIN_WIDTH; |
| 1680 |
} |
| 1681 |
if (width > accelWidth) { |
| 1682 |
accelWidth = width; |
| 1683 |
} |
| 1684 |
|
| 1685 |
GetMenuIndicatorGeometry(menuPtr, mePtr, tkfont, |
| 1686 |
fmPtr, &width, &height); |
| 1687 |
if (height > mePtr->height) { |
| 1688 |
mePtr->height = height; |
| 1689 |
} |
| 1690 |
if (!mePtr->hideMargin) { |
| 1691 |
width += MENU_MARGIN_WIDTH; |
| 1692 |
} |
| 1693 |
if (width > indicatorSpace) { |
| 1694 |
indicatorSpace = width; |
| 1695 |
} |
| 1696 |
|
| 1697 |
mePtr->height += 2 * activeBorderWidth + MENU_DIVIDER_HEIGHT; |
| 1698 |
} |
| 1699 |
mePtr->y = y; |
| 1700 |
y += mePtr->height; |
| 1701 |
if (y > windowHeight) { |
| 1702 |
windowHeight = y; |
| 1703 |
} |
| 1704 |
} |
| 1705 |
|
| 1706 |
if (accelWidth != 0) { |
| 1707 |
labelWidth += accelSpace; |
| 1708 |
} |
| 1709 |
for (j = lastColumnBreak; j < menuPtr->numEntries; j++) { |
| 1710 |
menuPtr->entries[j]->indicatorSpace = indicatorSpace; |
| 1711 |
menuPtr->entries[j]->labelWidth = labelWidth; |
| 1712 |
menuPtr->entries[j]->width = indicatorSpace + labelWidth |
| 1713 |
+ accelWidth + 2 * activeBorderWidth; |
| 1714 |
menuPtr->entries[j]->x = x; |
| 1715 |
menuPtr->entries[j]->entryFlags |= ENTRY_LAST_COLUMN; |
| 1716 |
} |
| 1717 |
windowWidth = x + indicatorSpace + labelWidth + accelWidth |
| 1718 |
+ 2 * activeBorderWidth + 2 * borderWidth; |
| 1719 |
|
| 1720 |
|
| 1721 |
windowHeight += borderWidth; |
| 1722 |
|
| 1723 |
|
| 1724 |
|
| 1725 |
|
| 1726 |
|
| 1727 |
|
| 1728 |
if (windowWidth <= 0) { |
| 1729 |
windowWidth = 1; |
| 1730 |
} |
| 1731 |
if (windowHeight <= 0) { |
| 1732 |
windowHeight = 1; |
| 1733 |
} |
| 1734 |
menuPtr->totalWidth = windowWidth; |
| 1735 |
menuPtr->totalHeight = windowHeight; |
| 1736 |
} |
| 1737 |
|
| 1738 |
|
| 1739 |
|
| 1740 |
|
| 1741 |
|
| 1742 |
|
| 1743 |
|
| 1744 |
|
| 1745 |
|
| 1746 |
|
| 1747 |
|
| 1748 |
|
| 1749 |
|
| 1750 |
|
| 1751 |
|
| 1752 |
|
| 1753 |
|
| 1754 |
|
| 1755 |
|
| 1756 |
void |
| 1757 |
TkpMenuNotifyToplevelCreate(interp, menuName) |
| 1758 |
Tcl_Interp *interp; |
| 1759 |
char *menuName; |
| 1760 |
|
| 1761 |
{ |
| 1762 |
|
| 1763 |
|
| 1764 |
|
| 1765 |
} |
| 1766 |
|
| 1767 |
|
| 1768 |
|
| 1769 |
|
| 1770 |
|
| 1771 |
|
| 1772 |
|
| 1773 |
|
| 1774 |
|
| 1775 |
|
| 1776 |
|
| 1777 |
|
| 1778 |
|
| 1779 |
|
| 1780 |
|
| 1781 |
|
| 1782 |
|
| 1783 |
void |
| 1784 |
TkpMenuInit() |
| 1785 |
{ |
| 1786 |
|
| 1787 |
|
| 1788 |
|
| 1789 |
} |
| 1790 |
|
| 1791 |
|
| 1792 |
|
| 1793 |
|
| 1794 |
|
| 1795 |
|
| 1796 |
|
| 1797 |
|
| 1798 |
|
| 1799 |
|
| 1800 |
|
| 1801 |
|
| 1802 |
|
| 1803 |
|
| 1804 |
|
| 1805 |
|
| 1806 |
|
| 1807 |
|
| 1808 |
|
| 1809 |
void |
| 1810 |
TkpMenuThreadInit() |
| 1811 |
{ |
| 1812 |
|
| 1813 |
|
| 1814 |
|
| 1815 |
} |
| 1816 |
|
| 1817 |
|