Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread TPanel minimize events
Thu, Aug 4 2016 10:43 AMPermanent Link

Matthew Jones

This was suggested back in October, but I can't see how to "know" that
the TPanel has been minimized or opened. My aim is to have a set of
TPanels, and you can expand only one at at time, so I need to hook an
event to close the others.

--

Matthew Jones
Thu, Aug 4 2016 11:05 AMPermanent Link

Matthew Jones

There is an interesting little issue with TPanel minimization, but ship
2.05 and then I'll get a simple demo of it.


--

Matthew Jones
Thu, Aug 4 2016 1:46 PMPermanent Link

Raul

Team Elevate Team Elevate

On 8/4/2016 10:43 AM, Matthew Jones wrote:
> This was suggested back in October, but I can't see how to "know" that
> the TPanel has been minimized or opened. My aim is to have a set of
> TPanels, and you can expand only one at at time, so I need to hook an
> event to close the others.
>

Not in front of EWB right now but would AnimationComplete trigger for this ?

Raul
Fri, Aug 5 2016 5:01 AMPermanent Link

Matthew Jones

Raul wrote:

> Not in front of EWB right now but would AnimationComplete trigger for
> this ?

Not sure it would, as it isn't an animation per se. I am using "OnSize"
but there are still issues - it gets confused about the layout. I will
put a demo together soon I think.

--

Matthew Jones
Fri, Aug 5 2016 5:31 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

> There is an interesting little issue with TPanel minimization, but
> ship 2.05 and then I'll get a simple demo of it.

http://matthew-jones.com/elevate/panelissue/project1.html

http://matthew-jones.com/elevate/panelissue/TPanelIssue.zip


Open the page, and then click on the sizer buttons for a while.
Particularly if you click before an animation has completed, it will
start to go awry. The exact issue varies, but some start to change
order, not take their alignment etc.

The code that matters is below, but the whole project is in the zip.

I don't really care what the solution is - I just want this style of
operation to work nicely. 8-)


--

Matthew Jones



procedure TfrmServerSetup.frmServerSetupCreate(Sender: TObject);
begin
   timerLoader.Enabled := true;
   pnlAdmin.Minimize;
   pnlMessage.Minimize;
   pnlUsers.Minimize;
   pnlSecurity.Minimize;
   pnlCertificate.Minimize;
end;

procedure TfrmServerSetup.MinimizeConditional(xPanel : TPanel; nNotTag
: Integer);
begin
   if xPanel.Tag <> nNotTag then
       xPanel.Minimize;
end;

procedure TfrmServerSetup.pnlCertificateSize(Sender: TObject);
var
   nTag : Integer;
begin              
   if not m_bResizing then
   begin         
       m_bResizing := true;
       nTag := TComponent(Sender).Tag;
       DebugReport('resize ' + IntToStr(nTag));
       MinimizeConditional(pnlAdmin, nTag);
       MinimizeConditional(pnlMessage, nTag);
       MinimizeConditional(pnlUsers, nTag);
       MinimizeConditional(pnlSecurity, nTag);
       MinimizeConditional(pnlCertificate, nTag);
       m_bResizing := false;
   end;
end;
Tue, Aug 9 2016 8:34 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Open the page, and then click on the sizer buttons for a while.  Particularly if you click before an animation has completed, it will start to go awry. The exact issue varies, but some start to change order, not take their alignment etc. >>

Yeah, you'll need to use the OnAnimationComplete event to detect when the animation is complete and reset the m_bResizing flag to False in that event instead of right after calling Minimize, otherwise you'll end up with a disconnect between the actual size of the control and what EWB *thinks* is the size.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Aug 9 2016 11:25 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> Yeah, you'll need to use the OnAnimationComplete event to detect when
> the animation is complete and reset the m_bResizing flag to False in
> that event instead of right after calling Minimize, otherwise you'll
> end up with a disconnect between the actual size of the control and
> what EWB thinks is the size.

That doesn't seem to fix it. The issue can happen even if you go
slowly. But don't worry until 2.05 is out - digging into the cause can
be done once stable library is there. It may well be me.

--

Matthew Jones
Image