Changeset 111


Ignore:
Timestamp:
Feb 2, 2018, 4:40:46 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Custom defined form dialogs moved to CevoComponents so they can be correctly opened in IDE.
  • Modified: Moved Sound, StringTables and Directories to CevoComponents as dependency for custom form dialogs.
Location:
trunk
Files:
6 added
7 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/Area.pas

    r10 r111  
    2626begin
    2727  inherited;
    28   Enabled:=false;
    29   ShowHint:=true;
     28  Enabled := false;
     29  ShowHint := true;
    3030end;
    3131
     
    3434  if csDesigning in ComponentState then
    3535    with Canvas do
    36       begin Brush.Color:=$FF0000; FrameRect(Rect(0,0,width,height)) end
     36      begin
     37        Brush.Color := $FF0000;
     38        FrameRect(Rect(0, 0, width, height));
     39      end;
    3740end;
    3841
  • trunk/Components/ButtonBase.pas

    r14 r111  
    122122begin
    123123  FDown := x;
    124   Invalidate
     124  Invalidate;
    125125end;
    126126
  • trunk/Components/ButtonC.pas

    r14 r111  
    1111    constructor Create(aOwner: TComponent); override;
    1212  private
    13     FIndex: integer;
    14     procedure SetIndex(x: integer);
     13    FIndex: Integer;
     14    procedure SetIndex(x: Integer);
    1515  published
    1616    property Visible;
     
    3333begin
    3434  inherited Create(aOwner);
    35   ShowHint := true;
     35  ShowHint := True;
    3636  SetBounds(0, 0, 12, 12);
    3737end;
     
    5555  begin
    5656    FIndex := x;
    57     Invalidate
    58   end
     57    Invalidate;
     58  end;
    5959end;
    6060
  • trunk/Components/CevoComponents.lpk

    r100 r111  
    1515          <SyntaxMode Value="Delphi"/>
    1616          <CStyleOperator Value="False"/>
     17          <IncludeAssertionCode Value="True"/>
    1718          <AllowLabel Value="False"/>
    1819          <CPPInline Value="False"/>
     
    2021      </Parsing>
    2122      <CodeGeneration>
     23        <Checks>
     24          <IOChecks Value="True"/>
     25          <RangeChecks Value="True"/>
     26          <OverflowChecks Value="True"/>
     27          <StackChecks Value="True"/>
     28        </Checks>
     29        <VerifyObjMethodCallValidity Value="True"/>
    2230        <Optimizations>
    2331          <OptimizationLevel Value="0"/>
    2432        </Optimizations>
    2533      </CodeGeneration>
    26       <Linking>
    27         <Debugging>
    28           <GenerateDebugInfo Value="False"/>
    29         </Debugging>
    30       </Linking>
    3134      <Other>
    3235        <CompilerMessages>
     
    3538      </Other>
    3639    </CompilerOptions>
    37     <Files Count="7">
     40    <Files Count="12">
    3841      <Item1>
    3942        <Filename Value="Area.pas"/>
     
    7073        <UnitName Value="ButtonBase"/>
    7174      </Item7>
     75      <Item8>
     76        <Filename Value="DrawDlg.pas"/>
     77        <HasRegisterProc Value="True"/>
     78        <UnitName Value="DrawDlg"/>
     79      </Item8>
     80      <Item9>
     81        <Filename Value="ScreenTools.pas"/>
     82        <Type Value="Include"/>
     83      </Item9>
     84      <Item10>
     85        <Filename Value="Directories.pas"/>
     86        <Type Value="Include"/>
     87      </Item10>
     88      <Item11>
     89        <Filename Value="StringTables.pas"/>
     90        <Type Value="Include"/>
     91      </Item11>
     92      <Item12>
     93        <Filename Value="Sound.pas"/>
     94        <UnitName Value="Sound"/>
     95      </Item12>
    7296    </Files>
    7397    <RequiredPkgs Count="2">
  • trunk/Components/CevoComponents.pas

    r10 r111  
    55unit CevoComponents;
    66
     7{$warn 5023 off : no warning about unused units}
    78interface
    89
    910uses
    10   Area, ButtonA, ButtonB, ButtonC, ButtonN, EOTButton, ButtonBase,
    11   LazarusPackageIntf;
     11  Area, ButtonA, ButtonB, ButtonC, ButtonN, EOTButton, ButtonBase, DrawDlg,
     12  Sound, LazarusPackageIntf;
    1213
    1314implementation
     
    2122  RegisterUnit('ButtonN', @ButtonN.Register);
    2223  RegisterUnit('EOTButton', @EOTButton.Register);
     24  RegisterUnit('DrawDlg', @DrawDlg.Register);
    2325end;
    2426
  • trunk/Direct.pas

    r53 r111  
    77  Messg,
    88
    9   LCLIntf, LCLType, {$IFDEF Linux}LMessages, {$ENDIF}Messages, SysUtils, Classes, Graphics, Controls, Forms;
     9  LCLIntf, LCLType, {$IFDEF Linux}LMessages, {$ENDIF}Messages, SysUtils, Classes,
     10  Graphics, Controls, Forms, DrawDlg;
    1011
    1112const
  • trunk/Inp.pas

    r104 r111  
    66uses
    77  ScreenTools, Messg,
    8   LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
     8  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, DrawDlg,
    99  ButtonA, StdCtrls;
    1010
  • trunk/Integrated.lpi

    r100 r111  
    9090      </Item2>
    9191    </RequiredPackages>
    92     <Units Count="44">
     92    <Units Count="40">
    9393      <Unit0>
    9494        <Filename Value="Integrated.lpr"/>
     
    9696      </Unit0>
    9797      <Unit1>
    98         <Filename Value="StringTables.pas"/>
     98        <Filename Value="Protocol.pas"/>
    9999        <IsPartOfProject Value="True"/>
    100100      </Unit1>
    101101      <Unit2>
    102         <Filename Value="Directories.pas"/>
     102        <Filename Value="CmdList.pas"/>
    103103        <IsPartOfProject Value="True"/>
    104104      </Unit2>
    105105      <Unit3>
    106         <Filename Value="Protocol.pas"/>
     106        <Filename Value="Database.pas"/>
    107107        <IsPartOfProject Value="True"/>
    108108      </Unit3>
    109109      <Unit4>
    110         <Filename Value="CmdList.pas"/>
     110        <Filename Value="GameServer.pas"/>
    111111        <IsPartOfProject Value="True"/>
    112112      </Unit4>
    113113      <Unit5>
    114         <Filename Value="Database.pas"/>
     114        <Filename Value="CityProcessing.pas"/>
    115115        <IsPartOfProject Value="True"/>
    116116      </Unit5>
    117117      <Unit6>
    118         <Filename Value="GameServer.pas"/>
     118        <Filename Value="UnitProcessing.pas"/>
    119119        <IsPartOfProject Value="True"/>
    120120      </Unit6>
    121121      <Unit7>
    122         <Filename Value="CityProcessing.pas"/>
    123         <IsPartOfProject Value="True"/>
     122        <Filename Value="Direct.pas"/>
     123        <IsPartOfProject Value="True"/>
     124        <ComponentName Value="DirectDlg"/>
     125        <HasResources Value="True"/>
     126        <ResourceBaseClass Value="Form"/>
    124127      </Unit7>
    125128      <Unit8>
    126         <Filename Value="UnitProcessing.pas"/>
    127         <IsPartOfProject Value="True"/>
     129        <Filename Value="Start.pas"/>
     130        <IsPartOfProject Value="True"/>
     131        <ComponentName Value="StartDlg"/>
     132        <HasResources Value="True"/>
     133        <ResourceBaseClass Value="Form"/>
    128134      </Unit8>
    129135      <Unit9>
    130         <Filename Value="Direct.pas"/>
    131         <IsPartOfProject Value="True"/>
    132         <ComponentName Value="DirectDlg"/>
     136        <Filename Value="Messg.pas"/>
     137        <IsPartOfProject Value="True"/>
     138        <ComponentName Value="MessgDlg"/>
    133139        <HasResources Value="True"/>
    134140        <ResourceBaseClass Value="Form"/>
    135141      </Unit9>
    136142      <Unit10>
    137         <Filename Value="ScreenTools.pas"/>
    138         <IsPartOfProject Value="True"/>
     143        <Filename Value="Inp.pas"/>
     144        <IsPartOfProject Value="True"/>
     145        <ComponentName Value="InputDlg"/>
     146        <HasResources Value="True"/>
     147        <ResourceBaseClass Value="Form"/>
    139148      </Unit10>
    140149      <Unit11>
    141         <Filename Value="Start.pas"/>
    142         <IsPartOfProject Value="True"/>
    143         <ComponentName Value="StartDlg"/>
     150        <Filename Value="Back.pas"/>
     151        <IsPartOfProject Value="True"/>
     152        <ComponentName Value="Background"/>
    144153        <HasResources Value="True"/>
    145154        <ResourceBaseClass Value="Form"/>
    146155      </Unit11>
    147156      <Unit12>
    148         <Filename Value="Messg.pas"/>
    149         <IsPartOfProject Value="True"/>
    150         <ComponentName Value="MessgDlg"/>
     157        <Filename Value="Log.pas"/>
     158        <IsPartOfProject Value="True"/>
     159        <ComponentName Value="LogDlg"/>
    151160        <HasResources Value="True"/>
    152161        <ResourceBaseClass Value="Form"/>
    153162      </Unit12>
    154163      <Unit13>
    155         <Filename Value="Inp.pas"/>
    156         <IsPartOfProject Value="True"/>
    157         <ComponentName Value="InputDlg"/>
    158         <HasResources Value="True"/>
    159         <ResourceBaseClass Value="Form"/>
     164        <Filename Value="LocalPlayer\PVSB.pas"/>
     165        <IsPartOfProject Value="True"/>
    160166      </Unit13>
    161167      <Unit14>
    162         <Filename Value="Back.pas"/>
    163         <IsPartOfProject Value="True"/>
    164         <ComponentName Value="Background"/>
    165         <HasResources Value="True"/>
    166         <ResourceBaseClass Value="Form"/>
     168        <Filename Value="LocalPlayer\LocalPlayer.pas"/>
     169        <IsPartOfProject Value="True"/>
    167170      </Unit14>
    168171      <Unit15>
    169         <Filename Value="Log.pas"/>
    170         <IsPartOfProject Value="True"/>
    171         <ComponentName Value="LogDlg"/>
    172         <HasResources Value="True"/>
    173         <ResourceBaseClass Value="Form"/>
     172        <Filename Value="LocalPlayer\ClientTools.pas"/>
     173        <IsPartOfProject Value="True"/>
    174174      </Unit15>
    175175      <Unit16>
    176         <Filename Value="LocalPlayer\PVSB.pas"/>
     176        <Filename Value="LocalPlayer\Diplomacy.pas"/>
    177177        <IsPartOfProject Value="True"/>
    178178      </Unit16>
    179179      <Unit17>
    180         <Filename Value="LocalPlayer\LocalPlayer.pas"/>
     180        <Filename Value="LocalPlayer\Tribes.pas"/>
    181181        <IsPartOfProject Value="True"/>
    182182      </Unit17>
    183183      <Unit18>
    184         <Filename Value="LocalPlayer\ClientTools.pas"/>
     184        <Filename Value="LocalPlayer\IsoEngine.pas"/>
    185185        <IsPartOfProject Value="True"/>
    186186      </Unit18>
    187187      <Unit19>
    188         <Filename Value="LocalPlayer\Diplomacy.pas"/>
    189         <IsPartOfProject Value="True"/>
     188        <Filename Value="LocalPlayer\Term.pas"/>
     189        <IsPartOfProject Value="True"/>
     190        <ComponentName Value="MainScreen"/>
     191        <HasResources Value="True"/>
     192        <ResourceBaseClass Value="Form"/>
    190193      </Unit19>
    191194      <Unit20>
    192         <Filename Value="LocalPlayer\Tribes.pas"/>
    193         <IsPartOfProject Value="True"/>
     195        <Filename Value="LocalPlayer\MessgEx.pas"/>
     196        <IsPartOfProject Value="True"/>
     197        <ComponentName Value="MessgExDlg"/>
     198        <HasResources Value="True"/>
     199        <ResourceBaseClass Value="Form"/>
    194200      </Unit20>
    195201      <Unit21>
    196         <Filename Value="LocalPlayer\IsoEngine.pas"/>
     202        <Filename Value="LocalPlayer\BaseWin.pas"/>
    197203        <IsPartOfProject Value="True"/>
    198204      </Unit21>
    199205      <Unit22>
    200         <Filename Value="LocalPlayer\Term.pas"/>
    201         <IsPartOfProject Value="True"/>
    202         <ComponentName Value="MainScreen"/>
     206        <Filename Value="LocalPlayer\Help.pas"/>
     207        <IsPartOfProject Value="True"/>
     208        <ComponentName Value="HelpDlg"/>
    203209        <HasResources Value="True"/>
    204210        <ResourceBaseClass Value="Form"/>
    205211      </Unit22>
    206212      <Unit23>
    207         <Filename Value="LocalPlayer\MessgEx.pas"/>
    208         <IsPartOfProject Value="True"/>
    209         <ComponentName Value="MessgExDlg"/>
     213        <Filename Value="LocalPlayer\Select.pas"/>
     214        <IsPartOfProject Value="True"/>
     215        <ComponentName Value="ListDlg"/>
    210216        <HasResources Value="True"/>
    211217        <ResourceBaseClass Value="Form"/>
    212218      </Unit23>
    213219      <Unit24>
    214         <Filename Value="LocalPlayer\BaseWin.pas"/>
    215         <IsPartOfProject Value="True"/>
     220        <Filename Value="LocalPlayer\CityScreen.pas"/>
     221        <IsPartOfProject Value="True"/>
     222        <ComponentName Value="CityDlg"/>
     223        <HasResources Value="True"/>
     224        <ResourceBaseClass Value="Form"/>
    216225      </Unit24>
    217226      <Unit25>
    218         <Filename Value="LocalPlayer\Help.pas"/>
    219         <IsPartOfProject Value="True"/>
    220         <ComponentName Value="HelpDlg"/>
     227        <Filename Value="LocalPlayer\UnitStat.pas"/>
     228        <IsPartOfProject Value="True"/>
     229        <ComponentName Value="UnitStatDlg"/>
    221230        <HasResources Value="True"/>
    222231        <ResourceBaseClass Value="Form"/>
    223232      </Unit25>
    224233      <Unit26>
    225         <Filename Value="LocalPlayer\Select.pas"/>
    226         <IsPartOfProject Value="True"/>
    227         <ComponentName Value="ListDlg"/>
     234        <Filename Value="LocalPlayer\Draft.pas"/>
     235        <IsPartOfProject Value="True"/>
     236        <ComponentName Value="DraftDlg"/>
    228237        <HasResources Value="True"/>
    229238        <ResourceBaseClass Value="Form"/>
    230239      </Unit26>
    231240      <Unit27>
    232         <Filename Value="LocalPlayer\CityScreen.pas"/>
    233         <IsPartOfProject Value="True"/>
    234         <ComponentName Value="CityDlg"/>
     241        <Filename Value="LocalPlayer\NatStat.pas"/>
     242        <IsPartOfProject Value="True"/>
     243        <ComponentName Value="NatStatDlg"/>
    235244        <HasResources Value="True"/>
    236245        <ResourceBaseClass Value="Form"/>
    237246      </Unit27>
    238247      <Unit28>
    239         <Filename Value="LocalPlayer\UnitStat.pas"/>
    240         <IsPartOfProject Value="True"/>
    241         <ComponentName Value="UnitStatDlg"/>
     248        <Filename Value="LocalPlayer\Diagram.pas"/>
     249        <IsPartOfProject Value="True"/>
     250        <ComponentName Value="DiaDlg"/>
    242251        <HasResources Value="True"/>
    243252        <ResourceBaseClass Value="Form"/>
    244253      </Unit28>
    245254      <Unit29>
    246         <Filename Value="LocalPlayer\Draft.pas"/>
    247         <IsPartOfProject Value="True"/>
    248         <ComponentName Value="DraftDlg"/>
     255        <Filename Value="LocalPlayer\Wonders.pas"/>
     256        <IsPartOfProject Value="True"/>
     257        <ComponentName Value="WondersDlg"/>
    249258        <HasResources Value="True"/>
    250259        <ResourceBaseClass Value="Form"/>
    251260      </Unit29>
    252261      <Unit30>
    253         <Filename Value="LocalPlayer\NatStat.pas"/>
    254         <IsPartOfProject Value="True"/>
    255         <ComponentName Value="NatStatDlg"/>
     262        <Filename Value="LocalPlayer\Nego.pas"/>
     263        <IsPartOfProject Value="True"/>
     264        <ComponentName Value="NegoDlg"/>
    256265        <HasResources Value="True"/>
    257266        <ResourceBaseClass Value="Form"/>
    258267      </Unit30>
    259268      <Unit31>
    260         <Filename Value="LocalPlayer\Diagram.pas"/>
    261         <IsPartOfProject Value="True"/>
    262         <ComponentName Value="DiaDlg"/>
     269        <Filename Value="LocalPlayer\CityType.pas"/>
     270        <IsPartOfProject Value="True"/>
     271        <ComponentName Value="CityTypeDlg"/>
    263272        <HasResources Value="True"/>
    264273        <ResourceBaseClass Value="Form"/>
    265274      </Unit31>
    266275      <Unit32>
    267         <Filename Value="LocalPlayer\Wonders.pas"/>
    268         <IsPartOfProject Value="True"/>
    269         <ComponentName Value="WondersDlg"/>
     276        <Filename Value="LocalPlayer\Enhance.pas"/>
     277        <IsPartOfProject Value="True"/>
     278        <ComponentName Value="EnhanceDlg"/>
    270279        <HasResources Value="True"/>
    271280        <ResourceBaseClass Value="Form"/>
    272281      </Unit32>
    273282      <Unit33>
    274         <Filename Value="LocalPlayer\Nego.pas"/>
    275         <IsPartOfProject Value="True"/>
    276         <ComponentName Value="NegoDlg"/>
     283        <Filename Value="NoTerm.pas"/>
     284        <IsPartOfProject Value="True"/>
     285        <ComponentName Value="NoTermDlg"/>
    277286        <HasResources Value="True"/>
    278287        <ResourceBaseClass Value="Form"/>
    279288      </Unit33>
    280289      <Unit34>
    281         <Filename Value="LocalPlayer\CityType.pas"/>
    282         <IsPartOfProject Value="True"/>
    283         <ComponentName Value="CityTypeDlg"/>
     290        <Filename Value="LocalPlayer\Battle.pas"/>
     291        <IsPartOfProject Value="True"/>
     292        <ComponentName Value="BattleDlg"/>
    284293        <HasResources Value="True"/>
    285294        <ResourceBaseClass Value="Form"/>
    286295      </Unit34>
    287296      <Unit35>
    288         <Filename Value="LocalPlayer\Enhance.pas"/>
    289         <IsPartOfProject Value="True"/>
    290         <ComponentName Value="EnhanceDlg"/>
     297        <Filename Value="LocalPlayer\Rates.pas"/>
     298        <IsPartOfProject Value="True"/>
     299        <ComponentName Value="RatesDlg"/>
    291300        <HasResources Value="True"/>
    292301        <ResourceBaseClass Value="Form"/>
    293302      </Unit35>
    294303      <Unit36>
    295         <Filename Value="NoTerm.pas"/>
    296         <IsPartOfProject Value="True"/>
    297         <HasResources Value="True"/>
     304        <Filename Value="LocalPlayer\TechTree.pas"/>
     305        <IsPartOfProject Value="True"/>
     306        <ComponentName Value="TechTreeDlg"/>
     307        <HasResources Value="True"/>
     308        <ResourceBaseClass Value="Form"/>
    298309      </Unit36>
    299310      <Unit37>
    300         <Filename Value="Sound.pas"/>
    301         <IsPartOfProject Value="True"/>
    302         <HasResources Value="True"/>
     311        <Filename Value="Platform.pas"/>
     312        <IsPartOfProject Value="True"/>
    303313      </Unit37>
    304314      <Unit38>
    305         <Filename Value="LocalPlayer\Battle.pas"/>
    306         <IsPartOfProject Value="True"/>
    307         <ComponentName Value="BattleDlg"/>
    308         <HasResources Value="True"/>
    309         <ResourceBaseClass Value="Form"/>
     315        <Filename Value="Switches.inc"/>
     316        <IsPartOfProject Value="True"/>
    310317      </Unit38>
    311318      <Unit39>
    312         <Filename Value="LocalPlayer\Rates.pas"/>
    313         <IsPartOfProject Value="True"/>
    314         <ComponentName Value="RatesDlg"/>
     319        <Filename Value="Locale.pas"/>
     320        <IsPartOfProject Value="True"/>
     321        <ComponentName Value="LocaleDlg"/>
    315322        <HasResources Value="True"/>
    316323        <ResourceBaseClass Value="Form"/>
    317324      </Unit39>
    318       <Unit40>
    319         <Filename Value="LocalPlayer\TechTree.pas"/>
    320         <IsPartOfProject Value="True"/>
    321         <ComponentName Value="TechTreeDlg"/>
    322         <HasResources Value="True"/>
    323         <ResourceBaseClass Value="Form"/>
    324       </Unit40>
    325       <Unit41>
    326         <Filename Value="Platform.pas"/>
    327         <IsPartOfProject Value="True"/>
    328       </Unit41>
    329       <Unit42>
    330         <Filename Value="Switches.inc"/>
    331         <IsPartOfProject Value="True"/>
    332       </Unit42>
    333       <Unit43>
    334         <Filename Value="Locale.pas"/>
    335         <IsPartOfProject Value="True"/>
    336         <ComponentName Value="LocaleDlg"/>
    337         <HasResources Value="True"/>
    338         <ResourceBaseClass Value="Form"/>
    339       </Unit43>
    340325    </Units>
    341326  </ProjectOptions>
     
    384369        <IgnoredMessages idx5024="True"/>
    385370      </CompilerMessages>
    386       <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL -dDEBUG"/>
     371      <CustomOptions Value="-dDEBUG"/>
    387372    </Other>
    388373  </CompilerOptions>
  • trunk/Integrated.lpr

    r64 r111  
    44uses
    55  Forms, Interfaces, SysUtils,
    6   StringTables in 'StringTables.pas',
    7   Directories in 'Directories.pas',
    86  Protocol in 'Protocol.pas',
    97  CmdList in 'CmdList.pas',
     
    1311  UnitProcessing in 'UnitProcessing.pas',
    1412  Direct in 'Direct.pas' {DirectDlg} ,
    15   ScreenTools in 'ScreenTools.pas',
    1613  Start in 'Start.pas' {StartDlg} ,
    1714  Messg in 'Messg.pas' {MessgDlg} ,
     
    4037  Enhance in 'LocalPlayer\Enhance.pas' {EnhanceDlg} ,
    4138  NoTerm in 'NoTerm.pas' {NoTermDlg} ,
    42   Sound in 'Sound.pas' {SoundPlayer} ,
    4339  Battle in 'LocalPlayer\Battle.pas' {BattleDlg} ,
    4440  Rates in 'LocalPlayer\Rates.pas' {RatesDlg} ,
    45   TechTree in 'LocalPlayer\TechTree.pas' {TechTreeDlg};
     41  TechTree in 'LocalPlayer\TechTree.pas' {TechTreeDlg},
     42  ScreenTools, Directories;
    4643
    4744{$R cevo.res}
     
    6461  Application.Initialize;
    6562  Application.Title := 'c-evo';
     63  Directories.InitUnit;
     64  ScreenTools.UnitInit;
    6665  Application.CreateForm(TDirectDlg, DirectDlg);
    6766  Application.CreateForm(TStartDlg, StartDlg);
     
    7170  Application.CreateForm(TLogDlg, LogDlg);
    7271  Application.Run;
    73 
     72  ScreenTools.UnitDone;
    7473end.
  • trunk/LocalPlayer/BaseWin.pas

    r104 r111  
    77  ScreenTools, Messg,
    88
    9   LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms;
     9  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, DrawDlg;
    1010
    1111type
  • trunk/LocalPlayer/Battle.pas

    r57 r111  
    66uses
    77  ScreenTools, Protocol, Messg, ButtonBase, ButtonA, Types, LCLIntf, LCLType,
    8   SysUtils, Classes, Graphics, Controls, Forms;
     8  SysUtils, Classes, Graphics, Controls, Forms, DrawDlg;
    99
    1010type
  • trunk/LocalPlayer/MessgEx.pas

    r62 r111  
    77  Messg, Protocol, ScreenTools, Platform, DateUtils,
    88  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
    9   ButtonB, StdCtrls;
     9  ButtonB, StdCtrls, DrawDlg;
    1010
    1111type
  • trunk/LocalPlayer/TechTree.pas

    r73 r111  
    55
    66uses
    7   ScreenTools, Messg, LCLIntf, LCLType,
    8 
    9   Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ButtonBase, ButtonB;
     7  ScreenTools, Messg, LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics,
     8  Controls, Forms, ButtonBase, ButtonB, DrawDlg;
    119
    1210type
  • trunk/LocalPlayer/Term.pas

    r99 r111  
    1212{$ENDIF}
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    14   LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls,
    15   Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area, Types;
     14  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types,
     15  Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area;
    1616
    1717const
  • trunk/Locale.pas

    r77 r111  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ScreenTools, Messg, ButtonA, Registry, fgl, Directories;
     9  ScreenTools, Messg, ButtonA, Registry, fgl, Directories, DrawDlg;
    1010
    1111type
  • trunk/Messg.lfm

    r9 r111  
    11object MessgDlg: TMessgDlg
    22  Left = 493
     3  Height = 134
    34  Top = 431
     5  Width = 418
    46  BorderIcons = []
    57  BorderStyle = bsNone
     
    810  ClientWidth = 418
    911  Color = clBtnFace
    10   Font.Charset = DEFAULT_CHARSET
     12  DesignTimePPI = 125
    1113  Font.Color = clWindowText
    1214  Font.Height = -13
    1315  Font.Name = 'MS Sans Serif'
    14   Font.Style = []
    1516  FormStyle = fsStayOnTop
    1617  OnCreate = FormCreate
     
    1819  OnPaint = FormPaint
    1920  OnShow = FormShow
    20   PixelsPerInch = 96
     21  LCLVersion = '1.8.0.6'
    2122  object Button1: TButtonA
    2223    Left = 101
     24    Height = 25
    2325    Top = 104
    2426    Width = 100
    25     Height = 25
    2627    Down = False
    2728    Permanent = False
    2829    OnClick = Button1Click
    29     Caption = ''
    3030  end
    3131  object Button2: TButtonA
    3232    Left = 217
     33    Height = 25
    3334    Top = 104
    3435    Width = 100
    35     Height = 25
    3636    Down = False
    3737    Permanent = False
    3838    OnClick = Button2Click
    39     Caption = ''
    4039  end
    4140end
  • trunk/Messg.pas

    r104 r111  
    55
    66uses
    7   ScreenTools,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonBase,
    10   ButtonA,
    11   ButtonB, Area;
     7  ScreenTools, LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes,
     8  Graphics, Controls, Forms, ButtonBase, ButtonA, ButtonB, Area, DrawDlg;
    129
    1310const
     
    1512
    1613type
    17   TDrawDlg = class(TForm)
    18   public
    19     constructor Create(AOwner: TComponent); override;
    20     procedure SmartInvalidate; virtual;
    21   protected
    22     TitleHeight: integer;
    23     // defines area to grip the window for moving (from top)
    24     procedure InitButtons();
    25     procedure OnEraseBkgnd(var m: TMessage); message WM_ERASEBKGND;
    26     procedure OnHitTest(var Msg: TMessage); message WM_NCHITTEST;
    27   end;
    28 
    29   TBaseMessgDlg = class(TDrawDlg)
    30     procedure FormCreate(Sender: TObject);
    31     procedure FormPaint(Sender: TObject);
    32   public
    33     MessgText: string;
    34   protected
    35     Lines, TopSpace: integer;
    36     procedure SplitText(preview: boolean);
    37     procedure CorrectHeight;
    38   end;
    39 
    4014  TMessgDlg = class(TBaseMessgDlg)
    4115    Button1: TButtonA;
     
    6034  mkYesNo = 3;
    6135
    62   Border = 3;
    63   MessageLineSpacing = 20;
    64 
    6536var
    6637  MessgDlg: TMessgDlg;
     
    6940procedure SoundMessage(SimpleText, SoundItem: string);
    7041
     42
    7143implementation
    7244
    7345{$R *.lfm}
    74 
    75 constructor TDrawDlg.Create(AOwner: TComponent);
    76 begin
    77   inherited;
    78   TitleHeight := 0;
    79 end;
    80 
    81 procedure TDrawDlg.OnEraseBkgnd(var m: TMessage);
    82 begin
    83 end;
    84 
    85 procedure TDrawDlg.OnHitTest(var Msg: TMessage);
    86 var
    87   i: integer;
    88   ControlBounds: TRect;
    89 begin
    90   if BorderStyle <> bsNone then
    91     inherited
    92   else
    93   begin
    94     if integer((Msg.LParam shr 16) and $ffff) >= Top + TitleHeight then
    95       Msg.result := HTCLIENT
    96     else
    97     begin
    98       for i := 0 to ControlCount - 1 do
    99         if Controls[i].Visible then
    100         begin
    101           ControlBounds := Controls[i].BoundsRect;
    102           if (integer(Msg.LParam and $ffff) >= Left + ControlBounds.Left) and
    103             (integer(Msg.LParam and $ffff) < Left + ControlBounds.Right) and
    104             (integer((Msg.LParam shr 16 ) and $ffff) >= Top + ControlBounds.Top) and
    105             (integer((Msg.LParam shr 16) and $ffff) < Top + ControlBounds.Bottom) then
    106           begin
    107             Msg.result := HTCLIENT;
    108             exit;
    109           end;
    110         end;
    111       Msg.result := HTCAPTION
    112     end;
    113   end
    114 end;
    115 
    116 procedure TDrawDlg.InitButtons();
    117 var
    118   cix: integer;
    119   // ButtonDownSound, ButtonUpSound: string;
    120 begin
    121   // ButtonDownSound:=Sounds.Lookup('BUTTON_DOWN');
    122   // ButtonUpSound:=Sounds.Lookup('BUTTON_UP');
    123   for cix := 0 to ComponentCount - 1 do
    124     if Components[cix] is TButtonBase then
    125     begin
    126       TButtonBase(Components[cix]).Graphic := GrExt[HGrSystem].Data;
    127       // if ButtonDownSound<>'*' then
    128       // DownSound:=HomeDir+'Sounds' + DirectorySeparator + ButtonDownSound + '.wav';
    129       // if ButtonUpSound<>'*' then
    130       // UpSound:=HomeDir+'Sounds' + DirectorySeparator + ButtonUpSound + '.wav';
    131       if Components[cix] is TButtonA then
    132         TButtonA(Components[cix]).Font := UniFont[ftButton];
    133       if Components[cix] is TButtonB then
    134         TButtonB(Components[cix]).Mask := GrExt[HGrSystem].Mask;
    135     end;
    136 end;
    137 
    138 procedure TDrawDlg.SmartInvalidate;
    139 var
    140   i: integer;
    141   r0, r1: HRgn;
    142 begin
    143   r0 := CreateRectRgn(0, 0, ClientWidth, ClientHeight);
    144   for i := 0 to ControlCount - 1 do
    145     if not(Controls[i] is TArea) and Controls[i].Visible then
    146     begin
    147       with Controls[i].BoundsRect do
    148         r1 := CreateRectRgn(Left, Top, Right, Bottom);
    149       CombineRgn(r0, r0, r1, RGN_DIFF);
    150       DeleteObject(r1);
    151     end;
    152   InvalidateRgn(Handle, r0, false);
    153   DeleteObject(r0);
    154 end;
    155 
    156 procedure TBaseMessgDlg.FormCreate(Sender: TObject);
    157 begin
    158   Left := (Screen.Width - Width) div 2;
    159   Canvas.Font.Assign(UniFont[ftNormal]);
    160   Canvas.Brush.Style := bsClear;
    161   MessgText := '';
    162   TopSpace := 0;
    163   TitleHeight := Screen.Height;
    164   InitButtons();
    165 end;
    166 
    167 procedure TBaseMessgDlg.FormPaint(Sender: TObject);
    168 var
    169   i, cix: integer;
    170 begin
    171   PaintBackground(self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
    172     ClientHeight - (6 + 2 * Border));
    173   for i := 0 to Border do
    174     Frame(Canvas, i, i, ClientWidth - 1 - i, ClientHeight - 1 - i,
    175       $000000, $000000);
    176   Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border),
    177     ClientHeight - (2 + Border), MainTexture.clBevelLight,
    178     MainTexture.clBevelShade);
    179   Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border),
    180     ClientHeight - (3 + Border), MainTexture.clBevelLight,
    181     MainTexture.clBevelShade);
    182   SplitText(false);
    183 
    184   for cix := 0 to ControlCount - 1 do
    185     if (Controls[cix].Visible) and (Controls[cix] is TButtonBase) then
    186       BtnFrame(Canvas, Controls[cix].BoundsRect, MainTexture);
    187 end;
    188 
    189 procedure TBaseMessgDlg.SplitText(preview: boolean);
    190 var
    191   Start, Stop, OrdinaryStop, LinesCount: integer;
    192   s: string;
    193 begin
    194   Start := 1;
    195   LinesCount := 0;
    196   while Start < Length(MessgText) do
    197   begin
    198     Stop := Start;
    199     while (Stop < Length(MessgText)) and (MessgText[Stop] <> '\') and
    200       (BiColorTextWidth(Canvas, Copy(MessgText, Start, Stop - Start + 1)) <
    201       ClientWidth - 56) do
    202       inc(Stop);
    203     if Stop <> Length(MessgText) then
    204     begin
    205       OrdinaryStop := Stop;
    206       repeat
    207         dec(OrdinaryStop)
    208       until (MessgText[OrdinaryStop + 1] = ' ') or
    209         (MessgText[OrdinaryStop + 1] = '\');
    210       if (OrdinaryStop + 1 - Start) * 2 >= Stop - Start then
    211         Stop := OrdinaryStop
    212     end;
    213     if not preview then
    214     begin
    215       s := Copy(MessgText, Start, Stop - Start + 1);
    216       LoweredTextOut(Canvas, -1, MainTexture,
    217         (ClientWidth - BiColorTextWidth(Canvas, s)) div 2,
    218         19 + Border + TopSpace + LinesCount * MessageLineSpacing, s);
    219     end;
    220     Start := Stop + 2;
    221     inc(LinesCount)
    222   end;
    223   if preview then
    224     Lines := LinesCount;
    225 end;
    226 
    227 procedure TBaseMessgDlg.CorrectHeight;
    228 var
    229   i: integer;
    230 begin
    231   ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
    232   Top := (Screen.Height - ClientHeight) div 2;
    233   for i := 0 to ControlCount - 1 do
    234     Controls[i].Top := ClientHeight - (34 + Border);
    235 end;
    23646
    23747procedure TMessgDlg.FormCreate(Sender: TObject);
  • trunk/NoTerm.pas

    r57 r111  
    66uses
    77  ScreenTools, Protocol, Messg, LCLIntf, LCLType, dateutils, Platform,
    8   SysUtils, Classes, Graphics, Controls, Forms, ButtonB;
     8  SysUtils, Classes, Graphics, Controls, Forms, ButtonB, DrawDlg;
    99
    1010type
  • trunk/Start.pas

    r105 r111  
    77  GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Math,
    88  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
    9   Menus, Registry;
     9  Menus, Registry, DrawDlg;
    1010
    1111const
Note: See TracChangeset for help on using the changeset viewer.