Changeset 107 for trunk


Ignore:
Timestamp:
Feb 17, 2016, 1:17:21 PM (9 years ago)
Author:
chronos
Message:
  • Added: Form constraintes which are also scaled for High DPI.
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAbout.lfm

    r98 r107  
    11object FormAbout: TFormAbout
    22  Left = 475
    3   Height = 229
     3  Height = 150
    44  Top = 161
    55  Width = 313
    66  BorderStyle = bsDialog
    77  Caption = 'About'
    8   ClientHeight = 229
     8  ClientHeight = 150
    99  ClientWidth = 313
     10  Constraints.MinHeight = 150
     11  Constraints.MinWidth = 313
    1012  Font.Height = -11
    1113  Font.Name = 'MS Sans Serif'
    1214  OnShow = FormShow
    1315  Position = poMainFormCenter
    14   LCLVersion = '1.3'
     16  LCLVersion = '1.4.4.0'
    1517  object Panel1: TPanel
    1618    Left = 8
    17     Height = 176
     19    Height = 97
    1820    Top = 8
    1921    Width = 299
     
    2123    BevelInner = bvRaised
    2224    BevelOuter = bvLowered
    23     ClientHeight = 176
     25    ClientHeight = 97
    2426    ClientWidth = 299
    2527    TabOrder = 0
    2628    object Memo1: TMemo
    2729      Left = 8
    28       Height = 157
     30      Height = 78
    2931      Top = 8
    3032      Width = 277
     
    3941    Left = 111
    4042    Height = 25
    41     Top = 196
     43    Top = 117
    4244    Width = 75
    4345    Anchors = [akLeft, akBottom]
  • trunk/Forms/UFormHelp.lfm

    r98 r107  
    11object FormHelp: TFormHelp
    22  Left = 560
    3   Height = 683
     3  Height = 223
    44  Top = 144
    5   Width = 850
     5  Width = 424
    66  Caption = 'Help'
    7   ClientHeight = 683
    8   ClientWidth = 850
     7  ClientHeight = 223
     8  ClientWidth = 424
     9  Constraints.MinHeight = 223
     10  Constraints.MinWidth = 424
    911  OnCreate = FormCreate
    1012  Position = poMainFormCenter
    11   LCLVersion = '1.3'
     13  LCLVersion = '1.4.4.0'
    1214  object Memo1: TMemo
    1315    Left = 6
    14     Height = 671
     16    Height = 211
    1517    Top = 6
    16     Width = 838
     18    Width = 412
    1719    Align = alClient
    1820    BorderSpacing.Around = 6
    1921    Lines.Strings = (
    20       'xTactics is a risk based strategic game. Main focus of the game is to offer player various possibilities to configure game conditions. Map for game is generated randomly for each play. Game is multiplayer so single player can play with other human opponents or with many computer opponents.'
     22      'xTactics is a risk based strategic game. Main '
     23      'focus of the game is to offer player various '
     24      'possibilities to configure game conditions. '
     25      'Map for game is generated randomly for each '
     26      'play. Game is multiplayer so single player can '
     27      'play with other human opponents or with '
     28      'many computer opponents.'
    2129    )
    2230    ReadOnly = True
  • trunk/Forms/UFormMain.lfm

    r100 r107  
    11object FormMain: TFormMain
    2   Left = 490
     2  Left = 784
    33  Height = 621
    4   Top = 358
     4  Top = 435
    55  Width = 775
    66  Caption = 'xTactics'
    7   ClientHeight = 595
     7  ClientHeight = 591
    88  ClientWidth = 775
    99  Menu = MainMenu1
     
    1414  OnKeyUp = FormKeyUp
    1515  OnShow = FormShow
    16   LCLVersion = '1.3'
     16  LCLVersion = '1.4.4.0'
    1717  WindowState = wsMaximized
    1818  object StatusBar1: TStatusBar
    1919    Left = 0
    20     Height = 26
    21     Top = 569
     20    Height = 28
     21    Top = 563
    2222    Width = 775
    2323    Panels = <   
     
    3535  object ToolBar1: TToolBar
    3636    Left = 0
    37     Height = 569
     37    Height = 563
    3838    Top = 0
    39     Width = 40
     39    Width = 80
    4040    Align = alLeft
    4141    ButtonHeight = 32
     
    117117  end
    118118  object PaintBox1: TPaintBox
    119     Left = 40
    120     Height = 569
     119    Left = 80
     120    Height = 563
    121121    Top = 0
    122     Width = 735
     122    Width = 695
    123123    Align = alClient
    124124    OnMouseDown = PaintBox1MouseDown
  • trunk/Forms/UFormMain.pas

    r100 r107  
    141141      PaintBox1.Canvas.Draw(0, 0, TempBitmap);
    142142    end else begin
     143      {$ifdef WINDOWS}
     144      PaintBox1.Canvas.Brush.Color := clBackground; //PaintBox1.GetColorResolvingParent;
     145      PaintBox1.Canvas.FillRect(0, 0, PaintBox1.Width, PaintBox1.Height);
     146      {$endif}
    143147      Paint(PaintBox1.Canvas);
    144148    end;
     
    203207  if AToolBarBigIcons.Checked then begin
    204208    ToolBar1.Images := Core.ImageListLarge;
    205     ToolBar1.ButtonWidth := 32 + 7;
    206     ToolBar1.ButtonHeight := 32 + 6;
    207     ToolBar1.Height := 32 + 10;
    208     ToolBar1.Width := 32 + 10;
     209    ToolBar1.ButtonWidth := Core.ImageListLarge.Width + 7;
     210    ToolBar1.ButtonHeight := Core.ImageListLarge.Height + 6;
     211    ToolBar1.Width := Core.ImageListLarge.Width + 10;
     212    ToolBar1.Height := Core.ImageListLarge.Height + 10;
    209213  end else begin
    210     ToolBar1.ButtonWidth := 16 + 7;
    211     ToolBar1.ButtonHeight := 16 + 6;
    212     ToolBar1.Height := 16 + 10;
    213     ToolBar1.Width := 16 + 10;
    214214    ToolBar1.Images := Core.ImageListSmall;
     215    ToolBar1.ButtonWidth := Core.ImageListSmall.Width + 7;
     216    ToolBar1.ButtonHeight := Core.ImageListSmall.Height + 6;
     217    ToolBar1.Width := Core.ImageListSmall.Width + 10;
     218    ToolBar1.Height := Core.ImageListSmall.Height + 10;
    215219  end;
    216220  ToolBar1.Visible := AToolBarVisible.Checked;
  • trunk/Forms/UFormMove.lfm

    r98 r107  
    88  ClientHeight = 257
    99  ClientWidth = 367
     10  Constraints.MinHeight = 257
     11  Constraints.MinWidth = 367
    1012  OnCreate = FormCreate
    1113  OnKeyPress = FormKeyPress
    1214  OnShow = FormShow
    1315  Position = poMainFormCenter
    14   LCLVersion = '1.3'
     16  LCLVersion = '1.4.4.0'
    1517  object SpinEditOnce: TSpinEdit
    1618    Left = 208
    17     Height = 32
     19    Height = 33
    1820    Top = 40
    1921    Width = 98
     
    2426  object Label1: TLabel
    2527    Left = 16
    26     Height = 22
     28    Height = 25
    2729    Top = 40
    28     Width = 46
     30    Width = 45
    2931    Caption = 'Once:'
    3032    ParentColor = False
     
    5153  object Label2: TLabel
    5254    Left = 24
    53     Height = 22
     55    Height = 25
    5456    Top = 136
    55     Width = 91
     57    Width = 83
    5658    Caption = 'Every turn:'
    5759    ParentColor = False
     
    5961  object SpinEditRepeat: TSpinEdit
    6062    Left = 208
    61     Height = 32
     63    Height = 33
    6264    Top = 128
    6365    Width = 98
     
    132134  object Label3: TLabel
    133135    Left = 16
    134     Height = 22
     136    Height = 25
    135137    Top = 8
    136     Width = 132
     138    Width = 126
    137139    Caption = 'Win probability:'
    138140    ParentColor = False
     
    140142  object LabelWinProbability: TLabel
    141143    Left = 264
    142     Height = 22
     144    Height = 25
    143145    Top = 8
    144146    Width = 15
  • trunk/Forms/UFormNew.lfm

    r100 r107  
    11object FormNew: TFormNew
    2   Left = 624
    3   Height = 519
    4   Top = 313
    5   Width = 1229
     2  Left = 1176
     3  Height = 501
     4  Top = 331
     5  Width = 677
    66  Caption = 'New game'
    7   ClientHeight = 519
    8   ClientWidth = 1229
     7  ClientHeight = 501
     8  ClientWidth = 677
     9  Constraints.MinHeight = 501
     10  Constraints.MinWidth = 667
    911  OnCreate = FormCreate
    1012  OnDestroy = FormDestroy
    1113  OnShow = FormShow
    1214  Position = poMainFormCenter
    13   LCLVersion = '1.3'
     15  LCLVersion = '1.4.4.0'
    1416  object ButtonCancel: TButton
    15     Left = 1006
     17    Left = 454
    1618    Height = 25
    17     Top = 477
     19    Top = 459
    1820    Width = 75
    1921    Anchors = [akRight, akBottom]
     
    2325  end
    2426  object ButtonOk: TButton
    25     Left = 1110
     27    Left = 558
    2628    Height = 25
    27     Top = 477
     29    Top = 459
    2830    Width = 75
    2931    Anchors = [akRight, akBottom]
     
    3436  object PageControl1: TPageControl
    3537    Left = 4
    36     Height = 457
     38    Height = 439
    3739    Top = 4
    38     Width = 1221
     40    Width = 669
    3941    ActivePage = TabSheet2
    4042    Align = alTop
     
    4547    object TabSheet1: TTabSheet
    4648      Caption = 'Players'
    47       ClientHeight = 417
    48       ClientWidth = 1215
     49      ClientHeight = 398
     50      ClientWidth = 854
    4951      object ListView1: TListView
    5052        Left = 4
    51         Height = 367
     53        Height = 348
    5254        Top = 4
    53         Width = 1207
     55        Width = 846
    5456        Align = alTop
    5557        Anchors = [akTop, akLeft, akRight, akBottom]
     
    8890        Left = 224
    8991        Height = 25
    90         Top = 379
     92        Top = 360
    9193        Width = 83
    9294        Action = APlayerRemove
     
    9799        Left = 16
    98100        Height = 25
    99         Top = 379
     101        Top = 360
    100102        Width = 83
    101103        Action = APlayerAdd
     
    106108        Left = 120
    107109        Height = 25
    108         Top = 379
     110        Top = 360
    109111        Width = 83
    110112        Action = APlayerModify
     
    116118    object TabSheet2: TTabSheet
    117119      Caption = 'Map'
    118       ClientHeight = 417
    119       ClientWidth = 1215
     120      ClientHeight = 401
     121      ClientWidth = 661
    120122      object Label1: TLabel
    121123        Left = 8
    122         Height = 22
     124        Height = 25
    123125        Top = 9
    124         Width = 92
     126        Width = 89
    125127        Caption = 'Map width:'
    126128        ParentColor = False
     
    128130      object Label2: TLabel
    129131        Left = 8
    130         Height = 22
     132        Height = 25
    131133        Top = 57
    132         Width = 99
     134        Width = 95
    133135        Caption = 'Map height:'
    134136        ParentColor = False
     
    136138      object SpinEditMapSizeX: TSpinEdit
    137139        Left = 128
    138         Height = 32
     140        Height = 33
    139141        Top = 4
    140142        Width = 98
     
    146148      object SpinEditMapSizeY: TSpinEdit
    147149        Left = 128
    148         Height = 32
     150        Height = 33
    149151        Top = 55
    150152        Width = 98
     
    158160        Height = 46
    159161        Top = 8
    160         Width = 964
     162        Width = 410
    161163        Max = 100
    162164        Min = 2
     
    171173        Height = 46
    172174        Top = 49
    173         Width = 964
     175        Width = 410
    174176        Max = 100
    175177        Min = 2
     
    182184      object Label5: TLabel
    183185        Left = 8
    184         Height = 22
     186        Height = 25
    185187        Top = 104
    186         Width = 81
     188        Width = 77
    187189        Caption = 'Grid type:'
    188190        ParentColor = False
     
    190192      object ComboBoxGridType: TComboBox
    191193        Left = 146
    192         Height = 30
     194        Height = 33
    193195        Top = 104
    194196        Width = 208
    195         ItemHeight = 0
     197        ItemHeight = 25
    196198        Items.Strings = (
    197199          'Hexagonal'
     
    204206      object ComboBoxMapShape: TComboBox
    205207        Left = 146
    206         Height = 30
     208        Height = 33
    207209        Top = 144
    208210        Width = 208
    209         ItemHeight = 0
     211        ItemHeight = 25
    210212        Items.Strings = (
    211213          'Hexagonal'
     
    219221      object Label8: TLabel
    220222        Left = 8
    221         Height = 22
     223        Height = 25
    222224        Top = 144
    223         Width = 97
     225        Width = 92
    224226        Caption = 'Map shape:'
    225227        ParentColor = False
     
    229231        Height = 27
    230232        Top = 110
    231         Width = 727
     233        Width = 173
    232234        Anchors = [akTop, akLeft, akRight]
    233235        AutoSize = False
     
    237239      object SpinEditVoidPercent: TSpinEdit
    238240        Left = 216
    239         Height = 32
     241        Height = 33
    240242        Top = 224
    241243        Width = 106
     
    246248      object CheckBoxVoid: TCheckBox
    247249        Left = 8
    248         Height = 24
     250        Height = 29
    249251        Top = 232
    250         Width = 183
     252        Width = 177
    251253        Caption = 'Inaccessible places'
    252254        OnChange = CheckBoxVoidChange
     
    255257      object CheckBoxCity: TCheckBox
    256258        Left = 8
    257         Height = 24
     259        Height = 29
    258260        Top = 272
    259         Width = 69
     261        Width = 72
    260262        Caption = 'Cities'
    261263        OnChange = CheckBoxCityChange
     
    264266      object SpinEditCityPercent: TSpinEdit
    265267        Left = 216
    266         Height = 32
     268        Height = 33
    267269        Top = 272
    268270        Width = 106
     
    273275      object Label4: TLabel
    274276        Left = 331
    275         Height = 22
     277        Height = 25
    276278        Top = 272
    277279        Width = 15
     
    281283      object Label3: TLabel
    282284        Left = 331
    283         Height = 22
     285        Height = 25
    284286        Top = 232
    285287        Width = 15
     
    289291      object SpinEditNeutralUnits: TSpinEdit
    290292        Left = 408
    291         Height = 32
     293        Height = 33
    292294        Top = 352
    293295        Width = 98
     
    299301      object Label7: TLabel
    300302        Left = 8
    301         Height = 22
     303        Height = 25
    302304        Top = 352
    303         Width = 221
     305        Width = 207
    304306        Caption = 'Max random neutral units:'
    305307        ParentColor = False
     
    307309      object EditImageFile: TEdit
    308310        Left = 144
    309         Height = 32
     311        Height = 33
    310312        Top = 184
    311         Width = 948
     313        Width = 394
    312314        Anchors = [akTop, akLeft, akRight]
    313315        TabOrder = 12
    314316      end
    315317      object ButtonImageBrowse: TButton
    316         Left = 1100
     318        Left = 546
    317319        Height = 25
    318320        Top = 192
     
    325327      object Label9: TLabel
    326328        Left = 8
    327         Height = 22
     329        Height = 25
    328330        Top = 184
    329         Width = 88
     331        Width = 82
    330332        Caption = 'Image file:'
    331333        ParentColor = False
     
    333335      object CheckBoxBridges: TCheckBox
    334336        Left = 8
    335         Height = 24
     337        Height = 29
    336338        Top = 310
    337         Width = 204
     339        Width = 199
    338340        Caption = 'Bridges between cells'
    339341        TabOrder = 14
     
    342344    object TabSheet3: TTabSheet
    343345      Caption = 'Rules'
    344       ClientHeight = 417
    345       ClientWidth = 1215
     346      ClientHeight = 398
     347      ClientWidth = 854
    346348      object RadioGroupGrowCells: TRadioGroup
    347349        Left = 15
     
    358360        ChildSizing.Layout = cclLeftToRightThenTopToBottom
    359361        ChildSizing.ControlsPerLine = 1
    360         ClientHeight = 81
     362        ClientHeight = 75
    361363        ClientWidth = 308
    362364        Items.Strings = (
     
    369371      object Label6: TLabel
    370372        Left = 8
    371         Height = 22
     373        Height = 25
    372374        Top = 248
    373         Width = 116
     375        Width = 111
    374376        Caption = 'Win objective:'
    375377        ParentColor = False
     
    377379      object ComboBoxWinObjective: TComboBox
    378380        Left = 232
    379         Height = 30
     381        Height = 33
    380382        Top = 240
    381383        Width = 328
    382         ItemHeight = 0
     384        ItemHeight = 25
    383385        Items.Strings = (
    384386          'Defeat all oponents'
     
    404406        ChildSizing.Layout = cclLeftToRightThenTopToBottom
    405407        ChildSizing.ControlsPerLine = 1
    406         ClientHeight = 52
     408        ClientHeight = 46
    407409        ClientWidth = 301
    408410        Items.Strings = (
     
    416418        Height = 27
    417419        Top = 24
    418         Width = 864
     420        Width = 503
    419421        Anchors = [akTop, akLeft, akRight]
    420422        AutoSize = False
  • trunk/Forms/UFormPlayer.lfm

    r98 r107  
    11object FormPlayer: TFormPlayer
    22  Left = 470
    3   Height = 347
     3  Height = 279
    44  Top = 219
    5   Width = 551
     5  Width = 522
    66  Caption = 'Player'
    7   ClientHeight = 347
    8   ClientWidth = 551
     7  ClientHeight = 279
     8  ClientWidth = 522
     9  Constraints.MinHeight = 279
     10  Constraints.MinWidth = 522
    911  Position = poMainFormCenter
    10   LCLVersion = '1.3'
     12  LCLVersion = '1.4.4.0'
    1113  object Label1: TLabel
    1214    Left = 28
    13     Height = 22
     15    Height = 25
    1416    Top = 27
    15     Width = 53
     17    Width = 51
    1618    Caption = 'Name:'
    1719    ParentColor = False
     
    1921  object EditName: TEdit
    2022    Left = 139
    21     Height = 32
     23    Height = 33
    2224    Top = 27
    2325    Width = 368
     26    Anchors = [akTop, akLeft, akRight]
    2427    TabOrder = 0
    2528  end
    2629  object ButtonCancel: TButton
    27     Left = 307
     30    Left = 278
    2831    Height = 25
    29     Top = 296
     32    Top = 242
    3033    Width = 75
    3134    Anchors = [akRight, akBottom]
     
    3538  end
    3639  object ButtonOk: TButton
    37     Left = 428
     40    Left = 403
    3841    Height = 25
    39     Top = 296
     42    Top = 242
    4043    Width = 75
    4144    Anchors = [akRight, akBottom]
     
    4750  object ComboBox1: TComboBox
    4851    Left = 139
    49     Height = 30
     52    Height = 33
    5053    Top = 72
    5154    Width = 368
    52     ItemHeight = 0
     55    Anchors = [akTop, akLeft, akRight]
     56    ItemHeight = 25
    5357    ItemIndex = 0
    5458    Items.Strings = (
     
    6266  object Label2: TLabel
    6367    Left = 24
    64     Height = 22
     68    Height = 25
    6569    Top = 72
    6670    Width = 51
     
    7074  object Label3: TLabel
    7175    Left = 24
    72     Height = 22
     76    Height = 25
    7377    Top = 128
    7478    Width = 47
     
    7882  object ColorBox1: TColorBox
    7983    Left = 139
    80     Height = 34
     84    Height = 28
    8185    Top = 120
    8286    Width = 368
    8387    Style = [cbStandardColors, cbExtendedColors, cbCustomColor, cbPrettyNames]
    84     ItemHeight = 0
     88    Anchors = [akTop, akLeft, akRight]
     89    ItemHeight = 20
    8590    TabOrder = 4
    8691  end
    8792  object Label4: TLabel
    8893    Left = 24
    89     Height = 22
     94    Height = 25
    9095    Top = 168
    91     Width = 96
     96    Width = 90
    9297    Caption = 'Agressivity:'
    9398    ParentColor = False
     
    95100  object ComboBoxAgressivity: TComboBox
    96101    Left = 139
    97     Height = 30
     102    Height = 33
    98103    Top = 168
    99104    Width = 368
    100     ItemHeight = 0
     105    Anchors = [akTop, akLeft, akRight]
     106    ItemHeight = 25
    101107    Items.Strings = (
    102108      'Low'
     
    110116  object CheckBoxDefensive: TCheckBox
    111117    Left = 24
    112     Height = 24
     118    Height = 29
    113119    Top = 208
    114120    Width = 107
  • trunk/Forms/UFormSettings.lfm

    r99 r107  
    11object FormSettings: TFormSettings
    22  Left = 404
    3   Height = 563
    4   Top = 338
    5   Width = 700
     3  Height = 327
     4  Top = 574
     5  Width = 554
    66  ActiveControl = ButtonOk
    77  Caption = 'Settings'
    8   ClientHeight = 563
    9   ClientWidth = 700
     8  ClientHeight = 327
     9  ClientWidth = 554
     10  Constraints.MinHeight = 327
     11  Constraints.MinWidth = 554
    1012  OnCreate = FormCreate
    1113  OnShow = FormShow
    1214  Position = poMainFormCenter
    13   LCLVersion = '1.3'
     15  LCLVersion = '1.4.4.0'
    1416  object ButtonOk: TButton
    15     Left = 590
     17    Left = 444
    1618    Height = 25
    17     Top = 520
     19    Top = 284
    1820    Width = 75
    1921    Anchors = [akRight, akBottom]
     
    2325  end
    2426  object ButtonCancel: TButton
    25     Left = 468
     27    Left = 322
    2628    Height = 25
    27     Top = 520
     29    Top = 284
    2830    Width = 75
    2931    Anchors = [akRight, akBottom]
     
    3436  object PageControl1: TPageControl
    3537    Left = 4
    36     Height = 500
     38    Height = 264
    3739    Top = 4
    38     Width = 692
    39     ActivePage = TabSheetDebug
     40    Width = 546
     41    ActivePage = TabSheetGeneral
    4042    Align = alTop
    4143    Anchors = [akTop, akLeft, akRight, akBottom]
    4244    BorderSpacing.Around = 4
    43     TabIndex = 1
     45    TabIndex = 0
    4446    TabOrder = 2
    4547    object TabSheetGeneral: TTabSheet
    4648      Caption = 'General'
    47       ClientHeight = 460
    48       ClientWidth = 686
     49      ClientHeight = 226
     50      ClientWidth = 538
    4951      object Label2: TLabel
    5052        Left = 27
    51         Height = 22
     53        Height = 25
    5254        Top = 78
    53         Width = 145
     55        Width = 139
    5456        Caption = 'Animation speed:'
    5557        ParentColor = False
     
    5759      object SpinEditAnimSpeed: TSpinEdit
    5860        Left = 232
    59         Height = 32
     61        Height = 33
    6062        Top = 72
    6163        Width = 122
     
    6466      object Label3: TLabel
    6567        Left = 368
    66         Height = 22
     68        Height = 25
    6769        Top = 82
    6870        Width = 15
     
    7476        Height = 27
    7577        Top = 112
    76         Width = 732
     78        Width = 584
    7779        Anchors = [akTop, akLeft, akRight]
    7880        AutoSize = False
     
    8284      object Label1: TLabel
    8385        Left = 20
    84         Height = 22
     86        Height = 25
    8587        Top = 26
    86         Width = 85
     88        Width = 81
    8789        Caption = 'Language:'
    8890        ParentColor = False
     
    9092      object ComboBoxLanguage: TComboBox
    9193        Left = 178
    92         Height = 34
     94        Height = 33
    9395        Top = 24
    9496        Width = 196
    95         ItemHeight = 0
     97        ItemHeight = 25
    9698        Style = csDropDownList
    9799        TabOrder = 2
     
    100102    object TabSheetDebug: TTabSheet
    101103      Caption = 'Debug'
    102       ClientHeight = 460
    103       ClientWidth = 686
     104      ClientHeight = 226
     105      ClientWidth = 538
    104106      object CheckBoxDevelMode: TCheckBox
    105107        Left = 16
    106108        Height = 27
    107109        Top = 136
    108         Width = 660
     110        Width = 512
    109111        Anchors = [akTop, akLeft, akRight]
    110112        AutoSize = False
     
    114116      object Label4: TLabel
    115117        Left = 14
    116         Height = 22
     118        Height = 25
    117119        Top = 67
    118         Width = 33
     120        Width = 32
    119121        Caption = 'DPI:'
    120122        ParentColor = False
     
    122124      object SpinEditX: TSpinEdit
    123125        Left = 104
    124         Height = 32
     126        Height = 33
    125127        Top = 64
    126128        Width = 96
     
    132134      object SpinEditY: TSpinEdit
    133135        Left = 232
    134         Height = 32
     136        Height = 33
    135137        Top = 64
    136138        Width = 90
     
    142144      object Label5: TLabel
    143145        Left = 208
    144         Height = 22
     146        Height = 25
    145147        Top = 67
    146         Width = 9
     148        Width = 8
    147149        Caption = 'x'
    148150        ParentColor = False
     
    152154        Height = 24
    153155        Top = 32
    154         Width = 656
     156        Width = 508
    155157        Anchors = [akTop, akLeft, akRight]
    156158        AutoSize = False
  • trunk/Languages/xtactics.cs.po

    r100 r107  
    632632msgid "Zero zoom not allowed"
    633633msgstr "Nulové přiblížení není povoleno"
     634
  • trunk/Packages/Common/UScaleDPI.pas

    r91 r107  
    1717  TControlDimension = class
    1818    BoundsRect: TRect;
    19     AuxSize: TPoint;
    2019    FontHeight: Integer;
    2120    Controls: TObjectList; // TList<TControlDimension>
     21    // Class specifics
     22    ButtonSize: TPoint; // TToolBar
     23    CoolBandWidth: Integer;
     24    ConstraintsMin: TPoint; // TForm
     25    ConstraintsMax: TPoint; // TForm
    2226    constructor Create;
    2327    destructor Destroy; override;
     
    7478destructor TControlDimension.Destroy;
    7579begin
    76   Controls.Free;
     80  FreeAndNil(Controls);
    7781  inherited Destroy;
    7882end;
     
    113117  Dimensions.Controls.Clear;
    114118  if Control is TToolBar then
    115     Dimensions.AuxSize := Point(TToolBar(Control).ButtonWidth, TToolBar(Control).ButtonHeight);
    116 
     119    Dimensions.ButtonSize := Point(TToolBar(Control).ButtonWidth, TToolBar(Control).ButtonHeight);
     120  if Control is TForm then begin
     121    Dimensions.ConstraintsMin := Point(TForm(Control).Constraints.MinWidth,
     122      TForm(Control).Constraints.MinHeight);
     123    Dimensions.ConstraintsMax := Point(TForm(Control).Constraints.MaxWidth,
     124      TForm(Control).Constraints.MaxHeight);
     125  end;
    117126  if Control is TWinControl then
    118127  for I := 0 to TWinControl(Control).ControlCount - 1 do begin
    119     if TWinControl(Control).Controls[I] is TControl then begin
     128    if TWinControl(Control).Controls[I] is TControl then
     129    // Do not scale docked forms twice
     130    if not (TWinControl(Control).Controls[I] is TForm) then begin
    120131      NewControl := TControlDimension.Create;
    121132      Dimensions.Controls.Add(NewControl);
     
    133144  Control.Font.Height := Dimensions.FontHeight;
    134145  if Control is TToolBar then begin
    135     TToolBar(Control).ButtonWidth := Dimensions.AuxSize.X;
    136     TToolBar(Control).ButtonHeight := Dimensions.AuxSize.Y;
     146    TToolBar(Control).ButtonWidth := Dimensions.ButtonSize.X;
     147    TToolBar(Control).ButtonHeight := Dimensions.ButtonSize.Y;
     148  end;
     149  if Control is TForm then begin
     150    TForm(Control).Constraints.MinWidth := Dimensions.ConstraintsMin.X;
     151    TForm(Control).Constraints.MinHeight := Dimensions.ConstraintsMin.Y;
     152    TForm(Control).Constraints.MaxWidth := Dimensions.ConstraintsMax.X;
     153    TForm(Control).Constraints.MaxHeight := Dimensions.ConstraintsMax.Y;
    137154  end;
    138155  if Control is TWinControl then
    139156  for I := 0 to TWinControl(Control).ControlCount - 1 do begin
    140     if TWinControl(Control).Controls[I] is TControl then begin
     157    if TWinControl(Control).Controls[I] is TControl then
     158    // Do not scale docked forms twice
     159    if not (TWinControl(Control).Controls[I] is TForm) then begin
    141160      RestoreDimensions(TWinControl(Control).Controls[I], TControlDimension(Dimensions.Controls[I]));
    142161    end;
     
    152171  Control.Font.Height := ScaleY(Dimensions.FontHeight, DesignDPI.Y);
    153172  if Control is TToolBar then begin
    154     TToolBar(Control).ButtonWidth := ScaleX(Dimensions.AuxSize.X, DesignDPI.X);
    155     TToolBar(Control).ButtonHeight := ScaleY(Dimensions.AuxSize.Y, DesignDPI.Y);
     173    TToolBar(Control).ButtonWidth := ScaleX(Dimensions.ButtonSize.X, DesignDPI.X);
     174    TToolBar(Control).ButtonHeight := ScaleY(Dimensions.ButtonSize.Y, DesignDPI.Y);
     175  end;
     176  if Control is TCoolBar then begin
     177    with TCoolBar(Control) do
     178    for I := 0 to Bands.Count - 1 do
     179    with TCoolBand(Bands[I]) do begin
     180      MinWidth := ScaleX(Dimensions.ButtonSize.X, DesignDPI.X);
     181      MinHeight := ScaleY(Dimensions.ButtonSize.Y, DesignDPI.Y);
     182      //Width := ScaleX(Dimensions.BoundsRect.Left -
     183    end;
     184  end;
     185  if Control is TForm then begin
     186    TForm(Control).Constraints.MinWidth := ScaleX(Dimensions.ConstraintsMin.X, DesignDPI.X);
     187    TForm(Control).Constraints.MaxWidth := ScaleX(Dimensions.ConstraintsMax.X, DesignDPI.X);
     188    TForm(Control).Constraints.MinHeight := ScaleY(Dimensions.ConstraintsMin.Y, DesignDPI.Y);
     189    TForm(Control).Constraints.MaxHeight := ScaleY(Dimensions.ConstraintsMax.Y, DesignDPI.Y);
    156190  end;
    157191  if Control is TWinControl then
    158192  for I := 0 to TWinControl(Control).ControlCount - 1 do begin
    159     if TWinControl(Control).Controls[I] is TControl then begin
     193    if TWinControl(Control).Controls[I] is TControl then
     194    // Do not scale docked forms twice
     195    if not (TWinControl(Control).Controls[I] is TForm) then begin
    160196      ScaleDimensions(TWinControl(Control).Controls[I], TControlDimension(Dimensions.Controls[I]));
    161197    end;
     
    183219
    184220  SetLength(Temp, ImgList.Count);
    185   TempBmp := TBitmap.Create;
    186221  for I := 0 to ImgList.Count - 1 do
    187222  begin
     223    TempBmp := TBitmap.Create;
     224    TempBmp.PixelFormat := pf32bit;
    188225    ImgList.GetBitmap(I, TempBmp);
    189     //TempBmp.PixelFormat := pfDevice;
    190226    Temp[I] := TBitmap.Create;
    191227    Temp[I].SetSize(NewWidth, NewHeight);
     228    Temp[I].PixelFormat := pf32bit;
    192229    Temp[I].TransparentColor := TempBmp.TransparentColor;
    193230    //Temp[I].TransparentMode := TempBmp.TransparentMode;
     
    199236    if (Temp[I].Width = 0) or (Temp[I].Height = 0) then Continue;
    200237    Temp[I].Canvas.StretchDraw(Rect(0, 0, Temp[I].Width, Temp[I].Height), TempBmp);
    201   end;
    202   TempBmp.Free;
     238    TempBmp.Free;
     239  end;
    203240
    204241  ImgList.Clear;
     
    272309  end;
    273310
    274 
    275 
    276311  if Control is TToolBar then begin
    277312    ToolBarControl := TToolBar(Control);
  • trunk/UCore.pas

    r103 r107  
    5959    procedure SaveConfig;
    6060    procedure CommandLineParams;
     61    procedure ScaleDPI;
    6162  public
    6263    Game: TGame;
     
    196197end;
    197198
     199procedure TCore.ScaleDPI;
     200var
     201  I: Integer;
     202begin
     203  {$ifdef DEBUG}
     204  with Core.ScaleDPI1 do begin
     205    //DesignDPI := Point(144, 144);
     206    if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin
     207      //ApplyToAll(DesignDPI);
     208      FormNew.Show;
     209      FormNew.Hide;
     210      for I := 0 to Screen.FormCount - 1 do begin
     211        StoreDimensions(Screen.Forms[I], StoredDimension);
     212        ScaleDimensions(Screen.Forms[I], StoredDimension);
     213      end;
     214      ScaleImageList(Core.ImageListSmall, DesignDPI);
     215      ScaleImageList(Core.ImageListLarge, DesignDPI);
     216    end;
     217  end;
     218  {$endif}
     219end;
     220
    198221procedure TCore.UpdateActions;
    199222begin
     
    351374
    352375  CommandLineParams;
    353 
    354   {$IFDEF DEBUG}
    355   {with Core.ScaleDPI1 do
    356   if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin
    357     //ApplyToAll(DesignDPI);
    358     FormNew.Show;
    359     FormNew.Hide;
    360     for I := 0 to Screen.FormCount - 1 do begin
    361       StoreDimensions(Screen.Forms[I], StoredDimension);
    362       ScaleDimensions(Screen.Forms[I], StoredDimension);
    363     end;
    364     ScaleImageList(Core.ImageListSmall, DesignDPI);
    365     ScaleImageList(Core.ImageListLarge, DesignDPI);
    366   end;
    367   }
    368   {$ENDIF}
     376  ScaleDPI;
    369377
    370378  if Game.FileName = '' then begin
  • trunk/xtactics.lpi

    r106 r107  
    99      <ResourceType Value="res"/>
    1010      <UseXPManifest Value="True"/>
     11      <XPManifest>
     12        <DpiAware Value="True"/>
     13      </XPManifest>
    1114      <Icon Value="0"/>
    1215    </General>
     
    1821      <StringTable ProductVersion=""/>
    1922    </VersionInfo>
    20     <MacroValues Count="1">
    21       <Macro1 Name="LCLWidgetType" Value="qt"/>
    22     </MacroValues>
    2323    <BuildModes Count="2">
    2424      <Item1 Name="Debug" Default="True"/>
    2525      <Item2 Name="Release">
    26         <MacroValues Count="1">
    27           <Macro1 Name="LCLWidgetType" Value="qt"/>
    28         </MacroValues>
    2926        <CompilerOptions>
    3027          <Version Value="11"/>
     
    6562        </CompilerOptions>
    6663      </Item2>
    67       <SharedMatrixOptions Count="1">
    68         <Item1 ID="462723536445" Modes="Debug,Release" Type="IDEMacro" MacroName="LCLWidgetType" Value="qt"/>
    69       </SharedMatrixOptions>
    7064    </BuildModes>
    7165    <PublishOptions>
     
    10599        <Filename Value="UGame.pas"/>
    106100        <IsPartOfProject Value="True"/>
    107         <UnitName Value="UGame"/>
    108101      </Unit1>
    109102      <Unit2>
     
    113106        <HasResources Value="True"/>
    114107        <ResourceBaseClass Value="DataModule"/>
    115         <UnitName Value="UCore"/>
    116108      </Unit2>
    117109      <Unit3>
     
    128120        <HasResources Value="True"/>
    129121        <ResourceBaseClass Value="Form"/>
    130         <UnitName Value="UFormSettings"/>
    131122      </Unit4>
    132123      <Unit5>
     
    136127        <HasResources Value="True"/>
    137128        <ResourceBaseClass Value="Form"/>
    138         <UnitName Value="UFormMain"/>
    139129      </Unit5>
    140130      <Unit6>
     
    151141        <HasResources Value="True"/>
    152142        <ResourceBaseClass Value="Form"/>
    153         <UnitName Value="UFormNew"/>
    154143      </Unit7>
    155144      <Unit8>
Note: See TracChangeset for help on using the changeset viewer.