Changeset 38 for trunk/Forms


Ignore:
Timestamp:
Feb 19, 2012, 10:29:55 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Used manual docked forms for better code separation.
  • Modified: Used tabbed layout with PageControl and TabSheets for better usability.
Location:
trunk/Forms
Files:
3 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCPU.lfm

    r37 r38  
    1 object InterpreterForm: TInterpreterForm
     1object FormCPU: TFormCPU
    22  Left = 262
    3   Height = 509
     3  Height = 287
    44  Top = 127
    5   Width = 762
     5  Width = 414
    66  Caption = 'Interpretter'
    7   ClientHeight = 509
    8   ClientWidth = 762
    9   OnHide = FormHide
    10   OnShow = FormShow
     7  ClientHeight = 287
     8  ClientWidth = 414
    119  LCLVersion = '0.9.31'
    12   object Panel3: TPanel
    13     Left = 0
    14     Height = 483
    15     Top = 26
    16     Width = 323
    17     Align = alLeft
    18     BevelOuter = bvNone
    19     ClientHeight = 483
    20     ClientWidth = 323
    21     TabOrder = 0
    22     object Panel1: TPanel
    23       Left = 0
    24       Height = 242
    25       Top = 0
    26       Width = 323
    27       Align = alTop
    28       BevelOuter = bvNone
    29       ClientHeight = 242
    30       ClientWidth = 323
    31       TabOrder = 0
    32       object MemoInput: TMemo
    33         Left = 8
    34         Height = 210
    35         Top = 22
    36         Width = 309
    37         Anchors = [akTop, akLeft, akRight, akBottom]
    38         Font.Height = -12
    39         Font.Name = 'Courier New'
    40         OnKeyPress = MemoInputKeyPress
    41         ParentFont = False
    42         ScrollBars = ssAutoBoth
    43         TabOrder = 0
    44       end
    45       object Label1: TLabel
    46         Left = 8
    47         Height = 18
    48         Top = 8
    49         Width = 38
    50         Caption = 'Input:'
    51         ParentColor = False
    52       end
    53     end
    54     object Splitter1: TSplitter
    55       Cursor = crVSplit
    56       Left = 0
    57       Height = 5
    58       Top = 242
    59       Width = 323
    60       Align = alTop
    61       ResizeAnchor = akTop
    62     end
    63     object Panel2: TPanel
    64       Left = 0
    65       Height = 236
    66       Top = 247
    67       Width = 323
    68       Align = alClient
    69       BevelOuter = bvNone
    70       ClientHeight = 236
    71       ClientWidth = 323
    72       TabOrder = 2
    73       object Label2: TLabel
    74         Left = 8
    75         Height = 18
    76         Top = 6
    77         Width = 49
    78         Caption = 'Output:'
    79         ParentColor = False
    80       end
    81       object MemoOutput: TMemo
    82         Left = 8
    83         Height = 211
    84         Top = 22
    85         Width = 309
    86         Anchors = [akTop, akLeft, akRight, akBottom]
    87         Font.Height = -12
    88         Font.Name = 'Courier New'
    89         ParentFont = False
    90         ScrollBars = ssAutoBoth
    91         TabOrder = 0
    92       end
    93     end
     10  object Label4: TLabel
     11    Left = 8
     12    Height = 18
     13    Top = 42
     14    Width = 87
     15    Caption = 'Step counter:'
     16    ParentColor = False
    9417  end
    95   object Splitter2: TSplitter
    96     Left = 323
    97     Height = 483
    98     Top = 26
    99     Width = 5
     18  object Label7: TLabel
     19    Left = 8
     20    Height = 18
     21    Top = 62
     22    Width = 45
     23    Caption = 'Speed:'
     24    ParentColor = False
    10025  end
    101   object Panel4: TPanel
    102     Left = 328
    103     Height = 483
    104     Top = 26
    105     Width = 434
    106     Align = alClient
    107     BevelOuter = bvNone
    108     ClientHeight = 483
    109     ClientWidth = 434
    110     TabOrder = 2
    111     object Label3: TLabel
    112       Left = 1
    113       Height = 18
    114       Top = 8
    115       Width = 110
    116       Caption = 'Program pointer:'
    117       ParentColor = False
    118     end
    119     object LabelProgramPointer: TLabel
    120       Left = 112
    121       Height = 18
    122       Top = 8
    123       Width = 13
    124       Caption = '   '
    125       ParentColor = False
    126     end
    127     object Label5: TLabel
    128       Left = 1
    129       Height = 18
    130       Top = 24
    131       Width = 108
    132       Caption = 'Memory pointer:'
    133       ParentColor = False
    134     end
    135     object LabelMemoryPointer: TLabel
    136       Left = 112
    137       Height = 18
    138       Top = 24
    139       Width = 13
    140       Caption = '   '
    141       ParentColor = False
    142     end
    143     object Label4: TLabel
    144       Left = 1
    145       Height = 18
    146       Top = 42
    147       Width = 87
    148       Caption = 'Step counter:'
    149       ParentColor = False
    150     end
    151     object LabelStepCounter: TLabel
    152       Left = 112
    153       Height = 18
    154       Top = 42
    155       Width = 13
    156       Caption = '   '
    157       ParentColor = False
    158     end
    159     object ListViewMemory: TListView
    160       Left = 1
    161       Height = 358
    162       Top = 120
    163       Width = 429
    164       Anchors = [akTop, akLeft, akRight, akBottom]
    165       Columns = <     
    166         item
    167           Caption = 'Address'
    168           Width = 80
    169         end     
    170         item
    171           Caption = 'Data'
    172           Width = 330
    173         end>
    174       Font.Height = -11
    175       Font.Name = 'Courier New'
    176       OwnerData = True
    177       ParentFont = False
    178       ReadOnly = True
    179       TabOrder = 0
    180       ViewStyle = vsReport
    181       OnData = ListViewMemoryData
    182     end
    183     object Label6: TLabel
    184       Left = 8
    185       Height = 18
    186       Top = 104
    187       Width = 57
    188       Caption = 'Memory:'
    189       ParentColor = False
    190     end
    191     object Label7: TLabel
    192       Left = 1
    193       Height = 18
    194       Top = 62
    195       Width = 45
    196       Caption = 'Speed:'
    197       ParentColor = False
    198     end
    199     object LabelStepSpeed: TLabel
    200       Left = 112
    201       Height = 18
    202       Top = 62
    203       Width = 13
    204       Caption = '   '
    205       ParentColor = False
    206     end
     26  object LabelStepSpeed: TLabel
     27    Left = 119
     28    Height = 18
     29    Top = 62
     30    Width = 13
     31    Caption = '   '
     32    ParentColor = False
    20733  end
    208   object ToolBar1: TToolBar
    209     Left = 0
    210     Height = 26
    211     Top = 0
    212     Width = 762
    213     Images = MainForm.ImageList1
    214     TabOrder = 3
    215     object ToolButton1: TToolButton
    216       Left = 1
    217       Top = 2
    218       Action = MainForm.AProgramRun
    219     end
    220     object ToolButton2: TToolButton
    221       Left = 24
    222       Top = 2
    223       Action = MainForm.AProgramPause
    224     end
    225     object ToolButton3: TToolButton
    226       Left = 47
    227       Top = 2
    228       Action = MainForm.AProgramStop
    229     end
    230     object ToolButton4: TToolButton
    231       Left = 139
    232       Top = 2
    233       Action = MainForm.AProgramRunToCursor
    234     end
    235     object ToolButton5: TToolButton
    236       Left = 93
    237       Top = 2
    238       Action = MainForm.AProgramStepInto
    239     end
    240     object ToolButton6: TToolButton
    241       Left = 116
    242       Top = 2
    243       Action = MainForm.AProgramStepOut
    244     end
    245     object ToolButton7: TToolButton
    246       Left = 70
    247       Top = 2
    248       Action = MainForm.AProgramStepOver
    249     end
     34  object LabelStepCounter: TLabel
     35    Left = 119
     36    Height = 18
     37    Top = 42
     38    Width = 13
     39    Caption = '   '
     40    ParentColor = False
    25041  end
    251   object Timer1: TTimer
    252     Enabled = False
    253     OnTimer = Timer1Timer
    254     left = 495
    255     top = 61
     42  object LabelMemoryPointer: TLabel
     43    Left = 119
     44    Height = 18
     45    Top = 24
     46    Width = 13
     47    Caption = '   '
     48    ParentColor = False
     49  end
     50  object LabelProgramPointer: TLabel
     51    Left = 119
     52    Height = 18
     53    Top = 8
     54    Width = 13
     55    Caption = '   '
     56    ParentColor = False
     57  end
     58  object Label3: TLabel
     59    Left = 8
     60    Height = 18
     61    Top = 8
     62    Width = 110
     63    Caption = 'Program pointer:'
     64    ParentColor = False
     65  end
     66  object Label5: TLabel
     67    Left = 8
     68    Height = 18
     69    Top = 24
     70    Width = 108
     71    Caption = 'Memory pointer:'
     72    ParentColor = False
    25673  end
    25774end
  • trunk/Forms/UFormCPU.lrt

    r37 r38  
    1 TINTERPRETERFORM.CAPTION=Interpretter
    2 TINTERPRETERFORM.LABEL1.CAPTION=Input:
    3 TINTERPRETERFORM.LABEL2.CAPTION=Output:
    4 TINTERPRETERFORM.LABEL3.CAPTION=Program pointer:
    5 TINTERPRETERFORM.LABELPROGRAMPOINTER.CAPTION=   
    6 TINTERPRETERFORM.LABEL5.CAPTION=Memory pointer:
    7 TINTERPRETERFORM.LABELMEMORYPOINTER.CAPTION=   
    8 TINTERPRETERFORM.LABEL4.CAPTION=Step counter:
    9 TINTERPRETERFORM.LABELSTEPCOUNTER.CAPTION=   
    10 TINTERPRETERFORM.LISTVIEWMEMORY.COLUMNS[0].CAPTION=Address
    11 TINTERPRETERFORM.LISTVIEWMEMORY.COLUMNS[1].CAPTION=Data
    12 TINTERPRETERFORM.LABEL6.CAPTION=Memory:
    13 TINTERPRETERFORM.LABEL7.CAPTION=Speed:
    14 TINTERPRETERFORM.LABELSTEPSPEED.CAPTION=   
     1TFORMCPU.CAPTION=Interpretter
     2TFORMCPU.LABEL4.CAPTION=Step counter:
     3TFORMCPU.LABEL7.CAPTION=Speed:
     4TFORMCPU.LABELSTEPSPEED.CAPTION=   
     5TFORMCPU.LABELSTEPCOUNTER.CAPTION=   
     6TFORMCPU.LABELMEMORYPOINTER.CAPTION=   
     7TFORMCPU.LABELPROGRAMPOINTER.CAPTION=   
     8TFORMCPU.LABEL3.CAPTION=Program pointer:
     9TFORMCPU.LABEL5.CAPTION=Memory pointer:
  • trunk/Forms/UFormCPU.pas

    r37 r38  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ExtCtrls, ComCtrls;
    10 
    11 const
    12   RowSize = 16;
     9  ExtCtrls;
    1310
    1411type
    1512
    16   { TInterpreterForm }
     13  { TFormCPU }
    1714
    18   TInterpreterForm = class(TForm)
    19     Label1: TLabel;
    20     Label2: TLabel;
     15  TFormCPU = class(TForm)
    2116    Label3: TLabel;
    2217    Label4: TLabel;
    23     Label6: TLabel;
     18    Label5: TLabel;
    2419    Label7: TLabel;
     20    LabelMemoryPointer: TLabel;
     21    LabelProgramPointer: TLabel;
    2522    LabelStepCounter: TLabel;
    26     LabelProgramPointer: TLabel;
    27     Label5: TLabel;
    28     LabelMemoryPointer: TLabel;
    2923    LabelStepSpeed: TLabel;
    30     ListViewMemory: TListView;
    31     MemoInput: TMemo;
    32     MemoOutput: TMemo;
    33     Panel1: TPanel;
    34     Panel2: TPanel;
    35     Panel3: TPanel;
    36     Panel4: TPanel;
    37     Splitter1: TSplitter;
    38     Splitter2: TSplitter;
    39     Timer1: TTimer;
    40     ToolBar1: TToolBar;
    41     ToolButton1: TToolButton;
    42     ToolButton2: TToolButton;
    43     ToolButton3: TToolButton;
    44     ToolButton4: TToolButton;
    45     ToolButton5: TToolButton;
    46     ToolButton6: TToolButton;
    47     ToolButton7: TToolButton;
    48     procedure FormHide(Sender: TObject);
    49     procedure FormShow(Sender: TObject);
    50     procedure ListViewMemoryData(Sender: TObject; Item: TListItem);
    51     procedure MemoInputKeyPress(Sender: TObject; var Key: char);
    52     procedure Timer1Timer(Sender: TObject);
    5324  private
    5425  public
    5526    LastStepCounter: Integer;
    56     procedure RefreshListViewMemory;
    57     procedure UpadateInterface;
     27    procedure Reload;
    5828  end;
    5929
    6030var
    61   InterpreterForm: TInterpreterForm;
     31  FormCPU: TFormCPU;
    6232
    6333implementation
     
    7141  SStepsPerSecond = ' steps/s';
    7242
    73 { TInterpreterForm }
     43{ TFormCPU }
    7444
    75 procedure TInterpreterForm.Timer1Timer(Sender: TObject);
     45procedure TFormCPU.Reload;
    7646begin
    7747  if MainForm.CurrentTarget is TTargetInterpretter then
     
    8252    LabelStepSpeed.Caption := IntToStr(StepCount - LastStepCounter) + SStepsPerSecond;
    8353    LastStepCounter := StepCount;
    84     MemoOutput.Lines.Text := Output;
    8554  end;
    86   RefreshListViewMemory;
    87 end;
    88 
    89 procedure TInterpreterForm.RefreshListViewMemory;
    90 begin
    91   if MainForm.CurrentTarget is TTargetInterpretter then
    92   with TTargetInterpretter(MainForm.CurrentTarget) do begin
    93     ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize);
    94     ListViewMemory.Refresh;
    95   end;
    96 end;
    97 
    98 procedure TInterpreterForm.UpadateInterface;
    99 begin
    100   MainForm.UpdateInterface;
    101 end;
    102 
    103 procedure TInterpreterForm.ListViewMemoryData(Sender: TObject; Item: TListItem);
    104 var
    105   Row: string;
    106   I: Integer;
    107 begin
    108   if MainForm.CurrentTarget is TTargetInterpretter then
    109   with TTargetInterpretter(MainForm.CurrentTarget) do
    110   if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin
    111     Item.Caption := IntToHex(Item.Index * RowSize, 8);
    112     Row := '';
    113     for I := 0 to RowSize - 1 do
    114       Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2);
    115     Item.SubItems.Add(Row);
    116   end;
    117 end;
    118 
    119 procedure TInterpreterForm.FormHide(Sender: TObject);
    120 begin
    121   Timer1.Enabled := False;
    122 end;
    123 
    124 procedure TInterpreterForm.FormShow(Sender: TObject);
    125 begin
    126   Timer1.Enabled := True;
    127 end;
    128 
    129 procedure TInterpreterForm.MemoInputKeyPress(Sender: TObject; var Key: char);
    130 begin
    131   if MainForm.CurrentTarget is TTargetInterpretter then
    132   with TTargetInterpretter(MainForm.CurrentTarget) do
    133     Input := Input + Key;
    13455end;
    13556
  • trunk/Forms/UFormInput.lfm

    r37 r38  
    1 object Form2: TForm2
     1object FormInput: TFormInput
    22  Left = 256
    33  Height = 240
    44  Top = 32
    55  Width = 320
    6   Caption = 'Form2'
     6  Caption = 'FormInput'
     7  ClientHeight = 240
     8  ClientWidth = 320
    79  LCLVersion = '0.9.31'
     10  object MemoInput: TMemo
     11    Left = 8
     12    Height = 210
     13    Top = 22
     14    Width = 309
     15    Anchors = [akTop, akLeft, akRight, akBottom]
     16    Font.Height = -12
     17    Font.Name = 'Courier New'
     18    OnKeyPress = MemoInputKeyPress
     19    ParentFont = False
     20    ScrollBars = ssAutoBoth
     21    TabOrder = 0
     22  end
     23  object Label1: TLabel
     24    Left = 8
     25    Height = 18
     26    Top = 8
     27    Width = 38
     28    Caption = 'Input:'
     29    ParentColor = False
     30  end
    831end
  • trunk/Forms/UFormInput.lrt

    r37 r38  
    1 TFORM2.CAPTION=Form2
     1TFORMINPUT.CAPTION=FormInput
     2TFORMINPUT.LABEL1.CAPTION=Input:
  • trunk/Forms/UFormInput.pas

    r37 r38  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
     8  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
    99
    1010type
    11   TForm2 = class(TForm)
     11
     12  { TFormInput }
     13
     14  TFormInput = class(TForm)
     15    Label1: TLabel;
     16    MemoInput: TMemo;
     17    procedure MemoInputKeyPress(Sender: TObject; var Key: char);
    1218  private
    1319    { private declarations }
     
    1723
    1824var
    19   Form2: TForm2;
     25  FormInput: TFormInput;
     26
    2027
    2128implementation
     
    2330{$R *.lfm}
    2431
     32uses
     33  UFormMain, UTargetInterpretter;
     34
     35procedure TFormInput.MemoInputKeyPress(Sender: TObject; var Key: char);
     36begin
     37  if MainForm.CurrentTarget is TTargetInterpretter then
     38  with TTargetInterpretter(MainForm.CurrentTarget) do
     39    Input := Input + Key;
     40end;
     41
     42
    2543end.
    2644
  • trunk/Forms/UFormMain.lfm

    r37 r38  
    11object MainForm: TMainForm
    2   Left = 236
     2  Left = 208
    33  Height = 609
    4   Top = 74
     4  Top = 134
    55  Width = 790
    66  Caption = 'LazFuck'
     
    1414  LCLVersion = '0.9.31'
    1515  WindowState = wsMaximized
    16   object StatusBar1: TStatusBar
     16  object StatusBarMain: TStatusBar
    1717    Left = 0
    1818    Height = 21
     
    3131    SimplePanel = False
    3232  end
    33   object ToolBar1: TToolBar
     33  object ToolBarMain: TToolBar
    3434    Left = 0
    3535    Height = 26
     
    117117    end
    118118  end
    119   object PageControl2: TPageControl
    120     Left = 590
     119  object PageControlRight: TPageControl
     120    Left = 397
    121121    Height = 537
    122122    Top = 26
    123     Width = 200
    124     ActivePage = TabSheet2
     123    Width = 393
     124    ActivePage = TabSheetDebug
    125125    Align = alRight
    126126    TabIndex = 0
    127127    TabOrder = 2
    128128    TabPosition = tpRight
    129     object TabSheet2: TTabSheet
     129    object TabSheetDebug: TTabSheet
    130130      Caption = 'Debug'
     131      ClientHeight = 535
     132      ClientWidth = 341
     133      object PanelInput: TPanel
     134        Left = 0
     135        Height = 133
     136        Top = 0
     137        Width = 341
     138        Align = alTop
     139        BevelOuter = bvNone
     140        TabOrder = 0
     141      end
     142      object Splitter3: TSplitter
     143        Cursor = crVSplit
     144        Left = 0
     145        Height = 5
     146        Top = 133
     147        Width = 341
     148        Align = alTop
     149        ResizeAnchor = akTop
     150      end
     151      object PanelOutput: TPanel
     152        Left = 0
     153        Height = 123
     154        Top = 138
     155        Width = 341
     156        Align = alTop
     157        BevelOuter = bvNone
     158        TabOrder = 2
     159      end
     160      object Splitter4: TSplitter
     161        Cursor = crVSplit
     162        Left = 0
     163        Height = 5
     164        Top = 261
     165        Width = 341
     166        Align = alTop
     167        ResizeAnchor = akTop
     168      end
     169      object PanelCPU: TPanel
     170        Left = 0
     171        Height = 139
     172        Top = 266
     173        Width = 341
     174        Align = alTop
     175        BevelOuter = bvNone
     176        TabOrder = 4
     177      end
     178      object Splitter5: TSplitter
     179        Cursor = crVSplit
     180        Left = 0
     181        Height = 5
     182        Top = 405
     183        Width = 341
     184        Align = alTop
     185        ResizeAnchor = akTop
     186      end
     187      object PanelMemory: TPanel
     188        Left = 0
     189        Height = 125
     190        Top = 410
     191        Width = 341
     192        Align = alClient
     193        BevelOuter = bvNone
     194        TabOrder = 6
     195      end
    131196    end
    132197  end
    133198  object Splitter1: TSplitter
    134     Left = 585
     199    Left = 392
    135200    Height = 537
    136201    Top = 26
     
    139204    ResizeAnchor = akRight
    140205  end
    141   object Panel1: TPanel
     206  object PanelLeft: TPanel
    142207    Left = 0
    143208    Height = 537
    144209    Top = 26
    145     Width = 585
     210    Width = 392
    146211    Align = alClient
    147212    BevelOuter = bvNone
    148213    ClientHeight = 537
    149     ClientWidth = 585
     214    ClientWidth = 392
    150215    TabOrder = 4
    151     object PageControl1: TPageControl
     216    object PageControlMain: TPageControl
    152217      Left = 0
    153218      Height = 414
    154219      Top = 0
    155       Width = 585
     220      Width = 392
    156221      ActivePage = TabSheetSource
    157222      Align = alClient
     
    162227        Caption = 'Source code'
    163228        ClientHeight = 387
    164         ClientWidth = 583
     229        ClientWidth = 390
    165230        object MemoSource: TMemo
    166231          Left = 0
    167232          Height = 387
    168233          Top = 0
    169           Width = 583
     234          Width = 390
    170235          Align = alClient
    171236          Font.Height = -12
     
    185250        Caption = 'Target code'
    186251        ClientHeight = 387
    187         ClientWidth = 583
     252        ClientWidth = 390
    188253        object MemoTarget: TMemo
    189254          Left = 0
     
    199264      end
    200265    end
    201     object PageControl3: TPageControl
     266    object PageControlBottom: TPageControl
    202267      Left = 0
    203268      Height = 118
    204269      Top = 419
    205       Width = 585
    206       ActivePage = TabSheet1
     270      Width = 392
     271      ActivePage = TabSheetMessages
    207272      Align = alBottom
    208273      TabIndex = 0
    209274      TabOrder = 1
    210275      TabPosition = tpBottom
    211       object TabSheet1: TTabSheet
     276      object TabSheetMessages: TTabSheet
    212277        Caption = 'Messages'
    213         ClientHeight = 91
    214         ClientWidth = 583
    215         object MemoMessages: TMemo
    216           Left = 0
    217           Height = 91
    218           Top = 0
    219           Width = 583
    220           Align = alClient
    221           TabOrder = 0
    222         end
    223278      end
    224279    end
     
    228283      Height = 5
    229284      Top = 414
    230       Width = 585
     285      Width = 392
    231286      Align = alBottom
    232287      ResizeAnchor = akBottom
     
    235290  object MainMenu1: TMainMenu
    236291    Images = ImageList1
    237     left = 356
    238     top = 152
     292    left = 216
     293    top = 128
    239294    object MenuItem1: TMenuItem
    240295      Caption = 'Project'
     
    9481003  object ActionList1: TActionList
    9491004    Images = ImageList1
    950     left = 448
    951     top = 96
     1005    left = 216
     1006    top = 240
    9521007    object AProjectOpen: TAction
    9531008      Category = 'Project'
     
    11071162  end
    11081163  object ImageList1: TImageList
    1109     left = 356
    1110     top = 96
     1164    left = 216
     1165    top = 72
    11111166    Bitmap = {
    11121167      4C69120000001000000010000000000000000000000000000000000000000000
     
    16921747    DefaultExt = '.b'
    16931748    Filter = 'BrainFuck (*.b)|*.b|Any file (*.*)|*.*'
    1694     left = 192
    1695     top = 157
     1749    left = 56
     1750    top = 184
    16961751  end
    16971752  object SaveDialog1: TSaveDialog
    16981753    DefaultExt = '.b'
    16991754    Filter = 'BrainFuck (*.b)|*.b|Any file (*.*)|*.*'
    1700     left = 192
    1701     top = 208
     1755    left = 56
     1756    top = 240
    17021757  end
    17031758  object CoolTranslator1: TCoolTranslator
    17041759    POFilesFolder = 'Languages'
    1705     left = 362
    1706     top = 216
     1760    left = 216
     1761    top = 184
    17071762  end
    17081763  object PopupMenuSource: TPopupMenu
    17091764    Images = ImageList1
    1710     left = 192
    1711     top = 104
     1765    left = 56
     1766    top = 128
    17121767    object MenuItem23: TMenuItem
    17131768      Action = ABreakpointToggle
     
    17991854  end
    18001855  object PopupMenuTarget: TPopupMenu
    1801     left = 92
    1802     top = 136
     1856    left = 56
     1857    top = 72
    18031858    object MenuItem20: TMenuItem
    18041859      Action = AShowSourcePosition
    18051860    end
    18061861  end
     1862  object TimerRefresh: TTimer
     1863    OnTimer = TimerRefreshTimer
     1864    left = 56
     1865    top = 296
     1866  end
    18071867end
  • trunk/Forms/UFormMain.lrt

    r37 r38  
    11TMAINFORM.CAPTION=LazFuck
    2 TMAINFORM.TABSHEET2.CAPTION=Debug
     2TMAINFORM.TABSHEETDEBUG.CAPTION=Debug
    33TMAINFORM.TABSHEETSOURCE.CAPTION=Source code
    44TMAINFORM.TABSHEETTARGET.CAPTION=Target code
    5 TMAINFORM.TABSHEET1.CAPTION=Messages
     5TMAINFORM.TABSHEETMESSAGES.CAPTION=Messages
    66TMAINFORM.MENUITEM1.CAPTION=Project
    77TMAINFORM.MENUITEMOPENRECENT.CAPTION=Open recent
  • trunk/Forms/UFormMain.pas

    r37 r38  
    4949    ImageList1: TImageList;
    5050    MainMenu1: TMainMenu;
    51     MemoMessages: TMemo;
    5251    MemoSource: TMemo;
    5352    MemoTarget: TMemo;
     
    9190    MenuItem9: TMenuItem;
    9291    OpenDialog1: TOpenDialog;
    93     PageControl1: TPageControl;
    94     PageControl2: TPageControl;
    95     PageControl3: TPageControl;
    96     Panel1: TPanel;
     92    PageControlMain: TPageControl;
     93    PageControlRight: TPageControl;
     94    PageControlBottom: TPageControl;
     95    PanelLeft: TPanel;
     96    PanelMemory: TPanel;
     97    PanelCPU: TPanel;
     98    PanelOutput: TPanel;
     99    PanelInput: TPanel;
    97100    PopupMenuTarget: TPopupMenu;
    98101    PopupMenuSource: TPopupMenu;
     
    100103    Splitter1: TSplitter;
    101104    Splitter2: TSplitter;
    102     StatusBar1: TStatusBar;
    103     TabSheet1: TTabSheet;
    104     TabSheet2: TTabSheet;
     105    Splitter3: TSplitter;
     106    Splitter4: TSplitter;
     107    Splitter5: TSplitter;
     108    StatusBarMain: TStatusBar;
     109    TabSheetMessages: TTabSheet;
     110    TabSheetDebug: TTabSheet;
    105111    TabSheetSource: TTabSheet;
    106112    TabSheetTarget: TTabSheet;
    107     ToolBar1: TToolBar;
     113    TimerRefresh: TTimer;
     114    ToolBarMain: TToolBar;
    108115    ToolButton1: TToolButton;
    109116    ToolButton10: TToolButton;
     
    157164    procedure MemoSourceMouseDown(Sender: TObject; Button: TMouseButton;
    158165      Shift: TShiftState; X, Y: Integer);
     166    procedure TimerRefreshTimer(Sender: TObject);
    159167  private
    160168    FCurrentTarget: TTarget;
     
    165173    procedure SetCurrentTarget(AValue: TTarget);
    166174    procedure UpdateToolBarHints;
     175    procedure DockInit;
    167176  public
    168177    Modified: Boolean;
     
    187196
    188197uses
    189   UFormCPU, UApplicationInfo, UFormOptions,
    190   UTargetDelphi, UTargetPHP, UTargetC, UFormTargets;
     198  UFormCPU, UApplicationInfo, UFormOptions, UFormMessages,
     199  UTargetDelphi, UTargetPHP, UTargetC, UFormTargets, UFormOutput, UFormInput,
     200  UFormMemory;
    191201
    192202resourcestring
     
    199209procedure TMainForm.FormShow(Sender: TObject);
    200210begin
    201   PageControl1.TabIndex := 0;
     211  PageControlMain.TabIndex := 0;
    202212  if OpenProjectOnStart and (LastOpenedList.Count > 0) then
    203213    ProjectOpen(LastOpenedList[0])
     
    206216  UpdateToolBarHints;
    207217  UpdateTargetList;
     218  DockInit;
    208219end;
    209220
     
    234245begin
    235246  UpdateStatusBar;
     247end;
     248
     249procedure TMainForm.TimerRefreshTimer(Sender: TObject);
     250begin
     251  FormCPU.Reload;
     252  FormOutput.Reload;
     253  FormMemory.Reload;
    236254end;
    237255
     
    283301  I: Integer;
    284302begin
    285   for I := 0 to ToolBar1.ControlCount - 1 do
    286     ToolBar1.Controls[I].Hint := ToolBar1.Controls[I].Caption;
     303  for I := 0 to ToolBarMain.ControlCount - 1 do
     304    ToolBarMain.Controls[I].Hint := ToolBarMain.Controls[I].Caption;
     305end;
     306
     307procedure TMainForm.DockInit;
     308begin
     309  FormCPU.ManualDock(PanelCPU, nil, alClient);
     310  FormCPU.Align := alClient;
     311  FormCPU.Show;
     312  FormInput.ManualDock(PanelInput, nil, alClient);
     313  FormInput.Align := alClient;
     314  FormInput.Show;
     315  FormOutput.ManualDock(PanelOutput, nil, alClient);
     316  FormOutput.Align := alClient;
     317  FormOutput.Show;
     318  FormMemory.ManualDock(PanelMemory, nil, alClient);
     319  FormMemory.Align := alClient;
     320  FormMemory.Show;
     321  FormMesssages.ManualDock(TabSheetMessages, nil, alClient);
     322  FormMesssages.Align := alClient;
     323  FormMesssages.Show;
    287324end;
    288325
     
    362399procedure TMainForm.UpdateStatusBar;
    363400begin
    364   StatusBar1.Panels[0].Text := IntToStr(MemoSource.CaretPos.X) + ', ' + IntToStr(MemoSource.CaretPos.Y);
     401  StatusBarMain.Panels[0].Text := IntToStr(MemoSource.CaretPos.X) + ', ' + IntToStr(MemoSource.CaretPos.Y);
    365402end;
    366403
     
    403440procedure TMainForm.AProgramRunExecute(Sender: TObject);
    404441begin
    405   InterpreterForm.LastStepCounter := 0;
    406   InterpreterForm.Show;
     442  FormCPU.LastStepCounter := 0;
     443  FormCPU.Show;
    407444  if CurrentTarget is TTargetInterpretter then
    408     TTargetInterpretter(CurrentTarget).Input := InterpreterForm.MemoInput.Lines.Text;
     445    TTargetInterpretter(CurrentTarget).Input := FormInput.MemoInput.Lines.Text;
    409446  if not CurrentTarget.Compiled then AProgramCompile.Execute;
    410447  CurrentTarget.Run;
     
    418455  if Assigned(DebugStep) then begin
    419456    MemoSource.SelStart := DebugStep.SourcePosition;
    420     PageControl1.TabIndex := 0;
     457    PageControlMain.TabIndex := 0;
    421458  end;
    422459end;
     
    429466  if Assigned(DebugStep) then begin
    430467    MemoTarget.SelStart := DebugStep.TargetPosition;
    431     PageControl1.TabIndex := 1;
     468    PageControlMain.TabIndex := 1;
    432469  end;
    433470end;
     
    458495procedure TMainForm.AViewInterpretterExecute(Sender: TObject);
    459496begin
    460   InterpreterForm.Show;
     497  FormCPU.Show;
    461498end;
    462499
     
    573610  MemoSource.SelStart := DebugStep.SourcePosition;
    574611  MemoTarget.SelStart := DebugStep.TargetPosition;
    575   if PageControl1.TabIndex = 0 then MemoSource.SetFocus;
    576   if PageControl1.TabIndex = 1 then MemoTarget.SetFocus;
     612  if PageControlMain.TabIndex = 0 then MemoSource.SetFocus;
     613  if PageControlMain.TabIndex = 1 then MemoTarget.SetFocus;
    577614end;
    578615
  • trunk/Forms/UFormMemory.lfm

    r37 r38  
    1 object Form3: TForm3
     1object FormMemory: TFormMemory
    22  Left = 256
    3   Height = 240
     3  Height = 259
    44  Top = 32
    5   Width = 320
    6   Caption = 'Form3'
     5  Width = 391
     6  Caption = 'FormMemory'
     7  ClientHeight = 259
     8  ClientWidth = 391
    79  LCLVersion = '0.9.31'
     10  object Label6: TLabel
     11    Left = 8
     12    Height = 18
     13    Top = 8
     14    Width = 57
     15    Caption = 'Memory:'
     16    ParentColor = False
     17  end
     18  object ListViewMemory: TListView
     19    Left = 8
     20    Height = 231
     21    Top = 24
     22    Width = 374
     23    Anchors = [akTop, akLeft, akRight, akBottom]
     24    Columns = <   
     25      item
     26        Caption = 'Address'
     27        Width = 80
     28      end   
     29      item
     30        Caption = 'Data'
     31        Width = 330
     32      end>
     33    Font.Height = -11
     34    Font.Name = 'Courier New'
     35    OwnerData = True
     36    ParentFont = False
     37    ReadOnly = True
     38    TabOrder = 0
     39    ViewStyle = vsReport
     40    OnData = ListViewMemoryData
     41  end
    842end
  • trunk/Forms/UFormMemory.lrt

    r37 r38  
    1 TFORM3.CAPTION=Form3
     1TFORMMEMORY.CAPTION=FormMemory
     2TFORMMEMORY.LABEL6.CAPTION=Memory:
     3TFORMMEMORY.LISTVIEWMEMORY.COLUMNS[0].CAPTION=Address
     4TFORMMEMORY.LISTVIEWMEMORY.COLUMNS[1].CAPTION=Data
  • trunk/Forms/UFormMemory.pas

    r37 r38  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
     8  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     9  ComCtrls;
     10
     11const
     12  RowSize = 16;
    913
    1014type
    11   TForm3 = class(TForm)
     15
     16  { TFormMemory }
     17
     18  TFormMemory = class(TForm)
     19    Label6: TLabel;
     20    ListViewMemory: TListView;
     21    procedure ListViewMemoryData(Sender: TObject; Item: TListItem);
    1222  private
    1323    { private declarations }
    1424  public
    15     { public declarations }
     25    procedure Reload;
    1626  end;
    1727
    1828var
    19   Form3: TForm3;
     29  FormMemory: TFormMemory;
    2030
    2131implementation
     
    2333{$R *.lfm}
    2434
     35uses
     36  UFormMain, UTargetInterpretter;
     37
     38{ TFormMemory }
     39
     40procedure TFormMemory.Reload;
     41begin
     42  if MainForm.CurrentTarget is TTargetInterpretter then
     43  with TTargetInterpretter(MainForm.CurrentTarget) do begin
     44    ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize);
     45    ListViewMemory.Refresh;
     46  end;
     47end;
     48
     49procedure TFormMemory.ListViewMemoryData(Sender: TObject; Item: TListItem);
     50var
     51  Row: string;
     52  I: Integer;
     53begin
     54  if MainForm.CurrentTarget is TTargetInterpretter then
     55  with TTargetInterpretter(MainForm.CurrentTarget) do
     56  if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin
     57    Item.Caption := IntToHex(Item.Index * RowSize, 8);
     58    Row := '';
     59    for I := 0 to RowSize - 1 do
     60      Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2);
     61    Item.SubItems.Add(Row);
     62  end;
     63end;
     64
     65
    2566end.
    2667
  • trunk/Forms/UFormOutput.lfm

    r37 r38  
    1 object Form1: TForm1
     1object FormOutput: TFormOutput
    22  Left = 256
    33  Height = 240
    44  Top = 32
    55  Width = 320
    6   Caption = 'Form1'
     6  Caption = 'FormOutput'
     7  ClientHeight = 240
     8  ClientWidth = 320
    79  LCLVersion = '0.9.31'
     10  object Label2: TLabel
     11    Left = 8
     12    Height = 18
     13    Top = 6
     14    Width = 49
     15    Caption = 'Output:'
     16    ParentColor = False
     17  end
     18  object MemoOutput: TMemo
     19    Left = 8
     20    Height = 211
     21    Top = 22
     22    Width = 309
     23    Anchors = [akTop, akLeft, akRight, akBottom]
     24    Font.Height = -12
     25    Font.Name = 'Courier New'
     26    ParentFont = False
     27    ScrollBars = ssAutoBoth
     28    TabOrder = 0
     29  end
    830end
  • trunk/Forms/UFormOutput.lrt

    r37 r38  
    1 TFORM1.CAPTION=Form1
     1TFORMOUTPUT.CAPTION=FormOutput
     2TFORMOUTPUT.LABEL2.CAPTION=Output:
  • trunk/Forms/UFormOutput.pas

    r37 r38  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
     8  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
    99
    1010type
    11   TForm1 = class(TForm)
     11
     12  { TFormOutput }
     13
     14  TFormOutput = class(TForm)
     15    Label2: TLabel;
     16    MemoOutput: TMemo;
    1217  private
    1318    { private declarations }
    1419  public
    15     { public declarations }
     20    procedure Reload;
    1621  end;
    1722
    1823var
    19   Form1: TForm1;
     24  FormOutput: TFormOutput;
    2025
    2126implementation
     
    2328{$R *.lfm}
    2429
     30uses
     31  UFormMain, UTargetInterpretter;
     32
     33{ TFormOutput }
     34
     35procedure TFormOutput.Reload;
     36begin
     37  if MainForm.CurrentTarget is TTargetInterpretter then
     38  with TTargetInterpretter(MainForm.CurrentTarget) do
     39    MemoOutput.Lines.Text := Output;
     40end;
     41
    2542end.
    2643
Note: See TracChangeset for help on using the changeset viewer.