Changeset 474


Ignore:
Timestamp:
Dec 4, 2023, 7:18:18 PM (13 months ago)
Author:
chronos
Message:
  • Fixed: More high dpi related fixes.
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Global.pas

    r447 r474  
    44
    55const
     6  CevoTitle = 'C-evo';
    67  CevoExt = '.cevo';
    78  CevoMapExt = '.cevomap';
  • trunk/Inp.lfm

    r232 r474  
    11object InputDlg: TInputDlg
    22  Left = 514
     3  Height = 99
    34  Top = 236
     5  Width = 232
    46  BorderStyle = bsNone
    57  ClientHeight = 99
    68  ClientWidth = 232
    79  Color = clBtnFace
    8   Font.Charset = DEFAULT_CHARSET
     10  DesignTimePPI = 144
    911  Font.Color = clWindowText
    10   Font.Height = -13
     12  Font.Height = -20
    1113  Font.Name = 'MS Sans Serif'
    12   Font.Style = []
    1314  FormStyle = fsStayOnTop
    1415  OnClose = FormClose
     
    1617  OnPaint = FormPaint
    1718  OnShow = FormShow
    18   PixelsPerInch = 96
     19  LCLVersion = '2.2.6.0'
    1920  Scaled = False
    20   object OKBtn: TButtonA
     21  object ButtonOk: TButtonA
    2122    Left = 66
     23    Height = 25
    2224    Top = 67
    2325    Width = 100
    24     Height = 25
    2526    Down = False
    2627    Permanent = False
    27     OnClick = OKBtnClick
    28     Caption = ''
     28    OnClick = ButtonOkClick
    2929  end
    30   object EInput: TEdit
     30  object EditInput: TEdit
    3131    Left = 16
     32    Height = 27
    3233    Top = 40
    3334    Width = 200
    34     Height = 19
    3535    BorderStyle = bsNone
    3636    Color = clBlack
    37     Font.Charset = DEFAULT_CHARSET
    3837    Font.Color = 4176863
    3938    Font.Height = -15
    4039    Font.Name = 'Times New Roman'
    4140    Font.Style = [fsBold]
     41    OnKeyPress = EInputKeyPress
    4242    ParentFont = False
    4343    TabOrder = 0
    44     OnKeyPress = EInputKeyPress
    4544  end
    4645end
  • trunk/Inp.pas

    r471 r474  
    55
    66uses
    7   ScreenTools, LCLIntf, LCLType, SysUtils, Classes, DrawDlg, ButtonA, StdCtrls,
    8   {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, System.UITypes{$ELSE}
    9   Graphics, Controls, Forms{$ENDIF};
     7  ScreenTools, LCLIntf, LCLType, SysUtils, Classes, DrawDlg, ButtonA,
     8  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.StdCtrls, System.UITypes{$ELSE}
     9  Graphics, Controls, Forms, StdCtrls{$ENDIF};
    1010
    1111type
    1212  TInputDlg = class(TDrawDlg)
    13     OKBtn: TButtonA;
    14     EInput: TEdit;
    15     procedure OKBtnClick(Sender: TObject);
     13    ButtonOk: TButtonA;
     14    EditInput: TEdit;
     15    procedure ButtonOkClick(Sender: TObject);
    1616    procedure FormPaint(Sender: TObject);
    1717    procedure FormCreate(Sender: TObject);
     
    4444procedure TInputDlg.FormPaint(Sender: TObject);
    4545begin
    46   PaintBackground(self, 3, 3, ClientWidth - 6, ClientHeight - 6);
    47   Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    48   Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
     46  PaintBackground(Self, 3, 3, Width - 6, Height - 6);
     47  Frame(Canvas, 0, 0, Width - 1, Height - 1, 0, 0);
     48  Frame(Canvas, 1, 1, Width - 2, Height - 2,
    4949    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    50   Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
     50  Frame(Canvas, 2, 2, Width - 3, Height - 3,
    5151    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    52   EditFrame(Canvas, EInput.BoundsRect, MainTexture);
    53   BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture);
    54   RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, Caption)) div 2,
     52  EditFrame(Canvas, EditInput.BoundsRect, MainTexture);
     53  BtnFrame(Canvas, ButtonOk.BoundsRect, MainTexture);
     54  RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, Caption)) div 2,
    5555    9, Caption);
    56   { Corner(canvas,1,1,0,MainTexture);
    57     Corner(Canvas,ClientWidth-9,1,1,MainTexture);
    58     Corner(Canvas,1,ClientHeight-9,2,MainTexture);
    59     Corner(Canvas,ClientWidth-9,ClientHeight-9,3,MainTexture); }
     56  { Corner(canvas, 1, 1, 0, MainTexture);
     57    Corner(Canvas, Width - 9, 1, 1, MainTexture);
     58    Corner(Canvas, 1, Height - 9, 2, MainTexture);
     59    Corner(Canvas, Width - 9, Height - 9, 3, MainTexture); }
    6060end;
    6161
    62 procedure TInputDlg.OKBtnClick(Sender: TObject);
     62procedure TInputDlg.ButtonOkClick(Sender: TObject);
    6363begin
    64   if EInput.Text = '' then
     64  if EditInput.Text = '' then
    6565    ModalResult := mrCancel
    6666  else
     
    7070procedure TInputDlg.EInputKeyPress(Sender: TObject; var Key: Char);
    7171begin
    72   if (Key = #13) and (EInput.Text <> '') then
     72  if (Key = #13) and (EditInput.Text <> '') then
    7373  begin
    7474    Key := #0;
     
    8484procedure TInputDlg.FormShow(Sender: TObject);
    8585begin
    86   OKBtn.Caption := Phrases.Lookup('BTN_OK');
    87   EInput.Font.Color := MainTexture.ColorMark;
    88   EInput.SelStart := 0;
    89   EInput.SelLength := Length(EInput.Text);
     86  ButtonOk.Caption := Phrases.Lookup('BTN_OK');
     87  EditInput.Font.Color := MainTexture.ColorMark;
     88  EditInput.SelStart := 0;
     89  EditInput.SelLength := Length(EditInput.Text);
    9090  if Center then
    9191    CenterToRect(Rect(0, 0, Screen.Width, Screen.Height));
  • trunk/Integrated.lpr

    r473 r474  
    2727  DotNetClient := nil;
    2828  Application.Initialize;
    29   Application.Title := 'C-evo';
     29  Application.Title := CevoTitle;
    3030  Application.TaskBarBehavior := TTaskBarBehavior.tbMultiButton;
    3131  ScreenTools.LoadConfig(AppRegistryKey);
  • trunk/LocalPlayer/Help.pas

    r471 r474  
    20442044begin
    20452045  InputDlg.Caption := Phrases.Lookup('SEARCH');
    2046   InputDlg.EInput.Text := SearchContent;
     2046  InputDlg.EditInput.Text := SearchContent;
    20472047  InputDlg.CenterToRect(BoundsRect);
    20482048  InputDlg.ShowModal;
    2049   if (InputDlg.ModalResult = mrOK) and (Length(InputDlg.EInput.Text) >= 2) then
    2050   begin
    2051     Search(InputDlg.EInput.Text);
     2049  if (InputDlg.ModalResult = mrOK) and (Length(InputDlg.EditInput.Text) >= 2) then
     2050  begin
     2051    Search(InputDlg.EditInput.Text);
    20522052    case SearchResult.Count of
    20532053      0: begin
    20542054        Gtk2Fix;
    20552055        SimpleMessage(Format(HelpText.Lookup('NOMATCHES'),
    2056           [InputDlg.EInput.Text]));
     2056          [InputDlg.EditInput.Text]));
    20572057      end;
    20582058      1:
     
    20602060          ShowNewContent(FWindowMode, Category, Index);
    20612061      else begin
    2062         NewSearchContent := InputDlg.EInput.Text;
     2062        NewSearchContent := InputDlg.EditInput.Text;
    20632063        ShowNewContent(FWindowMode, hkMisc, Integer(miscSearchResult));
    20642064      end;
  • trunk/LocalPlayer/Nego.pas

    r471 r474  
    741741        begin // choose amount
    742742          InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
    743           InputDlg.EInput.Text := '';
     743          InputDlg.EditInput.Text := '';
    744744          InputDlg.CenterToRect(BoundsRect);
    745745          InputDlg.ShowModal;
    746746          if InputDlg.ModalResult <> mrOK then
    747747            Exit;
    748           val(InputDlg.EInput.Text, A, I);
     748          val(InputDlg.EditInput.Text, A, I);
    749749          if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
    750750            Exit;
     
    771771          Max := MyRO.Ship[DipMem[Me].pContact].Parts[MainScreen.ModalSelectDlg.Result];
    772772          InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
    773           InputDlg.EInput.Text := '';
     773          InputDlg.EditInput.Text := '';
    774774          InputDlg.CenterToRect(BoundsRect);
    775775          InputDlg.ShowModal;
    776776          if InputDlg.ModalResult <> mrOK then
    777777            Exit;
    778           val(InputDlg.EInput.Text, A, I);
     778          val(InputDlg.EditInput.Text, A, I);
    779779          if (I <> 0) or (A <= 0) then
    780780            Exit;
     
    853853        begin // choose amount
    854854          InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
    855           InputDlg.EInput.Text := '';
     855          InputDlg.EditInput.Text := '';
    856856          InputDlg.CenterToRect(BoundsRect);
    857857          InputDlg.ShowModal;
    858858          if InputDlg.ModalResult <> mrOK then
    859859            Exit;
    860           val(InputDlg.EInput.Text, A, I);
     860          val(InputDlg.EditInput.Text, A, I);
    861861          if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
    862862            Exit;
     
    873873          Max := MyRO.Ship[Me].Parts[MainScreen.ModalSelectDlg.Result];
    874874          InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
    875           InputDlg.EInput.Text := '';
     875          InputDlg.EditInput.Text := '';
    876876          InputDlg.CenterToRect(BoundsRect);
    877877          InputDlg.ShowModal;
    878878          if InputDlg.ModalResult <> mrOK then
    879879            Exit;
    880           val(InputDlg.EInput.Text, A, I);
     880          val(InputDlg.EditInput.Text, A, I);
    881881          if (I <> 0) or (A <= 0) then
    882882            Exit;
  • trunk/LocalPlayer/Select.pas

    r473 r474  
    856856begin
    857857  InputDlg.Caption := Phrases.Lookup('TITLE_CITYNAME');
    858   InputDlg.EInput.Text := CityName(MyCity[cix].ID);
     858  InputDlg.EditInput.Text := CityName(MyCity[cix].ID);
    859859  InputDlg.CenterToRect(BoundsRect);
    860860  InputDlg.ShowModal;
    861   if (InputDlg.ModalResult = mrOK) and (InputDlg.EInput.Text <> '') and
    862     (InputDlg.EInput.Text <> CityName(MyCity[cix].ID)) then
     861  if (InputDlg.ModalResult = mrOK) and (InputDlg.EditInput.Text <> '') and
     862    (InputDlg.EditInput.Text <> CityName(MyCity[cix].ID)) then
    863863  begin
    864864    CityNameInfo.ID := MyCity[cix].ID;
    865     CityNameInfo.NewName := InputDlg.EInput.Text;
     865    CityNameInfo.NewName := InputDlg.EditInput.Text;
    866866    if CityNameInfo.GetCommandDataSize > CommandDataMaxSize then
    867867      Delete(CityNameInfo.NewName, Length(CityNameInfo.NewName) -
     
    885885begin
    886886  InputDlg.Caption := Phrases.Lookup('TITLE_MODELNAME');
    887   InputDlg.EInput.Text := Tribe[Me].ModelName[mix];
     887  InputDlg.EditInput.Text := Tribe[Me].ModelName[mix];
    888888  InputDlg.CenterToRect(BoundsRect);
    889889  InputDlg.ShowModal;
    890   if (InputDlg.ModalResult = mrOK) and (InputDlg.EInput.Text <> '') and
    891     (InputDlg.EInput.Text <> Tribe[Me].ModelName[mix]) then
     890  if (InputDlg.ModalResult = mrOK) and (InputDlg.EditInput.Text <> '') and
     891    (InputDlg.EditInput.Text <> Tribe[Me].ModelName[mix]) then
    892892  begin
    893893    ModelNameInfo.mix := mix;
    894     ModelNameInfo.NewName := InputDlg.EInput.Text;
     894    ModelNameInfo.NewName := InputDlg.EditInput.Text;
    895895    if ModelNameInfo.GetCommandDataSize > CommandDataMaxSize then
    896896      Delete(ModelNameInfo.NewName, Length(ModelNameInfo.NewName) -
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r473 r474  
    17951795  end;
    17961796
    1797   LogoBuffer := TBitmap.Create;
    1798   LogoBuffer.PixelFormat := TPixelFormat.pf24bit;
    1799   LogoBuffer.SetSize(BigBook.Width, BigBook.Height);
     1797  if not Assigned(LogoBuffer) then begin
     1798    LogoBuffer := TBitmap.Create;
     1799    LogoBuffer.PixelFormat := TPixelFormat.pf24bit;
     1800    LogoBuffer.SetSize(BigBook.Width, BigBook.Height);
     1801  end;
    18001802
    18011803  LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
  • trunk/Packages/DpiControls/Dpi.Graphics.pas

    r468 r474  
    245245  public
    246246    constructor Create; override;
     247    destructor Destroy; override;
    247248    procedure BeginUpdate(ACanvasOnly: Boolean = False);
    248249    procedure EndUpdate(AStreamIsValid: Boolean = False);
     
    630631end;
    631632
     633destructor TRasterImage.Destroy;
     634begin
     635  FreeAndNil(FCanvas);
     636  inherited;
     637end;
     638
    632639procedure TRasterImage.BeginUpdate(ACanvasOnly: Boolean);
    633640begin
  • trunk/Start.pas

    r473 r474  
    16441644    else
    16451645      InputDlg.Caption := Phrases.Lookup('TITLE_MAPNAME');
    1646     InputDlg.EInput.Text := List.Items[List.ItemIndex];
     1646    InputDlg.EditInput.Text := List.Items[List.ItemIndex];
    16471647    InputDlg.CenterToRect(BoundsRect);
    16481648    InputDlg.ShowModal;
    1649     NewName := InputDlg.EInput.Text;
     1649    NewName := InputDlg.EditInput.Text;
    16501650    while (NewName <> '') and (NewName[1] = '~') do
    16511651      Delete(NewName, 1, 1);
Note: See TracChangeset for help on using the changeset viewer.