Jump to content


Photo

Panels in a Accordion Layout

Panels Accordion Layout

  • Please log in to reply
5 replies to this topic

#1 Oscar Flor

Oscar Flor

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 140 posts
  • LocationAsuncion

Posted 07 November 2017 - 07:40 PM

Hi:

 

There is a way to know if a panel that are into a accordion layout are visible or not?

 

Or a OnTitleClick like event to know if a especific panel is visible or not?

 

I try Collapsed, OnCollapse and OnExpand events a nothing of thesse works.

 

Thanks to all and

Best Regards


  • 0

Oscar Flor
Sebaot Software


#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3475 posts

Posted 08 November 2017 - 09:54 AM

Hi,

 

There is a way to know if a panel that are into a accordion layout are visible or not?

 

Sorry, can you explain in more detail where do you want to use it?

 

Best regards,


  • 0

#3 Oscar Flor

Oscar Flor

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 140 posts
  • LocationAsuncion

Posted 08 November 2017 - 03:18 PM

Hi:

 

I have to emulate on UniGui the behavior of our Win32 program.

 

See the attached pictures to ilustrate to.

 

In "First Page" You have a left panel with possible options to take a report on PDF, a Center panel where You configure you reports options.

 

This center panel changes in according to the options You press on the left panel.

 

Because there are to many options on the left panel is needed to use something like a Outlook bar to group them by type of report.

 

The problem is...

 

I can't detect when a accordion button is pressed, and also, I can't know what panel is on the front when the accordion button is pressed.

 

I need this event because the center panel must change, when the group is changed to.

 

You can see the sequence of use if you see the "First Page", "Second Page" and "Third Page" examples screenshots.

 

I was use OnClick on the "groups panels" but if I click on the accordion button I can't detect it, and if I click twice on the same "Group Tittle" I don't know if the panel is showed or hidden.

 

As resume I need to know what panel is "active" at a time.

 

Best Regards

 

 

Attached Files


  • 0

Oscar Flor
Sebaot Software


#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3475 posts

Posted 08 November 2017 - 05:27 PM

Hi,

 

Maybe like this (need to optimize)?:

 

1. "MainPanel" (UniPanelA) -> ... -> function afterrender:

function afterrender(sender, eOpts)
{
    var me=sender;

    //me.layout.getLayoutItems().forEach...

    me.items.items.forEach(function(item){
        //item.addListener('collapse', function(){
        //    ajaxRequest(me, '_expandorcollapse', ['uname='+me.layout.getExpanded()[0].uname]);
        //});
        item.addListener('expand', function(){
            ajaxRequest(me, '_expandorcollapse', ['uname='+me.layout.getExpanded()[0].uname]);
        })
    });
}

2. "MainPanel" (UniPanelA) -> OnAjaxEvent:

procedure TMainForm.UniPanelAAjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_expandorcollapse' then
    ShowMessage(Params.Values['uname'] + ' expanded');

end;

Best regards,


  • 0

#5 Oscar Flor

Oscar Flor

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 140 posts
  • LocationAsuncion

Posted 08 November 2017 - 09:18 PM

Thank You!

 

I think I can do something with this code.

 

Best Regards


  • 0

Oscar Flor
Sebaot Software


#6 Oscar Flor

Oscar Flor

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 140 posts
  • LocationAsuncion

Posted 08 November 2017 - 09:38 PM

Hi Pals:

 

There is another aproach that is more Delphi-Like.

 

Best Regards

Attached Files


  • 0

Oscar Flor
Sebaot Software





1 user(s) are reading this topic

1 members, 0 guests, 0 anonymous users


    merolarosa