close Warning: Can't synchronize with repository "(default)" (No changeset 184 in the repository). Look in the Trac log for more information.

Changeset 115


Ignore:
Timestamp:
Dec 10, 2016, 3:52:26 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: In Debug mode also check executed classes references.
  • Modified: Better About dialog.
  • Modified: About and Help dialogs are created in time when they are shown.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAbout.lfm

    r107 r115  
    11object FormAbout: TFormAbout
    2   Left = 475
    3   Height = 150
    4   Top = 161
    5   Width = 313
    6   BorderStyle = bsDialog
     2  Left = 1014
     3  Height = 358
     4  Top = 442
     5  Width = 564
    76  Caption = 'About'
    8   ClientHeight = 150
    9   ClientWidth = 313
    10   Constraints.MinHeight = 150
    11   Constraints.MinWidth = 313
    12   Font.Height = -11
    13   Font.Name = 'MS Sans Serif'
     7  ClientHeight = 358
     8  ClientWidth = 564
     9  OnCreate = FormCreate
    1410  OnShow = FormShow
    15   Position = poMainFormCenter
    16   LCLVersion = '1.4.4.0'
     11  Position = poScreenCenter
     12  LCLVersion = '1.6.0.4'
     13  object LabelDescription: TLabel
     14    Left = 20
     15    Height = 72
     16    Top = 110
     17    Width = 524
     18    Align = alTop
     19    BorderSpacing.Around = 20
     20    Caption = 'Turn-based strategy game inspired by classic Risk board game. The game is highly configurable to allow to adjust battle field and game rules.'
     21    ParentColor = False
     22    WordWrap = True
     23  end
     24  object ButtonClose: TButton
     25    Left = 451
     26    Height = 25
     27    Top = 318
     28    Width = 93
     29    Anchors = [akRight, akBottom]
     30    Caption = 'Close'
     31    ModalResult = 1
     32    TabOrder = 0
     33  end
     34  object LabelContent: TLabel
     35    Left = 20
     36    Height = 24
     37    Top = 202
     38    Width = 524
     39    Align = alTop
     40    BorderSpacing.Around = 20
     41    Caption = '   '
     42    ParentColor = False
     43  end
     44  object ButtonHomePage: TButton
     45    Left = 16
     46    Height = 25
     47    Top = 318
     48    Width = 176
     49    Anchors = [akLeft, akBottom]
     50    Caption = 'Home page'
     51    OnClick = ButtonHomePageClick
     52    TabOrder = 1
     53  end
    1754  object Panel1: TPanel
    18     Left = 8
    19     Height = 97
    20     Top = 8
    21     Width = 299
    22     Anchors = [akTop, akLeft, akRight, akBottom]
    23     BevelInner = bvRaised
    24     BevelOuter = bvLowered
    25     ClientHeight = 97
    26     ClientWidth = 299
    27     TabOrder = 0
    28     object Memo1: TMemo
    29       Left = 8
    30       Height = 78
    31       Top = 8
    32       Width = 277
    33       Anchors = [akTop, akLeft, akRight, akBottom]
    34       BorderStyle = bsNone
    35       Color = clBtnFace
    36       ReadOnly = True
    37       TabOrder = 0
     55    Left = 0
     56    Height = 90
     57    Top = 0
     58    Width = 564
     59    Align = alTop
     60    BevelOuter = bvNone
     61    ClientHeight = 90
     62    ClientWidth = 564
     63    FullRepaint = False
     64    TabOrder = 2
     65    object LabelAppName: TLabel
     66      Left = 96
     67      Height = 55
     68      Top = 20
     69      Width = 144
     70      Align = alCustom
     71      BorderSpacing.Around = 20
     72      Caption = 'xTactics'
     73      Font.Height = -40
     74      ParentColor = False
     75      ParentFont = False
     76      WordWrap = True
     77    end
     78    object Image1: TImage
     79      Left = 16
     80      Height = 66
     81      Top = 20
     82      Width = 66
     83      Picture.Data = {
     84        1754506F727461626C654E6574776F726B47726170686963CF01000089504E47
     85        0D0A1A0A0000000D49484452000000400000004008030000009DB781EC000000
     86        0F504C54450000000000000000FFF9042CFFFFFFF07F75380000000174524E53
     87        0040E6D8660000016E49444154789CADD6590EC3200C04D01473FF33774BC0CB
     88        8C3169F98A22CF2B181A711CC9789C23AB29C46F120F377E8C6F1233D45F639B
     89        B0F16D22C6B7081C2F133C5E22F2F89258C78DE089529CCFE27A25E760E1760E
     90        474C5372A179E043E8C94B2A8C7C330BD16B974C681A98C4A15B2789D01C7011
     91        87EEBC70A145E04B704068BE0A08CB738009240F002CB03C029040F3108802CF
     92        63C00B499E00A9D02B4022F41A40055F47012284320E40215625001040510604
     93        01D50060D6B570A22E3903E64C5F4F58D0560066AF3E4F4830B3C1401B0F4090
     94        1CB8847172BCE0DA819AE8868091EE4241E839B014FA0A081F609E6727D1FFFF
     95        69BE007C5F6C02E0FBB1B50490A7C2721B417EB58D23197B301C000C42FDB2DF
     96        0535131577170C33737B0ECC5A665C016FC2AE5C9F44DB0D77575384EDFD9C81
     97        DD8F78D59B2FECB7F3EA817E2712E27FB868D6091AFFC3657B4D2CE339518A73
     98        A21CC7C4563C12DB714BDC8A236233EE891B714D64354F08C023531B730D1E00
     99        00000049454E44AE426082
     100      }
    38101    end
    39102  end
    40   object OKButton: TButton
    41     Left = 111
    42     Height = 25
    43     Top = 117
    44     Width = 75
    45     Anchors = [akLeft, akBottom]
    46     Caption = 'OK'
    47     Default = True
    48     ModalResult = 1
    49     OnClick = OKButtonClick
    50     TabOrder = 1
    51   end
    52103end
  • trunk/Forms/UFormAbout.lrt

    r107 r115  
    11TFORMABOUT.CAPTION=About
    2 TFORMABOUT.OKBUTTON.CAPTION=OK
     2TFORMABOUT.LABELDESCRIPTION.CAPTION=Turn-based strategy game inspired by classic Risk board game. The game is highly configurable to allow to adjust battle field and game rules.
     3TFORMABOUT.BUTTONCLOSE.CAPTION=Close
     4TFORMABOUT.LABELCONTENT.CAPTION=   
     5TFORMABOUT.BUTTONHOMEPAGE.CAPTION=Home page
     6TFORMABOUT.LABELAPPNAME.CAPTION=xTactics
  • trunk/Forms/UFormAbout.pas

    r47 r115  
    11unit UFormAbout;
    22
    3 {$MODE Delphi}
     3{$mode delphi}
    44
    55interface
    66
    77uses
    8   SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
    9   Buttons, ExtCtrls;
     8  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
     9  StdCtrls, ExtCtrls, UApplicationInfo, UCommon;
    1010
    1111type
     
    1414
    1515  TFormAbout = class(TForm)
     16    ButtonHomePage: TButton;
     17    ButtonClose: TButton;
     18    Image1: TImage;
     19    LabelAppName: TLabel;
     20    LabelDescription: TLabel;
     21    LabelContent: TLabel;
    1622    Panel1: TPanel;
    17     OKButton: TButton;
    18     Memo1: TMemo;
    19     procedure OKButtonClick(Sender: TObject);
     23    procedure ButtonHomePageClick(Sender: TObject);
     24    procedure FormCreate(Sender: TObject);
    2025    procedure FormShow(Sender: TObject);
    2126  private
    22     { Private declarations }
     27    { private declarations }
    2328  public
    24     { Public declarations }
     29    { public declarations }
    2530  end;
    2631
     
    3641
    3742resourcestring
    38   SApplicationName = 'Application name';
    3943  SVersion = 'Version';
    4044  SReleaseDate = 'Release date';
    41   SManufacturer = 'Company';
    42   SEmail = 'E-mail';
    43   SHomePage = 'Homepage';
     45  SLicense = 'License';
     46
     47{ TFormAbout }
    4448
    4549procedure TFormAbout.FormShow(Sender: TObject);
    4650begin
    47   with Memo1, Lines, Core.ApplicationInfo do begin
    48     BeginUpdate;
    49     Clear;
    50     Add(SApplicationName + ': ' + AppName);
    51     Add(SVersion + ': ' + Version);
    52     Add(SReleaseDate + ': ' + DateToStr(ReleaseDate));
    53     Add(SHomePage + ': ' + HomePage);
    54     Add(SManufacturer + ': ' + CompanyName);
    55     Add(SEmail + ': ' + EmailContact);
    56     EndUpdate;
     51  with Core do begin
     52    LabelAppName.Caption := ApplicationInfo.AppName;
     53    LabelContent.Caption := SVersion + ': ' + ApplicationInfo.Version + LineEnding +
     54      SReleaseDate + ': ' + DateToStr(ApplicationInfo.ReleaseDate) + LineEnding +
     55      SLicense + ': ' + ApplicationInfo.License;
    5756  end;
    58   FocusControl(OKButton);
    5957end;
    6058
    61 procedure TFormAbout.OKButtonClick(Sender: TObject);
     59procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
    6260begin
    63   Close;
     61  OpenWebPage(Core.ApplicationInfo.HomePage);
     62end;
     63
     64procedure TFormAbout.FormCreate(Sender: TObject);
     65begin
     66  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    6467end;
    6568
    6669end.
    67  
     70
  • trunk/Languages/xtactics.cs.po

    r107 r115  
    99"MIME-Version: 1.0\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "X-Generator: Poedit 1.5.4\n"
     11"X-Generator: Poedit 1.8.9\n"
     12"Language: cs\n"
    1213
    1314#: tcore.aabout.caption
     
    8485msgstr "Nastavení aplikace"
    8586
    86 #: tform1.button1.caption
    87 msgid "Button1"
    88 msgstr ""
    89 
    90 #: tform1.caption
    91 msgid "Form1"
    92 msgstr ""
    93 
    94 #: tform1.groupbox1.caption
    95 msgid "GroupBox1"
    96 msgstr ""
    97 
    98 #: tform1.tabsheet1.caption
    99 msgid "TabSheet1"
    100 msgstr ""
    101 
    102 #: tform1.tabsheet2.caption
    103 msgid "TabSheet2"
    104 msgstr ""
    105 
    106 #: tform1.tabsheet3.caption
    107 msgid "TabSheet3"
    108 msgstr ""
     87#: tformabout.buttonclose.caption
     88msgid "Close"
     89msgstr "Zavřít"
     90
     91#: tformabout.buttonhomepage.caption
     92msgid "Home page"
     93msgstr "Domovská stránka"
    10994
    11095#: tformabout.caption
     
    11398msgstr "O aplikaci"
    11499
    115 #: tformabout.okbutton.caption
    116 msgid "OK"
    117 msgstr "OK"
     100#: tformabout.labelappname.caption
     101msgctxt "tformabout.labelappname.caption"
     102msgid "xTactics"
     103msgstr "xTactics"
     104
     105#: tformabout.labelcontent.caption
     106#, fuzzy
     107msgctxt "tformabout.labelcontent.caption"
     108msgid "   "
     109msgstr "   "
     110
     111#: tformabout.labeldescription.caption
     112msgid "Turn-based strategy game inspired by classic Risk board game. The game is highly configurable to allow to adjust battle field and game rules."
     113msgstr "Tahová strategie inspirovaná klasickou deskovou hrou Risk. Hra je vysoce nastavitelná a umožňuje přizpůsobit bitevní pole a herní pravidla."
    118114
    119115#: tformhelp.caption
     
    147143
    148144#: tformmain.caption
     145msgctxt "tformmain.caption"
    149146msgid "xTactics"
    150147msgstr "xTactics"
     
    226223
    227224#: tformmove.labelwinprobability.caption
     225msgctxt "tformmove.labelwinprobability.caption"
    228226msgid "   "
    229227msgstr "   "
     
    480478msgstr "Chcete restartovat aktuální hru?"
    481479
    482 #: uformabout.sapplicationname
    483 msgid "Application name"
    484 msgstr "Název aplikace"
    485 
    486 #: uformabout.semail
    487 msgid "E-mail"
    488 msgstr "E-mail"
    489 
    490 #: uformabout.shomepage
    491 msgid "Homepage"
    492 msgstr "Domovská stránka"
    493 
    494 #: uformabout.smanufacturer
    495 msgid "Company"
    496 msgstr "Společnost"
     480#: uformabout.slicense
     481msgid "License"
     482msgstr ""
    497483
    498484#: uformabout.sreleasedate
  • trunk/Languages/xtactics.po

    r100 r115  
    7575msgstr ""
    7676
    77 #: tform1.button1.caption
    78 msgid "Button1"
    79 msgstr ""
    80 
    81 #: tform1.caption
    82 msgid "Form1"
    83 msgstr ""
    84 
    85 #: tform1.groupbox1.caption
    86 msgid "GroupBox1"
    87 msgstr ""
    88 
    89 #: tform1.tabsheet1.caption
    90 msgid "TabSheet1"
    91 msgstr ""
    92 
    93 #: tform1.tabsheet2.caption
    94 msgid "TabSheet2"
    95 msgstr ""
    96 
    97 #: tform1.tabsheet3.caption
    98 msgid "TabSheet3"
     77#: tformabout.buttonclose.caption
     78msgid "Close"
     79msgstr ""
     80
     81#: tformabout.buttonhomepage.caption
     82msgid "Home page"
    9983msgstr ""
    10084
     
    10488msgstr ""
    10589
    106 #: tformabout.okbutton.caption
    107 msgid "OK"
     90#: tformabout.labelappname.caption
     91msgctxt "TFORMABOUT.LABELAPPNAME.CAPTION"
     92msgid "xTactics"
     93msgstr ""
     94
     95#: tformabout.labelcontent.caption
     96msgctxt "TFORMABOUT.LABELCONTENT.CAPTION"
     97msgid "   "
     98msgstr ""
     99
     100#: tformabout.labeldescription.caption
     101msgid "Turn-based strategy game inspired by classic Risk board game. The game is highly configurable to allow to adjust battle field and game rules."
    108102msgstr ""
    109103
     
    138132
    139133#: tformmain.caption
     134msgctxt "tformmain.caption"
    140135msgid "xTactics"
    141136msgstr ""
     
    216211
    217212#: tformmove.labelwinprobability.caption
     213msgctxt "tformmove.labelwinprobability.caption"
    218214msgid "   "
    219215msgstr ""
     
    466462msgstr ""
    467463
    468 #: uformabout.sapplicationname
    469 msgid "Application name"
    470 msgstr ""
    471 
    472 #: uformabout.semail
    473 msgid "E-mail"
    474 msgstr ""
    475 
    476 #: uformabout.shomepage
    477 msgid "Homepage"
    478 msgstr ""
    479 
    480 #: uformabout.smanufacturer
    481 msgid "Company"
     464#: uformabout.slicense
     465msgid "License"
    482466msgstr ""
    483467
  • trunk/UCore.lfm

    r111 r115  
    20452045    AuthorsName = 'Chronos'
    20462046    AppName = 'xTactics'
    2047     ReleaseDate = 42701
     2047    ReleaseDate = 42714
    20482048    RegistryKey = '\Software\xTactics'
    20492049    RegistryRoot = rrKeyCurrentUser
    2050     left = 109
    2051     top = 140
     2050    License = 'CC0'
     2051    left = 112
     2052    top = 155
    20522053  end
    20532054  object PersistentForm: TPersistentForm
  • trunk/UCore.pas

    r111 r115  
    233233procedure TCore.AAboutExecute(Sender: TObject);
    234234begin
    235   FormAbout.ShowModal;
     235  FormAbout := TFormAbout.Create(Self);
     236  try
     237    FormAbout.ShowModal;
     238  finally
     239    FreeAndNil(FormAbout);
     240  end;
    236241end;
    237242
     
    321326procedure TCore.AHelpExecute(Sender: TObject);
    322327begin
    323   FormHelp.ShowModal;
     328  FormHelp := TFormHelp.Create(Self);
     329  try
     330    FormHelp.ShowModal;
     331  finally
     332    FreeAndNil(FormHelp);
     333  end;
    324334end;
    325335
  • trunk/UGame.pas

    r106 r115  
    139139
    140140  TCanvasEx = class(TCanvas)
    141     procedure TextOutEx(X,Y: Integer; const Text: string; MovePen: Boolean = True);
    142     procedure PolygonEx(const Points: array of TPoint; Winding: Boolean);
     141    class procedure TextOutEx(Canvas: TCanvas; X,Y: Integer; const Text: string; MovePen: Boolean = True);
     142    class procedure PolygonEx(Canvas: TCanvas; const Points: array of TPoint; Winding: Boolean);
    143143  end;
    144144
     
    874874{ TCanvasEx }
    875875
    876 procedure TCanvasEx.TextOutEx(X, Y: Integer; const Text: string;
     876class procedure TCanvasEx.TextOutEx(Canvas: TCanvas; X, Y: Integer; const Text: string;
    877877  MovePen: Boolean);
    878878var
    879879  Flags : Cardinal;
    880880begin
    881   Changing;
    882   RequiredState([csHandleValid, csFontValid, csBrushValid]);
    883   Flags := 0;
    884   if TextStyle.Opaque then
    885     Flags := ETO_Opaque;
    886   ExtUTF8Out(Handle, X, Y, Flags, nil, PChar(Text), Length(Text), nil);
    887   if MovePen then MoveTo(X + TextWidth(Text), Y);
    888   Changed;
    889 end;
    890 
    891 procedure TCanvasEx.PolygonEx(const Points: array of TPoint; Winding: Boolean);
     881  with Canvas do begin
     882    Changing;
     883    RequiredState([csHandleValid, csFontValid, csBrushValid]);
     884    Flags := 0;
     885    if TextStyle.Opaque then
     886      Flags := ETO_Opaque;
     887    ExtUTF8Out(Handle, X, Y, Flags, nil, PChar(Text), Length(Text), nil);
     888    if MovePen then MoveTo(X + TextWidth(Text), Y);
     889    Changed;
     890  end;
     891end;
     892
     893class procedure TCanvasEx.PolygonEx(Canvas: TCanvas; const Points: array of TPoint; Winding: Boolean);
    892894begin
    893895  //Changing;
    894896  //RequiredState([csHandleValid, csBrushValid, csPenValid]);
    895   LCLIntf.Polygon(Handle, @Points[0], Length(Points), Winding);
     897  LCLIntf.Polygon(Canvas.Handle, @Points[0], Length(Points), Winding);
    896898  //Changed;
    897899end;
     
    12971299    Brush.Style := bsSolid;
    12981300    //Polygon(Points, False, 0, Length(Points));
    1299     TCanvasEx(Canvas).PolygonEx(Points, False);
     1301    TCanvasEx.PolygonEx(Canvas, Points, False);
    13001302    //MoveTo(Points[0].X, Points[0].Y);
    13011303    //LineTo(Points[1].X, Points[1].Y);
     
    13091311      TextPos := View.CellToCanvasPos(Pos);
    13101312      TextSize := TextExtent(Text);
    1311       TCanvasEx(Canvas).TextOutEx(Round(TextPos.X) - TextSize.cx div 2,
     1313      TCanvasEx.TextOutEx(Canvas, Round(TextPos.X) - TextSize.cx div 2,
    13121314        Round(TextPos.Y) - TextSize.cy div 2, Text, False);
    13131315    end;
  • trunk/xtactics.lpr

    r108 r115  
    3737  Application.CreateForm(TFormPlayer, FormPlayer);
    3838  Application.CreateForm(TFormSettings, FormSettings);
    39   Application.CreateForm(TFormAbout, FormAbout);
    40   Application.CreateForm(TFormHelp, FormHelp);
    4139  Application.Run;
    4240end.
Note: See TracChangeset for help on using the changeset viewer.