trouble with shortcut commands

View: New views
5 Messages — Rating Filter:   Alert me  

trouble with shortcut commands

by skar karthikeyan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm trying to build a menu with shortcuts. Problem is, I can't link a
shortcut with a qx.ui.menu.RadioButton, but I can with a qx.ui.menu.Button.

Of course, I can manually set the "execute" listener for a shortcut
command to execute the same function as the radio group button's
handler, but I wanted to know if that is the only option?

Also, is there any way to support gmail like shortcuts, like say
pressing g and then i gets me to the inbox?

cheers,
skar.

--
--
The life so short, the craft so long to learn.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: trouble with shortcut commands

by Alexander Steitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi skar,

On Friday 06 November 2009 skar wrote:
> I'm trying to build a menu with shortcuts. Problem is, I can't link a
> shortcut with a qx.ui.menu.RadioButton, but I can with a qx.ui.menu.Button.
That's interesting since both classes are sub-classes of
"qx.ui.menu.AbstractButton" which does include the "MExecuteable" mixin for
commands.

> Of course, I can manually set the "execute" listener for a shortcut
> command to execute the same function as the radio group button's
> handler, but I wanted to know if that is the only option?
How do setup the command?

--snip--
var commandInstance = new qx.event.Command();
var menuRadioButtonInstance.setCommand(commandInstance);
--snip--

This should do the job.
 
> Also, is there any way to support gmail like shortcuts, like say
> pressing g and then i gets me to the inbox?
Yepp, there is shortcut support. This is the first parameter of the
"qx.event.Command" class.

See

        http://demo.qooxdoo.org/current/apiviewer/#qx.event.Command

for details.

cheers,
  Alex

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: trouble with shortcut commands

by skar karthikeyan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alex,
How do setup the command?

--snip--
var commandInstance = new qx.event.Command();
var menuRadioButtonInstance.setCommand(commandInstance);
--snip--

This should do the job.
  

Thanks for the snippet :)

I did the following and the short cut "Ctrl+Alt+C" is shown if I click the Edit menu, but it doesn't show for the view menu. If I change the RadioButton to normal Button, now it shows.

main  : function() {
        // Call super class
        this.base(arguments);

        // Enable logging in debug variant
        if (qx.core.Variant.isSet("qx.debug", "on")) {
            // support native logging capabilities, e.g. Firebug for Firefox
            qx.log.appender.Native;
            // support additional cross-browser console. Press F7 to toggle visibility
            qx.log.appender.Console;
        }

        APP =  this;
        APPROOT =  this.getRoot();
        var view_menu = new qx.ui.menu.Menu;
        var view = new qx.ui.menubar.Button("View", null, view_menu);
        var viewFixedCommand = new qx.ui.core.Command("Control+Alt+I");
        var viewFluidCommand = new qx.ui.core.Command("Control+Alt+U");

        this.fixedButton = new qx.ui.menu.RadioButton("fixed");
        this.fluidButton = new qx.ui.menu.RadioButton("fluid");
        this.fixedButton.setCommand(viewFixedCommand);
        this.fluidButton.setCommand(viewFluidCommand);
        view_menu.add(this.fixedButton);
        view_menu.add(this.fluidButton);


        var edit_menu = new qx.ui.menu.Menu;
        var edit = new qx.ui.menubar.Button("Edit", null, edit_menu);
        var copyCommand = new qx.ui.core.Command("Control+Alt+C");
        var pasteCommand = new qx.ui.core.Command("Control+Alt+V");

        this.copyButton = new qx.ui.menu.Button("copy",null,copyCommand);
        this.pasteButton = new qx.ui.menu.Button("paste",null,pasteCommand);
        //this.copyButton.setCommand(copyCommand);
        //this.pasteButton.setCommand(pasteCommand);
        edit_menu.add(this.copyButton);
        edit_menu.add(this.pasteButton);


        var menubar = new qx.ui.menubar.MenuBar;
        menubar.setPaddingRight(10);
        menubar.add(edit);
        menubar.add(view);
        APPROOT.add(menubar, {top:10, left: 10});

      }

 
  
Also, is there any way to support gmail like shortcuts, like say 
pressing g and then i gets me to the inbox?
    
Yepp, there is shortcut support. This is the first parameter of the 
"qx.event.Command" class.
  
Well, the command can only be a simultaneous pressing of Ctrl, Alt, Meta, Shift with one of the normal keys. I want it to be a sequence of 2 commands, like g followed by i in case of gmail to reach inbox. Same with GNU screen, emacs etc where a sequence of key presses can be used. I know it's tough to have it in a browser, but still wanted to check with you guys :)

cheers,
skar.
-- 
--
The life so short, the craft so long to learn. 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: trouble with shortcut commands

by Alexander Steitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi skar,

On Friday 06 November 2009 skar wrote:
> Thanks for the snippet :)
Nevermind :)

> I did the following and the short cut "Ctrl+Alt+C" is shown if I click
> the Edit menu, but it doesn't show for the view menu. If I change the
> RadioButton to normal Button, now it shows.
Seems you found a bug. Can you please file a report for this and attaching your
example for the playground?

Just a hint: if you work with RadioButtons you can group them with
"qx.ui.form.RadioGroup" to have only one selected.

> Well, the command can only be a simultaneous pressing of Ctrl, Alt,
> Meta, Shift with one of the normal keys. I want it to be a sequence of 2
> commands, like g followed by i in case of gmail to reach inbox. Same
> with GNU screen, emacs etc where a sequence of key presses can be used.
> I know it's tough to have it in a browser, but still wanted to check
> with you guys :)
Currently this is not supported in qooxdoo. If you like to see this feature in
qooxdoo you can also file a bug report for this. This helps us to keep an eye
on the feature/enhancement wishes.

cheers,
  Alex

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: trouble with shortcut commands

by skar karthikeyan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alex,
Seems you found a bug. Can you please file a report for this and attaching your 
example for the playground?
  
The bug is at http://bugzilla.qooxdoo.org/show_bug.cgi?id=3037.
Just a hint: if you work with RadioButtons you can group them with 
"qx.ui.form.RadioGroup" to have only one selected.
  
Yes, I did that too. For this example however, I didn't use it.
  
Well, the command can only be a simultaneous pressing of Ctrl, Alt,
Meta, Shift with one of the normal keys. I want it to be a sequence of 2
commands, like g followed by i in case of gmail to reach inbox. Same
with GNU screen, emacs etc where a sequence of key presses can be used.
I know it's tough to have it in a browser, but still wanted to check
with you guys :)
    
Currently this is not supported in qooxdoo. If you like to see this feature in 
qooxdoo you can also file a bug report for this. This helps us to keep an eye 
on the feature/enhancement wishes.
  
Well, it isn't that important, so I'd like the devs work on something important. Existing shortcut is quite good enough IMHO.

cheers
skar.
-- 
--
The life so short, the craft so long to learn. 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel