Matthias Benkmann wrote:
On 8/31/05, Carsten Driesner <[EMAIL PROTECTED]> wrote:
That would be great as I'm currently evaluating different implementation options for one of our projects.


Hi Matthias,

Sorry for the late answer, but I was very busy. I give you a first draft how you can add a combo box to a toolbar. Be aware that this solution needs some effort:

1. You have to implement a toolbar controller to be able to use a combo box in the tool bar.

2. You have to create a uno package. The configuration file org.openoffice.Office.UI.Controller.xcu contains all registered user interface controllers. You have to add your new toolbar controller in the configuration set "ToolBar". There are some examples in an installed OOo, see <Office installation>/share/registry/data/org/openoffice/Office/UI/Controller.xcu. An toolbar controller in the Controller.xcu must provide three properties: - Command: The command which is associated with your toolbar controller. - Module: You can associate a controller with a certain module or leave this empty, so your controller is created for all application modules.
- Controller: This is the implementation name of your uno service.

3. You have to implement the com.sun.star.frame.ToolbarController service. It's responsible to create the combo box and provide it to the toolbar implementation. You also have to support several listeners to react on user input.

4. You have to create you combo box with the toolkit service: com.sun.star.awt.Toolkit. It has one interface com.sun.star.awt.XToolkit, where you can call createWindow(...).

5. The toolbar controller has to provide the combo box in the call createItemWindow(...) . You have to use the provided parent window to create your combo box (see interface com.sun.star.frame.XToolbarController).

These are the first steps to add a custom combo box into a toolbar. You should adapt an add-on example from the SDK, so don't have to start from the scratch.

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to