Changeset 99


Ignore:
Timestamp:
Dec 26, 2014, 3:04:52 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Enabled DPI settings for DEBUG build mode.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormSettings.lfm

    r98 r99  
    11object FormSettings: TFormSettings
    2   Left = 917
     2  Left = 404
    33  Height = 563
    4   Top = 190
    5   Width = 784
     4  Top = 338
     5  Width = 700
    66  ActiveControl = ButtonOk
    77  Caption = 'Settings'
    88  ClientHeight = 563
    9   ClientWidth = 784
     9  ClientWidth = 700
     10  OnCreate = FormCreate
     11  OnShow = FormShow
    1012  Position = poMainFormCenter
    1113  LCLVersion = '1.3'
    1214  object ButtonOk: TButton
    13     Left = 674
     15    Left = 590
    1416    Height = 25
    15     Top = 511
     17    Top = 520
    1618    Width = 75
     19    Anchors = [akRight, akBottom]
    1720    Caption = 'Ok'
    1821    ModalResult = 1
     
    2023  end
    2124  object ButtonCancel: TButton
    22     Left = 552
     25    Left = 468
    2326    Height = 25
    24     Top = 511
     27    Top = 520
    2528    Width = 75
     29    Anchors = [akRight, akBottom]
    2630    Caption = 'Cancel'
    2731    ModalResult = 2
    2832    TabOrder = 1
    2933  end
    30   object Label1: TLabel
    31     Left = 20
    32     Height = 22
    33     Top = 26
    34     Width = 85
    35     Caption = 'Language:'
    36     ParentColor = False
    37   end
    38   object ComboBoxLanguage: TComboBox
    39     Left = 178
    40     Height = 34
    41     Top = 24
    42     Width = 196
    43     ItemHeight = 0
    44     Style = csDropDownList
     34  object PageControl1: TPageControl
     35    Left = 4
     36    Height = 500
     37    Top = 4
     38    Width = 692
     39    ActivePage = TabSheetDebug
     40    Align = alTop
     41    Anchors = [akTop, akLeft, akRight, akBottom]
     42    BorderSpacing.Around = 4
     43    TabIndex = 1
    4544    TabOrder = 2
    46   end
    47   object CheckBoxDevelMode: TCheckBox
    48     Left = 16
    49     Height = 27
    50     Top = 80
    51     Width = 752
    52     Anchors = [akTop, akLeft, akRight]
    53     AutoSize = False
    54     Caption = 'Developer mode'
    55     TabOrder = 3
    56   end
    57   object SpinEditAnimSpeed: TSpinEdit
    58     Left = 224
    59     Height = 32
    60     Top = 120
    61     Width = 122
    62     TabOrder = 4
    63   end
    64   object Label2: TLabel
    65     Left = 19
    66     Height = 22
    67     Top = 126
    68     Width = 145
    69     Caption = 'Animation speed:'
    70     ParentColor = False
    71   end
    72   object Label3: TLabel
    73     Left = 360
    74     Height = 22
    75     Top = 130
    76     Width = 15
    77     Caption = '%'
    78     ParentColor = False
    79   end
    80   object CheckBox1: TCheckBox
    81     Left = 16
    82     Height = 27
    83     Top = 160
    84     Width = 752
    85     Anchors = [akTop, akLeft, akRight]
    86     AutoSize = False
    87     Caption = 'Autosave game on each turn'
    88     TabOrder = 5
     45    object TabSheetGeneral: TTabSheet
     46      Caption = 'General'
     47      ClientHeight = 460
     48      ClientWidth = 686
     49      object Label2: TLabel
     50        Left = 27
     51        Height = 22
     52        Top = 78
     53        Width = 145
     54        Caption = 'Animation speed:'
     55        ParentColor = False
     56      end
     57      object SpinEditAnimSpeed: TSpinEdit
     58        Left = 232
     59        Height = 32
     60        Top = 72
     61        Width = 122
     62        TabOrder = 0
     63      end
     64      object Label3: TLabel
     65        Left = 368
     66        Height = 22
     67        Top = 82
     68        Width = 15
     69        Caption = '%'
     70        ParentColor = False
     71      end
     72      object CheckBox1: TCheckBox
     73        Left = 8
     74        Height = 27
     75        Top = 112
     76        Width = 732
     77        Anchors = [akTop, akLeft, akRight]
     78        AutoSize = False
     79        Caption = 'Autosave game on each turn'
     80        TabOrder = 1
     81      end
     82      object Label1: TLabel
     83        Left = 20
     84        Height = 22
     85        Top = 26
     86        Width = 85
     87        Caption = 'Language:'
     88        ParentColor = False
     89      end
     90      object ComboBoxLanguage: TComboBox
     91        Left = 178
     92        Height = 34
     93        Top = 24
     94        Width = 196
     95        ItemHeight = 0
     96        Style = csDropDownList
     97        TabOrder = 2
     98      end
     99    end
     100    object TabSheetDebug: TTabSheet
     101      Caption = 'Debug'
     102      ClientHeight = 460
     103      ClientWidth = 686
     104      object CheckBoxDevelMode: TCheckBox
     105        Left = 16
     106        Height = 27
     107        Top = 136
     108        Width = 660
     109        Anchors = [akTop, akLeft, akRight]
     110        AutoSize = False
     111        Caption = 'Developer mode'
     112        TabOrder = 0
     113      end
     114      object Label4: TLabel
     115        Left = 14
     116        Height = 22
     117        Top = 67
     118        Width = 33
     119        Caption = 'DPI:'
     120        ParentColor = False
     121      end
     122      object SpinEditX: TSpinEdit
     123        Left = 104
     124        Height = 32
     125        Top = 64
     126        Width = 96
     127        MaxValue = 500
     128        MinValue = 20
     129        TabOrder = 1
     130        Value = 50
     131      end
     132      object SpinEditY: TSpinEdit
     133        Left = 232
     134        Height = 32
     135        Top = 64
     136        Width = 90
     137        MaxValue = 500
     138        MinValue = 20
     139        TabOrder = 2
     140        Value = 20
     141      end
     142      object Label5: TLabel
     143        Left = 208
     144        Height = 22
     145        Top = 67
     146        Width = 9
     147        Caption = 'x'
     148        ParentColor = False
     149      end
     150      object CheckBox2: TCheckBox
     151        Left = 16
     152        Height = 24
     153        Top = 32
     154        Width = 656
     155        Anchors = [akTop, akLeft, akRight]
     156        AutoSize = False
     157        Caption = 'Automatic DPI'
     158        OnChange = CheckBox2Change
     159        TabOrder = 3
     160      end
     161    end
    89162  end
    90163end
  • trunk/Forms/UFormSettings.lrt

    r77 r99  
    22TFORMSETTINGS.BUTTONOK.CAPTION=Ok
    33TFORMSETTINGS.BUTTONCANCEL.CAPTION=Cancel
    4 TFORMSETTINGS.LABEL1.CAPTION=Language:
    5 TFORMSETTINGS.CHECKBOXDEVELMODE.CAPTION=Developer mode
     4TFORMSETTINGS.TABSHEETGENERAL.CAPTION=General
    65TFORMSETTINGS.LABEL2.CAPTION=Animation speed:
    76TFORMSETTINGS.LABEL3.CAPTION=%
    87TFORMSETTINGS.CHECKBOX1.CAPTION=Autosave game on each turn
     8TFORMSETTINGS.LABEL1.CAPTION=Language:
     9TFORMSETTINGS.TABSHEETDEBUG.CAPTION=Debug
     10TFORMSETTINGS.CHECKBOXDEVELMODE.CAPTION=Developer mode
     11TFORMSETTINGS.LABEL4.CAPTION=DPI:
     12TFORMSETTINGS.LABEL5.CAPTION=x
     13TFORMSETTINGS.CHECKBOX2.CAPTION=Automatic DPI
  • trunk/Forms/UFormSettings.pas

    r97 r99  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Spin;
     9  Spin, ComCtrls;
    1010
    1111type
     
    1717    ButtonCancel: TButton;
    1818    CheckBox1: TCheckBox;
     19    CheckBox2: TCheckBox;
    1920    CheckBoxDevelMode: TCheckBox;
    2021    ComboBoxLanguage: TComboBox;
     
    2223    Label2: TLabel;
    2324    Label3: TLabel;
     25    Label4: TLabel;
     26    Label5: TLabel;
     27    PageControl1: TPageControl;
     28    SpinEditX: TSpinEdit;
     29    SpinEditY: TSpinEdit;
    2430    SpinEditAnimSpeed: TSpinEdit;
     31    TabSheetGeneral: TTabSheet;
     32    TabSheetDebug: TTabSheet;
     33    procedure CheckBox2Change(Sender: TObject);
     34    procedure FormCreate(Sender: TObject);
     35    procedure FormShow(Sender: TObject);
    2536  private
    2637    { private declarations }
     
    4253{ TFormSettings }
    4354
     55procedure TFormSettings.CheckBox2Change(Sender: TObject);
     56begin
     57  SpinEditX.Enabled := not CheckBox2.Checked;
     58  SpinEditY.Enabled := not CheckBox2.Checked;
     59end;
     60
     61procedure TFormSettings.FormCreate(Sender: TObject);
     62begin
     63  PageControl1.TabIndex := 0;
     64end;
     65
     66procedure TFormSettings.FormShow(Sender: TObject);
     67begin
     68
     69end;
     70
    4471procedure TFormSettings.Load;
    4572begin
     
    4976  CheckBoxDevelMode.Checked := Core.DevelMode;
    5077  SpinEditAnimSpeed.Value := Core.AnimationSpeed;
     78  CheckBox2.Checked := Core.ScaleDPI1.AutoDetect;
     79  SpinEditX.Value := Core.ScaleDPI1.DPI.X;
     80  SpinEditY.Value := Core.ScaleDPI1.DPI.Y;
    5181  {$IFDEF DEBUG}
    52   CheckBoxDevelMode.Visible := True;
     82  TabSheetDebug.Visible := True;
    5383  {$ELSE}
    54    CheckBoxDevelMode.Visible := False;
     84  TabSheetDebug.Visible := False;
    5585  {$ENDIF}
    5686end;
     
    6292  Core.DevelMode := CheckBoxDevelMode.Checked;
    6393  Core.AnimationSpeed := SpinEditAnimSpeed.Value;
     94  Core.ScaleDPI1.AutoDetect := CheckBox2.Checked;
     95  Core.ScaleDPI1.DPI := Point(SpinEditX.Value, SpinEditY.Value);
    6496end;
    6597
  • trunk/Languages/xtactics.cs.po

    r97 r99  
    418418msgstr "Automaticky uložit hru po každém tahu"
    419419
     420#: tformsettings.checkbox2.caption
     421msgid "Automatic DPI"
     422msgstr ""
     423
    420424#: tformsettings.checkboxdevelmode.caption
    421425msgid "Developer mode"
     
    435439msgstr "%"
    436440
     441#: tformsettings.label4.caption
     442msgid "DPI:"
     443msgstr ""
     444
     445#: tformsettings.label5.caption
     446msgid "x"
     447msgstr ""
     448
     449#: tformsettings.tabsheetdebug.caption
     450msgid "Debug"
     451msgstr ""
     452
     453#: tformsettings.tabsheetgeneral.caption
     454msgid "General"
     455msgstr ""
     456
    437457#: ucore.sendgame
    438458msgid "End game?"
  • trunk/Languages/xtactics.po

    r97 r99  
    404404msgstr ""
    405405
     406#: tformsettings.checkbox2.caption
     407msgid "Automatic DPI"
     408msgstr ""
     409
    406410#: tformsettings.checkboxdevelmode.caption
    407411msgid "Developer mode"
     
    421425msgstr ""
    422426
     427#: tformsettings.label4.caption
     428msgid "DPI:"
     429msgstr ""
     430
     431#: tformsettings.label5.caption
     432msgid "x"
     433msgstr ""
     434
     435#: tformsettings.tabsheetdebug.caption
     436msgid "Debug"
     437msgstr ""
     438
     439#: tformsettings.tabsheetgeneral.caption
     440msgid "General"
     441msgstr ""
     442
    423443#: ucore.sendgame
    424444msgid "End game?"
  • trunk/UCore.lfm

    r97 r99  
    20582058  end
    20592059  object ScaleDPI1: TScaleDPI
     2060    AutoDetect = False
    20602061    left = 245
    20612062    top = 54
  • trunk/UCore.pas

    r97 r99  
    355355  CommandLineParams;
    356356
    357   if Game.FileName = '' then begin
    358     Game.New;
    359     Player := Game.Players.GetFirstHuman;
    360     Game.Running := True;
    361     FormMain.AZoomAll.Execute;
    362   end;
    363   {with Core.ScaleDPI1 do begin
     357  with Core.ScaleDPI1 do
     358  if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin
    364359    //ApplyToAll(DesignDPI);
    365360    FormNew.Show;
     
    371366    ScaleImageList(Core.ImageListSmall, DesignDPI);
    372367    ScaleImageList(Core.ImageListLarge, DesignDPI);
    373   end;}
     368  end;
     369
     370  if Game.FileName = '' then begin
     371    Game.New;
     372    Player := Game.Players.GetFirstHuman;
     373    Game.Running := True;
     374    FormMain.AZoomAll.Execute;
     375  end;
    374376end;
    375377
Note: See TracChangeset for help on using the changeset viewer.