Ignore:
Timestamp:
Jun 24, 2023, 11:23:26 PM (17 months ago)
Author:
chronos
Message:
  • Added: Several basic interpretter tests.
Location:
branches/xpascal/Packages/Common/Forms
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/xpascal/Packages/Common/Forms/FormAbout.lfm

    r228 r229  
    11object FormAbout: TFormAbout
    2   Left = 1014
    3   Height = 349
    4   Top = 577
    5   Width = 609
     2  Left = 624
     3  Height = 402
     4  Top = 622
     5  Width = 702
    66  Caption = 'About'
    7   ClientHeight = 349
    8   ClientWidth = 609
    9   DesignTimePPI = 125
     7  ClientHeight = 402
     8  ClientWidth = 702
     9  DesignTimePPI = 144
    1010  OnShow = FormShow
    1111  Position = poScreenCenter
    12   LCLVersion = '2.2.4.0'
     12  LCLVersion = '2.2.6.0'
    1313  object LabelDescription: TLabel
    14     Left = 26
    15     Height = 22
    16     Top = 117
    17     Width = 557
     14    Left = 30
     15    Height = 26
     16    Top = 135
     17    Width = 642
    1818    Align = alTop
    19     BorderSpacing.Left = 26
    20     BorderSpacing.Right = 26
    21     BorderSpacing.Bottom = 26
     19    BorderSpacing.Left = 30
     20    BorderSpacing.Right = 30
     21    BorderSpacing.Bottom = 30
    2222    Caption = 'Description'
    2323    ParentColor = False
     
    2626  end
    2727  object LabelContent: TLabel
    28     Left = 26
    29     Height = 22
    30     Top = 165
    31     Width = 557
     28    Left = 30
     29    Height = 26
     30    Top = 191
     31    Width = 642
    3232    Align = alTop
    33     BorderSpacing.Around = 26
     33    BorderSpacing.Around = 30
    3434    Caption = '   '
    3535    ParentColor = False
     
    3838  object PanelTop: TPanel
    3939    Left = 0
    40     Height = 117
     40    Height = 135
    4141    Top = 0
    42     Width = 609
     42    Width = 702
    4343    Align = alTop
    4444    BevelOuter = bvNone
    45     ClientHeight = 117
    46     ClientWidth = 609
     45    ClientHeight = 135
     46    ClientWidth = 702
    4747    FullRepaint = False
    4848    ParentFont = False
    4949    TabOrder = 0
    5050    object LabelAppName: TLabel
    51       Left = 94
    52       Height = 73
    53       Top = 17
    54       Width = 489
     51      Left = 108
     52      Height = 84
     53      Top = 20
     54      Width = 564
    5555      Anchors = [akTop, akLeft, akRight]
    5656      AutoSize = False
    57       BorderSpacing.Around = 26
     57      BorderSpacing.Around = 30
    5858      Caption = 'Title'
    59       Font.Height = -52
     59      Font.Height = -60
    6060      ParentColor = False
    6161      ParentFont = False
     
    6363    end
    6464    object ImageLogo: TImage
    65       Left = 21
    66       Height = 64
    67       Top = 26
    68       Width = 62
     65      Left = 24
     66      Height = 74
     67      Top = 30
     68      Width = 71
    6969      Proportional = True
    7070      Stretch = True
     
    7373  object PanelButtons: TPanel
    7474    Left = 0
    75     Height = 65
    76     Top = 284
    77     Width = 609
     75    Height = 75
     76    Top = 327
     77    Width = 702
    7878    Align = alBottom
    7979    BevelOuter = bvNone
    80     ClientHeight = 65
    81     ClientWidth = 609
     80    ClientHeight = 75
     81    ClientWidth = 702
    8282    TabOrder = 1
    8383    object ButtonHomePage: TButton
    84       Left = 21
    85       Height = 33
    86       Top = 21
    87       Width = 229
     84      Left = 24
     85      Height = 38
     86      Top = 24
     87      Width = 264
    8888      Anchors = [akLeft, akBottom]
    8989      Caption = 'Home page'
     
    9393    end
    9494    object ButtonClose: TButton
    95       Left = 461
    96       Height = 33
    97       Top = 21
    98       Width = 122
     95      Left = 531
     96      Height = 38
     97      Top = 24
     98      Width = 141
    9999      Anchors = [akRight, akBottom]
    100100      Caption = 'Close'
  • branches/xpascal/Packages/Common/Forms/FormAbout.pas

    r228 r229  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    7   StdCtrls, ExtCtrls, ApplicationInfo, Common, Translator, Theme;
     7  StdCtrls, ExtCtrls, ApplicationInfo, Common, Translator, Theme, FormEx;
    88
    99type
    1010  { TFormAbout }
    1111
    12   TFormAbout = class(TForm)
     12  TFormAbout = class(TFormEx)
    1313    ButtonClose: TButton;
    1414    ButtonHomePage: TButton;
     
    2121    procedure ButtonHomePageClick(Sender: TObject);
    2222    procedure FormShow(Sender: TObject);
     23  private
     24    FApplicationInfo: TApplicationInfo;
    2325  public
    24     AboutDialog: TObject; //TAboutDialog
    2526    procedure UpdateInterface;
     27    property ApplicationInfo: TApplicationInfo read FApplicationInfo write
     28      FApplicationInfo;
    2629  end;
    2730
     
    3033
    3134{$R *.lfm}
    32 
    33 uses
    34   AboutDialog;
    3535
    3636resourcestring
     
    4343procedure TFormAbout.FormShow(Sender: TObject);
    4444begin
    45   if Assigned(AboutDialog) then
    46   with TAboutDialog(AboutDialog) do begin
    47     if Assigned(Translator) then
    48       Translator.TranslateComponentRecursive(Self);
    49     if Assigned(ThemeManager) then
    50       ThemeManager.UseTheme(Self);
    51 
    52     if Assigned(ApplicationInfo) then
    53     with ApplicationInfo do begin
    54       LabelAppName.Caption := AppName;
    55       LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
    56         SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
    57         SLicense + ': ' + License;
    58       LabelDescription.Caption := Description;
    59       ImageLogo.Picture.Bitmap.Assign(Icon);
    60     end;
     45  if Assigned(ApplicationInfo) then
     46  with ApplicationInfo do begin
     47    LabelAppName.Caption := AppName;
     48    LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
     49      SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
     50      SLicense + ': ' + License;
     51    LabelDescription.Caption := Description;
     52    ImageLogo.Picture.Bitmap.Assign(Icon);
    6153  end;
    6254  UpdateInterface;
     
    6557procedure TFormAbout.UpdateInterface;
    6658begin
    67   ButtonHomePage.Enabled := Assigned(AboutDialog) and
    68     Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
     59  ButtonHomePage.Enabled := Assigned(ApplicationInfo);
    6960end;
    7061
    7162procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
    7263begin
    73   OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
     64  OpenWebPage(ApplicationInfo.HomePage);
    7465end;
    7566
  • branches/xpascal/Packages/Common/Forms/FormTest.lfm

    r228 r229  
    1 object FormTestCase: TFormTestCase
     1object FormTest: TFormTest
    22  Left = 579
    33  Height = 521
    44  Top = 468
    55  Width = 865
    6   Caption = 'Test case'
     6  Caption = 'Test'
    77  ClientHeight = 521
    88  ClientWidth = 865
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    11   OnCreate = FormCreate
    12   OnShow = FormShow
    1310  LCLVersion = '2.2.6.0'
    1411  object MemoLog: TMemo
  • branches/xpascal/Packages/Common/Forms/FormTest.lrj

    r228 r229  
    11{"version":1,"strings":[
    2 {"hash":174506581,"name":"tformtestcase.caption","sourcebytes":[84,101,115,116,32,99,97,115,101],"value":"Test case"}
     2{"hash":371876,"name":"tformtest.caption","sourcebytes":[84,101,115,116],"value":"Test"}
    33]}
  • branches/xpascal/Packages/Common/Forms/FormTest.pas

    r228 r229  
    88type
    99
    10   { TFormTestCase }
     10  { TFormTest }
    1111
    12   TFormTestCase = class(TFormEx)
     12  TFormTest = class(TFormEx)
    1313    MemoLog: TMemo;
    1414  end;
  • branches/xpascal/Packages/Common/Forms/FormTests.lfm

    r228 r229  
    44  Top = 338
    55  Width = 1072
    6   Caption = 'Test'
     6  Caption = 'Tests'
    77  ClientHeight = 632
    88  ClientWidth = 1072
  • branches/xpascal/Packages/Common/Forms/FormTests.lrj

    r228 r229  
    11{"version":1,"strings":[
    2 {"hash":371876,"name":"tformtest.caption","sourcebytes":[84,101,115,116],"value":"Test"},
    3 {"hash":346165,"name":"tformtest.listviewtestcases.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"},
    4 {"hash":93105204,"name":"tformtest.listviewtestcases.columns[1].caption","sourcebytes":[82,101,115,117,108,116],"value":"Result"},
    5 {"hash":22974,"name":"tformtest.buttonrun.caption","sourcebytes":[82,117,110],"value":"Run"},
    6 {"hash":8736,"name":"tformtest.labelresult.caption","sourcebytes":[32,32,32],"value":"   "},
    7 {"hash":368487,"name":"tformtest.ashow.caption","sourcebytes":[83,104,111,119],"value":"Show"},
    8 {"hash":22974,"name":"tformtest.arun.caption","sourcebytes":[82,117,110],"value":"Run"}
     2{"hash":5950131,"name":"tformtests.caption","sourcebytes":[84,101,115,116,115],"value":"Tests"},
     3{"hash":346165,"name":"tformtests.listviewtestcases.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"},
     4{"hash":93105204,"name":"tformtests.listviewtestcases.columns[1].caption","sourcebytes":[82,101,115,117,108,116],"value":"Result"},
     5{"hash":22974,"name":"tformtests.buttonrun.caption","sourcebytes":[82,117,110],"value":"Run"},
     6{"hash":8736,"name":"tformtests.labelresult.caption","sourcebytes":[32,32,32],"value":"   "},
     7{"hash":368487,"name":"tformtests.ashow.caption","sourcebytes":[83,104,111,119],"value":"Show"},
     8{"hash":22974,"name":"tformtests.arun.caption","sourcebytes":[82,117,110],"value":"Run"}
    99]}
  • branches/xpascal/Packages/Common/Forms/FormTests.pas

    r228 r229  
    8989  ARun.Enabled := Selected;
    9090  AShow.Enabled := Selected;
     91  ButtonRun.Enabled := Assigned(TestCases);
    9192
    9293  Passed := 0;
     
    116117begin
    117118  if Assigned(ListViewTestCases.Selected) then
    118   with TFormTestCase.Create(nil) do
     119  with TFormTest.Create(nil) do
    119120  try
    120121    MemoLog.Text := TTestCase(ListViewTestCases.Selected.Data).Log;
Note: See TracChangeset for help on using the changeset viewer.