Re: [api-dev] How to set false of MenuBarVaisible via Java?

2008-05-20 Thread Carsten Driesner
SeanYoung wrote:
 Hi, 
 
 I want customize view of openoffice 3.0 beta thought execute Java code.
 The slot:5920 could hide StatusBar,but the slot:6661 is invalid.
 Can anybody ask me , what is MenuBarVisible's new slotID in new OpenOffice 
 3.0 Beta?
 
 
 dispatch( slot:5920, StatusBarVisible, false );
 dispatch( slot:6661, MenuBarVisible, false ); 
 
Hi Sean,

As Ariel already stated slot commands have been deprecated since OOo 2.0
(although they still work). Don't rely on slot URLs as they can be
removed without further notice. The implementation for slot:6661 which
uses the command URL .uno:MenuBarVisible was removed for
OpenOffice.org 2.0. There is a better way to show/hide the menu bar.
Please use the LayoutManager accessible via the frame of your document.
Ariel posted some code on how you can control the visibility of the ui
elements. Please use this way which is more powerful and consistent.

Regards,
Carsten

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



Re: [api-dev] How can I set the right image size on complex toolbar controls?

2008-05-20 Thread Giuseppe Castagno

Hi Carsten,

sorry for the delay, comments follow

Carsten Driesner wrote:

Giuseppe Castagno wrote:

Hi all,

while testing the 'complex toolbar control' implementation I'm working
on, I ran into a problem with the image size.

Toolbar images should be 16x16 or 26x26 pixel.
I have prepared the two set of images but I can't figure out when I have
to change them.
I mean, the user has three selections available: Automatic, Small, Large.

What can I monitor to detect when such changes are applied to my toolbar
in order to set the correct image size?

For the Small and Large selections I can use an 'XChangesListener' to
the right
configuration parameter (e.g. create read-only view that listens for
changes), but I have no idea about how the Automatic one.

Any suggestion will be appreciated.


Hi Giuseppe,

I think your idea with the XChangesListener is the best way to get 
notifications about a selection for small and large icons. The automatic 
selection is a problem as you already found out. Currently there is only 
a C++ class which notifies about icon changes, therefore this 
notification is not available for extensions. For what complex toolbar 
control do you need this notification? I can think of using the 


the 'ControlType' value is ImageButton, where the custom image is 
dynamically changed to reflect the state of an internal extension status 
variable


XControlNotificationListener interface to provide this kind of 
information to a complex toolbar controller. As the interface can 
transfer any kind of information without being changed.


That would be a great idea, I suppose that the toolbar already receives 
the size change notification and routing it through the 
XControlNotificationListener interface seems to be the most sensible 
thing to do.


--
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



Re: [api-dev] Automation doubts

2008-05-20 Thread Juergen Schmidt

Carlos Rocha wrote:

Hi

I'm embedding OO in a program and I'm able to control it thru OLE 
automation. For this purpose I created a VB activeX to create listeners, 
receive events from OO, and pass them to my app. This is not a perfect 
solution but it's working.
The next step is to adapt OO UI to de design of my app, that provides a 
tabbed interface for different documents is different contexts (text 
documents, calc documents, etc, along some others of my own).
I don't want to limit in any way the normal usage of OO. The user must 
be able to use it independently of my program and have access to all his 
power.


Now I need to decide how to achieve a few things. For a start :)

1. It's possible to get rid of the desktop close button (the small X 
in the top-right) when there is only one opened document (when the 
document is opened by my app)?
to prevent confusion with the normal office installed on your computer i 
would suggest to work with your own local user installation. But that 
means that the office that is embedded in your app might have different 
user settings than the normal office.


I am not sure if it possible to control the close button, it have to be 
checked. Anyway you can always keep a hidden document in the back 
ground. That is not nice but should work.




2. I need to intercept menu commands in order to desallow the defined 
action and generate an event that I can intercept and decide the action.
I need this, for example, to redirect saving orders or to create new 
documents in the respective tabbed window.
yes it's possible to intercept commands and do something special. You 
even hide the normal menus and toolbars and do everything on your own. 
See for example the SDK example 
DevGuide/OfficeDev/ContextMenuInterceptor.java. I am sure you can find 
more examples online.




