diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-18 11:40:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-18 11:45:40 +0100 |
commit | d0b1f66aa76f1f74fcb6327776daed450530bef4 (patch) | |
tree | cccced2ec622cc99cd9aed310da36a080c6305f0 /dbaccess/source | |
parent | AutoText: loading dotx documents (diff) | |
download | core-d0b1f66aa76f1f74fcb6327776daed450530bef4.tar.gz core-d0b1f66aa76f1f74fcb6327776daed450530bef4.zip |
convert query functions menu to .ui
Change-Id: Iba4fc93d6042d873c45c58f11b7b54638ed54d82
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/inc/browserids.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 51 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/query.src | 39 |
4 files changed, 28 insertions, 70 deletions
diff --git a/dbaccess/source/ui/inc/browserids.hxx b/dbaccess/source/ui/inc/browserids.hxx index 1777d619d009..fbb74328d3f5 100644 --- a/dbaccess/source/ui/inc/browserids.hxx +++ b/dbaccess/source/ui/inc/browserids.hxx @@ -95,10 +95,6 @@ #define ID_BROWSER_CLOSE SID_CLOSEWIN #define ID_BROWSER_ESCAPEPROCESSING SID_FM_NATIVESQL -#define ID_QUERY_FUNCTION (SID_SBA_START + 41) // show functions -#define ID_QUERY_TABLENAME (SID_SBA_START + 42) // show table name -#define ID_QUERY_ALIASNAME (SID_SBA_START + 43) // show alias name -#define ID_QUERY_DISTINCT (SID_SBA_START + 44) // show distinct #define ID_BROWSER_INSERT_ROW (SID_SBA_START + 46) // insert row #define ID_QUERY_ZOOM_IN SID_ZOOM_IN #define ID_QUERY_ZOOM_OUT SID_ZOOM_OUT diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 563eb9a88b71..0160b47aa680 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -121,10 +121,6 @@ // free #define FORMFOLDER_TREE_ICON RID_IMAGE_START + 55 -// menus - -#define RID_QUERYFUNCTION_POPUPMENU RID_MENU_START + 6 - // strings #define STR_TBL_TITLE RID_STR_GEN_START #define STR_ERROR_DURING_CREATION RID_STR_GEN_START + 1 diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 308f238f8f4e..8c37af77531f 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -1953,31 +1953,36 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) { if (!static_cast<OQueryController&>(getDesignView()->getController()).isReadOnly()) { - ScopedVclPtrInstance<PopupMenu> aContextMenu(ModuleRes(RID_QUERYFUNCTION_POPUPMENU)); - aContextMenu->CheckItem( ID_QUERY_FUNCTION, m_bVisibleRow[BROW_FUNCTION_ROW]); - aContextMenu->CheckItem( ID_QUERY_TABLENAME, m_bVisibleRow[BROW_TABLE_ROW]); - aContextMenu->CheckItem( ID_QUERY_ALIASNAME, m_bVisibleRow[BROW_COLUMNALIAS_ROW]); - aContextMenu->CheckItem( ID_QUERY_DISTINCT, static_cast<OQueryController&>(getDesignView()->getController()).isDistinct()); + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/queryfuncmenu.ui", ""); + VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); + aContextMenu->CheckItem(aContextMenu->GetItemId("functions"), m_bVisibleRow[BROW_FUNCTION_ROW]); + aContextMenu->CheckItem(aContextMenu->GetItemId("tablename"), m_bVisibleRow[BROW_TABLE_ROW]); + aContextMenu->CheckItem(aContextMenu->GetItemId("alias"), m_bVisibleRow[BROW_COLUMNALIAS_ROW]); + aContextMenu->CheckItem(aContextMenu->GetItemId("distinct"), static_cast<OQueryController&>(getDesignView()->getController()).isDistinct()); + + aContextMenu->Execute(this, aMenuPos); - switch (aContextMenu->Execute(this, aMenuPos)) + OString sIdent = aContextMenu->GetCurItemIdent(); + if (sIdent == "functions") + { + SetRowVisible(BROW_FUNCTION_ROW, !IsRowVisible(BROW_FUNCTION_ROW)); + static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_VIEW_FUNCTIONS ); + } + else if (sIdent == "tablename") + { + SetRowVisible(BROW_TABLE_ROW, !IsRowVisible(BROW_TABLE_ROW)); + static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_VIEW_TABLES ); + } + else if (sIdent == "alias") + { + SetRowVisible(BROW_COLUMNALIAS_ROW, !IsRowVisible(BROW_COLUMNALIAS_ROW)); + static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_VIEW_ALIASES ); + } + else if (sIdent == "distinct") { - case ID_QUERY_FUNCTION: - SetRowVisible(BROW_FUNCTION_ROW, !IsRowVisible(BROW_FUNCTION_ROW)); - static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_VIEW_FUNCTIONS ); - break; - case ID_QUERY_TABLENAME: - SetRowVisible(BROW_TABLE_ROW, !IsRowVisible(BROW_TABLE_ROW)); - static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_VIEW_TABLES ); - break; - case ID_QUERY_ALIASNAME: - SetRowVisible(BROW_COLUMNALIAS_ROW, !IsRowVisible(BROW_COLUMNALIAS_ROW)); - static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_VIEW_ALIASES ); - break; - case ID_QUERY_DISTINCT: - static_cast<OQueryController&>(getDesignView()->getController()).setDistinct(!static_cast<OQueryController&>(getDesignView()->getController()).isDistinct()); - static_cast<OQueryController&>(getDesignView()->getController()).setModified( true ); - static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_DISTINCT_VALUES ); - break; + static_cast<OQueryController&>(getDesignView()->getController()).setDistinct(!static_cast<OQueryController&>(getDesignView()->getController()).isDistinct()); + static_cast<OQueryController&>(getDesignView()->getController()).setModified( true ); + static_cast<OQueryController&>(getDesignView()->getController()).InvalidateFeature( SID_QUERY_DISTINCT_VALUES ); } static_cast<OQueryController&>(getDesignView()->getController()).setModified( true ); diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src index 4914830cebf6..d96f0c3632e7 100644 --- a/dbaccess/source/ui/querydesign/query.src +++ b/dbaccess/source/ui/querydesign/query.src @@ -104,45 +104,6 @@ String STR_QRY_ORDERBY_UNRELATED Text [ en-US ] = "The database only supports sorting for visible fields."; }; -Menu RID_QUERYFUNCTION_POPUPMENU -{ - ItemList = - { - MenuItem - { - Identifier = ID_QUERY_FUNCTION ; - HelpID = HID_QUERY_FUNCTION; - Text [ en-US ] = "Functions"; - }; - MenuItem - { - Separator = TRUE ; - }; - MenuItem - { - Identifier = ID_QUERY_TABLENAME ; - HelpID = HID_QUERY_TABLENAME ; - Text [ en-US ] = "Table Name"; - }; - MenuItem - { - Identifier = ID_QUERY_ALIASNAME ; - HelpID = HID_QUERY_ALIASNAME ; - Text [ en-US ] = "Alias"; - }; - MenuItem - { - Separator = TRUE; - }; - MenuItem - { - Identifier = ID_QUERY_DISTINCT ; - HelpID = HID_QUERY_DISTINCT ; - Text [ en-US ] = "Distinct Values"; - }; - }; -}; - String STR_QUERY_HANDLETEXT { Text [ en-US ] = "Field;Alias;Table;Sort;Visible;Function;Criterion;Or;Or"; |