Changeset 81


Ignore:
Timestamp:
Jun 21, 2017, 4:02:31 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Show main form as maximized by default on first start.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r74 r81  
    55  Width = 860
    66  Caption = 'LazFuck'
    7   ClientHeight = 554
     7  ClientHeight = 561
    88  ClientWidth = 860
    99  Menu = MainMenu1
     
    1313  OnDestroy = FormDestroy
    1414  OnShow = FormShow
    15   LCLVersion = '1.6.0.4'
     15  LCLVersion = '1.6.4.0'
    1616  WindowState = wsMaximized
    1717  object StatusBarMain: TStatusBar
    1818    Left = 0
    1919    Height = 28
    20     Top = 526
     20    Top = 533
    2121    Width = 860
    2222    Panels = <   
     
    131131  object PageControlRight: TPageControl
    132132    Left = 467
    133     Height = 500
     133    Height = 507
    134134    Top = 26
    135135    Width = 393
     
    141141    object TabSheetDebug: TTabSheet
    142142      Caption = 'Debug'
    143       ClientHeight = 494
    144       ClientWidth = 319
     143      ClientHeight = 499
     144      ClientWidth = 359
    145145      object PanelInput: TPanel
    146146        Left = 0
    147147        Height = 64
    148148        Top = 0
    149         Width = 319
     149        Width = 359
    150150        Align = alTop
    151151        BevelOuter = bvNone
     
    157157        Height = 5
    158158        Top = 64
    159         Width = 319
     159        Width = 359
    160160        Align = alTop
    161161        ResizeAnchor = akTop
     
    165165        Height = 259
    166166        Top = 69
    167         Width = 319
     167        Width = 359
    168168        Align = alTop
    169169        BevelOuter = bvNone
     
    175175        Height = 5
    176176        Top = 328
    177         Width = 319
     177        Width = 359
    178178        Align = alTop
    179179        ResizeAnchor = akTop
     
    183183        Height = 86
    184184        Top = 333
    185         Width = 319
     185        Width = 359
    186186        Align = alTop
    187187        BevelOuter = bvNone
     
    193193        Height = 5
    194194        Top = 419
    195         Width = 319
     195        Width = 359
    196196        Align = alTop
    197197        ResizeAnchor = akTop
     
    199199      object PanelMemory: TPanel
    200200        Left = 0
    201         Height = 70
     201        Height = 75
    202202        Top = 424
    203         Width = 319
     203        Width = 359
    204204        Align = alClient
    205205        BevelOuter = bvNone
     
    210210  object Splitter1: TSplitter
    211211    Left = 462
    212     Height = 500
     212    Height = 507
    213213    Top = 26
    214214    Width = 5
     
    218218  object PanelLeft: TPanel
    219219    Left = 0
    220     Height = 500
     220    Height = 507
    221221    Top = 26
    222222    Width = 462
    223223    Align = alClient
    224224    BevelOuter = bvNone
    225     ClientHeight = 500
     225    ClientHeight = 507
    226226    ClientWidth = 462
    227227    TabOrder = 4
    228228    object PageControlMain: TPageControl
    229229      Left = 0
    230       Height = 377
     230      Height = 384
    231231      Top = 0
    232232      Width = 462
     
    246246      Left = 0
    247247      Height = 118
    248       Top = 382
     248      Top = 389
    249249      Width = 462
    250250      ActivePage = TabSheetMessages
     
    261261      Left = 0
    262262      Height = 5
    263       Top = 377
     263      Top = 384
    264264      Width = 462
    265265      Align = alBottom
  • trunk/Forms/UFormMain.pas

    r74 r81  
    207207  UpdateTargetList;
    208208  DockInit;
    209   Core.PersistentForm1.Load(Self);
     209  Core.PersistentForm1.Load(Self, wsMaximized);
    210210end;
    211211
  • trunk/LazFuck.lpi

    r78 r81  
    22<CONFIG>
    33  <ProjectOptions>
    4     <Version Value="9"/>
     4    <Version Value="10"/>
    55    <PathDelim Value="\"/>
    66    <General>
  • trunk/Packages/Common/UPersistentForm.pas

    r74 r81  
    2626    FormWindowState: TWindowState;
    2727    Form: TForm;
     28    DefaultFormWindowState: TWindowState;
    2829    procedure LoadFromRegistry(RegistryContext: TRegistryContext);
    2930    procedure SaveToRegistry(RegistryContext: TRegistryContext);
    3031    function CheckEntireVisible(Rect: TRect): TRect;
    3132    function CheckPartVisible(Rect: TRect; Part: Integer): TRect;
    32     procedure Load(Form: TForm; DefaultMaximized: Boolean = False);
     33    procedure Load(Form: TForm; DefaultFormWindowState: TWindowState = wsNormal);
    3334    procedure Save(Form: TForm);
    3435    constructor Create(AOwner: TComponent); override;
     
    5657  I: Integer;
    5758  WinControl: TWinControl;
    58   Count: Integer;
    5959begin
    6060  if Control is TListView then begin
     
    135135      + FormRestoredSize.Top;
    136136    // Other state
    137     FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(wsNormal)));
     137    FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(DefaultFormWindowState)));
    138138  finally
    139139    Free;
     
    216216end;
    217217
    218 procedure TPersistentForm.Load(Form: TForm; DefaultMaximized: Boolean = False);
    219 var
    220   LoadDefaults: Boolean;
     218procedure TPersistentForm.Load(Form: TForm; DefaultFormWindowState: TWindowState = wsNormal);
    221219begin
    222220  Self.Form := Form;
     221  Self.DefaultFormWindowState := DefaultFormWindowState;
     222
    223223  // Set default
    224224  FormNormalSize := Bounds((Screen.Width - Form.Width) div 2,
     
    230230
    231231  if not EqualRect(FormNormalSize, FormRestoredSize) or
    232     (LoadDefaults and DefaultMaximized) then begin
     232    (FormWindowState = wsMaximized) then begin
    233233    // Restore to maximized state
    234234    Form.WindowState := wsNormal;
  • trunk/UCore.pas

    r77 r81  
    104104  LastOpenedList.LoadFromRegistry(RegContext(Root, Key + '\' + RecentFilesRegKey));
    105105  Targets.LoadFromRegistry(Root, Key);
    106   PersistentForm1.RegistryContext := RegContext(Root, Key + '\Forms');
     106  PersistentForm1.RegistryContext := RegContext(Root, Key);
    107107end;
    108108
Note: See TracChangeset for help on using the changeset viewer.