Changeset 244 for branches/highdpi/LocalPlayer/Term.pas
- Timestamp:
- May 21, 2020, 6:42:45 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.