Changeset 100 for trunk/UMenu.pas
- Timestamp:
- Sep 28, 2022, 7:14:22 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UMenu.pas
r95 r100 14 14 BackgroundColor: TColor; 15 15 BackgroundSelectedColor: TColor; 16 TextColor: TColor; 17 TextDisabledColor: TColor; 16 18 Kind: TMenuItemKind; 17 19 Text: string; 18 20 Selected: Boolean; 19 FontSize: Integer; 20 FontColor: Integer; 21 TextSize: Integer; 21 22 function GetOutputText: string; virtual; 22 23 constructor Create; override; … … 125 126 begin 126 127 Enabled := True; 127 FontSize := 40; 128 FontColor := clWhite; 128 TextSize := 40; 129 TextColor := clWhite; 130 TextDisabledColor := clSilver; 129 131 end; 130 132 … … 180 182 if Items[I].Bounds.Contains(Position) then begin 181 183 if (Items[I] is TMenuItemButton) then begin 182 if Assigned(TMenuItemButton(Items[I]).OnClick) then 183 TMenuItemButton(Items[I]).OnClick(Items[I]); 184 TMenuItemButton(Items[I]).MouseUp(Position); 184 185 end else 185 186 if (Items[I] is TMenuItemCheckBox) then begin … … 215 216 Brush.Style := bsSolid; 216 217 for I := 0 to Items.Count - 1 do begin 217 Font.Size := Items[I]. FontSize;218 Font.Size := Items[I].TextSize; 218 219 if TotalWidth < TextWidth(Items[I].GetOutputText) then 219 220 TotalWidth := TextWidth(Items[I].GetOutputText); … … 229 230 Brush.Style := bsSolid; 230 231 for I := 0 to Items.Count - 1 do begin 231 Font.Size := Items[I].FontSize; 232 Font.Color := Items[I].FontColor; 232 Font.Size := Items[I].TextSize; 233 if Items[I].Enabled then Font.Color := Items[I].TextColor 234 else Font.Color := Items[I].TextDisabledColor; 233 235 Items[I].Bounds.Left := X; 234 236 Items[I].Bounds.Top := Y;
Note:
See TracChangeset
for help on using the changeset viewer.