andyhill Posted October 16, 2017 Share Posted October 16, 2017 As can be seen via the attachment I am trying to pretty up the form (I want to make cpScreen hide white space, also size and align objects etc.). cpScreen.AlignmentControl:= uniAlignmentClient; messes everything up. I have a TUnimContainerPanel (cpScreen) with child objects and when an iPhone or iPad etc. is rotated (even on startup) I want to re-size, re-position and re-align my objects. Can someone please advise with a Delphi code example - thanks. // AjaxEvent Fires On Rotation procedure TLoginmForm.UnimLoginFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var i, p, w, h: Integer; s, JSName: String; ss: TUniStrings; begin if SameText(EventName, 'vpsize') then begin w:= 0; h:= 0; ss:= Params; for i:= 0 to ss.Count-1 do begin s:= ss.Strings; p:= Pos('w=', s); if p > 0 then begin w:= StrToInt(Copy(s, p+2, Length(s)-p-1)); end; p:= Pos('h=', s); if p > 0 then begin h:= StrToInt(Copy(s, p+2, Length(s)-p-1)); end; end; // for if ( (w > 0) and (h > 0) ) then begin JSName:= cpScreen.JSName+'_id'; s:= QuotedStr('w='+IntToStr(w))+'; '+QuotedStr('h='+IntToStr(h))+';'; //UniSession.AddJS(JSName+' Color = red;'); // this test fails (I need to set width and height) // edtEmail: TUnimEdit; // then I need to center child objects on portrait, left align on landscape etc. end; end; // vpsize end; Link to comment Share on other sites More sharing options...
mhmda Posted October 23, 2017 Share Posted October 23, 2017 http://forums.unigui.com/index.php?/topic/8954-me-myself-cart-a-new-mobile-app-with-full-source-code/page-2&do=findComment&comment=46555 Link to comment Share on other sites More sharing options...
Recommended Posts