[Libreoffice-commits] core.git: 2 commits - chart2/source framework/inc framework/source include/svtools include/toolkit odk/examples offapi/com offapi/type_reference offapi/UnoApi_offapi.mk qadevOOo/tests svtools/source svx/source toolkit/source
Ariel Constenla-Haile
arielch at apache.org
Sun Jun 23 13:16:42 PDT 2013
chart2/source/controller/main/ChartController_Window.cxx | 133 +-
framework/inc/uielement/controlmenucontroller.hxx | 2
framework/inc/uielement/fontmenucontroller.hxx | 2
framework/inc/uielement/newmenucontroller.hxx | 4
framework/inc/uielement/recentfilesmenucontroller.hxx | 4
framework/inc/uielement/toolbarsmenucontroller.hxx | 4
framework/source/uielement/controlmenucontroller.cxx | 2
framework/source/uielement/fontmenucontroller.cxx | 2
framework/source/uielement/langselectionmenucontroller.cxx | 1
framework/source/uielement/langselectionstatusbarcontroller.cxx | 6
framework/source/uielement/newmenucontroller.cxx | 4
framework/source/uielement/popupmenucontroller.cxx | 2
framework/source/uielement/recentfilesmenucontroller.cxx | 16
framework/source/uielement/toolbarsmenucontroller.cxx | 14
include/svtools/popupmenucontrollerbase.hxx | 8
include/toolkit/awt/vclxmenu.hxx | 198 +--
include/toolkit/helper/listenermultiplexer.hxx | 8
odk/examples/DevelopersGuide/GUI/UnoMenu.java | 56 -
odk/examples/DevelopersGuide/GUI/UnoMenu2.java | 4
offapi/UnoApi_offapi.mk | 5
offapi/com/sun/star/awt/MenuBar.idl | 4
offapi/com/sun/star/awt/MenuEvent.idl | 9
offapi/com/sun/star/awt/MenuItemStyle.idl | 15
offapi/com/sun/star/awt/MenuItemType.idl | 10
offapi/com/sun/star/awt/MenuLogo.idl | 54
offapi/com/sun/star/awt/PopupMenu.idl | 10
offapi/com/sun/star/awt/PopupMenuDirection.idl | 22
offapi/com/sun/star/awt/XMenu.idl | 238 +++-
offapi/com/sun/star/awt/XMenuBar.idl | 8
offapi/com/sun/star/awt/XMenuBarExtended.idl | 49
offapi/com/sun/star/awt/XMenuExtended.idl | 71 -
offapi/com/sun/star/awt/XMenuExtended2.idl | 93 -
offapi/com/sun/star/awt/XMenuListener.idl | 19
offapi/com/sun/star/awt/XPopupMenu.idl | 143 ++
offapi/com/sun/star/awt/XPopupMenuExtended.idl | 327 ------
offapi/type_reference/offapi.rdb |binary
qadevOOo/tests/java/ifc/frame/_XPopupMenuController.java | 93 +
svtools/source/uno/popupmenucontrollerbase.cxx | 23
svx/source/dialog/sdstring.src | 2
svx/source/tbxctrls/extrusioncontrols.cxx | 5
toolkit/source/awt/vclxmenu.cxx | 544 +++-------
toolkit/source/helper/listenermultiplexer.cxx | 8
42 files changed, 885 insertions(+), 1337 deletions(-)
New commits:
commit 9052caae53ef6ec7eeab20f1ac56bd6310b4451b
Author: Ariel Constenla-Haile <arielch at apache.org>
Date: Sun Dec 23 11:29:21 2012 +0000
Resolves: #i121542# Unify the Menu API
(cherry picked from commit 399946b82f5efec19cd82d1c320d5aa9295d235d)
Conflicts:
chart2/source/controller/main/ChartController_Window.cxx
framework/source/uielement/langselectionmenucontroller.cxx
framework/source/uielement/popupmenucontroller.cxx
framework/source/uielement/recentfilesmenucontroller.cxx
framework/source/uielement/toolbarsmenucontroller.cxx
odk/examples/DevelopersGuide/GUI/UnoMenu.java
odk/examples/DevelopersGuide/GUI/UnoMenu2.java
odk/examples/cpp/StatusbarController/SelectionModeStatusbarController/SelectionModeStatusbarController.cxx
offapi/com/sun/star/awt/MenuBar.idl
offapi/com/sun/star/awt/MenuEvent.idl
offapi/com/sun/star/awt/MenuItemStyle.idl
offapi/com/sun/star/awt/MenuItemType.idl
offapi/com/sun/star/awt/MenuLogo.idl
offapi/com/sun/star/awt/PopupMenu.idl
offapi/com/sun/star/awt/PopupMenuDirection.idl
offapi/com/sun/star/awt/XMenu.idl
offapi/com/sun/star/awt/XMenuBar.idl
offapi/com/sun/star/awt/XMenuBarExtended.idl
offapi/com/sun/star/awt/XMenuExtended.idl
offapi/com/sun/star/awt/XMenuExtended2.idl
offapi/com/sun/star/awt/XMenuListener.idl
offapi/com/sun/star/awt/XPopupMenu.idl
offapi/com/sun/star/awt/XPopupMenuExtended.idl
offapi/com/sun/star/awt/makefile.mk
offapi/type_reference/types.rdb
svtools/inc/svtools/popupmenucontrollerbase.hxx
svtools/source/uno/popupmenucontrollerbase.cxx
svx/source/tbxctrls/extrusioncontrols.cxx
toolkit/inc/pch/precompiled_toolkit.hxx
toolkit/inc/toolkit/awt/vclxmenu.hxx
toolkit/inc/toolkit/helper/listenermultiplexer.hxx
toolkit/source/awt/vclxmenu.cxx
Change-Id: I3d9a1e109b9ff35901a3075b44a4c27e7c12b5c7
Related: #i121542# css::awt::XPopupMenu::execute() needs a Rectangle
(cherry picked from commit c01a6f4f370b72f0751cf4f5c11310682e2b3248)
Conflicts:
odk/examples/DevelopersGuide/GUI/UnoMenu2.java
offapi/type_reference/types.rdb
toolkit/inc/toolkit/awt/vclxmenu.hxx
Change-Id: I2cccc95086fe3d1522d03346e3c577fb2f21f621
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 0c748f1..c148313 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -132,12 +132,11 @@ bool lcl_MoveObjectLogic(
void lcl_insertMenuCommand(
const uno::Reference< awt::XPopupMenu > & xMenu,
- const uno::Reference< awt::XMenuExtended > & xMenuEx,
sal_Int16 nId, const OUString & rCommand )
{
static OUString aEmptyString;
xMenu->insertItem( nId, aEmptyString, 0, -1 );
- xMenuEx->setCommand( nId, rCommand );
+ xMenu->setCommand( nId, rCommand );
}
OUString lcl_getFormatCommandForObjectCID( const OUString& rCID )
@@ -1034,15 +1033,14 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
uno::Reference< awt::XPopupMenu > xPopupMenu(
m_xCC->getServiceManager()->createInstanceWithContext(
"com.sun.star.awt.PopupMenu", m_xCC ), uno::UNO_QUERY );
- uno::Reference< awt::XMenuExtended > xMenuEx( xPopupMenu, uno::UNO_QUERY );
- if( xPopupMenu.is() && xMenuEx.is())
+ if( xPopupMenu.is())
{
sal_Int16 nUniqueId = 1;
ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( getModel() );
OUString aFormatCommand( lcl_getFormatCommandForObjectCID( m_aSelection.getSelectedCID() ) );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, aFormatCommand );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, aFormatCommand );
//some commands for dataseries and points:
//-----
@@ -1094,17 +1092,17 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if( bIsPoint )
{
if( bHasDataLabelAtPoint )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatDataLabel" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataLabel" );
if( !bHasDataLabelAtPoint )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertDataLabel" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertDataLabel" );
else
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteDataLabel" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteDataLabel" );
if( bSelectedPointIsFormatted )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:ResetDataPoint" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:ResetDataPoint" );
xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatDataSeries" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataSeries" );
}
Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
@@ -1120,8 +1118,8 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if( bJapaneseStyle )
{
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatStockLoss" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatStockGain" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockLoss" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockGain" );
}
}
}
@@ -1132,62 +1130,61 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
}
if( bHasDataLabelsAtSeries )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatDataLabels" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataLabels" );
if( xTrendline.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendline" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendline" );
if( bHasEquation )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendlineEquation" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
if( xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatMeanValue" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMeanValue" );
if( bHasXErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatXErrorBars" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatXErrorBars" );
if( bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatYErrorBars" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatYErrorBars" );
xPopupMenu->insertSeparator( -1 );
if( !bHasDataLabelsAtSeries )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertDataLabels" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertDataLabels" );
if( !xTrendline.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendline" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendline" );
else if( !bHasEquation )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquation" );
if( !xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertMeanValue" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMeanValue" );
if( !bHasXErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertXErrorBars" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertXErrorBars" );
if( !bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertYErrorBars" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertYErrorBars" );
if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteDataLabels" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteDataLabels" );
if( xTrendline.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendline" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendline" );
if( bHasEquation )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendlineEquation" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
if( xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteMeanValue" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteMeanValue" );
if( bHasXErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteXErrorBars" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteXErrorBars" );
if( bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteYErrorBars" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteYErrorBars" );
if( bHasFormattedDataPointsOtherThanSelected )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:ResetAllDataPoints" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:ResetAllDataPoints" );
xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId, ".uno:ArrangeRow" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId, ".uno:ArrangeRow" );
uno::Reference< awt::XPopupMenu > xArrangePopupMenu(
m_xCC->getServiceManager()->createInstanceWithContext(
"com.sun.star.awt.PopupMenu", m_xCC ), uno::UNO_QUERY );
- uno::Reference< awt::XMenuExtended > xArrangeMenuEx( xArrangePopupMenu, uno::UNO_QUERY );
- if( xArrangePopupMenu.is() && xArrangeMenuEx.is())
+ if( xArrangePopupMenu.is() )
{
sal_Int16 nSubId = nUniqueId + 1;
- lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId++, ".uno:Forward" );
- lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId, ".uno:Backward" );
+ lcl_insertMenuCommand( xArrangePopupMenu, nSubId++, ".uno:Forward" );
+ lcl_insertMenuCommand( xArrangePopupMenu, nSubId, ".uno:Backward" );
xPopupMenu->setPopupMenu( nUniqueId, xArrangePopupMenu );
nUniqueId = nSubId;
}
@@ -1195,17 +1192,17 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
}
else if( OBJECTTYPE_DATA_CURVE == eObjectType )
{
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendlineEquation" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertR2Value" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendlineEquation" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteR2Value" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquation" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertR2Value" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" );
}
else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType )
{
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertR2Value" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteR2Value" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertR2Value" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" );
}
//some commands for axes: and grids
@@ -1229,38 +1226,38 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
bHasTitle = !TitleHelper::getCompleteString( xTitled->getTitleObject() ).isEmpty();
if( OBJECTTYPE_AXIS != eObjectType && bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatAxis" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatAxis" );
if( OBJECTTYPE_GRID != eObjectType && bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatMajorGrid" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMajorGrid" );
if( OBJECTTYPE_SUBGRID != eObjectType && bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatMinorGrid" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMinorGrid" );
xPopupMenu->insertSeparator( -1 );
if( OBJECTTYPE_AXIS != eObjectType && !bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertAxis" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertAxis" );
if( OBJECTTYPE_GRID != eObjectType && !bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertMajorGrid" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMajorGrid" );
if( OBJECTTYPE_SUBGRID != eObjectType && !bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertMinorGrid" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMinorGrid" );
if( !bHasTitle )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertAxisTitle" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertAxisTitle" );
if( bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteAxis" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteAxis" );
if( bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteMajorGrid" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteMajorGrid" );
if( bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteMinorGrid" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteMinorGrid" );
}
}
if( OBJECTTYPE_DATA_STOCK_LOSS == eObjectType )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatStockGain" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockGain" );
else if( OBJECTTYPE_DATA_STOCK_GAIN == eObjectType )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatStockLoss" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockLoss" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:TransformDialog" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:TransformDialog" );
if( OBJECTTYPE_PAGE == eObjectType || OBJECTTYPE_DIAGRAM == eObjectType
|| OBJECTTYPE_DIAGRAM_WALL == eObjectType
@@ -1270,24 +1267,24 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if( OBJECTTYPE_UNKNOWN != eObjectType )
xPopupMenu->insertSeparator( -1 );
bool bHasLegend = LegendHelper::hasLegend( xDiagram );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTitles" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTitles" );
if( !bHasLegend )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertLegend" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertRemoveAxes" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertLegend" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertRemoveAxes" );
if( bHasLegend )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteLegend" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteLegend" );
}
//-----
xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DiagramType" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DataRanges" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DiagramData" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:View3D" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DiagramType" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DataRanges" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DiagramData" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:View3D" );
xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:Cut" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:Copy" );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:Paste" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Cut" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Copy" );
+ lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Paste" );
::svt::ContextMenuHelper aContextMenuHelper( m_xFrame );
Point aPos( rCEvt.GetMousePosPixel() );
diff --git a/framework/inc/uielement/controlmenucontroller.hxx b/framework/inc/uielement/controlmenucontroller.hxx
index a5f4fcf..9b86a62 100644
--- a/framework/inc/uielement/controlmenucontroller.hxx
+++ b/framework/inc/uielement/controlmenucontroller.hxx
@@ -63,7 +63,7 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// XMenuListener
- virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
diff --git a/framework/inc/uielement/fontmenucontroller.hxx b/framework/inc/uielement/fontmenucontroller.hxx
index d642a9c..df8c922 100644
--- a/framework/inc/uielement/fontmenucontroller.hxx
+++ b/framework/inc/uielement/fontmenucontroller.hxx
@@ -57,7 +57,7 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// XMenuListener
- virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
diff --git a/framework/inc/uielement/newmenucontroller.hxx b/framework/inc/uielement/newmenucontroller.hxx
index f2ee4ac..afacc16 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -70,8 +70,8 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// XMenuListener
- virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
diff --git a/framework/inc/uielement/recentfilesmenucontroller.hxx b/framework/inc/uielement/recentfilesmenucontroller.hxx
index fe5b594..1fb90a4 100644
--- a/framework/inc/uielement/recentfilesmenucontroller.hxx
+++ b/framework/inc/uielement/recentfilesmenucontroller.hxx
@@ -48,8 +48,8 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// XMenuListener
- virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
// XDispatchProvider
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx
index 3547abb..638170f 100644
--- a/framework/inc/uielement/toolbarsmenucontroller.hxx
+++ b/framework/inc/uielement/toolbarsmenucontroller.hxx
@@ -67,8 +67,8 @@ namespace framework
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
// XMenuListener
- virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
// XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index bda92e0..a861194 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -317,7 +317,7 @@ void ControlMenuController::impl_select(const Reference< XDispatch >& /*_xDispat
}
}
-void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL ControlMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
osl::ResettableMutexGuard aLock( m_aMutex );
diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx
index 47e3509..fd5186c 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -157,7 +157,7 @@ void FontMenuController::impl_select(const Reference< XDispatch >& _xDispatch,co
_xDispatch->dispatch( aTargetURL, aArgs );
}
-void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL FontMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
osl::MutexGuard aLock( m_aMutex );
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index db94d8f..38a4def 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -33,7 +33,6 @@
#include <vcl/i18nhelp.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/mnemonic.hxx>
-#include <com/sun/star/awt/XMenuExtended.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/document/XDocumentLanguages.hpp>
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 8773c81..903da76 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -184,10 +184,8 @@ throw (::com::sun::star::uno::RuntimeException)
// now display the popup menu and execute every command ...
Reference< awt::XWindowPeer > xParent( m_xParentWindow, UNO_QUERY );
- com::sun::star::awt::Rectangle aRectangle;
- aRectangle.X = aPos.X;
- aRectangle.Y = aPos.Y;
- sal_Int16 nId = xPopupMenu->execute( xParent, aRectangle, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
+ com::sun::star::awt::Rectangle aRect( aPos.X, aPos.Y, 0, 0 );
+ sal_Int16 nId = xPopupMenu->execute( xParent, aRect, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
//click "More..."
if ( nId && m_xFrame.is() )
{
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index dea64a4..156979c 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -388,7 +388,7 @@ void SAL_CALL NewMenuController::statusChanged( const FeatureStateEvent& ) throw
}
// XMenuListener
-void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
+void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
Reference< css::awt::XPopupMenu > xPopupMenu;
Reference< XDispatch > xDispatch;
@@ -444,7 +444,7 @@ void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) thr
}
}
-void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL NewMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
SolarMutexGuard aSolarMutexGuard;
if ( m_xFrame.is() && m_xPopupMenu.is() )
diff --git a/framework/source/uielement/popupmenucontroller.cxx b/framework/source/uielement/popupmenucontroller.cxx
index d980f6e..759bad1 100644
--- a/framework/source/uielement/popupmenucontroller.cxx
+++ b/framework/source/uielement/popupmenucontroller.cxx
@@ -59,7 +59,7 @@ class PopupMenuControllerImpl
};
//========================================================================
-// class PopupMenuController
+// class PopupMenuController REMOVE REMOVE REMOVE
//========================================================================
PopupMenuController::PopupMenuController( const Reference< uno::XComponentContext >& rxContext )
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 62197da..47f0868 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -267,20 +267,18 @@ void SAL_CALL RecentFilesMenuController::statusChanged( const FeatureStateEvent&
m_bDisabled = !Event.IsEnabled;
}
-void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
+void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< css::awt::XMenuExtended > xMenuExt;
+ Reference< css::awt::XPopupMenu > xPopupMenu;
osl::ClearableMutexGuard aLock( m_aMutex );
- xPopupMenu = m_xPopupMenu;
- xMenuExt = Reference< css::awt::XMenuExtended >( m_xPopupMenu, UNO_QUERY );
+ xPopupMenu = m_xPopupMenu;
aLock.clear();
- if ( xMenuExt.is() )
+ if ( xPopupMenu.is() )
{
- const OUString aCommand( xMenuExt->getCommand( rEvent.MenuId ) );
- OSL_TRACE( "RecentFilesMenuController::select() - Command : %s",
+ const OUString aCommand( xPopupMenu->getCommand( rEvent.MenuId ) );
+ OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s",
OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
if ( aCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_CLEAR_LIST ) ) )
@@ -290,7 +288,7 @@ void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEve
}
}
-void SAL_CALL RecentFilesMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL RecentFilesMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
osl::MutexGuard aLock( m_aMutex );
impl_setPopupMenu();
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index a93c965..a1d8cd7 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -163,8 +163,7 @@ void ToolbarsMenuController::addCommand(
aLabel = rLabel;
rPopupMenu->insertItem( nItemId, aLabel, 0, nItemId );
- Reference< awt::XMenuExtended > xMenuExtended( m_xPopupMenu, UNO_QUERY );
- xMenuExtended->setCommand( nItemId, rCommandURL );
+ rPopupMenu->setCommand( nItemId, rCommandURL );
bool bInternal = ( rCommandURL.indexOf( STATIC_INTERNAL_CMD_PART ) == 0);
if ( !bInternal )
@@ -354,9 +353,8 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
m_aCommandVector.clear();
// Retrieve layout manager for additional information
- OUString aEmptyString;
- Reference< awt::XMenuExtended > xMenuExtended( rPopupMenu, UNO_QUERY );
- Reference< XLayoutManager > xLayoutManager( getLayoutManagerFromFrame( m_xFrame ));
+ OUString aEmptyString;
+ Reference< XLayoutManager > xLayoutManager( getLayoutManagerFromFrame( m_xFrame ));
m_bResetActive = sal_False;
if ( xLayoutManager.is() )
@@ -467,7 +465,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
// Store complete uno-command so it can also be dispatched. This is necessary to support
// the test tool!
- xMenuExtended->setCommand( nIndex, aCmd );
+ rPopupMenu->setCommand( nIndex, aCmd );
++nIndex;
}
@@ -595,7 +593,7 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const FeatureStateEvent& Ev
}
// XMenuListener
-void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
+void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
Reference< css::awt::XPopupMenu > xPopupMenu;
Reference< XComponentContext > xContext;
@@ -754,7 +752,7 @@ void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent
}
}
-void SAL_CALL ToolbarsMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL ToolbarsMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
std::vector< OUString > aCmdVector;
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
diff --git a/include/svtools/popupmenucontrollerbase.hxx b/include/svtools/popupmenucontrollerbase.hxx
index 1bec619..e3f7020 100644
--- a/include/svtools/popupmenucontrollerbase.hxx
+++ b/include/svtools/popupmenucontrollerbase.hxx
@@ -78,10 +78,10 @@ namespace svt
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
// XMenuListener
- virtual void SAL_CALL highlight( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deactivate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemHighlighted( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemDeactivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
// XDispatchProvider
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/include/toolkit/awt/vclxmenu.hxx b/include/toolkit/awt/vclxmenu.hxx
index 32b7775..77b0cfe 100644
--- a/include/toolkit/awt/vclxmenu.hxx
+++ b/include/toolkit/awt/vclxmenu.hxx
@@ -21,37 +21,41 @@
#define _TOOLKIT_AWT_VCLXMENU_HXX_
#include <toolkit/dllapi.h>
-#include <com/sun/star/awt/XMenuBarExtended.hpp>
-#include <com/sun/star/awt/XPopupMenuExtended.hpp>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+#include <com/sun/star/awt/XMenuBar.hpp>
+#include <com/sun/star/awt/XPopupMenu.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
+
#include <cppuhelper/weak.hxx>
#include <osl/mutex.hxx>
#include <tools/link.hxx>
-#include <toolkit/helper/listenermultiplexer.hxx>
#include <vector>
+namespace css = ::com::sun::star;
+
class Menu;
class MenuBar;
class VclSimpleEvent;
class PopupMenu;
typedef ::std::vector<
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >*
+ css::uno::Reference< css::awt::XPopupMenu >*
> PopupMenuRefList;
// ----------------------------------------------------
// class VCLXMenu
// ----------------------------------------------------
-class TOOLKIT_DLLPUBLIC VCLXMenu : public ::com::sun::star::awt::XMenuBarExtended,
- public ::com::sun::star::awt::XPopupMenuExtended,
- public ::com::sun::star::lang::XServiceInfo,
- public ::com::sun::star::lang::XTypeProvider,
- public ::com::sun::star::lang::XUnoTunnel,
+class TOOLKIT_DLLPUBLIC VCLXMenu : public css::awt::XMenuBar,
+ public css::awt::XPopupMenu,
+ public css::lang::XServiceInfo,
+ public css::lang::XTypeProvider,
+ public css::lang::XUnoTunnel,
public ::cppu::OWeakObject
{
private:
@@ -63,120 +67,94 @@ private:
protected:
::osl::Mutex& GetMutex() { return maMutex; }
- DECL_LINK( MenuEventListener, VclSimpleEvent* );
+ DECL_LINK( MenuEventListener, VclSimpleEvent* );
- void ImplCreateMenu( sal_Bool bPopup );
+ void ImplCreateMenu( sal_Bool bPopup );
public:
- VCLXMenu();
- VCLXMenu( Menu* pMenu );
- ~VCLXMenu();
-
-
- Menu* GetMenu() const { return mpMenu; }
- sal_Bool IsPopupMenu() const;
-
- // ::com::sun::star::uno::XInterface
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
- void SAL_CALL release() throw() { OWeakObject::release(); }
-
- // ::com::sun::star::lang::XUnoTunnel
- static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
- static VCLXMenu* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace );
- sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::awt::XMenu
- void SAL_CALL addMenuListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeMenuListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL insertItem( sal_Int16 nItemId, const OUString& aText, sal_Int16 nItemStyle, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeItem( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int16 SAL_CALL getItemId( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int16 SAL_CALL getItemPos( sal_Int16 nId ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL enableItem( sal_Int16 nItemId, sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException);
- sal_Bool SAL_CALL isItemEnabled( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setItemText( sal_Int16 nItemId, const OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
- OUString SAL_CALL getItemText( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setPopupMenu( sal_Int16 nItemId, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& aPopupMenu ) throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > SAL_CALL getPopupMenu( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::awt::XPopupMenu
- void SAL_CALL insertSeparator( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setDefaultItem( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int16 SAL_CALL getDefaultItem( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL checkItem( sal_Int16 nItemId, sal_Bool bCheck ) throw(::com::sun::star::uno::RuntimeException);
- sal_Bool SAL_CALL isItemChecked( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int16 SAL_CALL execute( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent, const ::com::sun::star::awt::Rectangle& Area, sal_Int16 Direction ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::awt::XMenuBar
-
- // ::com::sun::star::awt::XMenuExtended
- virtual void SAL_CALL setCommand( sal_Int16 nItemId, const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
- virtual OUString SAL_CALL getCommand( sal_Int16 nItemId ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpCommand( sal_Int16 nItemId, const OUString& aHelp ) throw (::com::sun::star::uno::RuntimeException);
- virtual OUString SAL_CALL getHelpCommand( sal_Int16 nItemId ) throw (::com::sun::star::uno::RuntimeException);
-
- // ========================================================================
- // ========================================================================
- // ========================================================================
-
- // XMenuExtended2 Methods
- virtual ::sal_Bool SAL_CALL isPopupMenu( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL clear( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::awt::MenuItemType SAL_CALL getItemType( ::sal_Int16 nItemPos ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL hideDisabledEntries( ::sal_Bool bHide ) throw (::com::sun::star::uno::RuntimeException);
-
- // XMenuBarExtended Methods
-
- // XPopupMenuExtended Methods
- virtual ::sal_Bool SAL_CALL isInExecute( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endExecute( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLogo( const ::com::sun::star::awt::MenuLogo& aMenuLogo ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::awt::MenuLogo SAL_CALL getLogo( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL enableAutoMnemonics( ::sal_Bool bEnable ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAcceleratorKeyEvent( ::sal_Int16 nItemId, const ::com::sun::star::awt::KeyEvent& aKeyEvent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::awt::KeyEvent SAL_CALL getAcceleratorKeyEvent( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpText( ::sal_Int16 nItemId, const OUString& sHelpText ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual OUString SAL_CALL getHelpText( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTipHelpText( ::sal_Int16 nItemId, const OUString& sTipHelpText ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual OUString SAL_CALL getTipHelpText( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setItemImage( ::sal_Int16 nItemId, const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& xGraphic, ::sal_Bool bScale ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL getItemImage( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setItemImageAngle( ::sal_Int16 nItemId, ::sal_Int32 nAngle ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getItemImageAngle( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setItemImageMirrorMode( ::sal_Int16 nItemId, ::sal_Bool bMirror ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isItemImageInMirrorMode( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::lang::XServiceInfo
- virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
-
+ VCLXMenu();
+ VCLXMenu( Menu* pMenu );
+ ~VCLXMenu();
+
+
+ Menu* GetMenu() const { return mpMenu; }
+ sal_Bool IsPopupMenu() const;
+
+ // css::uno::XInterface
+ css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) throw(css::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // css::lang::XUnoTunnel
+ static const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXMenu* GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace );
+ sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) throw(css::uno::RuntimeException);
+
+ // css::lang::XTypeProvider
+ css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw(css::uno::RuntimeException);
+ css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(css::uno::RuntimeException);
+
+ // css::awt::XMenu
+ virtual void SAL_CALL addMenuListener( const css::uno::Reference< css::awt::XMenuListener >& xListener ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL removeMenuListener( const css::uno::Reference< css::awt::XMenuListener >& xListener ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL insertItem( sal_Int16 nItemId, const OUString& aText, sal_Int16 nItemStyle, sal_Int16 nPos ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL removeItem( sal_Int16 nPos, sal_Int16 nCount ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL clear( ) throw(css::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getItemCount( ) throw(css::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getItemId( sal_Int16 nPos ) throw(css::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getItemPos( sal_Int16 nId ) throw(css::uno::RuntimeException);
+ virtual css::awt::MenuItemType SAL_CALL getItemType( ::sal_Int16 nItemPos ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL enableItem( sal_Int16 nItemId, sal_Bool bEnable ) throw(css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isItemEnabled( sal_Int16 nItemId ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL hideDisabledEntries( ::sal_Bool bHide ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL enableAutoMnemonics( ::sal_Bool bEnable ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setItemText( sal_Int16 nItemId, const OUString& aText ) throw(css::uno::RuntimeException);
+ virtual OUString SAL_CALL getItemText( sal_Int16 nItemId ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL setCommand( sal_Int16 nItemId, const OUString& aCommand ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getCommand( sal_Int16 nItemId ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHelpCommand( sal_Int16 nItemId, const OUString& aHelp ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getHelpCommand( sal_Int16 nItemId ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHelpText( ::sal_Int16 nItemId, const OUString& sHelpText ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getHelpText( ::sal_Int16 nItemId ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTipHelpText( ::sal_Int16 nItemId, const OUString& sTipHelpText ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getTipHelpText( ::sal_Int16 nItemId ) throw (css::uno::RuntimeException);
+
+ virtual ::sal_Bool SAL_CALL isPopupMenu( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setPopupMenu( sal_Int16 nItemId, const css::uno::Reference< css::awt::XPopupMenu >& aPopupMenu ) throw(css::uno::RuntimeException);
+ virtual css::uno::Reference< css::awt::XPopupMenu > SAL_CALL getPopupMenu( sal_Int16 nItemId ) throw(css::uno::RuntimeException);
+
+ // css::awt::XPopupMenu
+ virtual void SAL_CALL insertSeparator( sal_Int16 nPos ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL setDefaultItem( sal_Int16 nItemId ) throw(css::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getDefaultItem( ) throw(css::uno::RuntimeException);
+ virtual void SAL_CALL checkItem( sal_Int16 nItemId, sal_Bool bCheck ) throw(css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isItemChecked( sal_Int16 nItemId ) throw(css::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL execute( const css::uno::Reference< css::awt::XWindowPeer >& Parent, const css::awt::Rectangle& Position, ::sal_Int16 Direction ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isInExecute( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL endExecute( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAcceleratorKeyEvent( ::sal_Int16 nItemId, const css::awt::KeyEvent& aKeyEvent ) throw (css::uno::RuntimeException);
+ virtual css::awt::KeyEvent SAL_CALL getAcceleratorKeyEvent( ::sal_Int16 nItemId ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setItemImage( ::sal_Int16 nItemId, const css::uno::Reference< css::graphic::XGraphic >& xGraphic, ::sal_Bool bScale ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getItemImage( ::sal_Int16 nItemId ) throw (css::uno::RuntimeException);
+
+ // css::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException);
};
-// ----------------------------------------------------
-// class VCLXMenuBar
-// ----------------------------------------------------
class TOOLKIT_DLLPUBLIC VCLXMenuBar : public VCLXMenu
{
public:
- VCLXMenuBar();
- VCLXMenuBar( MenuBar* pMenuBar );
+ VCLXMenuBar();
+ VCLXMenuBar( MenuBar* pMenuBar );
};
-// ----------------------------------------------------
-// class VCLXPopupMenu
-// ----------------------------------------------------
class TOOLKIT_DLLPUBLIC VCLXPopupMenu : public VCLXMenu
{
public:
- VCLXPopupMenu();
- VCLXPopupMenu( PopupMenu* pPopMenu );
+ VCLXPopupMenu();
+ VCLXPopupMenu( PopupMenu* pPopMenu );
};
#endif // _TOOLKIT_AWT_VCLXMENU_HXX_
diff --git a/include/toolkit/helper/listenermultiplexer.hxx b/include/toolkit/helper/listenermultiplexer.hxx
index dc06268..538abc9 100644
--- a/include/toolkit/helper/listenermultiplexer.hxx
+++ b/include/toolkit/helper/listenermultiplexer.hxx
@@ -217,10 +217,10 @@ DECL_LISTENERMULTIPLEXER_END
// class MenuListenerMultiplexer
// ----------------------------------------------------
DECL_LISTENERMULTIPLEXER_START( MenuListenerMultiplexer, ::com::sun::star::awt::XMenuListener )
- void SAL_CALL highlight( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL deactivate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL itemHighlighted( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL itemDeactivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
DECL_LISTENERMULTIPLEXER_END
// ----------------------------------------------------
diff --git a/odk/examples/DevelopersGuide/GUI/UnoMenu.java b/odk/examples/DevelopersGuide/GUI/UnoMenu.java
index 86942f9..87e7fce 100644
--- a/odk/examples/DevelopersGuide/GUI/UnoMenu.java
+++ b/odk/examples/DevelopersGuide/GUI/UnoMenu.java
@@ -22,7 +22,6 @@ import com.sun.star.awt.Rectangle;
import com.sun.star.awt.WindowAttribute;
import com.sun.star.awt.WindowClass;
import com.sun.star.awt.XMenuBar;
-import com.sun.star.awt.XMenuExtended;
import com.sun.star.awt.XMenuListener;
import com.sun.star.awt.XPopupMenu;
import com.sun.star.awt.XToolkit;
@@ -64,21 +63,26 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
XPopupMenu xPopupMenu = null;
try{
// create a popup menu
- Object oPopupMenu = m_xMCF.createInstanceWithContext("stardiv.Toolkit.VCLXPopupMenu", m_xContext);
+ Object oPopupMenu = m_xMCF.createInstanceWithContext("com.sun.star.awt.PopupMenu", m_xContext);
xPopupMenu = UnoRuntime.queryInterface(XPopupMenu.class, oPopupMenu);
- XMenuExtended xMenuExtended = UnoRuntime.queryInterface(XMenuExtended.class, xPopupMenu);
-
- xPopupMenu.insertItem((short) 0, "~First Entry", MenuItemStyle.AUTOCHECK, (short) 0);
- xPopupMenu.insertItem((short) 1, "First ~Radio Entry", (short) (MenuItemStyle.RADIOCHECK + MenuItemStyle.AUTOCHECK), (short) 1);
- xPopupMenu.insertItem((short) 2, "~Second Radio Entry", (short) (MenuItemStyle.RADIOCHECK + MenuItemStyle.AUTOCHECK), (short) 2);
- xPopupMenu.insertItem((short) 3, "~Third RadioEntry",(short) (MenuItemStyle.RADIOCHECK + MenuItemStyle.AUTOCHECK), (short) 3);
- xPopupMenu.insertSeparator((short)4);
- xPopupMenu.insertItem((short) 4, "F~ifth Entry", (short) (MenuItemStyle.CHECKABLE + MenuItemStyle.AUTOCHECK), (short) 5);
- xPopupMenu.insertItem((short) 5, "~Fourth Entry", (short) (MenuItemStyle.CHECKABLE + MenuItemStyle.AUTOCHECK), (short) 6);
- xPopupMenu.enableItem((short) 1, false);
- xPopupMenu.insertItem((short) 6, "~Sixth Entry", (short) 0, (short) 7);
- xPopupMenu.insertItem((short) 7, "~Close Dialog", (short) 0, (short) 8);
- xPopupMenu.checkItem((short) 2, true);
+
+ // ID must start be > 0
+ short nId = 1;
+ short nPos = 0;
+
+ xPopupMenu.insertItem(nId++, "First Entry", MenuItemStyle.AUTOCHECK, nPos++);
+ xPopupMenu.insertItem(nId++, "First Radio Entry", (short) (MenuItemStyle.RADIOCHECK + MenuItemStyle.AUTOCHECK), nPos++);
+ xPopupMenu.insertItem(nId++, "Second Radio Entry", (short) (MenuItemStyle.RADIOCHECK + MenuItemStyle.AUTOCHECK), nPos++);
+ xPopupMenu.insertItem(nId++, "Third RadioEntry",(short) (MenuItemStyle.RADIOCHECK + MenuItemStyle.AUTOCHECK), nPos++);
+ xPopupMenu.insertSeparator(nPos++);
+ xPopupMenu.insertItem(nId++, "Fifth Entry", (short) (MenuItemStyle.CHECKABLE + MenuItemStyle.AUTOCHECK), nPos++);
+ xPopupMenu.insertItem(nId++, "Fourth Entry", (short) (MenuItemStyle.CHECKABLE + MenuItemStyle.AUTOCHECK), nPos++);
+ xPopupMenu.insertItem(nId++, "Sixth Entry", (short) 0, nPos++);
+ xPopupMenu.insertItem(nId++, "Close Dialog", (short) 0, nPos++);
+
+ xPopupMenu.enableItem((short) 2, false);
+ xPopupMenu.checkItem((short) 3, true);
+
xPopupMenu.addMenuListener(this);
}catch( Exception e ) {
throw new java.lang.RuntimeException("cannot happen...");
@@ -90,12 +94,12 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
public void addMenuBar(XTopWindow _xTopWindow, XMenuListener _xMenuListener){
try{
// create a menubar at the global MultiComponentFactory...
- Object oMenuBar = m_xMCF.createInstanceWithContext("stardiv.Toolkit.VCLXMenuBar", m_xContext);
+ Object oMenuBar = m_xMCF.createInstanceWithContext("com.sun.star.awt.MenuBar", m_xContext);
// add the menu items...
XMenuBar xMenuBar = UnoRuntime.queryInterface(XMenuBar.class, oMenuBar);
- xMenuBar.insertItem((short) 0, "~First MenuBar Item", com.sun.star.awt.MenuItemStyle.AUTOCHECK, (short) 0);
- xMenuBar.insertItem((short) 1, "~Second MenuBar Item", com.sun.star.awt.MenuItemStyle.AUTOCHECK, (short) 1);
- xMenuBar.setPopupMenu((short) 0, getPopupMenu());
+ xMenuBar.insertItem((short) 1, "~First MenuBar Item", com.sun.star.awt.MenuItemStyle.AUTOCHECK, (short) 0);
+ xMenuBar.insertItem((short) 2, "~Second MenuBar Item", com.sun.star.awt.MenuItemStyle.AUTOCHECK, (short) 1);
+ xMenuBar.setPopupMenu((short) 1, getPopupMenu());
xMenuBar.addMenuListener(_xMenuListener);
_xTopWindow.setMenuBar(xMenuBar);
}catch( Exception e ) {
@@ -154,31 +158,31 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
addMenuBar(xTopWindow, this);
}
- public void select(MenuEvent menuEvent){
+ public void itemSelected(MenuEvent menuEvent){
// find out which menu item has been triggered,
// by getting the menu-id...
switch (menuEvent.MenuId){
- case 0:
+ case 1:
// add your menu-item-specific code here:
break;
- case 1:
+ case 2:
// add your menu-item-specific code here:
break;
- case 7:
+ case 8:
closeDialog();
default:
//..
}
}
- public void highlight(MenuEvent menuEvent) {
+ public void itemHighlighted(MenuEvent menuEvent) {
int i = 0;
}
- public void deactivate(MenuEvent menuEvent) {
+ public void itemDeactivated(MenuEvent menuEvent) {
int i = 0; }
- public void activate(MenuEvent menuEvent) {
+ public void itemActivated(MenuEvent menuEvent) {
int i = 0;
}
diff --git a/odk/examples/DevelopersGuide/GUI/UnoMenu2.java b/odk/examples/DevelopersGuide/GUI/UnoMenu2.java
index 0edae17..ea53a99 100644
--- a/odk/examples/DevelopersGuide/GUI/UnoMenu2.java
+++ b/odk/examples/DevelopersGuide/GUI/UnoMenu2.java
@@ -95,9 +95,9 @@ public UnoMenu2(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
public void mousePressed(MouseEvent mouseEvent) {
if (mouseEvent.PopupTrigger){
- Rectangle aRectangle = new Rectangle(mouseEvent.X, mouseEvent.Y, 0, 0);
+ Rectangle aPos = new Rectangle(mouseEvent.X, mouseEvent.Y, 0, 0);
XControl xControl = UnoRuntime.queryInterface(XControl.class, mouseEvent.Source);
- getPopupMenu().execute( xControl.getPeer(), aRectangle, com.sun.star.awt.PopupMenuDirection.DEFAULT);
+ getPopupMenu().execute( xControl.getPeer(), aPos, com.sun.star.awt.PopupMenuDirection.EXECUTE_DEFAULT);
}
}
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 929fe9f..a96bcd4 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1746,7 +1746,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
MenuEvent \
MenuItemStyle \
MenuItemType \
- MenuLogo \
MessageBoxButtons \
MessageBoxCommand \
MouseButton \
@@ -1831,9 +1830,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
XListBox \
XMenu \
XMenuBar \
- XMenuBarExtended \
- XMenuExtended \
- XMenuExtended2 \
XMenuListener \
XMessageBox \
XMessageBoxFactory \
@@ -1847,7 +1843,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
XPatternField \
XPointer \
XPopupMenu \
- XPopupMenuExtended \
XPrinter \
XPrinterPropertySet \
XPrinterServer \
diff --git a/offapi/com/sun/star/awt/MenuBar.idl b/offapi/com/sun/star/awt/MenuBar.idl
index 791a5f8..ce28b1a 100644
--- a/offapi/com/sun/star/awt/MenuBar.idl
+++ b/offapi/com/sun/star/awt/MenuBar.idl
@@ -21,12 +21,9 @@
#include <com/sun/star/awt/XMenuBar.idl>
-
module com { module sun { module star { module awt {
-
/** describes a menu for top-level windows.
-
<p>A menu bar can only be used by top-level windows. They support
the interface com::sun::star::awt::XTopWindow
to set an menu bar object.
@@ -34,7 +31,6 @@ module com { module sun { module star { module awt {
*/
published service MenuBar : XMenuBar;
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/MenuEvent.idl b/offapi/com/sun/star/awt/MenuEvent.idl
index b1a2b43..1682024 100644
--- a/offapi/com/sun/star/awt/MenuEvent.idl
+++ b/offapi/com/sun/star/awt/MenuEvent.idl
@@ -21,23 +21,18 @@
#include <com/sun/star/lang/EventObject.idl>
-
-
- module com { module sun { module star { module awt {
-
+module com { module sun { module star { module awt {
/** specifies a menu event.
*/
published struct MenuEvent: com::sun::star::lang::EventObject
{
-
- /** contains the item id.
+ /** contains the item ID.
*/
short MenuId;
};
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/MenuItemStyle.idl b/offapi/com/sun/star/awt/MenuItemStyle.idl
index b0c6fef..194a732 100644
--- a/offapi/com/sun/star/awt/MenuItemStyle.idl
+++ b/offapi/com/sun/star/awt/MenuItemStyle.idl
@@ -19,36 +19,27 @@
#ifndef __com_sun_star_awt_MenuItemStyle_idl__
#define __com_sun_star_awt_MenuItemStyle_idl__
-
-
- module com { module sun { module star { module awt {
-
+module com { module sun { module star { module awt {
/** These values are used to specify the properties of a menu item.
-
- <p>They may be expanded in future versions.</p>
*/
-published constants MenuItemStyle
+constants MenuItemStyle
{
-
/** specifies an item which can be checked independently.
*/
const short CHECKABLE = 1;
-
- /** specifies an item which can be checked dependent on the neighboring
+ /** specifies an item which can be checked dependent on the neighbouring
items.
*/
const short RADIOCHECK = 2;
-
/** specifies to check this item automatically on select.
*/
const short AUTOCHECK = 4;
};
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/MenuItemType.idl b/offapi/com/sun/star/awt/MenuItemType.idl
index 714d34b..cd538a3 100644
--- a/offapi/com/sun/star/awt/MenuItemType.idl
+++ b/offapi/com/sun/star/awt/MenuItemType.idl
@@ -19,15 +19,12 @@
#ifndef __com_sun_star_awt_MenuItemType_idl__
#define __com_sun_star_awt_MenuItemType_idl__
-
-
- module com { module sun { module star { module awt {
-
+module com { module sun { module star { module awt {
/** specifies the type of a menu item, as returned by
- com::sun::star::awt::XMenuExtended2::getItemType().
+ com::sun::star::awt::XMenu::getItemType().
*/
-enum MenuItemType
+published enum MenuItemType
{
/** specifies that the menu item type is unknown.
*/
@@ -51,7 +48,6 @@ enum MenuItemType
};
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/MenuLogo.idl b/offapi/com/sun/star/awt/MenuLogo.idl
deleted file mode 100644
index 167f32f..0000000
--- a/offapi/com/sun/star/awt/MenuLogo.idl
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_awt_MenuLogo_idl__
-#define __com_sun_star_awt_MenuLogo_idl__
-
-#include <com/sun/star/graphic/XGraphic.idl>
-#include <com/sun/star/util/Color.idl>
-
-
- module com { module sun { module star { module awt {
-
-
-/** specifies a logo to be displayed on a menu, with a background gradient.
- */
-struct MenuLogo
-{
- /** specifies the logo image.
- */
- ::com::sun::star::graphic::XGraphic Graphic;
-
-
- /** specifies the color at the start point of the gradient.
- */
- ::com::sun::star::util::Color StartColor;
-
-
- /** specifies the color at the end point of the gradient.
- */
- ::com::sun::star::util::Color EndColor;
-
-};
-
-
-}; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/PopupMenu.idl b/offapi/com/sun/star/awt/PopupMenu.idl
index 3edce5f..5040da5 100644
--- a/offapi/com/sun/star/awt/PopupMenu.idl
+++ b/offapi/com/sun/star/awt/PopupMenu.idl
@@ -21,19 +21,15 @@
#include <com/sun/star/awt/XPopupMenu.idl>
-
module com { module sun { module star { module awt {
-
-/** describes a pop-up menu which is a recursive container for commands
-
- <p>A pop-up menu can be used as a standalone object to display a context
- menu. It's also possible to use a pop-up menu to integrate it into
+/** describes a popup menu which is a recursive container for commands
+ <p>A popup menu can be used as a standalone object to display a context
+ menu. It's also possible to use a popup menu to integrate it into
another menu.</p>
*/
published service PopupMenu : XPopupMenu;
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/PopupMenuDirection.idl b/offapi/com/sun/star/awt/PopupMenuDirection.idl
index 5ecb2e3..021ab5c 100644
--- a/offapi/com/sun/star/awt/PopupMenuDirection.idl
+++ b/offapi/com/sun/star/awt/PopupMenuDirection.idl
@@ -19,10 +19,7 @@
#ifndef __com_sun_star_awt_PopupMenuDirection_idl__
#define __com_sun_star_awt_PopupMenuDirection_idl__
-
-
- module com { module sun { module star { module awt {
-
+module com { module sun { module star { module awt {
/** These values are used to specify the direction in which
a pop-up menu will grow.
@@ -31,44 +28,27 @@
*/
published constants PopupMenuDirection
{
-
- /** @deprecated
- */
- const short DEFAULT = 0;
-
-
- /** @deprecated
- */
- const short DOWN = 1;
-
-
/** opens on execute in a default direction.
*/
const short EXECUTE_DEFAULT = 0;
-
/** opens on execute downwards.
*/
const short EXECUTE_DOWN = 1;
-
/** opens on execute upwards.
*/
const short EXECUTE_UP = 2;
-
/** opens on execute to the left.
*/
const short EXECUTE_LEFT = 4;
-
/** opens on execute to the right.
*/
const short EXECUTE_RIGHT = 8;
-
};
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/XMenu.idl b/offapi/com/sun/star/awt/XMenu.idl
index ba8fedc..6caa381 100644
--- a/offapi/com/sun/star/awt/XMenu.idl
+++ b/offapi/com/sun/star/awt/XMenu.idl
@@ -20,98 +20,278 @@
#define __com_sun_star_awt_XMenu_idl__
#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/awt/MenuItemType.idl>
+module com { module sun { module star { module awt {
-
- module com { module sun { module star { module awt {
-
- published interface XPopupMenu;
- published interface XMenuListener;
-
+published interface XPopupMenu;
+published interface XMenuListener;
/** specifies a simple menu.
*/
published interface XMenu: com::sun::star::uno::XInterface
{
-
/** adds the specified menu listener to receive events from this menu.
+
+ @param xListener
+ the XMenuListener to be added.
*/
void addMenuListener( [in] XMenuListener xListener );
-
/** removes the specified menu listener so that it no longer
receives events from this menu.
+
+ @param xListener
+ the XMenuListener to be removed.
*/
void removeMenuListener( [in] XMenuListener xListener );
-
/** inserts an item into the menu.
-
<p>The item is appended if the position is greater than or equal to
- <code>getItemCount()</code> or if it is negative.</p>
+ <member>getItemCount()</member> or if it is negative.</p>
+
+ @param nItemId
+ specifies the ID of the menu item to be insterted.
+
+ @param aText
+ specifies the label of the menu item.
+
+ @param nItemStyle
+ specifies the style of the menu item, as defined in
+ MenuItemStyle.
+
+ @param nItemPos
+ specifies the position where the menu item will be insterted.
*/
void insertItem( [in] short nItemId,
- [in] string aText,
- [in] short nItemStyle,
- [in] short nPos );
-
+ [in] string aText,
+ [in] short nItemStyle,
+ [in] short nItemPos );
/** removes one or more items from the menu.
+
+ @param nItemPos
+ specifies the position of the (first) menu item to be removed.
+
+ @param nCount
+ specifies the number of menu items to remove.
*/
- void removeItem( [in] short nPos,
- [in] short nCount );
+ void removeItem( [in] short nItemPos,
+ [in] short nCount );
+ /** removes all items from the menu.
+ */
+ void clear();
/** returns the number of items in the menu.
+
+ @return
+ the number of items in this XMenu.
*/
short getItemCount();
+ /** returns the ID of the item at the specified position.
- /** returns the id of the item at the specified position.
+ @param nItemPos
+ specifies the position of the menu item for which the item ID is queried.
+
+ @return
+ the ID of the menu item at the given position.
*/
- short getItemId( [in] short nPos );
+ short getItemId( [in] short nItemPos );
+
+ /** returns the position of the item with the specified ID.
+ @param nItemId
+ specifies the ID of the menu item for which the item position is queried.
- /** returns the position of the item with the specified id.
+ @return
+ the position of the menu item with the specified ID.
*/
- short getItemPos( [in] short nId );
+ short getItemPos( [in] short nItemId );
+ /** retrieves the type of the menu item.
+
+ @param nItemPos
+ specifies the position of the menu item for which the item type is queried.
+
+ @return
+ a MenuItemType indicating the item type.
+ */
+ ::com::sun::star::awt::MenuItemType getItemType( [in] short nItemPos );
/** enables or disables the menu item.
+
+ @param nItemId
+ specifies the menu item ID.
+
+ @param bEnable
+ specifies whether the menu item should be enabled (`TRUE`) or
+ disabled (`FALSE`).
*/
void enableItem( [in] short nItemId,
- [in] boolean bEnable );
-
+ [in] boolean bEnable );
/** returns the state of the menu item.
+
+ @param nItemId
+ specifies the menu item ID.
+
+ @return
+ `TRUE` if the item is enabled, `FALSE` otherwise.
*/
boolean isItemEnabled( [in] short nItemId );
+ /** specifies whether disabled menu entries should be hidden, or not.
+
+ @param bHide
+ if `TRUE`, disabled menu entries are hidden.
+ */
+ void hideDisabledEntries( [in] boolean bHide );
+
+ /** specifies whether mnemonics are automatically assigned to menu items, or not.
+
+ @param bEnable
+ if `TRUE`, mnemonics are automatically assigned to menu items.
+ */
+ void enableAutoMnemonics( [in] boolean bEnable );
/** sets the text for the menu item.
+
+ @param nItemId
+ specifies the ID of the menu item.
+
+ @param aText
+ specifies the label of the menu item.
*/
void setItemText( [in] short nItemId,
- [in] string aText );
-
+ [in] string aText );
/** returns the string for the given item id.
+
+ @param nItemId
+ specifies the ID of the menu item.
+
+ @return
+ the label of the menu item.
*/
string getItemText( [in] short nItemId );
+ /** sets the command string for the menu item.
+
+ @param nItemId
+ specifies the menu item ID for which the command should be set.
+
+ @param aCommand
+ specifies the command for the menu item.
+ */
+ void setCommand( [in] short nItemId,
+ [in] string aCommand );
+
+ /** retrieves the command string for the menu item.
+
+ @param nItemId
+ specifies the menu item ID for which the command URL should be set.
+
+ @return
+ the command of the menu item.
+ */
+ string getCommand( [in] short nItemId );
+
+ /** sets the help command string for the menu item.
+
+ @param nItemId
+ specifies the menu item ID for which the help command URL be set.
+
+ @param aCommand
+ specifies the help command for the menu item.
+ */
+ void setHelpCommand( [in] short nItemId,
+ [in] string aCommand );
+
+ /** retrieves the help command string for the menu item.
+
+ @param nItemId
+ specifies the menu item ID for which the help command should be set.
+
+ @return
+ the help command of the menu item.
+ */
+ string getHelpCommand( [in] short nItemId );
+
+ /** sets the help text for the menu item.
+
+ @param nItemId
+ specifies the menu item identifier for which the help text should be set.
- /** sets the pop-up menu for a specified menu item.
+ @param sHelpText
+ specifies the help text for the menu item.
+ */
+ void setHelpText( [in] short nItemId,
+ [in] string sHelpText );
+
+ /** retrieves the help text for the menu item.
+
+ @param nItemId
+ specifies the menu item identifier for which the help text should be retrieved.
+
+ @return
+ a string with the help text.
+ */
+ string getHelpText( [in] short nItemId );
+
+ /** sets the tip help text for the menu item.
+
+ @param nItemId
+ specifies the menu item identifier for which the tip help text should be set.
+
+ @param sTipHelpText
+ specifies the tip help text for the menu item.
+ */
+ void setTipHelpText( [in] short nItemId,
+ [in] string sTipHelpText );
+
+ /** retrieves the tip help text for the menu item.
+
+ @param nItemId
+ specifies the menu item identifier for which the tip help text should be retrieved.
+
+ @return
+ a string with the tip help text.
+ */
+ string getTipHelpText( [in] short nItemId );
+
+ /** checks whether an XMenu is an XPopupMenu.
+
+ @return
+ `TRUE` if the menu is a PopupMenu,
+ `FALSE` if it is a MenuBar.
+ */
+ boolean isPopupMenu();
+
+ /** sets the popup menu for a specified menu item.
+
+ @param nItemId
+ specifies the menu item ID for which the XPopupMenu should be set.
+
+ @param aPopupMenu
+ specifies a XPopupMenu.
*/
void setPopupMenu( [in] short nItemId,
- [in] XPopupMenu aPopupMenu );
+ [in] XPopupMenu aPopupMenu );
+ /** returns the popup menu from the menu item.
- /** returns the pop-up menu from the menu item.
+ @param nItemId
+ specifies the menu item ID for which the XPopupMenu should be retrieved.
+
+ @return
+ a XPopupMenu.
*/
XPopupMenu getPopupMenu( [in] short nItemId );
};
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/XMenuBar.idl b/offapi/com/sun/star/awt/XMenuBar.idl
index f0d9c17..0bd07d9 100644
--- a/offapi/com/sun/star/awt/XMenuBar.idl
+++ b/offapi/com/sun/star/awt/XMenuBar.idl
@@ -21,18 +21,14 @@
#include <com/sun/star/awt/XMenu.idl>
-
-
- module com { module sun { module star { module awt {
-
+module com { module sun { module star { module awt {
/** identifies a menu bar.
*/
-published interface XMenuBar: com::sun::star::awt::XMenu
+published interface XMenuBar: XMenu
{
};
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/XMenuBarExtended.idl b/offapi/com/sun/star/awt/XMenuBarExtended.idl
deleted file mode 100644
index 9e2bde6..0000000
--- a/offapi/com/sun/star/awt/XMenuBarExtended.idl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_awt_XMenuBarExtended_idl__
-#define __com_sun_star_awt_XMenuBarExtended_idl__
-
-#include <com/sun/star/awt/XMenuBar.idl>
-#include <com/sun/star/awt/XMenuExtended2.idl>
-#include <com/sun/star/graphic/XGraphic.idl>
-#include <com/sun/star/awt/Rectangle.idl>
-
-
- module com { module sun { module star { module awt {
-
- interface XMenuBarButtonListener;
-
-
-/** multiple-inheritance interface designed to ease the use of all functions
- available for a com::sun::star::awt::MenuBar.
-
- @since OOo 3.1
- */
- interface XMenuBarExtended
-{
- interface com::sun::star::awt::XMenuExtended2;
- interface com::sun::star::awt::XMenuBar;
-};
-
-
-}; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XMenuExtended.idl b/offapi/com/sun/star/awt/XMenuExtended.idl
deleted file mode 100644
index f5d2703..0000000
--- a/offapi/com/sun/star/awt/XMenuExtended.idl
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_awt_XMenuExtended_idl__
-#define __com_sun_star_awt_XMenuExtended_idl__
-
-#include <com/sun/star/uno/XInterface.idl>
-
-
-module com { module sun { module star { module awt {
-
-/** specifies extended menu functions.
- */
-
-interface XMenuExtended: com::sun::star::uno::XInterface
-{
- /** sets the command string for the menu item.
-
- @param nItemId
- specifies the menu item ID for which the command should be set.
-
- @param aCommand
- specifies the command for the menu item.
- */
- void setCommand( [in] short nItemId, [in] string aCommand );
-
- /** retrieves the command string for the menu item.
-
- @param nItemId
- specifies the menu item ID for which the command URL should be set.
- */
- string getCommand( [in] short nItemId );
-
- /** sets the help command string for the menu item.
-
- @param nItemId
- specifies the menu item ID for which the help command URL be set.
-
- @param HelpCommand
- specifies the help command for the menu item.
- */
- void setHelpCommand( [in] short nItemId, [in] string HelpCommand );
-
- /** retrieves the help command string for the menu item.
-
- @param nItemId
- specifies the menu item ID for which the help command should be set.
- */
- string getHelpCommand( [in] short nItemId );
-};
-
-}; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XMenuExtended2.idl b/offapi/com/sun/star/awt/XMenuExtended2.idl
deleted file mode 100644
index 4a0cd6b..0000000
--- a/offapi/com/sun/star/awt/XMenuExtended2.idl
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_awt_XMenuExtended2_idl__
-#define __com_sun_star_awt_XMenuExtended2_idl__
-
-#include <com/sun/star/awt/XMenu.idl>
-#include <com/sun/star/awt/XMenuExtended.idl>
-#include <com/sun/star/awt/MenuItemType.idl>
-#include <com/sun/star/container/NoSuchElementException.idl>
-
-
-module com { module sun { module star { module awt {
-
-/** specifies extended menu functions.
- */
-
-interface XMenuExtended2
-{
- /** specifies some extended menu functions, like setting a command URL and a help command for a menu item.<br>
- These functions are available for both menu bar and pop-up menu.
- */
- interface com::sun::star::awt::XMenuExtended;
-
- /** specifies basic menu functions.
- */
- interface com::sun::star::awt::XMenu;
-
-
-
- /** checks whether an XMenu is an XPopupMenu.
-
- @return
- `TRUE` if the menu is a PopupMenu, `FALSE` if it is a MenuBar.
- */
- boolean isPopupMenu();
-
- //.........................................................................
-
- /** removes all items from the menu.
- */
- void clear();
-
- //.........................................................................
-
- /** retrieves the type of the menu item.
-
- @param nItemPos
- specifies the position of the menu item for which the item type is queried.
-
- @throws com::sun::star::container::NoSuchElementException
- if there is no menu item in the position specified in <var>nItemPos</var>.
-
- @see MenuItemType
- */
- ::com::sun::star::awt::MenuItemType getItemType( [in] short nItemPos )
- raises ( ::com::sun::star::container::NoSuchElementException );
-
- //.........................................................................
-
- /** specifies whether disabled menu entries should be hidden, or not.
-
- @param bHide
- if `TRUE`, disabled menu entries are hidden.
-
- @see
- com::sun::star::awt::XMenu::enableItem()
- */
- void hideDisabledEntries( [in] boolean bHide );
-
-
-};
-
-}; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XMenuListener.idl b/offapi/com/sun/star/awt/XMenuListener.idl
index 1a6f9a0..ea9fc8b 100644
--- a/offapi/com/sun/star/awt/XMenuListener.idl
+++ b/offapi/com/sun/star/awt/XMenuListener.idl
@@ -20,41 +20,32 @@
#define __com_sun_star_awt_XMenuListener_idl__
#include <com/sun/star/lang/XEventListener.idl>
-
#include <com/sun/star/awt/MenuEvent.idl>
-
-
- module com { module sun { module star { module awt {
-
+module com { module sun { module star { module awt {
/** makes it possible to receive menu events on a window.
*/
published interface XMenuListener: com::sun::star::lang::XEventListener
{
-
/** is invoked when a menu item is highlighted.
*/
- void highlight( [in] com::sun::star::awt::MenuEvent rEvent );
-
+ void itemHighlighted( [in] MenuEvent aEvent );
/** is invoked when a menu item is selected.
*/
- void select( [in] com::sun::star::awt::MenuEvent rEvent );
-
+ void itemSelected( [in] MenuEvent aEvent );
/** is invoked when a menu is activated.
*/
- void activate( [in] com::sun::star::awt::MenuEvent rEvent );
-
+ void itemActivated( [in] MenuEvent aEvent );
/** is invoked when a menu is deactivated.
*/
- void deactivate( [in] com::sun::star::awt::MenuEvent rEvent );
+ void itemDeactivated( [in] MenuEvent aEvent );
};
-
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/awt/XPopupMenu.idl b/offapi/com/sun/star/awt/XPopupMenu.idl
index 1e0ef33..e39a1f2 100644
--- a/offapi/com/sun/star/awt/XPopupMenu.idl
+++ b/offapi/com/sun/star/awt/XPopupMenu.idl
@@ -19,56 +19,167 @@
#ifndef __com_sun_star_awt_XPopupMenu_idl__
#define __com_sun_star_awt_XPopupMenu_idl__
-#include <com/sun/star/awt/XMenu.idl>
-
+#include <com/sun/star/awt/KeyEvent.idl>
#include <com/sun/star/awt/Rectangle.idl>
+#include <com/sun/star/awt/XMenu.idl>
+#include <com/sun/star/graphic/XGraphic.idl>
+#include <com/sun/star/awt/XMenu.idl>
- module com { module sun { module star { module awt {
+#include <com/sun/star/awt/Rectangle.idl>
- published interface XWindowPeer;
+module com { module sun { module star { module awt {
+published interface XWindowPeer;
/** controls a pop-up menu.
*/
published interface XPopupMenu: XMenu
{
-
/** inserts a separator at the specified position.
- */
- void insertSeparator( [in] short nPos );
+ @param nItemPos
+ specifies the position where the menu separator will be insterted.
+ */
+ void insertSeparator( [in] short nItemPos );
/** sets the menu default item.
+
+ @param nItemId
+ specifies the menu item identifier.
*/
void setDefaultItem( [in] short nItemId );
-
/** returns the menu default item.
+
+ @return
+ the ID of the default item.
*/
short getDefaultItem();
-
/** sets the state of the item to be checked or unchecked.
+
+ @param nItemId
+ specifies the menu item identifier.
+
+ @param bCheck
+ specifies if the item is checked (`TRUE`) or unchecked (`FALSE`).
*/
void checkItem( [in] short nItemId,
- [in] boolean bCheck );
-
+ [in] boolean bCheck );
/** returns whether the item is checked or unchecked.
+
+ @param nItemId
+ specifies the menu item identifier.
+
+ @return
+ `TRUE` if the item is checked, `FALSE` otherwise.
*/
boolean isItemChecked( [in] short nItemId );
+ /** executes the popup menu and returns the selected item
+ or <code>0</code>, if cancelled.
+
+ @param Parent
+ the parent window.
+
+ @param Position
+ a <type>Rectangle</type> representing the coordinates system
+ where the popup menu should be executed.
- /** executes the pop-up menu and returns the selected item
- or <code>0</code>, if canceled.
+ @param Direction
+ the direction in which a popup menu will grow, as specified
+ by one of the PopupMenuDirection constants.
+
+ @return
+ returns the selected item or <code>0</code>, if cancelled.
*/
short execute( [in] XWindowPeer Parent,
- [in] Rectangle Area,
- [in] short Direction );
+ [in] Rectangle Position,
+ [in] short Direction );
-};
+ /** queries if the PopupMenu is being.
+ <p>Returns `TRUE` only if the PopupMenu is being executed
+ as a result of invoking <member >XPopupMenu::execute()</member>; that is,
+ for a PopupMenu activated by a MenuBar item,
+ this methods returns `FALSE`.</p>
+
+ @return
+ `TRUE` if the PopupMenu is being executed,
+ `FALSE` otherwise.
+
+ @see <member >XPopupMenu::execute()</member>
+ */
+ boolean isInExecute();
+
+ /** ends the execution of the PopupMenu.
+ <p><member scope="com::sun::star::awt">XPopupMenu::execute()</member>
+ will then return 0.</p>
+
+ @see <member scope="com::sun::star::awt">XPopupMenu::execute()</member>
+ */
+ void endExecute();
+
+ /** sets the KeyEvent for the menu item.
+
+ <p>The KeyEvent is <b>only</b> used as a container to transport
+ the shortcut information, this methods only draws the text corresponding to
+ this keyboard shortcut. The client code is responsible for listening to
+ keyboard events (typicaly done via XUserInputInterception),
+ and dispatch the respective command.</p>
+
+ @param nItemId
+ specifies the menu item identifier for which the KeyEvent should be set.
+
+ @param aKeyEvent
+ specifies the KeyEvent for the menu item.
+ */
+ void setAcceleratorKeyEvent( [in] short nItemId,
+ [in] KeyEvent aKeyEvent );
+
+ /** retrieves the KeyEvent for the menu item.
+
+ <p>The KeyEvent is <b>only</b> used as a container to transport
+ the shortcut information, so that in this case
+ <member scope="::com::sun::star::lang::">EventObject::Source</member> is <NULL/>.</p>
+
+ @param nItemId
+ specifies the menu item identifier for which the KeyEvent should be retrieved.
+
+ @return
+ the KeyEvent struct assigned to the requested menu item.
+ */
+ KeyEvent getAcceleratorKeyEvent( [in] short nItemId );
+
+ /** sets the image for the menu item.
+
+ @param nItemId
+ specifies the menu item identifier for which the image should be set.
+
+ @param xGraphic
+ specifies the image for the menu item.
+
+ @param bScale
+ if `TRUE`, the image will be scaled to the standard size used internally by
+ the implementation.
+ */
+ void setItemImage( [in] short nItemId,
+ [in] ::com::sun::star::graphic::XGraphic xGraphic,
+ [in] boolean bScale );
+
+ /** retrieves the image for the menu item.
+
+ @param nItemId
+ specifies the menu item identifier for which the image should be retrieved.
+
+ @return
+ a XGraphic reference to the current image for the requested menu item.
+ */
+ ::com::sun::star::graphic::XGraphic getItemImage( [in] short nItemId );
+
+};
}; }; }; };
diff --git a/offapi/com/sun/star/awt/XPopupMenuExtended.idl b/offapi/com/sun/star/awt/XPopupMenuExtended.idl
deleted file mode 100644
index 4508b59..0000000
--- a/offapi/com/sun/star/awt/XPopupMenuExtended.idl
+++ /dev/null
@@ -1,327 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_awt_XPopupMenuExtended_idl__
-#define __com_sun_star_awt_XPopupMenuExtended_idl__
-
-#include <com/sun/star/uno/XInterface.idl>
-#include <com/sun/star/awt/XPopupMenu.idl>
-#include <com/sun/star/awt/XMenuExtended2.idl>
-#include <com/sun/star/awt/MenuLogo.idl>
-#include <com/sun/star/container/NoSuchElementException.idl>
-#include <com/sun/star/awt/KeyEvent.idl>
-#include <com/sun/star/graphic/XGraphic.idl>
-
-
-module com { module sun { module star { module awt {
-
-/** specifies extended functions for a com::sun::star::awt::PopupMenu.
-
- @since OOo 3.1
- */
-interface XPopupMenuExtended
-{
- /** specifies basic functions for a pop-up menu.
- */
- interface ::com::sun::star::awt::XPopupMenu;
-
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list