WillemvanZyl Posted May 14, 2018 Share Posted May 14, 2018 Hi, Please see the attached screens, for when the screen of a phone is flipped. Any form except the main form does this now. Is there a new setting that I'm missing or is this a bug? Kind Regards Willem Link to comment Share on other sites More sharing options...
Sherzod Posted May 14, 2018 Share Posted May 14, 2018 Hi, Please can you explain in more detail? How can we reproduce this...? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 14, 2018 Administrators Share Posted May 14, 2018 Make sure FullScreen property of 2nd form is True. Link to comment Share on other sites More sharing options...
WillemvanZyl Posted May 14, 2018 Author Share Posted May 14, 2018 Hi, So all the Forms have properties: FullScreen = True Scrollable = False AutoHeight = True I attach the sequence of events. 1. Main Form 2. Open 2nd Form 3. Flip screen with 2nd Form (resizing here fails) 4. Go Back to Main Form (screen still flipped) 5. Flip Main screen back to portrait 6. Open 2nd Form, displays correctly 7. Same result as 3 8 & 9. Repeating but starting the Main form on Landscape So as long as I go back to the main form and then to the 2nd form, the second form displays correctly. But when you flip the screen while the second form is open is when the resizing does not happen correctly. I also have events: procedure TfrmMobileAccount.UnimFormResize(Sender: TObject); begin Logger('UnimFormResize'); Setsizes; end; //This does not trigger at all procedure TfrmMobileAccount.UnimFormScreenResize(Sender: TObject; AWidth, AHeight: Integer); begin Logger('UnimFormScreenResize'); end; //frmMobileAccount > pnlMainContainer > sbMain //pnlMainContainer.alignment = Client //sbMain.alignment = Client //sbMain.constraints.maxwidth and minwidth = 320 procedure TfrmMobileAccount.Setsizes; Var MargDif :Integer; Begin sbMain.Left := (self.Width div 2) - (sbMain.Width div 2); MargDif := (self.Width-sbMain.Width) div 2; if MargDif < 7 then MargDif := 7; sbMain.Margins.Left := MargDif; sbMain.Margins.Right := MargDif; sbMain.AlignWithMargins := True; imgMainBackground.Top := pnlAccountTopToolbar.Height+1; imgMainBackground.left := 0; imgMainBackground.Width := self.Width; imgMainBackground.Height := self.Height-(pnlAccountTopToolbar.Height+1); if self.Width < self.Height then Begin imgMainBackground.Picture.LoadFromFile(IncludeTrailingBackslash(UniMainModule.RootPath)+'images\Account\BackgroundPortrait.jpg'); End else Begin imgMainBackground.Picture.LoadFromFile(IncludeTrailingBackslash(UniMainModule.RootPath)+'images\Account\BackgroundLandscape.jpg'); End; //Otherwise the backgrounds end up infront imgMainBackground.JSInterface.JSCall('element.setStyle', ['z-index', '0']); pnlMainContainer.JSInterface.JSCall('element.setStyle', ['z-index', '3']); //Force Synchronisation UniSession.Synchronize; sleep(100); (*Older version fix UniSession.AddJS('setTimeout(function(){' + sbMain.JSName + '.scrollableBehavior.scrollView.getScroller().maxPosition.y = ' + IntToStr(sbMain.Height) + '}, 500)' );*) End; Hope this explains it more. Link to comment Share on other sites More sharing options...
WillemvanZyl Posted May 14, 2018 Author Share Posted May 14, 2018 The behavior is however on all my non Main forms. I have other forms that have less code or no code on resizing that does exactly the same Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 14, 2018 Administrators Share Posted May 14, 2018 I cannot reproduce this with a simple application. Can you please report this issue to support portal with a test case?http://www.unigui.com/support/support-portal Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 14, 2018 Administrators Share Posted May 14, 2018 I also have events: Why do you need these events? There should be no need for custom code to arrange screen elements. It's better to leave all these tasks to the framework. Link to comment Share on other sites More sharing options...
WillemvanZyl Posted May 15, 2018 Author Share Posted May 15, 2018 My Creative Director and a UI consultant have come up with how they want the application to look. The mobile version also has to look and work on desktop. To have those buttons correctly align in the middle I have these events for. Believe me I have tried all sorts of ways. It is the new upgrades where the underlying Sencha framework has jumped two versions that now throws every thing around, I still can't get a simple label on click to work. Apart from that, our UI designer spend hours on the old cuppertino theme to customize the CSS and that now counts for nothing as cuppertino has been dropped. The catch 22 is that i'm in the middle of trying to complete the application, so to not upgrade will bite me at a later stage. Right now I am have completed 20 of the 80 forms that the application needs, and to upgrade 20 forms now as oppose to 80 later will save me time. The old version had lots of issues and work arounds, so I do prefer to upgrade now. And finally I'm the developer that punted the move away from ISAPI/Bootstrap developement to ISAPI UniGUI to the corporate team and I love UniGui (I do puke a little in the back of my moth if I have to write endless long JS pages for responsive sites, I'm old school pascal coder :-) ). I will build a test case application and submit to support and this thread. thanks Link to comment Share on other sites More sharing options...
WillemvanZyl Posted May 15, 2018 Author Share Posted May 15, 2018 Here is the test app. From the menu, you can select account to go to the second form. I include the custom CSS file and the graphics that need to load. UniGUI TestCase.7z Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 16, 2018 Administrators Share Posted May 16, 2018 Fixed. Link to comment Share on other sites More sharing options...
WillemvanZyl Posted May 16, 2018 Author Share Posted May 16, 2018 Thank you very very much! Link to comment Share on other sites More sharing options...
Recommended Posts