Changeset 59 for trunk/Forms


Ignore:
Timestamp:
Dec 3, 2014, 9:09:42 PM (9 years ago)
Author:
chronos
Message:
  • Added: Support for high DPI screens. If not detected automatically correctly then user can specify desired values.
  • Updated: Common package to newer version.
Location:
trunk/Forms
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCPU.lfm

    r39 r59  
    77  ClientHeight = 287
    88  ClientWidth = 414
    9   LCLVersion = '0.9.31'
     9  LCLVersion = '1.3'
    1010  object Label4: TLabel
    1111    Left = 8
    12     Height = 18
    13     Top = 42
    14     Width = 87
     12    Height = 25
     13    Top = 48
     14    Width = 124
    1515    Caption = 'Step counter:'
    1616    ParentColor = False
     
    1818  object Label7: TLabel
    1919    Left = 8
    20     Height = 18
    21     Top = 62
    22     Width = 45
     20    Height = 25
     21    Top = 72
     22    Width = 63
    2323    Caption = 'Speed:'
    2424    ParentColor = False
    2525  end
    2626  object LabelStepSpeed: TLabel
    27     Left = 119
    28     Height = 18
    29     Top = 62
    30     Width = 13
     27    Left = 192
     28    Height = 25
     29    Top = 72
     30    Width = 15
    3131    Caption = '   '
    3232    ParentColor = False
    3333  end
    3434  object LabelStepCounter: TLabel
    35     Left = 119
    36     Height = 18
    37     Top = 42
    38     Width = 13
     35    Left = 192
     36    Height = 25
     37    Top = 48
     38    Width = 15
    3939    Caption = '   '
    4040    ParentColor = False
    4141  end
    4242  object LabelMemoryPointer: TLabel
    43     Left = 119
    44     Height = 18
     43    Left = 192
     44    Height = 25
    4545    Top = 24
    46     Width = 13
     46    Width = 15
    4747    Caption = '   '
    4848    ParentColor = False
    4949  end
    5050  object LabelProgramPointer: TLabel
    51     Left = 119
    52     Height = 18
    53     Top = 8
    54     Width = 13
     51    Left = 192
     52    Height = 25
     53    Top = 0
     54    Width = 15
    5555    Caption = '   '
    5656    ParentColor = False
     
    5858  object Label3: TLabel
    5959    Left = 8
    60     Height = 18
    61     Top = 8
    62     Width = 110
     60    Height = 25
     61    Top = 0
     62    Width = 159
    6363    Caption = 'Program pointer:'
    6464    ParentColor = False
     
    6666  object Label5: TLabel
    6767    Left = 8
    68     Height = 18
     68    Height = 25
    6969    Top = 24
    70     Width = 108
     70    Width = 156
    7171    Caption = 'Memory pointer:'
    7272    ParentColor = False
  • trunk/Forms/UFormInput.lfm

    r39 r59  
    77  ClientHeight = 240
    88  ClientWidth = 320
    9   LCLVersion = '0.9.31'
     9  LCLVersion = '1.3'
    1010  object MemoInput: TMemo
    11     Left = 8
    12     Height = 210
    13     Top = 22
    14     Width = 309
    15     Anchors = [akTop, akLeft, akRight, akBottom]
     11    Left = 4
     12    Height = 203
     13    Top = 33
     14    Width = 312
     15    Align = alClient
     16    BorderSpacing.Around = 4
    1617    Font.Height = -12
    1718    Font.Name = 'Courier New'
     
    2223  end
    2324  object Label1: TLabel
    24     Left = 8
    25     Height = 18
    26     Top = 8
    27     Width = 38
     25    Left = 4
     26    Height = 25
     27    Top = 4
     28    Width = 312
     29    Align = alTop
     30    BorderSpacing.Around = 4
    2831    Caption = 'Input:'
    2932    ParentColor = False
  • trunk/Forms/UFormMain.lfm

    r52 r59  
    11object MainForm: TMainForm
    2   Left = 223
    3   Height = 430
    4   Top = 176
    5   Width = 670
     2  Left = 408
     3  Height = 586
     4  Top = 311
     5  Width = 860
    66  Caption = 'LazFuck'
    7   ClientHeight = 411
    8   ClientWidth = 670
     7  ClientHeight = 557
     8  ClientWidth = 860
    99  Menu = MainMenu1
    1010  OnCloseQuery = FormCloseQuery
     
    1212  OnDestroy = FormDestroy
    1313  OnShow = FormShow
    14   LCLVersion = '1.1'
     14  LCLVersion = '1.3'
    1515  WindowState = wsMaximized
    1616  object StatusBarMain: TStatusBar
    1717    Left = 0
    18     Height = 20
    19     Top = 391
    20     Width = 670
     18    Height = 29
     19    Top = 528
     20    Width = 860
    2121    Panels = <   
    2222      item
     
    3535    Height = 26
    3636    Top = 0
    37     Width = 670
     37    Width = 860
    3838    Images = ImageListMain
    3939    ParentShowHint = False
     
    128128  end
    129129  object PageControlRight: TPageControl
    130     Left = 277
    131     Height = 365
     130    Left = 467
     131    Height = 502
    132132    Top = 26
    133133    Width = 393
     
    139139    object TabSheetDebug: TTabSheet
    140140      Caption = 'Debug'
    141       ClientHeight = 357
    142       ClientWidth = 365
     141      ClientHeight = 496
     142      ClientWidth = 315
    143143      object PanelInput: TPanel
    144144        Left = 0
    145145        Height = 64
    146146        Top = 0
    147         Width = 365
     147        Width = 315
    148148        Align = alTop
    149149        BevelOuter = bvNone
     
    155155        Height = 5
    156156        Top = 64
    157         Width = 365
     157        Width = 315
    158158        Align = alTop
    159159        ResizeAnchor = akTop
     
    163163        Height = 259
    164164        Top = 69
    165         Width = 365
     165        Width = 315
    166166        Align = alTop
    167167        BevelOuter = bvNone
     
    173173        Height = 5
    174174        Top = 328
    175         Width = 365
     175        Width = 315
    176176        Align = alTop
    177177        ResizeAnchor = akTop
     
    181181        Height = 86
    182182        Top = 333
    183         Width = 365
     183        Width = 315
    184184        Align = alTop
    185185        BevelOuter = bvNone
     
    190190        Left = 0
    191191        Height = 5
    192         Top = 357
    193         Width = 365
     192        Top = 419
     193        Width = 315
    194194        Align = alTop
    195195        ResizeAnchor = akTop
     
    197197      object PanelMemory: TPanel
    198198        Left = 0
    199         Height = 0
    200         Top = 357
    201         Width = 365
     199        Height = 72
     200        Top = 424
     201        Width = 315
    202202        Align = alClient
    203203        BevelOuter = bvNone
     
    207207  end
    208208  object Splitter1: TSplitter
    209     Left = 272
    210     Height = 365
     209    Left = 462
     210    Height = 502
    211211    Top = 26
    212212    Width = 5
     
    216216  object PanelLeft: TPanel
    217217    Left = 0
    218     Height = 365
     218    Height = 502
    219219    Top = 26
    220     Width = 272
     220    Width = 462
    221221    Align = alClient
    222222    BevelOuter = bvNone
    223     ClientHeight = 365
    224     ClientWidth = 272
     223    ClientHeight = 502
     224    ClientWidth = 462
    225225    TabOrder = 4
    226226    object PageControlMain: TPageControl
    227227      Left = 0
    228       Height = 242
     228      Height = 379
    229229      Top = 0
    230       Width = 272
     230      Width = 462
    231231      ActivePage = TabSheetSource
    232232      Align = alClient
     
    244244      Left = 0
    245245      Height = 118
    246       Top = 247
    247       Width = 272
     246      Top = 384
     247      Width = 462
    248248      ActivePage = TabSheetMessages
    249249      Align = alBottom
     
    259259      Left = 0
    260260      Height = 5
    261       Top = 242
    262       Width = 272
     261      Top = 379
     262      Width = 462
    263263      Align = alBottom
    264264      ResizeAnchor = akBottom
  • trunk/Forms/UFormMain.pas

    r57 r59  
    197197procedure TMainForm.FormShow(Sender: TObject);
    198198begin
     199  with Core.ScaleDPI do begin
     200    ApplyToAll(DesignDPI);
     201    ScaleImageList(ImageListMain, DesignDPI);
     202  end;
    199203  Core.CoolTranslator1.Translate;
    200204  LoadFromRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);
     
    446450procedure TMainForm.AOptionsExecute(Sender: TObject);
    447451begin
     452  OptionsForm.Load;
    448453  //OptionsForm.LoadFromInterpretter(CurrentTarget);
    449454  if OptionsForm.ShowModal = mrOK then begin
    450455    //OptionsForm.SaveToInterpretter(CurrentTarget);
     456    OptionsForm.Save;
    451457  end;
    452458end;
  • trunk/Forms/UFormMemory.lfm

    r39 r59  
    77  ClientHeight = 259
    88  ClientWidth = 391
    9   LCLVersion = '0.9.31'
     9  LCLVersion = '1.3'
    1010  object Label6: TLabel
    11     Left = 8
    12     Height = 18
    13     Top = 8
    14     Width = 57
     11    Left = 4
     12    Height = 25
     13    Top = 4
     14    Width = 383
     15    Align = alTop
     16    BorderSpacing.Around = 4
    1517    Caption = 'Memory:'
    1618    ParentColor = False
    1719  end
    1820  object ListViewMemory: TListView
    19     Left = 8
    20     Height = 231
    21     Top = 24
    22     Width = 374
    23     Anchors = [akTop, akLeft, akRight, akBottom]
     21    Left = 4
     22    Height = 222
     23    Top = 33
     24    Width = 383
     25    Align = alClient
     26    BorderSpacing.Around = 4
    2427    Columns = <   
    2528      item
  • trunk/Forms/UFormOptions.lfm

    r37 r59  
    88  ClientWidth = 468
    99  OnShow = FormShow
    10   LCLVersion = '0.9.31'
     10  LCLVersion = '1.3'
    1111  object ButtonOk: TButton
    1212    Left = 389
     
    3131  end
    3232  object SpinEditCellSize: TSpinEdit
    33     Left = 136
    34     Height = 21
     33    Left = 165
     34    Height = 35
    3535    Top = 40
    3636    Width = 130
     
    3939  end
    4040  object SpinEditMemorySize: TSpinEdit
    41     Left = 136
    42     Height = 21
     41    Left = 165
     42    Height = 35
    4343    Top = 6
    4444    Width = 130
     
    4848  object Label1: TLabel
    4949    Left = 8
    50     Height = 14
     50    Height = 25
    5151    Top = 8
    52     Width = 64
     52    Width = 123
    5353    Caption = 'Memory size:'
    5454    ParentColor = False
     
    5656  object Label2: TLabel
    5757    Left = 8
    58     Height = 14
     58    Height = 25
    5959    Top = 40
    60     Width = 43
     60    Width = 79
    6161    Caption = 'Cell size:'
    6262    ParentColor = False
     
    6464  object Label3: TLabel
    6565    Left = 8
    66     Height = 14
     66    Height = 25
    6767    Top = 95
    68     Width = 97
     68    Width = 179
    6969    Caption = 'Interface language:'
    7070    ParentColor = False
     
    7272  object CheckBox1: TCheckBox
    7373    Left = 8
    74     Height = 17
    75     Top = 120
    76     Width = 159
     74    Height = 27
     75    Top = 128
     76    Width = 456
     77    Anchors = [akTop, akLeft, akRight]
     78    AutoSize = False
    7779    Caption = 'Reopend last opened project'
    7880    TabOrder = 4
    7981  end
    8082  object ComboBoxLanguage: TComboBox
    81     Left = 162
    82     Height = 21
    83     Top = 86
     83    Left = 248
     84    Height = 37
     85    Top = 83
    8486    Width = 188
    85     ItemHeight = 13
     87    ItemHeight = 0
    8688    Style = csDropDownList
    8789    TabOrder = 5
    8890  end
     91  object SpinEditDPIX: TSpinEdit
     92    Left = 104
     93    Height = 35
     94    Top = 193
     95    Width = 80
     96    MaxValue = 1000
     97    MinValue = 1
     98    TabOrder = 6
     99    Value = 1
     100  end
     101  object LabelDPI: TLabel
     102    Left = 24
     103    Height = 25
     104    Top = 201
     105    Width = 39
     106    Caption = 'DPI:'
     107    ParentColor = False
     108  end
     109  object SpinEditDPIY: TSpinEdit
     110    Left = 208
     111    Height = 35
     112    Top = 193
     113    Width = 80
     114    MaxValue = 1000
     115    MinValue = 1
     116    TabOrder = 7
     117    Value = 1
     118  end
     119  object LabelX: TLabel
     120    Left = 192
     121    Height = 25
     122    Top = 201
     123    Width = 10
     124    Caption = 'x'
     125    ParentColor = False
     126  end
     127  object CheckBoxDPIAuto: TCheckBox
     128    Left = 8
     129    Height = 27
     130    Top = 168
     131    Width = 448
     132    Anchors = [akTop, akLeft, akRight]
     133    AutoSize = False
     134    Caption = 'Automatic DPI'
     135    OnChange = CheckBoxDPIAutoChange
     136    TabOrder = 8
     137  end
    89138end
  • trunk/Forms/UFormOptions.pas

    r51 r59  
    11unit UFormOptions;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
     
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Spin, ComCtrls, UTargetInterpretter;
     9  Spin, UTargetInterpretter;
    1010
    1111type
     
    1717    ButtonCancel: TButton;
    1818    CheckBox1: TCheckBox;
     19    CheckBoxDPIAuto: TCheckBox;
    1920    ComboBoxLanguage: TComboBox;
    2021    Label1: TLabel;
    2122    Label2: TLabel;
    2223    Label3: TLabel;
     24    LabelDPI: TLabel;
     25    LabelX: TLabel;
     26    SpinEditDPIX: TSpinEdit;
     27    SpinEditDPIY: TSpinEdit;
    2328    SpinEditCellSize: TSpinEdit;
    2429    SpinEditMemorySize: TSpinEdit;
    2530    procedure ButtonOkClick(Sender: TObject);
     31    procedure CheckBoxDPIAutoChange(Sender: TObject);
    2632    procedure FormShow(Sender: TObject);
    2733  private
    2834    { private declarations }
    2935  public
     36    procedure UpdateInterface;
     37    procedure Load;
     38    procedure Save;
    3039    procedure LoadFromInterpretter(Interpretter: TTargetInterpretter);
    3140    procedure SaveToInterpretter(Interpretter: TTargetInterpretter);
     
    5261end;
    5362
     63procedure TOptionsForm.UpdateInterface;
     64begin
     65  SpinEditDPIX.Enabled := not CheckBoxDPIAuto.Checked;
     66  SpinEditDPIY.Enabled := not CheckBoxDPIAuto.Checked;
     67  LabelDPI.Enabled := not CheckBoxDPIAuto.Checked;
     68  LabelX.Enabled := not CheckBoxDPIAuto.Checked;
     69  if CheckBoxDPIAuto.Checked then begin
     70    SpinEditDPIX.Value := ScreenInfo.PixelsPerInchX;
     71    SpinEditDPIY.Value := ScreenInfo.PixelsPerInchY;
     72  end;
     73end;
     74
     75procedure TOptionsForm.Load;
     76begin
     77  SpinEditDPIX.Value := Core.ScaleDPI.DPI.X;
     78  SpinEditDPIY.Value := Core.ScaleDPI.DPI.Y;
     79  CheckBoxDPIAuto.Checked := Core.ScaleDPI.AutoDetect;
     80  UpdateInterface;
     81end;
     82
     83procedure TOptionsForm.Save;
     84begin
     85  Core.ScaleDPI.DPI.X := SpinEditDPIX.Value;
     86  Core.ScaleDPI.DPI.Y := SpinEditDPIY.Value;
     87  Core.ScaleDPI.AutoDetect := CheckBoxDPIAuto.Checked;
     88end;
     89
    5490procedure TOptionsForm.ButtonOkClick(Sender: TObject);
    5591begin
     
    5793    Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
    5894  Core.OpenProjectOnStart := CheckBox1.Checked;
     95end;
     96
     97procedure TOptionsForm.CheckBoxDPIAutoChange(Sender: TObject);
     98begin
     99  UpdateInterface;
    59100end;
    60101
  • trunk/Forms/UFormOutput.lfm

    r39 r59  
    11object FormOutput: TFormOutput
    22  Left = 256
    3   Height = 240
     3  Height = 440
    44  Top = 32
    55  Width = 320
    66  Caption = 'Output'
    7   ClientHeight = 240
     7  ClientHeight = 440
    88  ClientWidth = 320
    9   LCLVersion = '0.9.31'
     9  LCLVersion = '1.3'
    1010  object Label2: TLabel
    11     Left = 8
    12     Height = 18
    13     Top = 6
    14     Width = 49
     11    Left = 4
     12    Height = 25
     13    Top = 4
     14    Width = 312
     15    Align = alTop
     16    BorderSpacing.Around = 4
    1517    Caption = 'Output:'
    1618    ParentColor = False
    1719  end
    1820  object MemoOutput: TMemo
    19     Left = 8
    20     Height = 211
    21     Top = 22
    22     Width = 309
    23     Anchors = [akTop, akLeft, akRight, akBottom]
     21    Left = 4
     22    Height = 403
     23    Top = 33
     24    Width = 312
     25    Align = alClient
     26    BorderSpacing.Around = 4
    2427    Font.Height = -12
    2528    Font.Name = 'Courier New'
Note: See TracChangeset for help on using the changeset viewer.