Jump to content

build 1456 Form Resize Issue


WillemvanZyl

Recommended Posts

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.

 

post-5504-0-92334100-1526321031_thumb.png

post-5504-0-55597900-1526321068_thumb.png

post-5504-0-92106400-1526321094_thumb.png

post-5504-0-49085300-1526321124_thumb.png

post-5504-0-77795400-1526321151_thumb.png

post-5504-0-52703700-1526321181_thumb.png

post-5504-0-40492200-1526321207_thumb.png

post-5504-0-47969000-1526321233_thumb.png

post-5504-0-49680400-1526321264_thumb.png

Link to comment
Share on other sites

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

×
×
  • Create New...