diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-07 11:02:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-07 18:36:59 +0100 |
commit | 3e1977abc648a0b30be7af3c10060938de1b143f (patch) | |
tree | f4972e7f58139c08dad0339d1cc5071e524a659a /dbaccess | |
parent | 132307c089936ba39468a7957577866ab59904fc (diff) |
convert RID_QUERYCOLPOPUPMENU to .ui format
Change-Id: Idcf8566db964c475a0b9049f215af6fc57f0978b
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/UIConfig_dbaccess.mk | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 18 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/query.src | 23 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 13 | ||||
-rw-r--r-- | dbaccess/uiconfig/ui/querycolmenu.ui | 31 |
6 files changed, 44 insertions, 43 deletions
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk index c62fb19ff4be..e6a2a8fe5f14 100644 --- a/dbaccess/UIConfig_dbaccess.mk +++ b/dbaccess/UIConfig_dbaccess.mk @@ -51,6 +51,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \ dbaccess/uiconfig/ui/parametersdialog \ dbaccess/uiconfig/ui/password \ dbaccess/uiconfig/ui/preparepage \ + dbaccess/uiconfig/ui/querycolmenu \ dbaccess/uiconfig/ui/queryfilterdialog \ dbaccess/uiconfig/ui/querypropertiesdialog \ dbaccess/uiconfig/ui/relationdialog \ diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 0121edb0a3ef..574042ef9616 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -123,7 +123,6 @@ // menus -#define RID_QUERYCOLPOPUPMENU RID_MENU_START + 5 #define RID_QUERYFUNCTION_POPUPMENU RID_MENU_START + 6 #define RID_TABLEDESIGNROWPOPUPMENU RID_MENU_START + 7 #define RID_SBA_RTF_PKEYPOPUP RID_MENU_START + 9 diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 496ced84a687..308f238f8f4e 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -1940,17 +1940,13 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) if (!static_cast<OQueryController&>(getDesignView()->getController()).isReadOnly()) { - ScopedVclPtrInstance<PopupMenu> aContextMenu( ModuleRes( RID_QUERYCOLPOPUPMENU ) ); - switch (aContextMenu->Execute(this, aMenuPos)) - { - case SID_DELETE: - RemoveField(nColId); - break; - - case ID_BROWSER_COLWIDTH: - adjustBrowseBoxColumnWidth( this, nColId ); - break; - } + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/querycolmenu.ui", ""); + VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); + sal_uInt16 nItemId = aContextMenu->Execute(this, aMenuPos); + if (nItemId == aContextMenu->GetItemId("delete")) + RemoveField(nColId); + else if (nItemId == aContextMenu->GetItemId("width")) + adjustBrowseBoxColumnWidth( this, nColId ); } } else if(nRow >= 0 && nColId <= HANDLE_ID) diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src index 7530f5d0948f..f84fce531999 100644 --- a/dbaccess/source/ui/querydesign/query.src +++ b/dbaccess/source/ui/querydesign/query.src @@ -53,29 +53,6 @@ Menu RID_MENU_JOINVIEW_TABLE }; }; -Menu RID_QUERYCOLPOPUPMENU -{ - ItemList = - { - MenuItem - { - Identifier = ID_BROWSER_COLWIDTH ; - HelpID = HID_BROWSER_COLUMNWIDTH ; - Text [ en-US ] = "Column ~Width..." ; - }; - MenuItem - { - Separator = TRUE ; - }; - MenuItem - { - Identifier = SID_DELETE ; - Command = ".uno:Delete" ; - Text [ en-US ] = "~Delete" ; - }; - }; -}; - Bitmap BMP_PRIMARY_KEY { File = "jo01.png"; diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index d62b5cbd844c..5a5b7bd87bdf 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -1361,15 +1361,12 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt) if ( !IsColumnSelected( nColId ) ) SelectColumnId( nColId ); - ScopedVclPtrInstance<PopupMenu> aContextMenu( ModuleRes( RID_QUERYCOLPOPUPMENU ) ); - aContextMenu->EnableItem( SID_DELETE, false ); + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/querycolmenu.ui", ""); + VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); + aContextMenu->EnableItem(aContextMenu->GetItemId("delete"), false); aContextMenu->RemoveDisabledEntries(true, true); - switch ( aContextMenu->Execute( this, aMenuPos ) ) - { - case ID_BROWSER_COLWIDTH: - adjustBrowseBoxColumnWidth( this, nColId ); - break; - } + if (aContextMenu->Execute(this, aMenuPos) == aContextMenu->GetItemId("width")) + adjustBrowseBoxColumnWidth( this, nColId ); } } } diff --git a/dbaccess/uiconfig/ui/querycolmenu.ui b/dbaccess/uiconfig/ui/querycolmenu.ui new file mode 100644 index 000000000000..8044db9e1d95 --- /dev/null +++ b/dbaccess/uiconfig/ui/querycolmenu.ui @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.20.0 --> +<interface> + <requires lib="gtk+" version="3.10"/> + <object class="GtkMenu" id="menu"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkMenuItem" id="width"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Column _Width...</property> + <property name="use_underline">True</property> + </object> + </child> + <child> + <object class="GtkSeparatorMenuItem" id="menuitem1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="delete"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_Delete</property> + <property name="use_underline">True</property> + </object> + </child> + </object> +</interface> |