Hello Carsten,
On Thursday 03 September 2009, 10:35, Carsten Driesner wrote:
> Krzysztof Rączkiewicz wrote:
> > Hi,
> > first I was directed to d...@openoffice group but I think that this one
> > is more proper for my problem.
> >
> > I'm developing Java addon for OO3.1. (OOO310m11 Build: 9399)
> > I'm having toggledropdown control and when user select something from
> > that control I get to:
> > - public void dispatch(URL aURL, PropertyValue[] aArguments)
> > then I iterate on the aArguments to find the property with "Text" name.
> > PropertyValue propertyValue = aArguments[i];
> > if (propertyValue.Name.equals("Text"))
> >
> > and here I get the text that user selected on the toggledropdown.
> > This one works fine, but I have problem with Dropdownbox.
> >
> > I used same code with dropdownbox and when user select something from
> > dropdown I always get empty string in "Text". There's also one other
> > property KeyModifier which Value is always 0.
> >
> > Is it a bug or I'm doing something wrong?
> > I appreciate any help.
>
> Hi Krzysztof,
>
> Could you please tell me more about your use case? I don't know if you
> use the complex toolbar controls feature or a dropdownbox within a UNO
> AWT dialog. I would guess the first case but you can definitely tell me.
> Do you have a link where I can download the add-on to reproduce your
> problem?
you can reproduce it with your C++ SDK example (see the diff I attached here,
the example must be compiled with make DEBUG=yes).
Whenever a "color" from the listbox is selected, it prints
Thread: 1 :BaseDispatch::dispatch - Command7
Thread: 1 :[0] KeyModifier = 0
Thread: 1 :[1] Text =
Debugging this
Regards
--
Ariel Constenla-Haile
La Plata, Argentina
Sólo en .: complextoolbarcontrols_MyProtocolHandler.cxx.diff
diff -EbwBu /opt/openoffice.org/basis3.2/sdk/examples/cpp/complextoolbarcontrols/Makefile ./Makefile
--- /opt/openoffice.org/basis3.2/sdk/examples/cpp/complextoolbarcontrols/Makefile 2009-08-06 00:28:12.000000000 -0300
+++ ./Makefile 2009-09-03 11:32:12.000000000 -0300
@@ -79,6 +79,7 @@
Example
include $(SETTINGS)/stdtarget.mk
+CC_FLAGS += -DOSL_DEBUG_LEVEL=2
$(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
diff -EbwBu /opt/openoffice.org/basis3.2/sdk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx ./MyProtocolHandler.cxx
--- /opt/openoffice.org/basis3.2/sdk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx 2009-08-06 00:28:12.000000000 -0300
+++ ./MyProtocolHandler.cxx 2009-09-03 11:39:07.000000000 -0300
@@ -370,6 +370,32 @@
else if ( !aURL.Path.compareToAscii("Command5" ) )
{
}
+ else if ( !aURL.Path.compareToAscii("Command7" ) )
+ {
+ OSL_TRACE( "BaseDispatch::dispatch - Command7" );
+ for ( sal_Int32 i = 0; i < lArgs.getLength(); i++ )
+ {
+ PropertyValue propVal = lArgs[i];
+ if ( propVal.Name.equalsAsciiL( "Text", 4 ))
+ {
+ rtl::OUString sValue;
+ propVal.Value >>= sValue;
+ OSL_TRACE("[%d] %s = %s",
+ i,
+ ::rtl::OUStringToOString( propVal.Name, RTL_TEXTENCODING_ASCII_US ).getStr(),
+ ::rtl::OUStringToOString( sValue, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ }
+ else if ( propVal.Name.equalsAsciiL( "KeyModifier", 11 ))
+ {
+ sal_Int32 iValue;
+ propVal.Value >>= iValue;
+ OSL_TRACE("[%d] %s = %d",
+ i,
+ ::rtl::OUStringToOString( propVal.Name, RTL_TEXTENCODING_ASCII_US ).getStr(),
+ iValue);
+ }
+ }
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]