TOPIC: Access / AccessNav shortcut keys
#277
Access / AccessNav shortcut keys 4 Years, 1 Month ago
Hello,
While using Access / AccessNav the shortcut keys to activate the buttons (Ctrl + N /INSERT and others) do not work. This is known?
ajith
 
 
#280
Re:Access / AccessNav shortcut keys 4 Years, 1 Month ago
Seems to work for me, e.g. if I do: IDE > Access a Query > tables then Alt+N it works.

There is a known problem that if you have a dialog (rather than a window) open then the keyboard accelerators don't work.
 
 
andrew
 
#285
Re:Access / AccessNav shortcut keys 4 Years, 1 Month ago
When I use
Code:


Controller
{
Controls: (Access ...


a dialog is opened?
 
 
#289
Re:Access / AccessNav shortcut keys 4 Years, 1 Month ago
No, not unless Dialog is called. By default, a Window will be used to display your controller.
 
 
Jeff Ferguson
Suneido Software
 
#295
Re:Access / AccessNav shortcut keys 4 Years ago
Hi,
Could you check something like -
Code:


Controller
{
Controls:
(Access 'tables')}



It is not working for me,
ajith
 
 
#305
Re:Access / AccessNav shortcut keys 4 Years ago
Hi Ajith,

I checked it and it works the same for me, the accelerators do not work. It is because you are putting your Access in a Controller that does not handle redirecting those accelerators to the AccessControl. If you look at AccessControl, it handles redirecting the accelerators when used in a BookControl by calling the RedirAccelerators method. If you are not using a book, you would have to add code to your controller to redirect the accelerators to the AccessControl. The accelerators will work with no changes if you run your Controller inside the BookControl. Another option would be to eliminate the Controller that contains your Access if you don't need it and just use AccessControl directly.

Hope that helps.
 
 
Jeff Ferguson
Suneido Software
 
#307
Re:Access / AccessNav shortcut keys 4 Years ago
Hi Jeff,
I tried removing the controller - but then i cannot assemble the individual controls inside a TabsControl. I do not prefer to use BookControl (the annoying toolbar and bookmark options). Could you explain how this code
Code:


.Window.Ctrl.Redir('On_New', this)


works? I am not understanding how this is specific for BookControl.
ajith
 
 
#315
Re:Access / AccessNav shortcut keys 4 Years ago
I am not sure what Jeff figured out with this. I was away when this first came up, and Jeff is away now.

I also do not understand why it only works in a Book, or why using a Controller would be a problem.

I think at one time we had the opposite problem - it only worked outside books. Maybe when we fixed it to work in books we broke it outside. It should work both ways.

The problem is that we always use Books so we do not notice when something does not work in a regular window.
 
 
andrew
 
#320
Re:Access / AccessNav shortcut keys 4 Years ago
We figured out a fix. AccessControl was trying to handle it, but the way it was doing it only worked in a Book. The problem is that you can't do it from New because the controls haven't finished constructing. I used the first resize trick to handle it. Here are the changes to AccessControl:

at the end of New:

Code:

// if .Window.Member?('Ctrl')
// {
// .old_accels = .Window.SetupAccels(.Commands())
// .RedirAccelerators()
// }
.setFocus()
}

    first_resize: true
    Resize(x, y, w, h)
        {
        super.Resize(x, y, w, h)
        if .first_resize
            {
            .first_resize = false
            .old_accels = .Window.SetupAccels(.Commands())
            .RedirAccelerators()
            }
        }



The fix will be in the next release.
 
 
andrew
 
#322
Re:Access / AccessNav shortcut keys 4 Years ago
Hi,
Thanks for the fix. Tried the following code for AccessNav after commending out the corresponding portion from the New method.
Code:


first_resize: true
Resize(x, y, w, h)
{
super.Resize(x, y, w, h)
if .first_resize
{
.first_resize = false
.old_accels = .Window.SetupAccels(.Commands)
for (cmd in .Commands)
.Window.Ctrl.Redir('On_' $ cmd[0], this)
}
}



THe .RedirAccelerators() is not used by AccessNav and so
Code:


for (cmd in .Commands)
  .Window.Ctrl.Redir('On_' $ cmd[0], this)


was used in its place.

Thanks,
ajith