Procedure

SetUserBounds

Module

rMisc

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

procedure SetUserBounds(var AControl: TControl);

Calls Hierarchy


SetUserBounds
 └LoadSizes

Called-By Hierarchy


                    SetUserBounds
     TfrmFrame.LoadSizesForUser┘ 
TfrmFrame.LoadUserPreferences┘   
       TfrmFrame.UMInitiate┘     

Calls

Name Declaration Comments
LoadSizes procedure LoadSizes; -

Called-By

Name Declaration Comments
TfrmFrame.LoadSizesForUser procedure LoadSizesForUser; -


Source

270   procedure SetUserBounds(var AControl: TControl);
271   var
272     x: string;
273   begin
274     if uBounds = nil then LoadSizes;
275     x := AControl.Name;
276     if not (AControl is TForm) and (Assigned(AControl.Owner)) then x := AControl.Owner.Name + '.' + x;
277     x := uBounds.Values[x];
278     if (x = '0,0,0,0') and (AControl is TForm)
279       then TForm(AControl).WindowState := wsMaximized
280       else
281       begin
282         AControl.Left   := HigherOf(StrToIntDef(Piece(x, ',', 1), AControl.Left), 0);
283         AControl.Top    := HigherOf(StrToIntDef(Piece(x, ',', 2), AControl.Top), 0);
284         if Assigned( AControl.Parent ) then
285         begin
286           AControl.Width  := LowerOf(StrToIntDef(Piece(x, ',', 3), AControl.Width), AControl.Parent.Width - AControl.Left);
287           AControl.Height := LowerOf(StrToIntDef(Piece(x, ',', 4), AControl.Height), AControl.Parent.Height - AControl.Top);
288         end
289         else
290         begin
291           AControl.Width  := StrToIntDef(Piece(x, ',', 3), AControl.Width);
292           AControl.Height := StrToIntDef(Piece(x, ',', 4), AControl.Height);
293         end;
294       end;
295     //if (x = '0,0,' + IntToStr(Screen.Width) + ',' + IntToStr(Screen.Height)) and
296     //  (AControl is TForm) then TForm(AControl).WindowState := wsMaximized;
297   end;