Jump to content


Photo

Using SetBounds to manually layout crontrols


  • Please log in to reply
No replies to this topic

#1 ielite

ielite
  • Members
  • 692 posts

Posted 31 March 2017 - 10:37 PM

When I use SetBounds to layout out my controls, it works great within SMS built in browser.  However, when I build my project with phonegap and test it on my android phone, it does not.  (also doesn't look right in any other browser I try outside of SMS).
 
 
 
 
 
example code
 
procedure TfrmQuestion.Resize;
begin
  inherited;
  if not (Handle.Valid and (csReady in ComponentState)) then
    Exit;
  fHeader.SetBounds(0,0,width,50);
  fQuestion.SetBounds(0,50,ClientWidth,ClientHeight-100);
  fFooter.SetBounds(0,ClientHeight-50,ClientWidth,50);
end;


Don't even get me going on SmartCL.Layout, cause it is even worse on the android :)
 
I should note, that I do use the following code for capturing the orientation change
 
 
function window: variant; external 'window' property;


procedure TfrmQuestion.InitializeObject;
begin
  inherited;
  {$I 'Question:impl'}
  window.addEventListener('devicemotion', @Resize, false);
end;





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users