Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Form arrangement and pnl_back attribute
Tue, Mar 5 2013 6:32 AMPermanent Link

Matthew Jones

I have a bit of an issue, that may need me to give you source to look at. Or it
might just be something known.

My code needs to lay out some components which have a TPanel as parent according to
data it gets from a web service. As part of that, my code always starts with this:

   lblContent.Top := 16;

Now, most of the time this is working, but occasionally it goes wrong, and then the
content is actually not in the panel properly - it is partly hidden. See
http://www.matthew-jones.com/temp_xfer/image1.png

I looked at it in Chrome, and it all looks right - the values for the Top etc are
as they should be. (Note that the same problem occurs in IE so it is not a browser
thing per se.) So I started fiddling, and if I disable the CSS rule from
default.css for .pnl_back { position: absolute } then it causes a jump. Then when I
re-enable it, it goes back to how it should be, and is all positioned perfectly.
See http://www.matthew-jones.com/temp_xfer/image2.png

What might I do to fix or work around this? If my code can hack that CSS to give it
a kick then I'd be happy to do it. Or can I reload the form? Any other suggestions?

/Matthew Jones/
Tue, Mar 5 2013 6:37 AMPermanent Link

Matthew Jones

> So I started fiddling, and if I disable the CSS rule from
> default.css for .pnl_back { position: absolute } then it causes a
> jump. Then when I
> re-enable it, it goes back to how it should be, and is all
> positioned perfectly.

FWIW, this happens in IE too. Same CSS part causes it to sort itself out. Something
must be causing it to be ignored for a bit.

/Matthew Jones/
Tue, Mar 5 2013 10:10 AMPermanent Link

Matthew Jones

You can see this happen for yourself now. Goto poll123.com, then enter the poll
code "test55". If you get a -5 error, refresh, but that should be fixed. It now
rotates between waiting and a question, 20 seconds each to help debugging. After a
while, the question causes this issue and goes out of alignment. Check and uncheck
the .pnl_back active, and it sorts itself out.

If you need anything, let me know.

/Matthew Jones/
Tue, Mar 5 2013 10:43 AMPermanent Link

Matthew Jones

Hmm, an observation: On the "demo" rotation, the problem does not occur. On the
test one, it does. The difference is that the test one has a "blank" waiting
message, which hides all the entry fields. I will see if I can see anything obvious.
It might trigger a thought in someone though?

[later]

My code is setting
   pnlMain.ClientHeight := nCurrentEndHeight + 8;
   lnkLeave.Top := pnlMain.Height + 16;
   self.Height := lnkLeave.Top + lnkLeave.Height + 20;

Could setting the ClientHeight to be "too small" cause this? I have a test not
setting it less than 250 running. Maybe that would cause the browser to get upset?

/Matthew Jones/
Tue, Mar 5 2013 10:55 AMPermanent Link

Matthew Jones

> Could setting the ClientHeight to be "too small" cause this? I have
> a test not
> setting it less than 250 running. Maybe that would cause the
> browser to get upset?

This seems to be the case. I have it currently running on 10 seconds change, with
150 minimum, and it is stable. It might be worth working out what this is, but
there is a workaround at least.

Lucky really, as I have a demo to give in an hour... 8-)

/Matthew Jones/
Tue, Mar 5 2013 1:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I have a bit of an issue, that may need me to give you source to look at.
Or it might just be something known.

My code needs to lay out some components which have a TPanel as parent
according to data it gets from a web service. As part of that, my code
always starts with this:

   lblContent.Top := 16;

Now, most of the time this is working, but occasionally it goes wrong, and
then the content is actually not in the panel properly - it is partly
hidden. See http://www.matthew-jones.com/temp_xfer/image1.png >>

Please send me an example project that illustrates this in action.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Mar 6 2013 7:59 AMPermanent Link

Matthew Jones

You have email.

/Matthew Jones/
Thu, Mar 7 2013 10:58 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< You have email. >>

Thanks.  The issue here is that the client container in a panel/form still
expands/scrolls, even if you don't have scrollbars defined, when you add
controls (especially focusable controls) that extend beyond the actual
defined height of the client container (which is what you're doing).  This
is causing the scrolling to occur.  To fix this, just add this line after
you re-set the client height:

   pnlMain.ClientHeight := nCurrentEndHeight + 8;
   pnlMain.ScrollTop:=0;  <<<<<  Add

That will fix the issue.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Mar 7 2013 11:36 AMPermanent Link

Matthew Jones

That makes so much sense! TVM

/Matthew Jones/
Image