VCL window and keyboard control

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
mm44
Posts: 9
Joined: Tue Mar 02, 2010 3:17 am

VCL window and keyboard control

Post by mm44 »

Hi,

I have a problem.
If a control (e.g.. button) is located in a dialog the control has assigned a keyboard key (we can use "~" to force a key).
But how to enable keyboard control when we use vcl window?
I have created a window:

Code: Select all

 with winDesc1b
  rect.width = 100
  rect.height = 100
  .type = com.sun.star.awt.WindowClass.SIMPLE
  .WindowServiceName = "window"
  .ParentIndex = 0
  .Parent = peerWin0
  .Bounds = rect
 End with

 peerWin1b = tlKit.createWindow(winDesc1b)
 with peerWin1b
  .setBackground(rgb(235,235,235))
  .setPossize(615, 0, 305, 605, com.sun.star.awt.PosSize.POSSIZE)
  .setVisible(true)
 end with
and I placed a button:

Code: Select all

butImgSizeDecrM = createUnoService("com.sun.star.awt.UnoControlButtonModel")
 butImgSizeDecrC = createUnoService("com.sun.star.awt.UnoControlButton")
 with butImgSizeDecrM
  .label = "~Img. decr."
  .fontHeight = 9
  .enabled = false
  .focusOnClick = false
 end with
 with butImgSizeDecrC
  .setModel(butImgSizeDecrM)
  .actionCommand = "butImgSizeDecr"
  .setPosSize(180, 325, 30, 30, com.sun.star.awt.PosSize.POSSIZE)
  .createPeer(tlKit, peerWin1b)
 end with
but keybord control doesn't work.
How to enable it?
OOo 3.2.0 on Ubuntu 9.04
Post Reply