I hope that a kind expert in this group can point me in the right 
direction.

not sure if it helps

Juergen



TY,
Carlos


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




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



Re: [api-dev] Java in Windows and OOo uses different Paper Tray names

2008-05-20 Thread Tobias Krais
Hi Andrew,

 I thought that the tray names were set in the PPD file (for post script
 printers anyway).
 
 For example, read page 101 of this document
 
 http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf

This means OOo seems to read it from the ppd. Won't be platform
independent in case I want to do it this way...

Thank you.

Greetings, Tobias

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



Re: [api-dev] uno-skeletonmaker hacks

2008-05-20 Thread Cédric Bosdonnat
Hi Juergen,

Le lundi 19 mai 2008 à 23:05 +0200, Juergen Schmidt a écrit :
  Are talking of the -propertysetmixin option ? Why not making it a
  default ? If it's the helper to use its fine but the default case is
  still buggy in C++.
 maybe it's a bug i have to check it and will provide tests for the 
 future. Making the propertysetmixin as default is no option. People 
 should explicitly think about it.

Ok, then I'll simply fix the bug. However I think that it should be much
better to add some todo comments in the body of the default
implementation for the getters and setters.

Regards,

-- 
Cédric Bosdonnat
OOo Eclipse Integration developer
http://cedric.bosdonnat.free.fr



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



Re: [api-dev] How to set false of MenuBarVaisible via Java?

2008-05-20 Thread SeanYoung
Thank you very much!It's OK!

