Changeset 244
- Timestamp:
- May 21, 2020, 6:42:45 PM (5 years ago)
- Location:
- branches/highdpi
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/Diagram.lfm
r210 r244 38 38 ButtonIndex = 15 39 39 end 40 object Popup: T PopupMenu40 object Popup: TDpiPopupMenu 41 41 Left = 16 42 42 Top = 48 -
branches/highdpi/LocalPlayer/Diagram.pas
r210 r244 12 12 CloseBtn: TButtonB; 13 13 ToggleBtn: TButtonB; 14 Popup: T PopupMenu;14 Popup: TDpiPopupMenu; 15 15 procedure CloseBtnClick(Sender: TObject); 16 16 procedure FormPaint(Sender: TObject); … … 330 330 var 331 331 p1: integer; 332 m: T MenuItem;332 m: TDpiMenuItem; 333 333 begin 334 334 if Kind = dkChart then … … 345 345 MyRO.Ship[p1].Parts[spHab] > 0 then 346 346 begin 347 m := T MenuItem.Create(Popup);347 m := TDpiMenuItem.Create(Popup); 348 348 m.RadioItem := true; 349 349 m.Caption := Tribe[p1].TPhrase('SHORTNAME'); -
branches/highdpi/LocalPlayer/Enhance.pas
r210 r244 15 15 16 16 TEnhanceDlg = class(TFramedDlg) 17 MenuItem1: T MenuItem;17 MenuItem1: TDpiMenuItem; 18 18 ToggleBtn: TButtonB; 19 19 CloseBtn: TButtonB; … … 26 26 job6: TButtonC; 27 27 job9: TButtonC; 28 Popup: T PopupMenu;28 Popup: TDpiPopupMenu; 29 29 procedure FormCreate(Sender: TObject); 30 30 procedure FormPaint(Sender: TObject); … … 54 54 var 55 55 TerrType: integer; 56 m: T MenuItem;56 m: TDpiMenuItem; 57 57 begin 58 58 inherited; … … 67 67 if TerrType <> fJungle then 68 68 begin 69 m := T MenuItem.Create(Popup);69 m := TDpiMenuItem.Create(Popup); 70 70 m.RadioItem := true; 71 71 if TerrType = fGrass then -
branches/highdpi/LocalPlayer/NatStat.lfm
r210 r244 77 77 ButtonIndex = 0 78 78 end 79 object Popup: T PopupMenu79 object Popup: TDpiPopupMenu 80 80 Left = 16 81 81 Top = 48 -
branches/highdpi/LocalPlayer/NatStat.pas
r210 r244 16 16 ToggleBtn: TButtonB; 17 17 CloseBtn: TButtonB; 18 Popup: T PopupMenu;18 Popup: TDpiPopupMenu; 19 19 ScrollUpBtn: TButtonC; 20 20 ScrollDownBtn: TButtonC; … … 435 435 var 436 436 p1, StartCount: integer; 437 m: T MenuItem;437 m: TDpiMenuItem; 438 438 ExtinctPart: boolean; 439 439 begin … … 443 443 if G.Difficulty[me] <> 0 then 444 444 begin 445 m := T MenuItem.Create(Popup);445 m := TDpiMenuItem.Create(Popup); 446 446 m.RadioItem := true; 447 447 m.Caption := Tribe[me].TPhrase('TITLE_NATION'); … … 462 462 (1 shl p1 and MyRO.Alive <> 0) and (MyRO.Treaty[p1] >= trNone) then 463 463 begin 464 m := T MenuItem.Create(Popup);464 m := TDpiMenuItem.Create(Popup); 465 465 m.RadioItem := true; 466 466 m.Caption := Tribe[p1].TPhrase('TITLE_NATION'); … … 475 475 if (StartCount > 0) and (Popup.Items.Count > StartCount) then 476 476 begin // seperator 477 m := T MenuItem.Create(Popup);477 m := TDpiMenuItem.Create(Popup); 478 478 m.Caption := '-'; 479 479 Popup.Items.Insert(StartCount, m); -
branches/highdpi/LocalPlayer/Select.lfm
r210 r244 75 75 ButtonIndex = 15 76 76 end 77 object Popup: T PopupMenu77 object Popup: TDpiPopupMenu 78 78 Left = 16 79 79 Top = 48 -
branches/highdpi/LocalPlayer/Select.pas
r210 r244 27 27 Layer0Btn: TButtonB; 28 28 ToggleBtn: TButtonB; 29 Popup: T PopupMenu;29 Popup: TDpiPopupMenu; 30 30 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; 31 31 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); … … 1773 1773 var 1774 1774 p1: integer; 1775 m: T MenuItem;1775 m: TDpiMenuItem; 1776 1776 begin 1777 1777 case Kind of … … 1796 1796 if G.Difficulty[me] > 0 then 1797 1797 begin 1798 m := T MenuItem.Create(Popup);1798 m := TDpiMenuItem.Create(Popup); 1799 1799 m.RadioItem := true; 1800 1800 m.Caption := Tribe[me].TPhrase('SHORTNAME'); … … 1809 1809 (MyRO.EnemyReport[p1].TurnOfMilReport >= 0) then 1810 1810 begin 1811 m := T MenuItem.Create(Popup);1811 m := TDpiMenuItem.Create(Popup); 1812 1812 m.RadioItem := true; 1813 1813 m.Caption := Tribe[p1].TPhrase('SHORTNAME'); -
branches/highdpi/LocalPlayer/Term.lfm
r210 r244 219 219 top = 60 220 220 end 221 object GamePopup: T PopupMenu221 object GamePopup: TDpiPopupMenu 222 222 AutoPopup = False 223 223 left = 50 224 224 top = 60 225 object mHelp: T MenuItem225 object mHelp: TDpiMenuItem 226 226 Tag = 7 227 227 ShortCut = 112 228 228 OnClick = MenuClick 229 229 end 230 object mTechTree: T MenuItem230 object mTechTree: TDpiMenuItem 231 231 GroupIndex = 1 232 232 ShortCut = 84 233 233 OnClick = MenuClick 234 234 end 235 object N12: T MenuItem235 object N12: TDpiMenuItem 236 236 Caption = '-' 237 237 GroupIndex = 1 238 238 end 239 object mViewpoint: T MenuItem240 GroupIndex = 1 241 end 242 object mDebugMap: T MenuItem239 object mViewpoint: TDpiMenuItem 240 GroupIndex = 1 241 end 242 object mDebugMap: TDpiMenuItem 243 243 Tag = 49 244 244 GroupIndex = 1 245 245 ShortCut = 16459 246 246 end 247 object mOptions: T MenuItem247 object mOptions: TDpiMenuItem 248 248 Tag = 29 249 249 GroupIndex = 1 250 object mOwnMovement: T MenuItem250 object mOwnMovement: TDpiMenuItem 251 251 Tag = 30 252 252 GroupIndex = 1 253 253 RadioItem = True 254 object mSlowMoves: T MenuItem254 object mSlowMoves: TDpiMenuItem 255 255 Tag = 75 256 256 RadioItem = True 257 257 OnClick = Radio 258 258 end 259 object mFastMoves: T MenuItem259 object mFastMoves: TDpiMenuItem 260 260 Tag = 76 261 261 RadioItem = True 262 262 OnClick = Radio 263 263 end 264 object mVeryFastMoves: T MenuItem264 object mVeryFastMoves: TDpiMenuItem 265 265 Tag = 77 266 266 RadioItem = True 267 267 OnClick = Radio 268 268 end 269 object N7: T MenuItem269 object N7: TDpiMenuItem 270 270 Caption = '-' 271 271 end 272 object mEffectiveMovesOnly: T MenuItem272 object mEffectiveMovesOnly: TDpiMenuItem 273 273 Tag = 95 274 274 OnClick = Toggle 275 275 end 276 276 end 277 object mAllyMovement: T MenuItem277 object mAllyMovement: TDpiMenuItem 278 278 Tag = 90 279 279 GroupIndex = 1 280 280 RadioItem = True 281 object mAlSlowMoves: T MenuItem281 object mAlSlowMoves: TDpiMenuItem 282 282 Tag = 91 283 283 RadioItem = True 284 284 OnClick = Radio 285 285 end 286 object mAlFastMoves: T MenuItem286 object mAlFastMoves: TDpiMenuItem 287 287 Tag = 92 288 288 RadioItem = True 289 289 OnClick = Radio 290 290 end 291 object mAlNoMoves: T MenuItem291 object mAlNoMoves: TDpiMenuItem 292 292 Tag = 93 293 293 RadioItem = True 294 294 OnClick = Radio 295 295 end 296 object N8: T MenuItem296 object N8: TDpiMenuItem 297 297 Caption = '-' 298 298 end 299 object mAlEffectiveMovesOnly: T MenuItem299 object mAlEffectiveMovesOnly: TDpiMenuItem 300 300 Tag = 94 301 301 OnClick = Toggle 302 302 end 303 303 end 304 object mEnemyMovement: T MenuItem304 object mEnemyMovement: TDpiMenuItem 305 305 Tag = 74 306 306 GroupIndex = 1 307 307 RadioItem = True 308 object mEnMoves: T MenuItem308 object mEnMoves: TDpiMenuItem 309 309 Tag = 78 310 310 RadioItem = True 311 311 OnClick = Radio 312 312 end 313 object mEnFastMoves: T MenuItem313 object mEnFastMoves: TDpiMenuItem 314 314 Tag = 79 315 315 RadioItem = True 316 316 OnClick = Radio 317 317 end 318 object mEnNoMoves: T MenuItem318 object mEnNoMoves: TDpiMenuItem 319 319 Tag = 53 320 320 RadioItem = True 321 321 OnClick = Radio 322 322 end 323 object N9: T MenuItem323 object N9: TDpiMenuItem 324 324 Caption = '-' 325 325 end 326 object mEnAttacks: T MenuItem326 object mEnAttacks: TDpiMenuItem 327 327 Tag = 52 328 328 OnClick = Toggle 329 329 end 330 330 end 331 object N11: T MenuItem331 object N11: TDpiMenuItem 332 332 Caption = '-' 333 333 GroupIndex = 1 334 334 RadioItem = True 335 335 end 336 object mRepList: T MenuItem336 object mRepList: TDpiMenuItem 337 337 Tag = 65 338 338 GroupIndex = 1 … … 340 340 OnClick = Radio 341 341 end 342 object mRepScreens: T MenuItem342 object mRepScreens: TDpiMenuItem 343 343 Tag = 66 344 344 GroupIndex = 1 … … 346 346 OnClick = Radio 347 347 end 348 object mRep: T MenuItem348 object mRep: TDpiMenuItem 349 349 Tag = 34 350 350 GroupIndex = 1 351 object mRep0: T MenuItem352 OnClick = mRepClicked 353 end 354 object mRep1: T MenuItem351 object mRep0: TDpiMenuItem 352 OnClick = mRepClicked 353 end 354 object mRep1: TDpiMenuItem 355 355 Tag = 256 356 356 OnClick = mRepClicked 357 357 end 358 object mRep2: T MenuItem358 object mRep2: TDpiMenuItem 359 359 Tag = 512 360 360 OnClick = mRepClicked 361 361 end 362 object mRep3: T MenuItem362 object mRep3: TDpiMenuItem 363 363 Tag = 768 364 364 OnClick = mRepClicked 365 365 end 366 object mRep4: T MenuItem366 object mRep4: TDpiMenuItem 367 367 Tag = 1024 368 368 OnClick = mRepClicked 369 369 end 370 object mRep5: T MenuItem370 object mRep5: TDpiMenuItem 371 371 Tag = 1280 372 372 OnClick = mRepClicked 373 373 end 374 object mRep6: T MenuItem374 object mRep6: TDpiMenuItem 375 375 Tag = 1536 376 376 OnClick = mRepClicked 377 377 end 378 object mRep7: T MenuItem378 object mRep7: TDpiMenuItem 379 379 Tag = 1792 380 380 OnClick = mRepClicked 381 381 end 382 object mRep8: T MenuItem382 object mRep8: TDpiMenuItem 383 383 Tag = 2048 384 384 OnClick = mRepClicked 385 385 end 386 object mRep9: T MenuItem386 object mRep9: TDpiMenuItem 387 387 Tag = 2304 388 388 OnClick = mRepClicked 389 389 end 390 object mRep10: T MenuItem390 object mRep10: TDpiMenuItem 391 391 Tag = 2560 392 392 OnClick = mRepClicked 393 393 end 394 object mRep11: T MenuItem394 object mRep11: TDpiMenuItem 395 395 Tag = 2816 396 396 OnClick = mRepClicked 397 397 end 398 object mRep12: T MenuItem398 object mRep12: TDpiMenuItem 399 399 Tag = 3072 400 400 OnClick = mRepClicked 401 401 end 402 object mRep13: T MenuItem402 object mRep13: TDpiMenuItem 403 403 Tag = 3328 404 404 OnClick = mRepClicked 405 405 end 406 object mRep14: T MenuItem406 object mRep14: TDpiMenuItem 407 407 Tag = 3584 408 408 OnClick = mRepClicked 409 409 end 410 object mRep15: T MenuItem410 object mRep15: TDpiMenuItem 411 411 Tag = 3840 412 412 OnClick = mRepClicked 413 413 end 414 414 end 415 object N10: T MenuItem415 object N10: TDpiMenuItem 416 416 Caption = '-' 417 417 GroupIndex = 1 418 418 end 419 object mWaitTurn: T MenuItem419 object mWaitTurn: TDpiMenuItem 420 420 Tag = 32 421 421 GroupIndex = 1 422 422 OnClick = Toggle 423 423 end 424 object mScrolling: T MenuItem424 object mScrolling: TDpiMenuItem 425 425 Tag = 84 426 426 GroupIndex = 1 427 object mScrollSlow: T MenuItem427 object mScrollSlow: TDpiMenuItem 428 428 Tag = 85 429 429 RadioItem = True 430 430 OnClick = Radio 431 431 end 432 object mScrollFast: T MenuItem432 object mScrollFast: TDpiMenuItem 433 433 Tag = 86 434 434 RadioItem = True 435 435 OnClick = Radio 436 436 end 437 object mScrollOff: T MenuItem437 object mScrollOff: TDpiMenuItem 438 438 Tag = 87 439 439 RadioItem = True … … 441 441 end 442 442 end 443 object mTileSize: T MenuItem443 object mTileSize: TDpiMenuItem 444 444 Tag = 96 445 445 GroupIndex = 1 446 object mSmallTiles: T MenuItem446 object mSmallTiles: TDpiMenuItem 447 447 Caption = '40px' 448 448 RadioItem = True 449 449 OnClick = mSmallTilesClick 450 450 end 451 object mNormalTiles: T MenuItem451 object mNormalTiles: TDpiMenuItem 452 452 Caption = '60px' 453 453 RadioItem = True 454 454 OnClick = mNormalTilesClick 455 455 end 456 object mBigTiles: T MenuItem456 object mBigTiles: TDpiMenuItem 457 457 Caption = '90px' 458 458 RadioItem = True … … 460 460 end 461 461 end 462 object mSound: T MenuItem462 object mSound: TDpiMenuItem 463 463 Tag = 80 464 464 GroupIndex = 1 465 object mSoundOn: T MenuItem465 object mSoundOn: TDpiMenuItem 466 466 Tag = 82 467 467 RadioItem = True 468 468 OnClick = mSoundOnClick 469 469 end 470 object mSoundOnAlt: T MenuItem470 object mSoundOnAlt: TDpiMenuItem 471 471 Tag = 83 472 472 RadioItem = True … … 474 474 OnClick = mSoundOnAltClick 475 475 end 476 object mSoundOff: T MenuItem476 object mSoundOff: TDpiMenuItem 477 477 Tag = 81 478 478 RadioItem = True … … 480 480 end 481 481 end 482 object N6: T MenuItem482 object N6: TDpiMenuItem 483 483 Caption = '-' 484 484 GroupIndex = 1 485 485 end 486 object mTest: T MenuItem486 object mTest: TDpiMenuItem 487 487 Tag = 8 488 488 GroupIndex = 1 489 object mJump: T MenuItem489 object mJump: TDpiMenuItem 490 490 Tag = 54 491 491 ShortCut = 16458 492 492 OnClick = MenuClick 493 493 end 494 object mRun: T MenuItem494 object mRun: TDpiMenuItem 495 495 Tag = 63 496 496 ShortCut = 16466 497 497 OnClick = MenuClick 498 498 end 499 object mNames: T MenuItem499 object mNames: TDpiMenuItem 500 500 Tag = 67 501 501 ShortCut = 16462 502 502 OnClick = mNamesClick 503 503 end 504 object mLocCodes: T MenuItem504 object mLocCodes: TDpiMenuItem 505 505 Tag = 27 506 506 ShortCut = 16460 507 507 OnClick = mShowClick 508 508 end 509 object mLog: T MenuItem509 object mLog: TDpiMenuItem 510 510 Tag = 10 511 511 ShortCut = 16461 … … 514 514 end 515 515 end 516 object mManip: T MenuItem516 object mManip: TDpiMenuItem 517 517 Tag = 56 518 518 GroupIndex = 1 519 object mManip0: T MenuItem519 object mManip0: TDpiMenuItem 520 520 Tag = 57 521 521 OnClick = mManipClick 522 522 end 523 object mManip1: T MenuItem523 object mManip1: TDpiMenuItem 524 524 Tag = 314 525 525 OnClick = mManipClick 526 526 end 527 object mManip2: T MenuItem527 object mManip2: TDpiMenuItem 528 528 Tag = 571 529 529 OnClick = mManipClick 530 530 end 531 object mManip3: T MenuItem531 object mManip3: TDpiMenuItem 532 532 Tag = 828 533 533 OnClick = mManipClick 534 534 end 535 object mManip4: T MenuItem535 object mManip4: TDpiMenuItem 536 536 Tag = 1085 537 537 OnClick = mManipClick 538 538 end 539 object mManip5: T MenuItem539 object mManip5: TDpiMenuItem 540 540 Tag = 1342 541 541 OnClick = mManipClick 542 542 end 543 object mManip6: T MenuItem543 object mManip6: TDpiMenuItem 544 544 Tag = 1604 545 545 OnClick = mManipClick 546 546 end 547 547 end 548 object mMacro: T MenuItem548 object mMacro: TDpiMenuItem 549 549 Tag = 42 550 550 GroupIndex = 1 551 object mEnhanceDef: T MenuItem551 object mEnhanceDef: TDpiMenuItem 552 552 Tag = 40 553 553 OnClick = MenuClick 554 554 end 555 object mCityTypes: T MenuItem555 object mCityTypes: TDpiMenuItem 556 556 Tag = 11 557 557 OnClick = MenuClick 558 558 end 559 559 end 560 object mRandomMap: T MenuItem560 object mRandomMap: TDpiMenuItem 561 561 Tag = 71 562 562 GroupIndex = 1 … … 564 564 OnClick = MenuClick 565 565 end 566 object N3: T MenuItem566 object N3: TDpiMenuItem 567 567 Caption = '-' 568 568 GroupIndex = 1 569 569 end 570 object mWebsite: T MenuItem570 object mWebsite: TDpiMenuItem 571 571 Tag = 88 572 572 GroupIndex = 1 573 573 OnClick = MenuClick 574 574 end 575 object N2: T MenuItem575 object N2: TDpiMenuItem 576 576 Caption = '-' 577 577 GroupIndex = 1 578 578 end 579 object mResign: T MenuItem579 object mResign: TDpiMenuItem 580 580 Tag = 2 581 581 GroupIndex = 1 … … 584 584 end 585 585 end 586 object UnitPopup: T PopupMenu586 object UnitPopup: TDpiPopupMenu 587 587 AutoPopup = False 588 588 left = 130 589 589 top = 60 590 object mdisband: T MenuItem590 object mdisband: TDpiMenuItem 591 591 Tag = 72 592 592 ShortCut = 16452 593 593 OnClick = MenuClick 594 594 end 595 object mUtilize: T MenuItem595 object mUtilize: TDpiMenuItem 596 596 ShortCut = 90 597 597 OnClick = MenuClick 598 598 end 599 object N1: T MenuItem599 object N1: TDpiMenuItem 600 600 Caption = '-' 601 601 end 602 object mcity: T MenuItem602 object mcity: TDpiMenuItem 603 603 ShortCut = 66 604 604 OnClick = MenuClick 605 605 end 606 object mPillage: T MenuItem606 object mPillage: TDpiMenuItem 607 607 Tag = 19 608 608 ShortCut = 16464 609 609 OnClick = MenuClick 610 610 end 611 object N5: T MenuItem611 object N5: TDpiMenuItem 612 612 Caption = '-' 613 613 end 614 object mhome: T MenuItem614 object mhome: TDpiMenuItem 615 615 ShortCut = 72 616 616 OnClick = MenuClick 617 617 end 618 object mLoad: T MenuItem618 object mLoad: TDpiMenuItem 619 619 Tag = 24 620 620 ShortCut = 76 621 621 OnClick = MenuClick 622 622 end 623 object mUnload: T MenuItem623 object mUnload: TDpiMenuItem 624 624 Tag = 70 625 625 ShortCut = 85 626 626 OnClick = MenuClick 627 627 end 628 object mSelectTransport: T MenuItem628 object mSelectTransport: TDpiMenuItem 629 629 Tag = 73 630 630 ShortCut = 16468 631 631 OnClick = MenuClick 632 632 end 633 object mGoOn: T MenuItem633 object mGoOn: TDpiMenuItem 634 634 Tag = 13 635 635 ShortCut = 71 636 636 OnClick = MenuClick 637 637 end 638 object mCancel: T MenuItem638 object mCancel: TDpiMenuItem 639 639 Tag = 1 640 640 ShortCut = 16451 641 641 OnClick = MenuClick 642 642 end 643 object mRecover: T MenuItem643 object mRecover: TDpiMenuItem 644 644 Tag = 69 645 645 ShortCut = 86 646 646 OnClick = MenuClick 647 647 end 648 object mwait: T MenuItem648 object mwait: TDpiMenuItem 649 649 Tag = 25 650 650 ShortCut = 87 651 651 OnClick = MenuClick 652 652 end 653 object mnoorders: T MenuItem653 object mnoorders: TDpiMenuItem 654 654 Tag = 26 655 655 ShortCut = 32 656 656 OnClick = MenuClick 657 657 end 658 object mstay: T MenuItem658 object mstay: TDpiMenuItem 659 659 Tag = 22 660 660 ShortCut = 83 661 661 OnClick = MenuClick 662 662 end 663 object mCentre: T MenuItem663 object mCentre: TDpiMenuItem 664 664 Tag = 12 665 665 ShortCut = 67 … … 667 667 end 668 668 end 669 object StatPopup: T PopupMenu669 object StatPopup: TDpiPopupMenu 670 670 AutoPopup = False 671 671 left = 90 672 672 top = 60 673 object mUnitStat: T MenuItem673 object mUnitStat: TDpiMenuItem 674 674 Tag = 9 675 675 ShortCut = 113 676 676 OnClick = MenuClick 677 677 end 678 object mCityStat: T MenuItem678 object mCityStat: TDpiMenuItem 679 679 Tag = 37 680 680 ShortCut = 114 681 681 OnClick = MenuClick 682 682 end 683 object mScienceStat: T MenuItem683 object mScienceStat: TDpiMenuItem 684 684 Tag = 38 685 685 ShortCut = 115 686 686 OnClick = MenuClick 687 687 end 688 object mEUnitStat: T MenuItem688 object mEUnitStat: TDpiMenuItem 689 689 Tag = 50 690 690 ShortCut = 116 691 691 OnClick = MenuClick 692 692 end 693 object mDiagram: T MenuItem693 object mDiagram: TDpiMenuItem 694 694 Tag = 21 695 695 ShortCut = 117 696 696 OnClick = MenuClick 697 697 end 698 object mWonders: T MenuItem698 object mWonders: TDpiMenuItem 699 699 Tag = 6 700 700 ShortCut = 118 701 701 OnClick = MenuClick 702 702 end 703 object mShips: T MenuItem703 object mShips: TDpiMenuItem 704 704 Tag = 41 705 705 ShortCut = 119 706 706 OnClick = MenuClick 707 707 end 708 object N4: T MenuItem708 object N4: TDpiMenuItem 709 709 Caption = '-' 710 710 end 711 object mNations: T MenuItem711 object mNations: TDpiMenuItem 712 712 Tag = 55 713 713 ShortCut = 120 714 714 OnClick = MenuClick 715 715 end 716 object mEmpire: T MenuItem716 object mEmpire: TDpiMenuItem 717 717 Tag = 3 718 718 ShortCut = 121 719 719 OnClick = MenuClick 720 720 end 721 object mRevolution: T MenuItem721 object mRevolution: TDpiMenuItem 722 722 Tag = 89 723 723 OnClick = MenuClick 724 724 end 725 725 end 726 object EditPopup: T PopupMenu726 object EditPopup: TDpiPopupMenu 727 727 left = 210 728 728 top = 60 729 object mCreateUnit: T MenuItem729 object mCreateUnit: TDpiMenuItem 730 730 Tag = 47 731 731 end 732 732 end 733 object TerrainPopup: T PopupMenu733 object TerrainPopup: TDpiPopupMenu 734 734 left = 170 735 735 top = 60 736 object mtrans: T MenuItem736 object mtrans: TDpiMenuItem 737 737 Tag = 273 738 738 ShortCut = 79 739 739 OnClick = MenuClick 740 740 end 741 object mAfforest: T MenuItem741 object mAfforest: TDpiMenuItem 742 742 Tag = 301 743 743 ShortCut = 77 744 744 OnClick = MenuClick 745 745 end 746 object mClear: T MenuItem746 object mClear: TDpiMenuItem 747 747 Tag = 298 748 748 ShortCut = 73 749 749 OnClick = MenuClick 750 750 end 751 object mfort: T MenuItem751 object mfort: TDpiMenuItem 752 752 Tag = 276 753 753 ShortCut = 70 754 754 OnClick = MenuClick 755 755 end 756 object mAirBase: T MenuItem756 object mAirBase: TDpiMenuItem 757 757 Tag = 272 758 758 ShortCut = 65 759 759 OnClick = MenuClick 760 760 end 761 object mCanal: T MenuItem761 object mCanal: TDpiMenuItem 762 762 Tag = 279 763 763 ShortCut = 78 764 764 OnClick = MenuClick 765 765 end 766 object mmine: T MenuItem766 object mmine: TDpiMenuItem 767 767 Tag = 302 768 768 ShortCut = 77 769 769 OnClick = MenuClick 770 770 end 771 object mFarm: T MenuItem771 object mFarm: TDpiMenuItem 772 772 Tag = 300 773 773 ShortCut = 73 774 774 OnClick = MenuClick 775 775 end 776 object mirrigation: T MenuItem776 object mirrigation: TDpiMenuItem 777 777 Tag = 299 778 778 ShortCut = 73 779 779 OnClick = MenuClick 780 780 end 781 object mrr: T MenuItem781 object mrr: TDpiMenuItem 782 782 Tag = 297 783 783 ShortCut = 82 784 784 OnClick = MenuClick 785 785 end 786 object mroad: T MenuItem786 object mroad: TDpiMenuItem 787 787 Tag = 296 788 788 ShortCut = 82 789 789 OnClick = MenuClick 790 790 end 791 object mpollution: T MenuItem791 object mpollution: TDpiMenuItem 792 792 Tag = 274 793 793 ShortCut = 80 794 794 OnClick = MenuClick 795 795 end 796 object mEnhance: T MenuItem796 object mEnhance: TDpiMenuItem 797 797 Tag = 295 798 798 ShortCut = 69 -
branches/highdpi/LocalPlayer/Term.pas
r212 r244 26 26 27 27 TMainScreen = class(TDrawDlg) 28 mBigTiles: T MenuItem;28 mBigTiles: TDpiMenuItem; 29 29 Timer1: TTimer; 30 GamePopup: T PopupMenu;31 UnitPopup: T PopupMenu;32 mIrrigation: T MenuItem;33 mCity: T MenuItem;34 mRoad: T MenuItem;35 mMine: T MenuItem;36 mPollution: T MenuItem;37 mHome: T MenuItem;38 mStay: T MenuItem;39 mDisband: T MenuItem;40 mWait: T MenuItem;41 mNoOrders: T MenuItem;42 MTrans: T MenuItem;30 GamePopup: TDpiPopupMenu; 31 UnitPopup: TDpiPopupMenu; 32 mIrrigation: TDpiMenuItem; 33 mCity: TDpiMenuItem; 34 mRoad: TDpiMenuItem; 35 mMine: TDpiMenuItem; 36 mPollution: TDpiMenuItem; 37 mHome: TDpiMenuItem; 38 mStay: TDpiMenuItem; 39 mDisband: TDpiMenuItem; 40 mWait: TDpiMenuItem; 41 mNoOrders: TDpiMenuItem; 42 MTrans: TDpiMenuItem; 43 43 UnitBtn: TButtonB; 44 mResign: T MenuItem;45 mOptions: T MenuItem;46 mEnMoves: T MenuItem;47 mWaitTurn: T MenuItem;48 mRep: T MenuItem;49 mFort: T MenuItem;50 mCentre: T MenuItem;51 N1: T MenuItem;52 mAirBase: T MenuItem;53 N5: T MenuItem;54 mCityTypes: T MenuItem;55 mHelp: T MenuItem;56 mCanal: T MenuItem;57 mTest: T MenuItem;58 mLocCodes: T MenuItem;59 mLoad: T MenuItem;60 StatPopup: T PopupMenu;61 mCityStat: T MenuItem;62 mUnitStat: T MenuItem;63 mWonders: T MenuItem;64 mScienceStat: T MenuItem;65 mRR: T MenuItem;66 mClear: T MenuItem;67 mFarm: T MenuItem;68 mAfforest: T MenuItem;69 mRep0: T MenuItem;70 mRep1: T MenuItem;71 mRep2: T MenuItem;72 mRep3: T MenuItem;73 mRep4: T MenuItem;74 mRep5: T MenuItem;75 mRep7: T MenuItem;76 mRep8: T MenuItem;77 mRep9: T MenuItem;78 mRep15: T MenuItem;79 mCancel: T MenuItem;80 mLog: T MenuItem;81 mEUnitStat: T MenuItem;82 mRep10: T MenuItem;83 mEnAttacks: T MenuItem;84 mEnNoMoves: T MenuItem;85 mDiagram: T MenuItem;86 mJump: T MenuItem;87 mNations: T MenuItem;88 mManip: T MenuItem;89 mManip0: T MenuItem;90 mManip1: T MenuItem;91 mManip2: T MenuItem;92 mManip3: T MenuItem;93 mManip4: T MenuItem;94 mManip5: T MenuItem;95 mEnhanceDef: T MenuItem;96 mEnhance: T MenuItem;97 mShips: T MenuItem;98 mMacro: T MenuItem;99 mRun: T MenuItem;100 N10: T MenuItem;101 mRepList: T MenuItem;102 mRepScreens: T MenuItem;103 mRep11: T MenuItem;104 mNames: T MenuItem;105 mManip6: T MenuItem;106 mRep12: T MenuItem;107 mRandomMap: T MenuItem;108 mUnload: T MenuItem;109 mRecover: T MenuItem;44 mResign: TDpiMenuItem; 45 mOptions: TDpiMenuItem; 46 mEnMoves: TDpiMenuItem; 47 mWaitTurn: TDpiMenuItem; 48 mRep: TDpiMenuItem; 49 mFort: TDpiMenuItem; 50 mCentre: TDpiMenuItem; 51 N1: TDpiMenuItem; 52 mAirBase: TDpiMenuItem; 53 N5: TDpiMenuItem; 54 mCityTypes: TDpiMenuItem; 55 mHelp: TDpiMenuItem; 56 mCanal: TDpiMenuItem; 57 mTest: TDpiMenuItem; 58 mLocCodes: TDpiMenuItem; 59 mLoad: TDpiMenuItem; 60 StatPopup: TDpiPopupMenu; 61 mCityStat: TDpiMenuItem; 62 mUnitStat: TDpiMenuItem; 63 mWonders: TDpiMenuItem; 64 mScienceStat: TDpiMenuItem; 65 mRR: TDpiMenuItem; 66 mClear: TDpiMenuItem; 67 mFarm: TDpiMenuItem; 68 mAfforest: TDpiMenuItem; 69 mRep0: TDpiMenuItem; 70 mRep1: TDpiMenuItem; 71 mRep2: TDpiMenuItem; 72 mRep3: TDpiMenuItem; 73 mRep4: TDpiMenuItem; 74 mRep5: TDpiMenuItem; 75 mRep7: TDpiMenuItem; 76 mRep8: TDpiMenuItem; 77 mRep9: TDpiMenuItem; 78 mRep15: TDpiMenuItem; 79 mCancel: TDpiMenuItem; 80 mLog: TDpiMenuItem; 81 mEUnitStat: TDpiMenuItem; 82 mRep10: TDpiMenuItem; 83 mEnAttacks: TDpiMenuItem; 84 mEnNoMoves: TDpiMenuItem; 85 mDiagram: TDpiMenuItem; 86 mJump: TDpiMenuItem; 87 mNations: TDpiMenuItem; 88 mManip: TDpiMenuItem; 89 mManip0: TDpiMenuItem; 90 mManip1: TDpiMenuItem; 91 mManip2: TDpiMenuItem; 92 mManip3: TDpiMenuItem; 93 mManip4: TDpiMenuItem; 94 mManip5: TDpiMenuItem; 95 mEnhanceDef: TDpiMenuItem; 96 mEnhance: TDpiMenuItem; 97 mShips: TDpiMenuItem; 98 mMacro: TDpiMenuItem; 99 mRun: TDpiMenuItem; 100 N10: TDpiMenuItem; 101 mRepList: TDpiMenuItem; 102 mRepScreens: TDpiMenuItem; 103 mRep11: TDpiMenuItem; 104 mNames: TDpiMenuItem; 105 mManip6: TDpiMenuItem; 106 mRep12: TDpiMenuItem; 107 mRandomMap: TDpiMenuItem; 108 mUnload: TDpiMenuItem; 109 mRecover: TDpiMenuItem; 110 110 MapBtn0: TButtonC; 111 111 MapBtn1: TButtonC; 112 112 MapBtn4: TButtonC; 113 113 MapBtn5: TButtonC; 114 EditPopup: T PopupMenu;115 mCreateUnit: T MenuItem;114 EditPopup: TDpiPopupMenu; 115 mCreateUnit: TDpiMenuItem; 116 116 MapBtn6: TButtonC; 117 mDebugMap: T MenuItem;118 mUtilize: T MenuItem;119 mRep6: T MenuItem;120 mEnemyMovement: T MenuItem;121 mEnFastMoves: T MenuItem;122 mOwnMovement: T MenuItem;123 mSlowMoves: T MenuItem;124 mFastMoves: T MenuItem;125 mVeryFastMoves: T MenuItem;126 mGoOn: T MenuItem;127 mSound: T MenuItem;128 mSoundOn: T MenuItem;129 mSoundOnAlt: T MenuItem;130 mSoundOff: T MenuItem;131 N6: T MenuItem;117 mDebugMap: TDpiMenuItem; 118 mUtilize: TDpiMenuItem; 119 mRep6: TDpiMenuItem; 120 mEnemyMovement: TDpiMenuItem; 121 mEnFastMoves: TDpiMenuItem; 122 mOwnMovement: TDpiMenuItem; 123 mSlowMoves: TDpiMenuItem; 124 mFastMoves: TDpiMenuItem; 125 mVeryFastMoves: TDpiMenuItem; 126 mGoOn: TDpiMenuItem; 127 mSound: TDpiMenuItem; 128 mSoundOn: TDpiMenuItem; 129 mSoundOnAlt: TDpiMenuItem; 130 mSoundOff: TDpiMenuItem; 131 N6: TDpiMenuItem; 132 132 TerrainBtn: TButtonB; 133 TerrainPopup: T PopupMenu;134 mScrolling: T MenuItem;135 mScrollSlow: T MenuItem;136 mScrollFast: T MenuItem;137 mScrollOff: T MenuItem;138 mPillage: T MenuItem;139 mSelectTransport: T MenuItem;140 mEmpire: T MenuItem;141 N4: T MenuItem;142 N2: T MenuItem;143 mWebsite: T MenuItem;144 N3: T MenuItem;145 mRevolution: T MenuItem;146 mRep13: T MenuItem;133 TerrainPopup: TDpiPopupMenu; 134 mScrolling: TDpiMenuItem; 135 mScrollSlow: TDpiMenuItem; 136 mScrollFast: TDpiMenuItem; 137 mScrollOff: TDpiMenuItem; 138 mPillage: TDpiMenuItem; 139 mSelectTransport: TDpiMenuItem; 140 mEmpire: TDpiMenuItem; 141 N4: TDpiMenuItem; 142 N2: TDpiMenuItem; 143 mWebsite: TDpiMenuItem; 144 N3: TDpiMenuItem; 145 mRevolution: TDpiMenuItem; 146 mRep13: TDpiMenuItem; 147 147 UnitInfoBtn: TButtonB; 148 148 EOT: TEOTButton; 149 mAllyMovement: T MenuItem;150 mAlSlowMoves: T MenuItem;151 mAlFastMoves: T MenuItem;152 N7: T MenuItem;153 mEffectiveMovesOnly: T MenuItem;154 N8: T MenuItem;155 mAlEffectiveMovesOnly: T MenuItem;156 mAlNoMoves: T MenuItem;157 N9: T MenuItem;158 mViewpoint: T MenuItem;159 mTileSize: T MenuItem;160 mNormalTiles: T MenuItem;161 mSmallTiles: T MenuItem;162 N11: T MenuItem;149 mAllyMovement: TDpiMenuItem; 150 mAlSlowMoves: TDpiMenuItem; 151 mAlFastMoves: TDpiMenuItem; 152 N7: TDpiMenuItem; 153 mEffectiveMovesOnly: TDpiMenuItem; 154 N8: TDpiMenuItem; 155 mAlEffectiveMovesOnly: TDpiMenuItem; 156 mAlNoMoves: TDpiMenuItem; 157 N9: TDpiMenuItem; 158 mViewpoint: TDpiMenuItem; 159 mTileSize: TDpiMenuItem; 160 mNormalTiles: TDpiMenuItem; 161 mSmallTiles: TDpiMenuItem; 162 N11: TDpiMenuItem; 163 163 MenuArea: TArea; 164 164 TreasuryArea: TArea; 165 165 ResearchArea: TArea; 166 166 ManagementArea: TArea; 167 mTechTree: T MenuItem;167 mTechTree: TDpiMenuItem; 168 168 MovieSpeed1Btn: TButtonB; 169 169 MovieSpeed2Btn: TButtonB; 170 170 MovieSpeed3Btn: TButtonB; 171 171 MovieSpeed4Btn: TButtonB; 172 N12: T MenuItem;173 mRep14: T MenuItem;172 N12: TDpiMenuItem; 173 mRep14: TDpiMenuItem; 174 174 procedure FormCreate(Sender: TObject); 175 175 procedure FormDestroy(Sender: TObject); … … 266 266 procedure EndNego; 267 267 function IsPanelPixel(x, y: integer): boolean; 268 procedure InitPopup(Popup: T PopupMenu);268 procedure InitPopup(Popup: TDpiPopupMenu); 269 269 procedure SetMapOptions; 270 270 procedure CheckMovieSpeedBtnState; … … 3448 3448 for i := 0 to ComponentCount - 1 do 3449 3449 if Components[i].Tag and $FF <> 0 then 3450 if Components[i] is T MenuItem then3451 begin 3452 T MenuItem(Components[i]).Caption := Phrases.Lookup('CONTROLS',3450 if Components[i] is TDpiMenuItem then 3451 begin 3452 TDpiMenuItem(Components[i]).Caption := Phrases.Lookup('CONTROLS', 3453 3453 -1 + Components[i].Tag and $FF); 3454 3454 for j := 0 to nSaveOption - 1 do 3455 3455 if Components[i].Tag and $FF = SaveOption[j] then 3456 T MenuItem(Components[i]).Checked := ((1 shl j) and OptionChecked) <> 0;3456 TDpiMenuItem(Components[i]).Checked := ((1 shl j) and OptionChecked) <> 0; 3457 3457 end 3458 3458 else if Components[i] is TButtonBase then … … 5188 5188 i, uix, emix, p1, dx, dy, MouseLoc: integer; 5189 5189 EditTileData: TEditTileData; 5190 m, m2: T MenuItem;5190 m, m2: TDpiMenuItem; 5191 5191 MoveAdviceData: TMoveAdviceData; 5192 5192 DoCenter: boolean; … … 5338 5338 if 1 shl p1 and MyRO.Alive <> 0 then 5339 5339 begin 5340 m := T MenuItem.Create(mCreateUnit);5340 m := TDpiMenuItem.Create(mCreateUnit); 5341 5341 m.Caption := Tribe[p1].TPhrase('SHORTNAME'); 5342 5342 for emix := MyRO.nEnemyModel - 1 downto 0 do … … 5347 5347 if Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr = 0 then 5348 5348 InitEnemyModel(emix); 5349 m2 := T MenuItem.Create(m);5349 m2 := TDpiMenuItem.Create(m); 5350 5350 m2.Caption := Tribe[p1].ModelName[MyRO.EnemyModel[emix].mix]; 5351 5351 m2.Tag := p1 shl 16 + MyRO.EnemyModel[emix].mix; … … 6452 6452 Shift: TShiftState); 6453 6453 6454 procedure MenuClick_Check(Popup: T PopupMenu; Item: TMenuItem);6454 procedure MenuClick_Check(Popup: TDpiPopupMenu; Item: TDpiMenuItem); 6455 6455 begin 6456 6456 InitPopup(Popup); … … 7182 7182 end; 7183 7183 7184 procedure TMainScreen.InitPopup(Popup: T PopupMenu);7184 procedure TMainScreen.InitPopup(Popup: TDpiPopupMenu); 7185 7185 var 7186 7186 i, p1, Tile, Test: integer; 7187 7187 NoSuper, extended, Multi, NeedSep, HaveCities: boolean; 7188 LastSep, m: T MenuItem;7188 LastSep, m: TDpiMenuItem; 7189 7189 mox: ^TModel; 7190 7190 begin … … 7257 7257 if (p1 = 0) or (1 shl p1 and G.RO[0].Alive <> 0) then 7258 7258 begin 7259 m := T MenuItem.Create(mViewpoint);7259 m := TDpiMenuItem.Create(mViewpoint); 7260 7260 if p1 = 0 then 7261 7261 m.Caption := Phrases.Lookup('SUPER') … … 7279 7279 if (p1 = 0) or (1 shl p1 and G.RO[0].Alive <> 0) then 7280 7280 begin 7281 m := T MenuItem.Create(mDebugMap);7281 m := TDpiMenuItem.Create(mDebugMap); 7282 7282 if p1 = 0 then 7283 7283 m.Caption := Phrases2.Lookup('MENU_DEBUGMAPOFF') … … 7459 7459 procedure TMainScreen.PanelBtnClick(Sender: TObject); 7460 7460 var 7461 Popup: T PopupMenu;7461 Popup: TDpiPopupMenu; 7462 7462 begin 7463 7463 if Sender = UnitBtn then … … 7467 7467 InitPopup(Popup); 7468 7468 if FullScreen then 7469 Popup.Popup(Left + T Control(Sender).Left, Top + TControl(Sender).Top)7469 Popup.Popup(Left + TDpiControl(Sender).Left, Top + TDpiControl(Sender).Top) 7470 7470 else 7471 Popup.Popup(Left + T Control(Sender).Left + 4, Top + TControl(Sender).Top +7471 Popup.Popup(Left + TDpiControl(Sender).Left + 4, Top + TDpiControl(Sender).Top + 7472 7472 GetSystemMetrics(SM_CYCAPTION) + 4); 7473 7473 end; … … 7504 7504 procedure TMainScreen.Toggle(Sender: TObject); 7505 7505 begin 7506 T MenuItem(Sender).Checked := not TMenuItem(Sender).Checked7506 TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked 7507 7507 end; 7508 7508 … … 7590 7590 procedure TMainScreen.mShowClick(Sender: TObject); 7591 7591 begin 7592 T MenuItem(Sender).Checked := not TMenuItem(Sender).Checked;7592 TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked; 7593 7593 SetMapOptions; 7594 7594 MapValid := false; … … 7628 7628 InitPopup(GamePopup); 7629 7629 if FullScreen then 7630 // GamePopup.FItems.Count 7630 7631 GamePopup.Popup(Left, Top + TopBarHeight - 1) 7631 7632 else … … 7789 7790 procedure TMainScreen.mRepClicked(Sender: TObject); 7790 7791 begin 7791 with T MenuItem(Sender) do7792 with TDpiMenuItem(Sender) do 7792 7793 begin 7793 7794 Checked := not Checked; … … 7818 7819 procedure TMainScreen.Radio(Sender: TObject); 7819 7820 begin 7820 T MenuItem(Sender).Checked := true;7821 TDpiMenuItem(Sender).Checked := true; 7821 7822 end; 7822 7823 … … 7825 7826 Flag: integer; 7826 7827 begin 7827 with T MenuItem(Sender) do7828 with TDpiMenuItem(Sender) do 7828 7829 begin 7829 7830 Flag := 1 shl (Tag shr 8); … … 7984 7985 procedure TMainScreen.ViewpointClick(Sender: TObject); 7985 7986 begin 7986 SetViewpoint(T MenuItem(Sender).Tag);7987 SetViewpoint(TDpiMenuItem(Sender).Tag); 7987 7988 end; 7988 7989 7989 7990 procedure TMainScreen.DebugMapClick(Sender: TObject); 7990 7991 begin 7991 SetDebugMap(T MenuItem(Sender).Tag);7992 SetDebugMap(TDpiMenuItem(Sender).Tag); 7992 7993 end; 7993 7994 … … 8029 8030 OptionChecked := OptionChecked and soExtraMask; 8030 8031 for i := 0 to ComponentCount - 1 do 8031 if Components[i] is T MenuItem then8032 if Components[i] is TDpiMenuItem then 8032 8033 for j := 0 to nSaveOption - 1 do 8033 if T MenuItem(Components[i]).Checked and8034 (T MenuItem(Components[i]).Tag = SaveOption[j]) then8034 if TDpiMenuItem(Components[i]).Checked and 8035 (TDpiMenuItem(Components[i]).Tag = SaveOption[j]) then 8035 8036 inc(OptionChecked, 1 shl j); 8036 8037 -
branches/highdpi/Log.lfm
r210 r244 30 30 OnMouseDown = ListMouseDown 31 31 end 32 object LogPopup: T PopupMenu32 object LogPopup: TDpiPopupMenu 33 33 AutoPopup = False 34 34 Left = 8 35 35 Top = 8 36 object mInvalid: T MenuItem36 object mInvalid: TDpiMenuItem 37 37 Caption = 'Invalid Server Calls' 38 38 OnClick = Toggle 39 39 end 40 object mNegotiation: T MenuItem40 object mNegotiation: TDpiMenuItem 41 41 Caption = 'Negotiation' 42 42 OnClick = Toggle 43 43 end 44 object mTime: T MenuItem44 object mTime: TDpiMenuItem 45 45 Caption = 'Client Handover' 46 46 OnClick = Toggle 47 47 end 48 object N2: T MenuItem48 object N2: TDpiMenuItem 49 49 Caption = '-' 50 50 end 51 object mLog0: T MenuItem51 object mLog0: TDpiMenuItem 52 52 Caption = 'AI Messages Off' 53 53 Checked = True … … 55 55 OnClick = mLogClick 56 56 end 57 object mLog1: T MenuItem57 object mLog1: TDpiMenuItem 58 58 Tag = 1 59 59 Caption = 'AI Messages Level 1' … … 61 61 OnClick = mLogClick 62 62 end 63 object mLog2: T MenuItem63 object mLog2: TDpiMenuItem 64 64 Tag = 2 65 65 Caption = 'AI Messages Level 1+2' … … 67 67 OnClick = mLogClick 68 68 end 69 object mLog3: T MenuItem69 object mLog3: TDpiMenuItem 70 70 Tag = 999 71 71 Caption = 'All AI Messages' … … 73 73 OnClick = mLogClick 74 74 end 75 object N1: T MenuItem75 object N1: TDpiMenuItem 76 76 Caption = '-' 77 77 end 78 object mSlot: T MenuItem78 object mSlot: TDpiMenuItem 79 79 Caption = 'Nation <-> Slot' 80 80 OnClick = mSlotClick 81 81 end 82 object mClear: T MenuItem82 object mClear: TDpiMenuItem 83 83 Caption = 'Clear' 84 84 OnClick = mClearClick -
branches/highdpi/Log.pas
r210 r244 10 10 type 11 11 TLogDlg = class(TDpiForm) 12 LogPopup: T PopupMenu;13 mLog0: T MenuItem;14 mLog1: T MenuItem;15 mLog2: T MenuItem;16 mLog3: T MenuItem;17 N1: T MenuItem;18 mClear: T MenuItem;19 mSlot: T MenuItem;20 N2: T MenuItem;21 mInvalid: T MenuItem;22 mTime: T MenuItem;12 LogPopup: TDpiPopupMenu; 13 mLog0: TDpiMenuItem; 14 mLog1: TDpiMenuItem; 15 mLog2: TDpiMenuItem; 16 mLog3: TDpiMenuItem; 17 N1: TDpiMenuItem; 18 mClear: TDpiMenuItem; 19 mSlot: TDpiMenuItem; 20 N2: TDpiMenuItem; 21 mInvalid: TDpiMenuItem; 22 mTime: TDpiMenuItem; 23 23 List: TMemo; 24 mNegotiation: T MenuItem;24 mNegotiation: TDpiMenuItem; 25 25 procedure mLogClick(Sender: TObject); 26 26 procedure FormCreate(Sender: TObject); … … 60 60 procedure TLogDlg.mLogClick(Sender: TObject); 61 61 begin 62 MaxLevel := T MenuItem(Sender).Tag;63 T MenuItem(Sender).Checked := true;62 MaxLevel := TDpiMenuItem(Sender).Tag; 63 TDpiMenuItem(Sender).Checked := true; 64 64 end; 65 65 … … 124 124 procedure TLogDlg.Toggle(Sender: TObject); 125 125 begin 126 T MenuItem(Sender).Checked := not TMenuItem(Sender).Checked;126 TDpiMenuItem(Sender).Checked := not TDpiMenuItem(Sender).Checked; 127 127 end; 128 128 -
branches/highdpi/Packages/CevoComponents/ScreenTools.pas
r210 r244 21 21 {$ENDIF} 22 22 procedure RestoreResolution; 23 procedure EmptyMenu(MenuItems: T MenuItem; Keep: Integer = 0);23 procedure EmptyMenu(MenuItems: TDpiMenuItem; Keep: Integer = 0); 24 24 function TurnToYear(Turn: integer): integer; 25 25 function TurnToString(Turn: integer): string; … … 248 248 end; 249 249 250 procedure EmptyMenu(MenuItems: T MenuItem; Keep: Integer = 0);251 var 252 MenuItem: T MenuItem;250 procedure EmptyMenu(MenuItems: TDpiMenuItem; Keep: Integer = 0); 251 var 252 MenuItem: TDpiMenuItem; 253 253 begin 254 254 while MenuItems.Count > Keep do begin -
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r216 r244 8 8 Classes, SysUtils, LCLProc, LResources, Forms, FormEditingIntf, ProjectIntf, 9 9 Controls, StdCtrls, fgl, Graphics, ComCtrls, ExtCtrls, LCLType, GraphType, 10 Types, CustApp, LMessages, LCLIntf ;10 Types, CustApp, LMessages, LCLIntf, Menus; 11 11 12 12 type … … 483 483 function GetVclForm: TForm; virtual; 484 484 procedure UpdateVclControl; override; 485 procedure AfterConstruction; override;486 485 public 487 486 VclForm: TForm; 487 procedure AfterConstruction; override; 488 488 property ModalResult: TModalResult read GetModalResult write SetModalResult; 489 489 function ShowModal: Integer; virtual; … … 796 796 end; 797 797 798 { TDpiMenuItem } 799 800 TDpiMenuItem = class(TComponent) 801 private 802 FItems: TList; 803 FParent: TDpiMenuItem; 804 FOnClick: TNotifyEvent; 805 function GetCaption: TTranslateString; 806 function GetChecked: Boolean; 807 function GetCount: Integer; 808 function GetEnabled: Boolean; 809 function GetGroupIndex: Byte; 810 function GetItem(Index: Integer): TDpiMenuItem; 811 function GetOnClick: TNotifyEvent; 812 function GetRadioItem: Boolean; 813 function GetShortCut: TShortCut; 814 function GetVisible: Boolean; 815 function IsCaptionStored: Boolean; 816 function IsCheckedStored: Boolean; 817 function IsEnabledStored: Boolean; 818 function IsShortCutStored: Boolean; 819 function IsVisibleStored: Boolean; 820 procedure SetCaption(AValue: TTranslateString); 821 procedure SetChecked(AValue: Boolean); 822 procedure SetEnabled(AValue: Boolean); 823 procedure SetGroupIndex(AValue: Byte); 824 procedure SetOnClick(AValue: TNotifyEvent); 825 procedure SetRadioItem(AValue: Boolean); 826 procedure SetShortCut(AValue: TShortCut); 827 procedure SetVisible(AValue: Boolean); 828 procedure OnClickHandler(Sender: TObject); 829 protected 830 function GetVclMenuItem: TMenuItem; virtual; 831 procedure SetParentComponent(AValue: TComponent); override; 832 public 833 VclMenuItem: TMenuItem; 834 constructor Create(AOwner: TComponent); override; 835 destructor Destroy; override; 836 procedure Delete(Index: Integer); 837 procedure Add(Item: TDpiMenuItem); 838 procedure Insert(Index: Integer; Item: TDpiMenuItem); 839 function IndexOf(Item: TDpiMenuItem): Integer; 840 procedure Remove(Item: TDpiMenuItem); 841 property Items[Index: Integer]: TDpiMenuItem read GetItem; default; 842 property Count: Integer read GetCount; 843 published 844 property RadioItem: Boolean read GetRadioItem write SetRadioItem default False; 845 property ShortCut: TShortCut read GetShortCut write SetShortCut 846 stored IsShortCutStored default 0; 847 property Enabled: Boolean read GetEnabled write SetEnabled 848 stored IsEnabledStored default True; 849 property Visible: Boolean read GetVisible write SetVisible 850 stored IsVisibleStored default True; 851 property Checked: Boolean read GetChecked write SetChecked 852 stored IsCheckedStored default False; 853 property Caption: TTranslateString read GetCaption write SetCaption 854 stored IsCaptionStored; 855 property OnClick: TNotifyEvent read GetOnClick write SetOnClick; 856 property GroupIndex: Byte read GetGroupIndex write SetGroupIndex default 0; 857 end; 858 859 TDpiMenu = class(TComponent) 860 private 861 FItems: TDpiMenuItem; 862 protected 863 function GetVclMenu: TMenu; virtual; 864 public 865 property Items: TDpiMenuItem read FItems; 866 constructor Create(AOwner: TComponent); override; 867 destructor Destroy; override; 868 end; 869 870 { TDpiPopupMenu } 871 872 TDpiPopupMenu = class(TDpiMenu) 873 private 874 function GetAutoPopup: Boolean; 875 procedure SetAutoPopup(AValue: Boolean); 876 protected 877 function GetVclMenu: TMenu; override; 878 function GetVclPopupMenu: TPopupMenu; virtual; 879 public 880 VclPopupMenu: TPopupMenu; 881 procedure PopUp; 882 procedure PopUp(X, Y: Integer); virtual; 883 constructor Create(AOwner: TComponent); override; 884 destructor Destroy; override; 885 published 886 property AutoPopup: Boolean read GetAutoPopup write SetAutoPopup default True; 887 end; 888 798 889 var 799 890 DpiFormFileDesc: TDpiFormFileDesc; … … 818 909 implementation 819 910 911 uses 912 LCLStrConsts; 913 820 914 resourcestring 821 915 SDpiFormTitle = 'DpiForm form'; … … 827 921 DpiFormFileDesc := TDpiFormFileDesc.Create; 828 922 RegisterProjectFileDescriptor(DpiFormFileDesc); 829 RegisterComponents('DpiControls', [TDpiButton, TDpiImage, TDpiPaintBox, TDpiListBox]); 923 RegisterComponents('DpiControls', [TDpiButton, TDpiImage, TDpiPaintBox, 924 TDpiListBox, TDpiPopupMenu]); 830 925 end; 831 926 … … 897 992 Result := BitBlt(DestDC, ScaleToVcl(X), ScaleToVcl(Y), ScaleToVcl(Width), 898 993 ScaleToVcl(Height), SrcDC, ScaleToVcl(XSrc), ScaleToVcl(YSrc), Rop); 994 end; 995 996 { TDpiMenu } 997 998 function TDpiMenu.GetVclMenu: TMenu; 999 begin 1000 Result := nil; 1001 end; 1002 1003 constructor TDpiMenu.Create(AOwner: TComponent); 1004 begin 1005 inherited; 1006 FItems := TDpiMenuItem.Create(Self); 1007 end; 1008 1009 destructor TDpiMenu.Destroy; 1010 begin 1011 FreeAndNil(FItems); 1012 inherited; 1013 end; 1014 1015 { TDpiMenuItem } 1016 1017 function TDpiMenuItem.GetCaption: TTranslateString; 1018 begin 1019 Result := GetVclMenuItem.Caption; 1020 end; 1021 1022 function TDpiMenuItem.GetChecked: Boolean; 1023 begin 1024 Result := GetVclMenuItem.Checked; 1025 end; 1026 1027 function TDpiMenuItem.GetCount: Integer; 1028 begin 1029 Result := FItems.Count; 1030 end; 1031 1032 function TDpiMenuItem.GetEnabled: Boolean; 1033 begin 1034 Result := GetVclMenuItem.Enabled; 1035 end; 1036 1037 function TDpiMenuItem.GetGroupIndex: Byte; 1038 begin 1039 Result := GetVclMenuItem.GroupIndex; 1040 end; 1041 1042 function TDpiMenuItem.GetItem(Index: Integer): TDpiMenuItem; 1043 begin 1044 Result := TDpiMenuItem(FItems[Index]); 1045 end; 1046 1047 function TDpiMenuItem.GetOnClick: TNotifyEvent; 1048 begin 1049 Result := FOnClick; 1050 end; 1051 1052 function TDpiMenuItem.GetRadioItem: Boolean; 1053 begin 1054 Result := GetVclMenuItem.RadioItem; 1055 end; 1056 1057 function TDpiMenuItem.GetShortCut: TShortCut; 1058 begin 1059 Result := GetVclMenuItem.ShortCut; 1060 end; 1061 1062 function TDpiMenuItem.GetVisible: Boolean; 1063 begin 1064 Result := GetVclMenuItem.Visible; 1065 end; 1066 1067 function TDpiMenuItem.IsCaptionStored: Boolean; 1068 begin 1069 Result := False; 1070 end; 1071 1072 function TDpiMenuItem.IsCheckedStored: Boolean; 1073 begin 1074 Result := False; 1075 end; 1076 1077 function TDpiMenuItem.IsEnabledStored: Boolean; 1078 begin 1079 Result := False; 1080 end; 1081 1082 function TDpiMenuItem.IsShortCutStored: Boolean; 1083 begin 1084 Result := False; 1085 end; 1086 1087 function TDpiMenuItem.IsVisibleStored: Boolean; 1088 begin 1089 Result := False; 1090 end; 1091 1092 procedure TDpiMenuItem.SetCaption(AValue: TTranslateString); 1093 begin 1094 GetVclMenuItem.Caption := AValue; 1095 end; 1096 1097 procedure TDpiMenuItem.SetChecked(AValue: Boolean); 1098 begin 1099 GetVclMenuItem.Checked := AValue; 1100 end; 1101 1102 procedure TDpiMenuItem.SetEnabled(AValue: Boolean); 1103 begin 1104 GetVclMenuItem.Enabled := AValue; 1105 end; 1106 1107 procedure TDpiMenuItem.SetGroupIndex(AValue: Byte); 1108 begin 1109 GetVclMenuItem.GroupIndex := AValue; 1110 end; 1111 1112 procedure TDpiMenuItem.SetOnClick(AValue: TNotifyEvent); 1113 begin 1114 FOnClick := AValue; 1115 end; 1116 1117 procedure TDpiMenuItem.SetRadioItem(AValue: Boolean); 1118 begin 1119 GetVclMenuItem.RadioItem := AValue; 1120 end; 1121 1122 procedure TDpiMenuItem.SetShortCut(AValue: TShortCut); 1123 begin 1124 GetVclMenuItem.ShortCut := AValue; 1125 end; 1126 1127 procedure TDpiMenuItem.SetVisible(AValue: Boolean); 1128 begin 1129 GetVclMenuItem.Visible := AValue; 1130 end; 1131 1132 procedure TDpiMenuItem.OnClickHandler(Sender: TObject); 1133 begin 1134 if Assigned(FOnClick) then 1135 FOnClick(Self); 1136 end; 1137 1138 procedure TDpiMenuItem.Delete(Index: Integer); 1139 begin 1140 FItems.Delete(Index); 1141 GetVclMenuItem.Delete(Index); 1142 end; 1143 1144 procedure TDpiMenuItem.Add(Item: TDpiMenuItem); 1145 begin 1146 Insert(GetCount, Item); 1147 end; 1148 1149 procedure TDpiMenuItem.Insert(Index: Integer; Item: TDpiMenuItem); 1150 begin 1151 FItems.Insert(Index, Item); 1152 GetVclMenuItem.Insert(Index, Item.GetVclMenuItem); 1153 end; 1154 1155 function TDpiMenuItem.IndexOf(Item: TDpiMenuItem): Integer; 1156 begin 1157 if FItems = nil then 1158 Result := -1 1159 else 1160 Result := FItems.IndexOf(Item); 1161 end; 1162 1163 procedure TDpiMenuItem.Remove(Item: TDpiMenuItem); 1164 var 1165 I: Integer; 1166 begin 1167 I := IndexOf(Item); 1168 if I < 0 then 1169 raise EMenuError.Create(SMenuNotFound); 1170 Delete(I); 1171 end; 1172 1173 function TDpiMenuItem.GetVclMenuItem: TMenuItem; 1174 begin 1175 if not Assigned(VclMenuItem) then begin 1176 VclMenuItem := TMenuItem.Create(nil); 1177 VclMenuItem.Name := 'Vcl' + Name; 1178 VclMenuItem.OnClick := @OnClickHandler; 1179 end; 1180 Result := VclMenuItem; 1181 end; 1182 1183 procedure TDpiMenuItem.SetParentComponent(AValue: TComponent); 1184 begin 1185 if (FParent = AValue) then Exit; 1186 if Assigned(FParent) then FParent.Remove(Self); 1187 if Assigned(AValue) then 1188 begin 1189 if (AValue is TDpiMenu) 1190 then TDpiMenu(AValue).Items.Add(Self) 1191 else if (AValue is TDpiMenuItem) 1192 then TDpiMenuItem(AValue).Add(Self) 1193 else 1194 raise Exception.Create('TDpiMenuItem.SetParentComponent: suggested parent not of type TDpiMenu or TDpiMenuItem'); 1195 end; 1196 end; 1197 1198 constructor TDpiMenuItem.Create(AOwner: TComponent); 1199 begin 1200 inherited; 1201 FItems := TList.Create; 1202 end; 1203 1204 destructor TDpiMenuItem.Destroy; 1205 begin 1206 FreeAndNil(FItems); 1207 inherited Destroy; 1208 end; 1209 1210 { TDpiPopupMenu } 1211 1212 procedure TDpiPopupMenu.PopUp; 1213 var 1214 Pos: TPoint; 1215 begin 1216 Pos := DpiMouse.CursorPos; 1217 Popup(Pos.X, Pos.Y); 1218 end; 1219 1220 procedure TDpiPopupMenu.PopUp(X, Y: Integer); 1221 begin 1222 GetVclPopupMenu.PopUp(ScaleToVcl(X), ScaleToVcl(Y)); 1223 end; 1224 1225 constructor TDpiPopupMenu.Create(AOwner: TComponent); 1226 begin 1227 inherited; 1228 GetVclPopupMenu; 1229 end; 1230 1231 function TDpiPopupMenu.GetAutoPopup: Boolean; 1232 begin 1233 Result := GetVclPopupMenu.AutoPopup; 1234 end; 1235 1236 procedure TDpiPopupMenu.SetAutoPopup(AValue: Boolean); 1237 begin 1238 GetVclPopupMenu.AutoPopup := AValue; 1239 end; 1240 1241 function TDpiPopupMenu.GetVclMenu: TMenu; 1242 begin 1243 Result := GetVclPopupMenu; 1244 end; 1245 1246 function TDpiPopupMenu.GetVclPopupMenu: TPopupMenu; 1247 begin 1248 if not Assigned(VclPopupMenu) then begin 1249 VclPopupMenu := TPopupMenu.Create(nil); 1250 if Assigned(Items.VclMenuItem) then Items.VclMenuItem.Free; 1251 Items.VclMenuItem := VclPopupMenu.Items; 1252 end; 1253 Result := VclPopupMenu; 1254 end; 1255 1256 destructor TDpiPopupMenu.Destroy; 1257 begin 1258 if Assigned(VclPopupMenu) then FreeAndNil(VclPopupMenu); 1259 inherited Destroy; 899 1260 end; 900 1261 … … 2213 2574 procedure TDpiScreen.UpdateScreen; 2214 2575 begin 2215 Dpi := 96 * 2; //Screen.PixelsPerInch; 2576 // Dpi := 96 * 2; 2577 Dpi := Screen.PixelsPerInch; 2216 2578 end; 2217 2579 -
branches/highdpi/Start.lfm
r210 r244 336 336 Visible = False 337 337 end 338 object PopupMenu1: T PopupMenu338 object PopupMenu1: TDpiPopupMenu 339 339 left = 8 340 340 top = 8 -
branches/highdpi/Start.pas
r212 r244 61 61 62 62 TStartDlg = class(TDrawDlg) 63 PopupMenu1: T PopupMenu;63 PopupMenu1: TDpiPopupMenu; 64 64 StartBtn: TButtonA; 65 65 Down1Btn: TButtonC; … … 1299 1299 if PlayerPopupIndex < 0 then 1300 1300 begin // change default AI 1301 BrainDefault := Brains[T MenuItem(Sender).Tag];1301 BrainDefault := Brains[TDpiMenuItem(Sender).Tag]; 1302 1302 SmartInvalidate(xDefault, yDefault, xDefault + 64, yDefault + 64); 1303 1303 end … … 1306 1306 if Assigned(PlayersBrain[PlayerPopupIndex]) then 1307 1307 PlayersBrain[PlayerPopupIndex].Flags := PlayersBrain[PlayerPopupIndex].Flags and not fUsed; 1308 if T MenuItem(Sender).Tag = -1 then begin1308 if TDpiMenuItem(Sender).Tag = -1 then begin 1309 1309 PlayersBrain[PlayerPopupIndex] := nil; 1310 1310 PlayerSlots[PlayerPopupIndex].DiffUpBtn.Visible := False; … … 1316 1316 MultiControl := MultiControl and not (1 shl PlayerPopupIndex); 1317 1317 end else begin 1318 PlayersBrain[PlayerPopupIndex] := Brains[T MenuItem(Sender).Tag];1318 PlayersBrain[PlayerPopupIndex] := Brains[TDpiMenuItem(Sender).Tag]; 1319 1319 PlayerSlots[PlayerPopupIndex].DiffUpBtn.Visible := PlayersBrain[PlayerPopupIndex].Kind in [btTerm, btRandom, btAI]; 1320 1320 PlayerSlots[PlayerPopupIndex].DiffDownBtn.Visible := PlayersBrain[PlayerPopupIndex].Kind in [btTerm, btRandom, btAI]; … … 1360 1360 var 1361 1361 J: Integer; 1362 MenuItem: T MenuItem;1363 begin 1364 MenuItem := T MenuItem.Create(PopupMenu1);1362 MenuItem: TDpiMenuItem; 1363 begin 1364 MenuItem := TDpiMenuItem.Create(PopupMenu1); 1365 1365 if not Assigned(Brain) then MenuItem.Caption := Phrases.Lookup('NOMOD') 1366 1366 else MenuItem.Caption := Brain.Name; … … 1381 1381 I: Integer; 1382 1382 FixedLines: integer; 1383 MenuItem: T MenuItem;1383 MenuItem: TDpiMenuItem; 1384 1384 AIBrains: TBrains; 1385 1385 begin … … 1411 1411 end; 1412 1412 if PlayerPopupIndex > 0 then begin 1413 MenuItem := T MenuItem.Create(PopupMenu1);1413 MenuItem := TDpiMenuItem.Create(PopupMenu1); 1414 1414 MenuItem.Caption := '-'; 1415 1415 PopupMenu1.Items.Add(MenuItem);
Note:
See TracChangeset
for help on using the changeset viewer.