You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Joseph Paterson <jo...@gmail.com> on 2012/11/18 08:07:48 UTC

Simple button in MenuBar

Hi all,

My application contains a MenuBar in which I would like to place a simple button (to give easy access to a particular action), and I'm not sure how to do this. I've got the following code:

    <MenuBar>
	[…]
      <MenuBar.Item action="refresh">
        <buttonData>
          <content:MenuItemData text="Refresh" icon="/icon/refresh_16x16.png"/>
        </buttonData>
      </MenuBar.Item>
    </MenuBar>

With the code above I do get something appearing in the menu bar, but it is disabled (the "refresh" action is enabled).

Any help would be greatly appreciated!

Thanks,

Joseph.

Re: Simple button in MenuBar

Posted by Joseph Paterson <jo...@gmail.com>.
Thanks, I've raised PIVOT-881 (https://issues.apache.org/jira/browse/PIVOT-881) to track the issue.


On 21/11/2012, at 9:58 AM, "Roger L. Whitcomb" <Ro...@actian.com> wrote:

> Hi Joseph,
>                 Good that it at least works for now.  If you want you can add a JIRA issue for an improvement (https://issues.apache.org/jira/browse/PIVOT).
>  
> Thanks,
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
> Sent: Tuesday, November 20, 2012 2:51 PM
> To: user@pivot.apache.org
> Subject: Re: Simple button in MenuBar
>  
> Hi Roger,
>  
> Adding an empty <Menu/> tag underneath seems to have fixed it. Visually it's a little strange if you look closely, as it does look like it *should* have a menu beneath it but doesn't. Not a deal breaker for what I'm doing though so I'm OK with it. Could be an improvement for a future version!
>  
> Thanks for your help.
>  
> Joseph.
>  
> On 21/11/2012, at 9:44 AM, "Roger L. Whitcomb" <Ro...@actian.com> wrote:
> 
> 
> Ah, I see what is happening.  In MenuBar.java at line 162 (inside “isEnabled) it is checking for a null Menu item.  So, the MenuBar is definitely assuming that every MenuBar.Item will itself contain a Menu.  I wonder what would happen if you were to define an empty Menu (as in <Menu/>) underneath your MenuBar.Item …. Probably wouldn’t be very nice visually ….
>  
> I’m not sure how to suggest working around this otherwise….
>  
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
> Sent: Tuesday, November 20, 2012 2:32 PM
> To: user@pivot.apache.org
> Subject: Re: Simple button in MenuBar
>  
> Hi Roger,
>  
> The action is definitely enabled and works fine if it is contained within an enclosing menu. My menu bar has plenty of MenuBar.Item with menus within them which work fine, but what I want is to have a button to access an action directly on the menu bar, not within a menu on the menu bar (if that makes sense), a bit like a toolbar if you like.
>  
> Cheers,
>  
> Joseph.
>  
>  
> On 21/11/2012, at 4:48 AM, "Roger L. Whitcomb" <Ro...@actian.com> wrote:
> 
> 
> 
> Hi Joseph,
>    I’ve never seen this before, and our application has a lot of menu bar stuff.  Can you do some debugging or some debug printouts to verify that the action has not been disabled by some other means?  What happens if you change the action on this item to something else?
>  
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
> Sent: Saturday, November 17, 2012 11:08 PM
> To: user@pivot.apache.org
> Subject: Simple button in MenuBar
>  
> Hi all,
>  
> My application contains a MenuBar in which I would like to place a simple button (to give easy access to a particular action), and I'm not sure how to do this. I've got the following code:
>  
>     <MenuBar>
>             […]
>       <MenuBar.Item action="refresh">
>         <buttonData>
>           <content:MenuItemData text="Refresh" icon="/icon/refresh_16x16.png"/>
>         </buttonData>
>       </MenuBar.Item>
>     </MenuBar>
>  
> With the code above I do get something appearing in the menu bar, but it is disabled (the "refresh" action is enabled).
>  
> Any help would be greatly appreciated!
>  
> Thanks,
>  
> Joseph.


RE: Simple button in MenuBar

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
Hi Joseph,

                Good that it at least works for now.  If you want you
can add a JIRA issue for an improvement
(https://issues.apache.org/jira/browse/PIVOT).

 

Thanks,

~Roger Whitcomb

 

From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
Sent: Tuesday, November 20, 2012 2:51 PM
To: user@pivot.apache.org
Subject: Re: Simple button in MenuBar

 

Hi Roger,

 

Adding an empty <Menu/> tag underneath seems to have fixed it. Visually
it's a little strange if you look closely, as it does look like it
*should* have a menu beneath it but doesn't. Not a deal breaker for what
I'm doing though so I'm OK with it. Could be an improvement for a future
version!

 

Thanks for your help.

 

Joseph.

 

On 21/11/2012, at 9:44 AM, "Roger L. Whitcomb"
<Ro...@actian.com> wrote:





Ah, I see what is happening.  In MenuBar.java at line 162 (inside
"isEnabled) it is checking for a null Menu item.  So, the MenuBar is
definitely assuming that every MenuBar.Item will itself contain a Menu.
I wonder what would happen if you were to define an empty Menu (as in
<Menu/>) underneath your MenuBar.Item .... Probably wouldn't be very
nice visually ....

 

I'm not sure how to suggest working around this otherwise....

 

~Roger Whitcomb

 

From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
Sent: Tuesday, November 20, 2012 2:32 PM
To: user@pivot.apache.org
Subject: Re: Simple button in MenuBar

 

Hi Roger,

 

The action is definitely enabled and works fine if it is contained
within an enclosing menu. My menu bar has plenty of MenuBar.Item with
menus within them which work fine, but what I want is to have a button
to access an action directly on the menu bar, not within a menu on the
menu bar (if that makes sense), a bit like a toolbar if you like.

 

Cheers,

 

Joseph.

 

 

On 21/11/2012, at 4:48 AM, "Roger L. Whitcomb"
<Roger.Whitcomb@actian.com <ma...@actian.com> > wrote:






Hi Joseph,

   I've never seen this before, and our application has a lot of menu
bar stuff.  Can you do some debugging or some debug printouts to verify
that the action has not been disabled by some other means?  What happens
if you change the action on this item to something else?

 

~Roger Whitcomb

 

From: Joseph Paterson [mailto:joseph.paterson@gmail.com
<http://gmail.com> ] 
Sent: Saturday, November 17, 2012 11:08 PM
To: user@pivot.apache.org <ma...@pivot.apache.org> 
Subject: Simple button in MenuBar

 

Hi all,

 

My application contains a MenuBar in which I would like to place a
simple button (to give easy access to a particular action), and I'm not
sure how to do this. I've got the following code:

 

    <MenuBar>

            [...]

      <MenuBar.Item action="refresh">

        <buttonData>

          <content:MenuItemData text="Refresh"
icon="/icon/refresh_16x16.png"/>

        </buttonData>

      </MenuBar.Item>

    </MenuBar>

 

With the code above I do get something appearing in the menu bar, but it
is disabled (the "refresh" action is enabled).

 

Any help would be greatly appreciated!

 

Thanks,

 

Joseph.

 


Re: Simple button in MenuBar

Posted by Joseph Paterson <jo...@gmail.com>.
Hi Roger,

Adding an empty <Menu/> tag underneath seems to have fixed it. Visually it's a little strange if you look closely, as it does look like it *should* have a menu beneath it but doesn't. Not a deal breaker for what I'm doing though so I'm OK with it. Could be an improvement for a future version!

Thanks for your help.

Joseph.

On 21/11/2012, at 9:44 AM, "Roger L. Whitcomb" <Ro...@actian.com> wrote:

> Ah, I see what is happening.  In MenuBar.java at line 162 (inside “isEnabled) it is checking for a null Menu item.  So, the MenuBar is definitely assuming that every MenuBar.Item will itself contain a Menu.  I wonder what would happen if you were to define an empty Menu (as in <Menu/>) underneath your MenuBar.Item …. Probably wouldn’t be very nice visually ….
>  
> I’m not sure how to suggest working around this otherwise….
>  
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
> Sent: Tuesday, November 20, 2012 2:32 PM
> To: user@pivot.apache.org
> Subject: Re: Simple button in MenuBar
>  
> Hi Roger,
>  
> The action is definitely enabled and works fine if it is contained within an enclosing menu. My menu bar has plenty of MenuBar.Item with menus within them which work fine, but what I want is to have a button to access an action directly on the menu bar, not within a menu on the menu bar (if that makes sense), a bit like a toolbar if you like.
>  
> Cheers,
>  
> Joseph.
>  
>  
> On 21/11/2012, at 4:48 AM, "Roger L. Whitcomb" <Ro...@actian.com> wrote:
> 
> 
> Hi Joseph,
>    I’ve never seen this before, and our application has a lot of menu bar stuff.  Can you do some debugging or some debug printouts to verify that the action has not been disabled by some other means?  What happens if you change the action on this item to something else?
>  
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
> Sent: Saturday, November 17, 2012 11:08 PM
> To: user@pivot.apache.org
> Subject: Simple button in MenuBar
>  
> Hi all,
>  
> My application contains a MenuBar in which I would like to place a simple button (to give easy access to a particular action), and I'm not sure how to do this. I've got the following code:
>  
>     <MenuBar>
>             […]
>       <MenuBar.Item action="refresh">
>         <buttonData>
>           <content:MenuItemData text="Refresh" icon="/icon/refresh_16x16.png"/>
>         </buttonData>
>       </MenuBar.Item>
>     </MenuBar>
>  
> With the code above I do get something appearing in the menu bar, but it is disabled (the "refresh" action is enabled).
>  
> Any help would be greatly appreciated!
>  
> Thanks,
>  
> Joseph.


RE: Simple button in MenuBar

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
Ah, I see what is happening.  In MenuBar.java at line 162 (inside
"isEnabled) it is checking for a null Menu item.  So, the MenuBar is
definitely assuming that every MenuBar.Item will itself contain a Menu.
I wonder what would happen if you were to define an empty Menu (as in
<Menu/>) underneath your MenuBar.Item .... Probably wouldn't be very
nice visually ....

 

I'm not sure how to suggest working around this otherwise....

 

~Roger Whitcomb

 

From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
Sent: Tuesday, November 20, 2012 2:32 PM
To: user@pivot.apache.org
Subject: Re: Simple button in MenuBar

 

Hi Roger,

 

The action is definitely enabled and works fine if it is contained
within an enclosing menu. My menu bar has plenty of MenuBar.Item with
menus within them which work fine, but what I want is to have a button
to access an action directly on the menu bar, not within a menu on the
menu bar (if that makes sense), a bit like a toolbar if you like.

 

Cheers,

 

Joseph.

 

 

On 21/11/2012, at 4:48 AM, "Roger L. Whitcomb"
<Ro...@actian.com> wrote:





Hi Joseph,

   I've never seen this before, and our application has a lot of menu
bar stuff.  Can you do some debugging or some debug printouts to verify
that the action has not been disabled by some other means?  What happens
if you change the action on this item to something else?

 

~Roger Whitcomb

 

From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
Sent: Saturday, November 17, 2012 11:08 PM
To: user@pivot.apache.org
Subject: Simple button in MenuBar

 

Hi all,

 

My application contains a MenuBar in which I would like to place a
simple button (to give easy access to a particular action), and I'm not
sure how to do this. I've got the following code:

 

    <MenuBar>

            [...]

      <MenuBar.Item action="refresh">

        <buttonData>

          <content:MenuItemData text="Refresh"
icon="/icon/refresh_16x16.png"/>

        </buttonData>

      </MenuBar.Item>

    </MenuBar>

 

With the code above I do get something appearing in the menu bar, but it
is disabled (the "refresh" action is enabled).

 

Any help would be greatly appreciated!

 

Thanks,

 

Joseph.

 


Re: Simple button in MenuBar

Posted by Joseph Paterson <jo...@gmail.com>.
Hi Roger,

The action is definitely enabled and works fine if it is contained within an enclosing menu. My menu bar has plenty of MenuBar.Item with menus within them which work fine, but what I want is to have a button to access an action directly on the menu bar, not within a menu on the menu bar (if that makes sense), a bit like a toolbar if you like.

Cheers,

Joseph.


On 21/11/2012, at 4:48 AM, "Roger L. Whitcomb" <Ro...@actian.com> wrote:

> Hi Joseph,
>    I’ve never seen this before, and our application has a lot of menu bar stuff.  Can you do some debugging or some debug printouts to verify that the action has not been disabled by some other means?  What happens if you change the action on this item to something else?
>  
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
> Sent: Saturday, November 17, 2012 11:08 PM
> To: user@pivot.apache.org
> Subject: Simple button in MenuBar
>  
> Hi all,
>  
> My application contains a MenuBar in which I would like to place a simple button (to give easy access to a particular action), and I'm not sure how to do this. I've got the following code:
>  
>     <MenuBar>
>             […]
>       <MenuBar.Item action="refresh">
>         <buttonData>
>           <content:MenuItemData text="Refresh" icon="/icon/refresh_16x16.png"/>
>         </buttonData>
>       </MenuBar.Item>
>     </MenuBar>
>  
> With the code above I do get something appearing in the menu bar, but it is disabled (the "refresh" action is enabled).
>  
> Any help would be greatly appreciated!
>  
> Thanks,
>  
> Joseph.


RE: Simple button in MenuBar

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
Hi Joseph,

   I've never seen this before, and our application has a lot of menu
bar stuff.  Can you do some debugging or some debug printouts to verify
that the action has not been disabled by some other means?  What happens
if you change the action on this item to something else?

 

~Roger Whitcomb

 

From: Joseph Paterson [mailto:joseph.paterson@gmail.com] 
Sent: Saturday, November 17, 2012 11:08 PM
To: user@pivot.apache.org
Subject: Simple button in MenuBar

 

Hi all,

 

My application contains a MenuBar in which I would like to place a
simple button (to give easy access to a particular action), and I'm not
sure how to do this. I've got the following code:

 

    <MenuBar>

            [...]

      <MenuBar.Item action="refresh">

        <buttonData>

          <content:MenuItemData text="Refresh"
icon="/icon/refresh_16x16.png"/>

        </buttonData>

      </MenuBar.Item>

    </MenuBar>

 

With the code above I do get something appearing in the menu bar, but it
is disabled (the "refresh" action is enabled).

 

Any help would be greatly appreciated!

 

Thanks,

 

Joseph.


Re: Simple button in MenuBar

Posted by Sandro Martini <sa...@gmail.com>.
Hi Joseph,
sorry but today it's a bad day, let's update tomorrow ...

Bye