Page 1 of 1

popupmenu with icons

Posted: Mon Jun 09, 2008 5:38 am
by rameshkancherla
Welcome beginner. Please answer all of the questions below which may provide information necessary to answer your question.
-----------------------------------------------------------------------------------------------------------
Which version of OpenOffice.org are you using?2.3
What Operating System (version) are you using?windows XP
What is your question or comment?

i have a button in my toolbar while click on button i want to show one popupmenu.
in the popupmenu i want to insert icons and text.
i have inserted text using xpopupmenu interface.
but i am uanable to inserting icons.

how can i insert icons to popupmenu.?

can any one please help me

thanks
ramesh

Re: popupmenu with icons

Posted: Mon Jun 09, 2008 5:35 pm
by acknak
Are you doing this through programming--a BASIC macro, perhaps? Some other language?

Re: popupmenu with icons

Posted: Tue Jun 10, 2008 10:51 am
by rameshkancherla
I am doing using java language.
can you please give me advice
how can i insert icons to popupmenu through programatically.

i will be waiting for your replay

Re: popupmenu with icons

Posted: Tue Jun 10, 2008 3:56 pm
by acknak
[Moved topic to Macros and UNO API]

Re: popupmenu with icons

Posted: Fri Jun 13, 2008 8:35 am
by rameshkancherla
i have to create popupmenu with icons and text items .
popupmenu contains (icon text)
icon text
icon text
icon text
icon text

how can i create this popupmenu

can any one please give me procedure or sample code

please help me

thanks
ramesh k

Re: popupmenu with icons

Posted: Sat Jun 14, 2008 7:41 pm
by rameshkancherla
Good evening

Tthis is Ramesh.
i am creating a toolbar through add-on in java language.
in my toolbar 4 buttons are there. in one button contains dropdown.
so
I have to create one popupmenu for displaying under that drop down
button.

i have created popupmenu through java language(using co.sun.star package) .
but in that package xpopupmenu interfce doesnot contained insertitem method
(both icon and text). it contains only text insert method . so i cant
done through java.

i have seen that in openoffice menubar.xml contains some commands,this
commands are linking to images

like .uno:About ., i created my own command, and insert in menubar.xml i
got image in menubar. (but it is menubar)


but i have to create popupmenu with images. (i am trying to create like new
button on stadared toolbar (it gives popup with images))
how is it possible
is there any xml for popupmenu or else any
can you please give me advice.

i will be waiting for your replay.


Thanks & Regards
Ramesh k

Re: popupmenu with icons

Posted: Mon Jun 23, 2008 8:03 am
by rameshkancherla
I have to display dropdownmenu with icons and label items on toolbar dropdown button.

can anyone please help me

Thanks & Regards
Ramesh K

Re: popupmenu with icons

Posted: Mon Jun 23, 2008 3:54 pm
by hanya
There is the implementation of the .uno:AddDirect menu (Files - New menu entry) in the source code.
http://lxr.go-oo.org/source/framework/f ... roller.cxx

I have also tried to implement new popupmenu controller and I couldn't find any way to add icon through api in Python. I don't have any skill on C++.

Re: popupmenu with icons

Posted: Mon Jun 23, 2008 7:00 pm
by ms777
Hanya,

I have come as far as you in identifying the newmenucontroller service as a potential candidate, but no further, too. The service uses some SetImage function, which is not exposed through any api. So I assume that, independent of the programming language, you have no chance to set image icons in drop down menus withour adding code and recompiling oo, which is not good for redistribution ...

One other idea I did not yet follow up: How about (temporally) abusing the .uno:AddDirect dispatch along the following steps ?

1. Identify, where newdocumentcontroller gets the config for the menus from. http://lxr.go-oo.org/source/util/svtool ... ns.cxx#493 may be a help here ...

2. Overwrite the configuration with the wanted configuration data

3. call the popupmenu via .AddDirect

4. restore the original settings

This workaround would by a very dirty workaround, though ...

ms777

Re: popupmenu with icons

Posted: Tue Jun 24, 2008 12:33 pm
by hanya
Hi, ms777
ms777 wrote:One other idea I did not yet follow up: How about (temporally) abusing the .uno:AddDirect dispatch along the following steps ?
Sounds interesting. I made the configuration entry like the following:

Code: Select all

<?xml version="1.0"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" 
xmlns:install="http://openoffice.org/2004/installation" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
oor:name="Common" 
oor:package="org.openoffice.Office">
  <node oor:name="Menus">
    <node oor:name="New">
      <node oor:name="m100" oor:op="replace">
        <prop oor:name="URL" oor:type="xs:string">
          <value>.uno:About</value>
        </prop>
        <prop oor:name="Title">
          <value xml:lang="en-US">~About</value>
        </prop>
        <prop oor:name="TargetName" oor:type="xs:string">
          <value>_self</value>
        </prop>
        <prop oor:name="ImageIdentifier" oor:type="xs:string">
          <value>.uno:Cut</value>
        </prop>
      </node>
    </node>
  </node>
</oor:component-data>
This configuration adds a new entry with the icon image of the Cut button into the New menu.
And then I tried to replace from the command url to my popupmenucontroller, however the item is shown as a normal menu entry that does not have sub menus. So, it seems the popupmenu is not created by the factory.

But there is the way to add new entries to the AddDirect or AutoPilotMenu menu.

Thanks ms777 for the idea.

Re: popupmenu with icons

Posted: Tue Jun 24, 2008 12:48 pm
by ms777
Hi Hanya,

I used the ConfigurationProvider to change the existing new menu entry from 'Drawing' to 'Drawwwwing' and found that it worked, but only after leaving and restarting OO. So the config changes seem not to be listened to ...

ms777

Re: popupmenu with icons

Posted: Tue Jun 24, 2008 3:18 pm
by rameshkancherla
hi ms777,
I have inserted common.xcu (your code )file in my project. i got cut button in file- new entry menu.

But how can i get it in my popupmenu.

can you please tell me


Thanks & Regards
Ramesh K

Re: popupmenu with icons

Posted: Wed Dec 03, 2014 9:07 pm
by Kiel
Do you have insert de file with this example?