--
From: Ariel Constenla-Haile [EMAIL PROTECTED]
Sent: Tuesday, May 20, 2008 12:53 PM
To: dev@api.openoffice.org
Subject: Re: [api-dev] How to set false of MenuBarVaisible via Java?

 Hi Sean,
 
 Hi, 
 
 I want customize view of openoffice 3.0 beta thought execute Java code.
 The slot:5920 could hide StatusBar,but the slot:6661 is invalid.
 Can anybody ask me , what is MenuBarVisible's new slotID in new OpenOffice 
 3.0 Beta?
 
 slots are from OOo's stone age, you should try to use the UNO commnad URLs:
 
 .uno:StatusBarVisible
 .uno:MenuBarVisible
 
 and you may try to use the newer API: XDispatchHelper
 
 Anyway, (1) .uno:MenuBarVisible seems not to work in 2.4.0 (I'm not 
 sure if this is this a bug, or this command does not work just because 
 it isn't available in the UI, and so they have remove it), (2) you 
 should avoid using the dispatch mechanism for this, and use instead the 
 ayoutManager, see the sample below: it is even *simpler*, and here you 
 *can* set the menu bar not visible!
 
 Regards
 Ariel.
 
 //***
 
 import com.sun.star.beans.PropertyValue;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.uno.XComponentContext;
 import com.sun.star.comp.helper.Bootstrap;
 import com.sun.star.frame.XComponentLoader;
 import com.sun.star.frame.XDispatchHelper;
 import com.sun.star.frame.XDispatchProvider;
 import com.sun.star.frame.XFrame;
 import com.sun.star.frame.XLayoutManager;
 import com.sun.star.frame.XModel;
 import com.sun.star.lang.XComponent;
 import com.sun.star.uno.UnoRuntime;
 
 /**
  *
  * @author ariel
  */
 public class UIElementsDemo {
 
 private XComponentContext m_xContext;
 
 /** Creates a new instance of DispatchDemo */
 public UIElementsDemo(XComponentContext xContext) {
 m_xContext = xContext;
 }
 
 
 protected void runDispatchDemo() {
 try {
 XModel xModel = (XModel) UnoRuntime.queryInterface(
 XModel.class, createNewDoc(m_xContext, swriter) );
 
 XFrame xFrame = xModel.getCurrentController().getFrame();
 
 PropertyValue[] aDispatchArgs = new PropertyValue[1];
 aDispatchArgs[0] = new PropertyValue();
 aDispatchArgs[0].Name = StatusBarVisible;
 aDispatchArgs[0].Value = Boolean.FALSE;
 
 executeDispatch(m_xContext, xFrame, .uno:StatusBarVisible,
 , 0, aDispatchArgs);
 
 aDispatchArgs[0].Name = MenuBarVisible;
 
 executeDispatch(m_xContext, xFrame, .uno:MenuBarVisible,
 , 0, aDispatchArgs);
 
 } catch (Exception e) {
 e.printStackTrace();
 }
 }
 
 
 protected void runLayoutManagerDemo() {
 String sStatusBar = private:resource/statusbar/statusbar;
 String sMenuBar = private:resource/menubar/menubar;
 try {
 XComponent xComponent = createNewDoc(m_xContext, swriter);
 
 XLayoutManager xLayoutManager = getLayoutManager(xComponent);
 
 toggleUIElement(xLayoutManager, sStatusBar);
 
 toggleUIElement(xLayoutManager, sMenuBar);
 
 } catch (Exception e) {
 e.printStackTrace();
 }
 }
 
 
 public static XLayoutManager getLayoutManager(XComponent xComponent) {
 XLayoutManager xLayoutManager = null;
 try {
 XModel xModel = (XModel) UnoRuntime.queryInterface(
 XModel.class, xComponent);
 XFrame xFrame = xModel.getCurrentController().getFrame();
 
 XPropertySet xPropertySet = (XPropertySet)
 UnoRuntime.queryInterface(
 XPropertySet.class, xFrame);
 xLayoutManager = (XLayoutManager) UnoRuntime.queryInterface(
 XLayoutManager.class,
 xPropertySet.getPropertyValue(LayoutManager));
 } catch (Exception e) {
 e.printStackTrace();
 } finally {
 return xLayoutManager;
 }
 }
 
 private void toggleUIElement(XLayoutManager xLayoutManager, String
 sUIElement) {
 if (xLayoutManager.isElementVisible(sUIElement)) {
 xLayoutManager.hideElement(sUIElement);
 } else {
 xLayoutManager.showElement(sUIElement);
 }
 }
 
 public XComponent createNewDoc(XComponentContext xContext, String
 sDocType) throws Exception {
 XComponentLoader xComponentLoader = (XComponentLoader)
 UnoRuntime.queryInterface(XComponentLoader.class,
 m_xContext.getServiceManager().createInstanceWithContext(
 com.sun.star.frame.Desktop, m_xContext));
 
 return (XComponent) UnoRuntime.queryInterface(
 XComponent.class, xComponentLoader.loadComponentFromURL(
 private:factory/ + sDocType, _default, 0, 

Re: [api-dev] Re: [Spam] Re: [api-dev] force the evaluation of the condition of a hidden paragraph

2008-05-20 Thread Michael Prochaska

Michael Prochaska schrieb:

Fernand Vanrie schrieb:

Michael Prochaska wrote:

Michael Prochaska wrote:
  
What i meaned was: when the view Hidden Paragraphs not is 
checked the

Hidden Paragraph  service do NOT work, even when the condition is
true




ok, thanks :-)

there is no difference if this option is checked or not.

that means i have the following situation:
- checked hidden paragraph option

- Sub refresh
Dim xFields
xFields = ThisComponent.getTextFields()
xFields.refresh
End Sub

- if i execute the macro the blank lines (with the hidden paragraph
fields) do not disappear

- the macro is stored in the document, that means ThisComponent 
should

definitely point to the document


any further ideas?

  

do the condition matches :-)



yes, if i do a mailmerge it works.
the condition is !fieldname and the field is blank.
  

OK but what is the value of fieldname when you run the macro ??


the value is  = empty field
Thiscomponent.Reformat()  does not work too :-(





Ok, is anybody out there who has this code (or any other code to solve 
the problem) running?


If no, are there any alternatives to solve this issue?


Best regards,
Michael



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



Re: [api-dev] Re: [Spam] Re: [api-dev] force the evaluation of the condition of a hidden paragraph

2008-05-20 Thread Cor Nouws

Michael Prochaska wrote (20-5-2008 18:46)

Michael Prochaska schrieb:

Fernand Vanrie schrieb:

Michael Prochaska wrote:

Michael Prochaska wrote:
 
What i meaned was: when the view Hidden Paragraphs not is 
checked the

Hidden Paragraph  service do NOT work, even when the condition is
true




ok, thanks :-)

there is no difference if this option is checked or not.

that means i have the following situation:
- checked hidden paragraph option

- Sub refresh
Dim xFields
xFields = ThisComponent.getTextFields()
xFields.refresh
End Sub

- if i execute the macro the blank lines (with the hidden paragraph
fields) do not disappear

- the macro is stored in the document, that means ThisComponent 
should

definitely point to the document


any further ideas?

  

do the condition matches :-)



yes, if i do a mailmerge it works.
the condition is !fieldname and the field is blank.
  

OK but what is the value of fieldname when you run the macro ??


the value is  = empty field
Thiscomponent.Reformat()  does not work too :-(





Ok, is anybody out there who has this code (or any other code to solve 
the problem) running?


If no, are there any alternatives to solve this issue?


Have you tried with (from what I know by head) a condition as EQ  ?
I was having inconsistent results when working with conditional hidden 
paragraphs :-\
I think the problem is more likely on that level, than with the simple 
piece of code.


Regards,
Cor


--

The Year of 3 -2008- Het jaar van 3

Cor Nouws
Arnhem - Netherlands - nl.OpenOffice.org - marketing contact


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



Re: [api-dev] Re: [Spam] Re: [api-dev] force the evaluation of the condition of a hidden paragraph

2008-05-20 Thread Michael Prochaska



Have you tried with (from what I know by head) a condition as EQ  ?
I was having inconsistent results when working with conditional hidden 
paragraphs :-\
I think the problem is more likely on that level, than with the simple 
piece of code.




i've tried it with the condition 1 which means that the condition is 
always true = same effect :-(


best regards,
michael

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



[api-dev] Re: Automation doubts

2008-05-20 Thread Carlos Rocha

Thanks for your fast reply.

I want to apologize for something I might say unintentionally, but 
english is not my primary language :)
Let me start to say that I'm reading OO docs for many months now, and I 
collected lots of sample code from many sources, including this list, 
but I don't program in Java, C++, Basic, Python, VB or Delphi. Some 
samples are easily portable, tho, specially VB.


to prevent confusion with the normal office installed on your computer i 
would suggest to work with your own local user installation. But that 
means that the office that is embedded in your app might have different 
user settings than the normal office.


Yes, the idea is to have different settings, but I don't want to rely on 
a (special or not) user account. I would prefere something like 
configuration files in a different path and, by using the API, force 
OO to use them instead. Could css.util.PathSettings be used for this 
purpose? It's easy to imagine some adapted menu configuration files (for 
example, the menu Window is useless for me for every opened file).
Of course, dynamically hiding/creating/changing menu elements is also a 
possibility, and for what I've read is the usual way. I just don't want 
to interfere with the normal office usage.


I am not sure if it possible to control the close button, it have to be 
checked. Anyway you can always keep a hidden document in the back 
ground. That is not nice but should work.


Yes, I though about that too, but it would appear as a ghost document 
in the Window menu (in the normal OO). Anyway, it's only a cosmetic issue.


yes it's possible to intercept commands and do something special. You 
even hide the normal menus and toolbars and do everything on your own. 
See for example the SDK example 
DevGuide/OfficeDev/ContextMenuInterceptor.java. I am sure you can find 
more examples online.



Thank you. I'll try that.

Carlos


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



Re: [api-dev] Java in Windows and OOo uses different Paper Tray names

2008-05-20 Thread Andrew Douglas Pitonyak

Tobias Krais wrote:

Hi Andrew,
  

I thought that the tray names were set in the PPD file (for post script
printers anyway).

For example, read page 101 of this document

http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf



This means OOo seems to read it from the ppd. Won't be platform
independent in case I want to do it this way...

Thank you.

Greetings, Tobia
I do not know that OOo does this, but I was guessing that the O/S may do 
this. If the O/S does this and then OOo asks the O/S, then it will find 
different names potentially.


It would be nice if OOo provide a Service to return this type of 
information.


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


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