Changeset 29


Ignore:
Timestamp:
Jun 4, 2010, 7:10:40 AM (14 years ago)
Author:
george
Message:
  • Opraveno: PersistentForm špatně obnovoval velikost formuláře v normálním stavu okna.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • PersistentForm/UPersistentForm.pas

    r28 r29  
    4848      if Form.Top > (Screen.Height - 50) then
    4949        Form.Top := Screen.Height - 50;
    50       RestoredWidth := ReadIntegerWithDefault('RestoredWidth', Form.RestoredWidth);
    51       RestoredHeight := ReadIntegerWithDefault ('RestoredHeight', Form.RestoredHeight);
    52       RestoredTop := ReadIntegerWithDefault ('RestoredTop', (Screen.Height - Form.RestoredHeight) div 2);
    53       RestoredLeft := ReadIntegerWithDefault ('RestoredLeft', (Screen.Width - Form.RestoredWidth) div 2);
    54       Form.SetRestoredBounds(RestoredLeft, RestoredTop, RestoredWidth, RestoredHeight);
     50      Form.WindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(wsNormal)));
     51      if Form.WindowState = wsMaximized then begin
     52        RestoredWidth := ReadIntegerWithDefault('RestoredWidth', Form.RestoredWidth);
     53        RestoredHeight := ReadIntegerWithDefault ('RestoredHeight', Form.RestoredHeight);
     54        RestoredTop := ReadIntegerWithDefault ('RestoredTop', (Screen.Height - Form.RestoredHeight) div 2);
     55        RestoredLeft := ReadIntegerWithDefault ('RestoredLeft', (Screen.Width - Form.RestoredWidth) div 2);
     56        Form.SetRestoredBounds(RestoredLeft, RestoredTop, RestoredWidth, RestoredHeight);
     57      end;
    5558
    56       Form.WindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(wsNormal)));
    5759      if ReadBoolWithDefault('Visible', False) then Form.Show;
    5860    finally
     
    7173      WriteInteger('Top', Form.Top);
    7274      WriteInteger('Left', Form.Left);
     75      WriteInteger('WindowState', Integer(Form.WindowState));
    7376      WriteInteger('RestoredWidth', Form.RestoredWidth);
    7477      WriteInteger('RestoredHeight', Form.RestoredHeight);
    7578      WriteInteger('RestoredTop', Form.RestoredTop);
    7679      WriteInteger('RestoredLeft', Form.RestoredLeft);
    77       WriteInteger('WindowState', Integer(Form.WindowState));
    7880      WriteBool('Visible', Form.Visible);
    7981    finally
Note: See TracChangeset for help on using the changeset viewer.