Author |
Message |
14/04/2009 09:37:45
|
levy
Power User
Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline
|
Hi,
I have a tabbedPane with some tabbedpanetabs. In each tab, there is a button to preview a document. The hotkey is always (ctrl-p). When I hit (ctrl-p), the listeners in *all* tabs are alerted, so in each tab a document is loaded.
Of course, I would like that only the current tab listens to the hotkey or at least that I could know the current tab to avoid the action in the other tabs. What would be the best solution?
Regards, Daniel
|
|
|
14/04/2009 09:57:40
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5538
Offline
|
Hi,
the following should work: define the POPUPMENU for hot key not on TABBEDPANE level but on each TABBEDPANETAB level - then the corresponding action listener of TABBEDPANETAB should be called.
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
14/04/2009 10:13:33
|
levy
Power User
Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline
|
Hi,
The hotkey is defined through the button's attribute "hotkey". Each Button is inside the corresponding tabbedpanetab.
I suppose you are writing about an alternative way to define hotkeys: with popupmenu. I never used this. Is there somewhere a description about it?
Daniel
|
|
|
14/04/2009 10:24:28
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5538
Offline
|
...yes, it's in the developer's guide.
Other possibility for you: you can tell the TABBEDPANE that it writes back the current tab-position (0,1,2,...). TABBEDPANE-VALUE is the corresponding attribute. Then you know where the user currently is - any only invoke this preview, that fits to the selected tab.
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
14/04/2009 16:53:01
|
levy
Power User
Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline
|
CaptainCasa wrote:
...yes, it's in the developer's guide.
And also in the Demo Workplace!
|
|
|
|