diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-02-06 06:45:42 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-02-06 06:45:42 +0000 |
commit | 332420922c4d52cac86ab429c2058e291a59920e (patch) | |
tree | e18ee53a75197f56d4469bbe55df096e1cc23484 /dbaccess/source/ui | |
parent | cbd12ea25d17dc56db55e828bd54e4bae315cee1 (diff) |
#90580# introduce new file for relation control
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/querydesign/query.src | 331 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querydlg.cxx | 240 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querydlg.hrc | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querydlg.hxx | 78 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querydlg.src | 269 |
5 files changed, 448 insertions, 480 deletions
diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src index 52b478a31539..8325f42c8064 100644 --- a/dbaccess/source/ui/querydesign/query.src +++ b/dbaccess/source/ui/querydesign/query.src @@ -2,9 +2,9 @@ * * $RCSfile: query.src,v $ * - * $Revision: 1.49 $ + * $Revision: 1.50 $ * - * last change: $Author: obo $ $Date: 2001-12-14 16:40:53 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:45:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,7 @@ #define MN_EDIT 20 #define MN_VIEW 21 #define MN_EXTRA 22 +#define MN_INSERT 23 #define MN_WIN 30 #define MN_HELP 31 @@ -94,6 +95,10 @@ Menu RID_QUERYCOLPOPUPMENU { ITEM_EDIT_DELETE }; + MenuItem + { + MID_DBUI_QUERY_EDIT_JOINCONNECTION + }; }; }; ImageList IMG_JOINS @@ -1173,30 +1178,7 @@ ToolBox RID_BRW_QUERYDESIGN_TOOLBOX { ToolBoxItem { - Identifier = ID_BROWSER_QUERY_EXECUTE; - HelpId = SID_FM_EXECUTE ; - Text = "Ausfhren" ; - Text [ ENGLISH ] = "Execute" ; - Text[ english_us ] = "Run"; - Text[ portuguese ] = "Executar"; - Text[ russian ] = ""; - Text[ greek ] = ""; - Text[ dutch ] = "Voltooien"; - Text[ french ] = "Excuter"; - Text[ spanish ] = "Ejecutar"; - Text[ italian ] = "Esegui"; - Text[ danish ] = "Execute"; - Text[ swedish ] = "Utfr"; - Text[ polish ] = "Wykonaj"; - Text[ portuguese_brazilian ] = "Execute"; - Text[ japanese ] = "実行"; - Text[ korean ] = "실행"; - Text[ chinese_simplified ] = "执行"; - Text[ chinese_traditional ] = "執行"; - Text[ turkish ] = "Execute"; - Text[ arabic ] = ""; - Text[ finnish ] = "Suorita"; - Text[ catalan ] = "Executa"; + MID_DBUI_QUERY_EXECUTE }; ToolBoxItem @@ -1205,84 +1187,15 @@ ToolBox RID_BRW_QUERYDESIGN_TOOLBOX }; ToolBoxItem { - Identifier = ID_BROWSER_CLEAR_QUERY; - HelpId = SID_SBA_CLEAR_QUERY ; - Text = "Abfrage lschen" ; - Text [ ENGLISH ] = "Clear query" ; - Text[ english_us ] = "Clear Query"; - Text[ portuguese ] = "Eliminar consulta"; - Text[ russian ] = " "; - Text[ greek ] = " "; - Text[ dutch ] = "Query wissen"; - Text[ french ] = "Supprimer la requte"; - Text[ spanish ] = "Eliminar consulta"; - Text[ italian ] = "Elimina ricerca"; - Text[ danish ] = "Clear query"; - Text[ swedish ] = "Radera skning"; - Text[ polish ] = "Usu kwerendy"; - Text[ portuguese_brazilian ] = "Clear query"; - Text[ japanese ] = "クエリーの削除"; - Text[ korean ] = "질의 삭제"; - Text[ chinese_simplified ] = "删除查询"; - Text[ chinese_traditional ] = "清除查詢"; - Text[ turkish ] = "Clear query"; - Text[ arabic ] = " "; - Text[ finnish ] = "Tyhjenn kysely"; - Text[ catalan ] = "Esborra la consulta"; + MID_DBUI_CLEAR_QUERY }; ToolBoxItem { - Identifier = ID_BROWSER_SQL; - HelpId = HID_QUERY_SQLMODE; - Text = "Design Ansicht an-, ausschalten" ; - Text [ ENGLISH ] = "Switch design view on/off" ; - Text[ english_us ] = "Switch Design View On/Off"; - Text[ portuguese ] = "Activar/desactivar modo Esboo"; - Text[ russian ] = "./. "; - Text[ greek ] = " /"; - Text[ dutch ] = "Ontwerpmodus in-/uitschakelen"; - Text[ french ] = "(Ds)activer le mode bauche"; - Text[ spanish ] = "Activar/desactivar vista diseo"; - Text[ italian ] = "Vista design on/off"; - Text[ danish ] = "Switch design view on/off"; - Text[ swedish ] = "Stt p/stng av designvy"; - Text[ polish ] = "Wcz / Wycz tryb projektu"; - Text[ portuguese_brazilian ] = "Switch design view on/off"; - Text[ japanese ] = "デザインビューの切り替え オン/オフ"; - Text[ korean ] = "디자인 보기 스위치 온/오프"; - Text[ chinese_simplified ] = "打开或关闭设计视图"; - Text[ chinese_traditional ] = "打開或關閉設計檢視"; - Text[ turkish ] = "Switch design view on/off"; - Text[ arabic ] = "/ "; - Text[ finnish ] = "Ota suunnittelunkym kyttn/pois kytst"; - Text[ catalan ] = "Activar/desactivar vista diseo"; + MID_BROWSER_SQL }; ToolBoxItem { - Identifier = ID_BROWSER_ADDTABLE; - HelpId = SID_FM_ADDTABLE ; - Text = "Tabellen hinzufgen..." ; - Text [ ENGLISH ] = "Add tables..." ; - Text[ english_us ] = "Add Tables..."; - Text[ portuguese ] = "Adicionar tabelas..."; - Text[ russian ] = " ..."; - Text[ greek ] = " "; - Text[ dutch ] = "Tabellen toevoegen"; - Text[ french ] = "Ajouter des tables..."; - Text[ spanish ] = "Aadir tablas"; - Text[ finnish ] = "Lis taulukoita"; - Text[ italian ] = "Aggiungi tabelle..."; - Text[ danish ] = "Add tables"; - Text[ swedish ] = "Lgg till tabeller..."; - Text[ polish ] = "Dodaj tabel..."; - Text[ portuguese_brazilian ] = "Add tables"; - Text[ japanese ] = "テーブルの追加..."; - Text[ korean ] = "시트 삽입"; - Text[ chinese_simplified ] = "新增表格..."; - Text[ chinese_traditional ] = "新增表格..."; - Text[ turkish ] = "Add tables"; - Text[ arabic ] = " "; - Text[ catalan ] = "Afegeix les taules"; + MID_DBUI_JOIN_ADD_TABLE }; ToolBoxItem { @@ -1290,150 +1203,23 @@ ToolBox RID_BRW_QUERYDESIGN_TOOLBOX }; ToolBoxItem { - Identifier = ID_BROWSER_ESACPEPROCESSING; - HelpId = SID_FM_NATIVESQL ; - Text = "SQL-Kommando direkt ausfhren" ; - Text [ ENGLISH ] = "Native SQL command" ; - Text[ english_us ] = "Run SQL command directly"; - Text[ portuguese ] = "Executar comando SQL directamente"; - Text[ russian ] = " SQL"; - Text[ greek ] = " SQL"; - Text[ dutch ] = "SQL-commando onmiddellijk uitvoeren"; - Text[ french ] = "Excuter directement l'instruction SQL"; - Text[ spanish ] = "Ejecutar directamente el comando SQL"; - Text[ italian ] = "Esegui direttamente comando SQL"; - Text[ danish ] = "Native sql command"; - Text[ swedish ] = "Utfr SQL-kommando direkt"; - Text[ polish ] = "Wykonaj bezporednio polecenie SQL"; - Text[ portuguese_brazilian ] = "Native sql command"; - Text[ japanese ] = "SQL コマンドを直接実行"; - Text[ korean ] = "SQL 명령 직접 실행"; - Text[ chinese_simplified ] = "直接执行SQL指令"; - Text[ chinese_traditional ] = "直接執行SQL指令"; - Text[ turkish ] = "Native sql command"; - Text[ arabic ] = " SQL "; - Text[ finnish ] = "Suorita SQL-komento suoraan"; - Text[ catalan ] = "Executa l'ordre SQL directament"; + MID_DBUI_BROWSER_ESACPEPROCESSING }; ToolBoxItem { - Identifier = ID_BROWSER_QUERY_VIEW_FUNCTIONS; - HelpId = SID_SBA_QUERY_VIEW_FUNCTIONS ; - Text = "Funktionen" ; - Text [ ENGLISH ] = "Functions" ; - Text[ english_us ] = "Functions"; - Text[ portuguese ] = "Funes"; - Text[ russian ] = ""; - Text[ dutch ] = "Functies"; - Text[ french ] = "Fonctions"; - Text[ spanish ] = "Funciones"; - Text[ italian ] = "Funzioni"; - Text[ danish ] = "Funktioner"; - Text[ swedish ] = "Funktioner"; - Text[ polish ] = "Funkcje"; - Text[ portuguese_brazilian ] = "Functions"; - Text[ japanese ] = "関数"; - Text[ chinese_simplified ] = "功能"; - Text[ chinese_traditional ] = "函數"; - Text[ dutch ] = "Functies"; - Text[ chinese_simplified ] = "功能"; - Text[ greek ] = ""; - Text[ korean ] = "기능"; - Text[ arabic ] = ""; - Text[ turkish ] = "levler"; - Text[ language_user1 ] = " "; - Text[ finnish ] = "Toiminnot"; - Text[ catalan ] = "Funcions"; + MID_DBUI_QUERY_VIEW_FUNCTIONS }; ToolBoxItem { - Identifier = ID_BROWSER_QUERY_VIEW_TABLES; - HelpId = SID_SBA_QUERY_VIEW_TABLES ; - Text = "Tabellenname" ; - Text [ ENGLISH ] = "Table name" ; - Text[ english_us ] = "Table Name"; - Text[ portuguese ] = "Nome da tabela"; - Text[ russian ] = " "; - Text[ dutch ] = "Tabelnaam"; - Text[ french ] = "Nom de la table"; - Text[ spanish ] = "Nombre de la tabla"; - Text[ italian ] = "Nome tabella"; - Text[ danish ] = "Tabelnavn"; - Text[ swedish ] = "Tabellnamn"; - Text[ polish ] = "Nazwa tabeli"; - Text[ portuguese_brazilian ] = "Table name"; - Text[ japanese ] = "テーブル名"; - Text[ chinese_simplified ] = "表格名称"; - Text[ chinese_traditional ] = "表格名稱"; - Text[ dutch ] = "Tabelnaam"; - Text[ chinese_simplified ] = "表格名称"; - Text[ greek ] = " "; - Text[ korean ] = "시트 이름"; - Text[ arabic ] = " "; - Text[ turkish ] = "Tablo ad"; - Text[ language_user1 ] = " "; - Text[ finnish ] = "Taulukon nimi"; - Text[ catalan ] = "Nom de la taula"; + MID_DBUI_QUERY_VIEW_TABLES }; ToolBoxItem { - Identifier = ID_BROWSER_QUERY_VIEW_ALIASES; - HelpId = SID_SBA_QUERY_VIEW_ALIASES ; - Text = "Aliasname" ; - Text [ ENGLISH ] = "Alias name" ; - Text[ english_us ] = "Alias"; - Text[ portuguese ] = "Alias"; - Text[ russian ] = ""; - Text[ dutch ] = "Aliasnaam"; - Text[ french ] = "Alias"; - Text[ spanish ] = "Alias"; - Text[ italian ] = "Alias"; - Text[ danish ] = "Aliasnavn"; - Text[ swedish ] = "Aliasnamn"; - Text[ polish ] = "Nazwa alias"; - Text[ portuguese_brazilian ] = "Alias name"; - Text[ japanese ] = "エイリアス名"; - Text[ chinese_simplified ] = "别名"; - Text[ chinese_traditional ] = "代用名"; - Text[ dutch ] = "Aliasnaam"; - Text[ chinese_simplified ] = "别名"; - Text[ greek ] = ""; - Text[ korean ] = "별칭 이름"; - Text[ arabic ] = " "; - Text[ turkish ] = "Dier ad"; - Text[ language_user1 ] = " "; - Text[ finnish ] = "Alias"; - Text[ catalan ] = "lies"; + MID_DBUI_QUERY_VIEW_ALIASES }; ToolBoxItem { - Identifier = ID_BROWSER_QUERY_DISTINCT_VALUES; - HelpId = SID_SBA_QUERY_DISTINCT_VALUES ; - Text = "Eindeutige Werte" ; - Text [ ENGLISH ] = "Distinct values" ; - Text[ english_us ] = "Distinct Values"; - Text[ portuguese ] = "Valores unvocos"; - Text[ russian ] = " "; - Text[ dutch ] = "Duidelijke waarden"; - Text[ french ] = "Valeurs distinctes"; - Text[ spanish ] = "Valores unvocos"; - Text[ italian ] = "Valori univoci"; - Text[ danish ] = "Entydige vrdier"; - Text[ swedish ] = "Entydiga vrden"; - Text[ polish ] = "Jednoznaczne wartoci"; - Text[ portuguese_brazilian ] = "Distinct values"; - Text[ japanese ] = "明瞭値"; - Text[ chinese_simplified ] = "明确的数值"; - Text[ chinese_traditional ] = "明確的數值"; - Text[ dutch ] = "Duidelijke waarden"; - Text[ chinese_simplified ] = "明确的数值"; - Text[ greek ] = " "; - Text[ korean ] = "고유값"; - Text[ arabic ] = " "; - Text[ turkish ] = "Benzersiz deerler"; - Text[ language_user1 ] = " "; - Text[ finnish ] = "Erityisarvot"; - Text[ catalan ] = "Valors diferents"; + MID_DBUI_QUERY_DISTINCT_VALUES }; ToolBoxItem { @@ -2336,6 +2122,25 @@ Menu RID_QUERY_DESIGN_MAIN_MENU ITEM_EDIT_PASTE Command = ".uno:Paste"; }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + MID_DBUI_QUERY_DISTINCT_VALUES + Command = ".uno:DB/DistinctValues"; + }; + MenuItem + { + MID_DBUI_CLEAR_QUERY + Command = ".uno:DB/ClearQuery"; + }; + MenuItem + { + MID_DBUI_QUERY_EXECUTE + Command = ".uno:DB/ExecuteQuery"; + }; }; }; Text[ russian ] = "~"; @@ -2349,7 +2154,73 @@ Menu RID_QUERY_DESIGN_MAIN_MENU Text[ turkish ] = "~Dzenle"; Text[ language_user1 ] = " "; Text[ catalan ] = "~Edita"; + }; + MenuItem + { + Identifier = MN_VIEW ; + HelpID = MN_VIEW ; + Text = "Ansicht" ; + Text [ English ] = "View" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + MID_DBUI_BROWSER_ESACPEPROCESSING + Command = ".uno:DB/EsacpeProcessing"; + }; + MenuItem + { + MID_DBUI_QUERY_VIEW_FUNCTIONS + Command = ".uno:DB/ViewFunctions"; + }; + MenuItem + { + MID_DBUI_QUERY_VIEW_TABLES + Command = ".uno:DB/ViewTables"; + }; + MenuItem + { + MID_DBUI_QUERY_VIEW_ALIASES + Command = ".uno:DB/ViewAliases"; + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + MID_BROWSER_SQL + Command = ".uno:DB/ChangeDesignMode"; + }; + }; }; + }; + MenuItem + { + Identifier = MN_INSERT ; + HelpID = MN_INSERT ; + Text = "~Einfgen" ; + Text [ English ] = "~Insert" ; + + SubMenu = Menu + { + ItemList = + { + MenuItem + { + MID_DBUI_REALTION_ADD_RELATION + Command = ".uno:DB/AddRelation"; + }; + MenuItem + { + MID_DBUI_JOIN_ADD_TABLE + Command = ".uno:DB/AddTable"; + }; + }; + }; + }; MenuItem { diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index 064c63c1edd1..ad3393d13c83 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: querydlg.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-10-05 12:31:27 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:45:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,91 +85,99 @@ #ifndef DBAUI_QUERYDESIGNVIEW_HXX #include "QueryDesignView.hxx" #endif +#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ +#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> +#endif +#ifndef DBAUI_RELATIONCONTROL_HXX +#include "RelationControl.hxx" +#endif +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif using namespace dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; DBG_NAME(DlgQryJoin); -DlgQryJoin::DlgQryJoin( Window * pParent,OQueryTableConnectionData* pData, - const Reference< XDatabaseMetaData >& _rxMetaData) +DlgQryJoin::DlgQryJoin( Window * pParent, + OQueryTableConnectionData* _pData, + OJoinTableView::OTableWindowMap* _pTableMap, + const Reference< XConnection >& _xConnection, + BOOL _bAllowTableSelect) : ModalDialog( pParent, ModuleRes(DLG_QRY_JOIN) ), aFL_Join( this, ResId( FL_JOIN ) ), - aRB_Inner( this, ResId( RB_INNER ) ), - aRB_Left( this, ResId( RB_LEFT ) ), - aRB_Right( this, ResId( RB_RIGHT ) ), - aRB_Full( this, ResId( RB_FULL ) ), aML_HelpText( this, ResId(ML_HELPTEXT) ), - + aFT_Title( this, ResId(FT_LISTBOXTITLE) ), + aLB_JoinType( this, ResId(LB_JOINTYPE) ), aPB_OK( this, ResId( PB_OK ) ), aPB_CANCEL( this, ResId( PB_CANCEL ) ), aPB_HELP( this, ResId( PB_HELP ) ), - eJoinType(pData->GetJoinType()), - pConnData(pData) + eJoinType(_pData->GetJoinType()), + m_pConnData(NULL), + m_xConnection(_xConnection), + m_pTableMap(_pTableMap), + m_pOrigConnData(_pData) { DBG_CTOR(DlgQryJoin,NULL); - aRB_Left.Disable(); - aRB_Right.Disable(); - aRB_Full.Disable(); + aML_HelpText.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() ); + ////////////////////////////////////////////////////////////////////// + // Connection kopieren + m_pConnData = static_cast<OQueryTableConnectionData*>(_pData->NewInstance()); + m_pConnData->CopyFrom(*_pData); - sal_Bool bFull = sal_False; - sal_Bool bOuter = sal_False; - try + m_pTableControl = new OTableListBoxControl(this,ModuleRes(LB_CONTROL),m_pTableMap,this); + + if( _bAllowTableSelect ) { - bFull = _rxMetaData->supportsFullOuterJoins(); - bOuter= _rxMetaData->supportsOuterJoins(); + m_pTableControl->Init( m_pConnData ); + m_pTableControl->fillListBoxes(); } - catch(SQLException&) + else { + m_pTableControl->fillAndDisable(m_pConnData); + m_pTableControl->Init( m_pConnData ); } - if(bFull) + + sal_Bool bFull = sal_False; + sal_Bool bOuter = sal_False; + try { - aRB_Left.Enable(); - aRB_Right.Enable(); - aRB_Full.Enable(); + Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); + bFull = xMeta->supportsFullOuterJoins(); + bOuter= xMeta->supportsOuterJoins(); } - else if(bOuter) + catch(SQLException&) { - aRB_Left.Enable(); - aRB_Right.Enable(); } - switch(eJoinType) - { - case INNER_JOIN: - aRB_Inner.Check(sal_True); - RBTogleHdl(&aRB_Inner); - break; - case LEFT_JOIN: - aRB_Left.Check(sal_True); - RBTogleHdl(&aRB_Left); - break; - case RIGHT_JOIN: - aRB_Right.Check(sal_True); - RBTogleHdl(&aRB_Right); - break; - case FULL_JOIN: - aRB_Full.Check(sal_True); - RBTogleHdl(&aRB_Full); - break; - } + setJoinType(eJoinType); aPB_OK.SetClickHdl( LINK(this, DlgQryJoin, OKClickHdl) ); - aRB_Inner.SetToggleHdl(LINK(this,DlgQryJoin,RBTogleHdl)); - aRB_Left.SetToggleHdl(LINK(this,DlgQryJoin,RBTogleHdl)); - aRB_Right.SetToggleHdl(LINK(this,DlgQryJoin,RBTogleHdl)); - aRB_Full.SetToggleHdl(LINK(this,DlgQryJoin,RBTogleHdl)); + aLB_JoinType.SetSelectHdl(LINK(this,DlgQryJoin,LBChangeHdl)); if (static_cast<OQueryTableView*>(pParent)->getDesignView()->getController()->isReadOnly()) { - aRB_Inner.Disable(); - aRB_Left.Disable(); - aRB_Right.Disable(); - aRB_Full.Disable(); + aLB_JoinType.Disable(); + m_pTableControl->Disable(); + } + else + { + if ( !bFull ) + aLB_JoinType.RemoveEntry(3); + + if ( !(bFull || bOuter) ) + { + aLB_JoinType.RemoveEntry(0); + aLB_JoinType.RemoveEntry(0); + aLB_JoinType.RemoveEntry(0); + } + + m_pTableControl->NotifyCellChange(); } FreeResource(); @@ -179,51 +187,115 @@ DlgQryJoin::DlgQryJoin( Window * pParent,OQueryTableConnectionData* pData, DlgQryJoin::~DlgQryJoin() { DBG_DTOR(DlgQryJoin,NULL); + delete m_pTableControl; + delete m_pConnData; } -IMPL_LINK( DlgQryJoin, RBTogleHdl, RadioButton*, pButton ) +// ----------------------------------------------------------------------------- +IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, pListBox ) { DBG_CHKTHIS(DlgQryJoin,NULL); aML_HelpText.SetText(String()); - String aStr; - if(pButton == &aRB_Inner) - { - aStr = String(ModuleRes(STR_QUERY_INNER_JOIN)); - } - else if(pButton == &aRB_Left) - { - aStr = String(ModuleRes(STR_QUERY_LEFTRIGHT_JOIN)); - aStr.SearchAndReplace(String::CreateFromAscii("%1"),pConnData->GetSourceWinName()); - aStr.SearchAndReplace(String::CreateFromAscii("%2"),pConnData->GetDestWinName()); - } - else if(pButton == &aRB_Right) + + String sFirstWinName,sSecondWinName; + USHORT nResId = 0; + USHORT nPos = aLB_JoinType.GetSelectEntryPos(); + switch ( nPos ) { - aStr = String(ModuleRes(STR_QUERY_LEFTRIGHT_JOIN)); - aStr.SearchAndReplace(String::CreateFromAscii("%1"),pConnData->GetDestWinName()); - aStr.SearchAndReplace(String::CreateFromAscii("%2"),pConnData->GetSourceWinName()); + default: + case 0: + nResId = STR_QUERY_INNER_JOIN; + break; + case 1: + nResId = STR_QUERY_LEFTRIGHT_JOIN; + sFirstWinName = m_pConnData->GetSourceWinName(); + sSecondWinName = m_pConnData->GetDestWinName(); + break; + case 2: + case 3: + nResId = (nPos == 2) ? STR_QUERY_LEFTRIGHT_JOIN : STR_QUERY_FULL_JOIN; + + sFirstWinName = m_pConnData->GetDestWinName(); + sSecondWinName = m_pConnData->GetSourceWinName(); + break; } - else if(pButton == &aRB_Full) + + String sStr = String(ModuleRes(nResId)); + if( sFirstWinName.Len() ) { - aStr = String(ModuleRes(STR_QUERY_FULL_JOIN)); - aStr.SearchAndReplace(String::CreateFromAscii("%1"),pConnData->GetDestWinName()); - aStr.SearchAndReplace(String::CreateFromAscii("%2"),pConnData->GetSourceWinName()); + sStr.SearchAndReplace(String(RTL_CONSTASCII_STRINGPARAM("%1")),sFirstWinName); + sStr.SearchAndReplace(String(RTL_CONSTASCII_STRINGPARAM("%2")),sSecondWinName); } - aML_HelpText.SetText(aStr); + aML_HelpText.SetText(sStr); return 1; } +// ----------------------------------------------------------------------------- IMPL_LINK( DlgQryJoin, OKClickHdl, Button*, pButton ) { DBG_CHKTHIS(DlgQryJoin,NULL); - if( aRB_Inner.IsChecked() ) - eJoinType = INNER_JOIN; - else if( aRB_Left.IsChecked() ) - eJoinType = LEFT_JOIN; - else if( aRB_Right.IsChecked() ) - eJoinType = RIGHT_JOIN; - else if( aRB_Full.IsChecked() ) - eJoinType = FULL_JOIN; - EndDialog(); + USHORT nPos = aLB_JoinType.GetSelectEntryPos(); + switch ( nPos ) + { + case 0: + eJoinType = INNER_JOIN; + break; + case 1: + eJoinType = LEFT_JOIN; + break; + case 2: + eJoinType = RIGHT_JOIN; + break; + case 3: + eJoinType = FULL_JOIN; + break; + } + + m_pConnData->Update(); + m_pOrigConnData->CopyFrom( *m_pConnData ); + + EndDialog(RET_OK); return 1; } +// ----------------------------------------------------------------------------- +OTableConnectionData* DlgQryJoin::getConnectionData() const +{ + return m_pConnData; +} +// ----------------------------------------------------------------------------- +void DlgQryJoin::setValid(sal_Bool _bValid) +{ + LBChangeHdl(&aLB_JoinType); + + aPB_OK.Enable(_bValid); +} +// ----------------------------------------------------------------------------- +void DlgQryJoin::notifyConnectionChange(OTableConnectionData* _pConnectionData) +{ + setJoinType(m_pConnData->GetJoinType()); +} +// ----------------------------------------------------------------------------- +void DlgQryJoin::setJoinType(EJoinType _eNewJoinType) +{ + eJoinType = _eNewJoinType; + USHORT nPos = 0; + switch(eJoinType) + { + case INNER_JOIN: + break; + case LEFT_JOIN: + nPos = 1; + break; + case RIGHT_JOIN: + nPos = 2; + break; + case FULL_JOIN: + nPos = 3; + break; + } + aLB_JoinType.SelectEntryPos(nPos); + LBChangeHdl(&aLB_JoinType); +} +// ----------------------------------------------------------------------------- + diff --git a/dbaccess/source/ui/querydesign/querydlg.hrc b/dbaccess/source/ui/querydesign/querydlg.hrc index c5e6dc34bd79..7d41ebf0bc8b 100644 --- a/dbaccess/source/ui/querydesign/querydlg.hrc +++ b/dbaccess/source/ui/querydesign/querydlg.hrc @@ -2,9 +2,9 @@ * * $RCSfile: querydlg.hrc,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fme $ $Date: 2001-06-21 15:32:06 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:45:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,11 +63,9 @@ #define DBAUI_QUERYDLG_HRC #define FL_JOIN 1 +#define FT_LISTBOXTITLE 2 -#define RB_INNER 1 -#define RB_LEFT 2 -#define RB_RIGHT 3 -#define RB_FULL 4 +#define LB_JOINTYPE 1 #define GB_FIELDS 1 diff --git a/dbaccess/source/ui/querydesign/querydlg.hxx b/dbaccess/source/ui/querydesign/querydlg.hxx index cd553d2d5015..d24bd43eaa3e 100644 --- a/dbaccess/source/ui/querydesign/querydlg.hxx +++ b/dbaccess/source/ui/querydesign/querydlg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: querydlg.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fme $ $Date: 2001-06-21 15:32:06 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:45:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,6 +71,9 @@ #ifndef _SV_FIXED_HXX //autogen #include <vcl/fixed.hxx> #endif +#ifndef _SV_LSTBOX_HXX +#include <vcl/lstbox.hxx> +#endif #ifndef _SVEDIT_HXX //autogen #include <svtools/svmedit.hxx> @@ -78,36 +81,71 @@ #ifndef DBAUI_ENUMTYPES_HXX #include "QEnumTypes.hxx" #endif -#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ -#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> + +#ifndef DBAUI_RELCONTROLIFACE_HXX +#include "RelControliFace.hxx" +#endif +#ifndef DBAUI_JOINTABLEVIEW_HXX +#include "JoinTableView.hxx" #endif + namespace dbaui { class OQueryTableConnectionData; - class DlgQryJoin : public ModalDialog + class OTableListBoxControl; + class DlgQryJoin : public ModalDialog + ,public IRelationControlInterface { protected: - FixedLine aFL_Join; - RadioButton aRB_Inner; - RadioButton aRB_Left; - RadioButton aRB_Right; - RadioButton aRB_Full; - MultiLineEdit aML_HelpText; - OKButton aPB_OK; - CancelButton aPB_CANCEL; - HelpButton aPB_HELP; - - EJoinType eJoinType; - OQueryTableConnectionData* pConnData; // enth"alt linke und rechte Tabelle + FixedLine aFL_Join; + FixedText aFT_Title; + ListBox aLB_JoinType; + MultiLineEdit aML_HelpText; + OKButton aPB_OK; + CancelButton aPB_CANCEL; + HelpButton aPB_HELP; + + OTableListBoxControl* m_pTableControl; + OJoinTableView::OTableWindowMap* m_pTableMap; + + EJoinType eJoinType; + OQueryTableConnectionData* m_pConnData; // enth"alt linke und rechte Tabelle + OQueryTableConnectionData* m_pOrigConnData; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; DECL_LINK( OKClickHdl, Button* ); - DECL_LINK( RBTogleHdl, RadioButton* ); + DECL_LINK( LBChangeHdl, ListBox* ); + + /** setJoinType enables and set the new join type + @param _eNewJoinType the new jointype + */ + void setJoinType(EJoinType _eNewJoinType); public: - DlgQryJoin( Window * pParent, OQueryTableConnectionData* pData, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMetaData); + DlgQryJoin( Window * pParent, + OQueryTableConnectionData* pData, + OJoinTableView::OTableWindowMap* _pTableMap, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, + BOOL _bAllowTableSelect); virtual ~DlgQryJoin(); EJoinType GetJoinType() const { return eJoinType; }; + + /** getConnectionData returns the current connection data + @return the current connectiondata + */ + virtual OTableConnectionData* getConnectionData() const; + + /** setValid set the valid inside, can be used for OK buttons + @param _bValid true when the using control allows an update + */ + virtual void setValid(sal_Bool _bValid); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() { return m_xConnection; } + + /** notifyConnectionChange is callback which is called when the table selection has changed and a new connection exists + @param _pConnectionData the connection which exists between the new tables + */ + virtual void notifyConnectionChange(OTableConnectionData* _pConnectionData); }; } #endif // DBAUI_QUERYDLG_HXX diff --git a/dbaccess/source/ui/querydesign/querydlg.src b/dbaccess/source/ui/querydesign/querydlg.src index 45b5517a10f6..54d325c70159 100644 --- a/dbaccess/source/ui/querydesign/querydlg.src +++ b/dbaccess/source/ui/querydesign/querydlg.src @@ -2,9 +2,9 @@ * * $RCSfile: querydlg.src,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: obo $ $Date: 2001-12-14 16:42:41 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:45:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,19 +71,100 @@ ModalDialog DLG_QRY_JOIN OutputSize = TRUE ; SVLook = TRUE ; HelpId = HID_DLG_QRY_JOIN ; - Size = MAP_APPFONT ( 203, 107 ) ; + Size = MAP_APPFONT ( 265, 205 ) ; Text = "Verbundeigenschaften" ; Text [ ENGLISH ] = "Join properties" ; Moveable = TRUE ; Closeable = TRUE ; + Window LB_CONTROL + { + Pos = MAP_APPFONT( 0, 0 ); + Size = MAP_APPFONT( 203, 113 ); + DialogControl = TRUE; + + FixedLine FL_INVOLVED_TABLES + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 191 , 8 ) ; + Text = "beteiligte Tabellen" ; + Text [ English ] = "involved tables" ; + Text[ english_us ] = "Tables involved"; + Text[ portuguese ] = "Tabelas consideradas"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "betrokken tabellen"; + Text[ french ] = "Tables impliques"; + Text[ spanish ] = "Tablas consideradas"; + Text[ italian ] = "Tabelle considerate"; + Text[ danish ] = "involverede tabeller"; + Text[ swedish ] = "inkluderade tabeller"; + Text[ polish ] = "implikowane tabele"; + Text[ portuguese_brazilian ] = "involved tables"; + Text[ japanese ] = "関連テーブル"; + Text[ korean ] = "관련 테이블"; + Text[ chinese_simplified ] = "有关联的表格"; + Text[ chinese_traditional ] = "相關的表格"; + Text[ arabic ] = " "; + Text[ turkish ] = "lgili tablolar"; + Text[ catalan ] = "tablas implicadas"; + Text[ finnish ] = "beteiligte Tabellen"; + }; + + ListBox LB_LEFT_TABLE + { + Border = TRUE; + Pos = MAP_APPFONT( 12, 14 ); + Size = MAP_APPFONT( 87, 60 ); + DropDown = TRUE; + TabStop = TRUE; + }; + + ListBox LB_RIGHT_TABLE + { + Border = TRUE; + Pos = MAP_APPFONT( 104, 14 ); + Size = MAP_APPFONT( 87, 60 ); + DropDown = TRUE; + TabStop = TRUE; + }; + + FixedLine FL_INVOLVED_FIELDS + { + Pos = MAP_APPFONT ( 6 , 29 ) ; + Size = MAP_APPFONT ( 191 , 8 ) ; + Text = "beteiligte Felder" ; + Text [ English ] = "involved fields" ; + Text[ english_us ] = "Fields involved"; + Text[ portuguese ] = "Campos considerados"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "betrokken velden"; + Text[ french ] = "Champs impliqus"; + Text[ spanish ] = "Campos considerados"; + Text[ italian ] = "Campi considerati"; + Text[ danish ] = "involverede felter"; + Text[ swedish ] = "inkluderade flt"; + Text[ polish ] = "implikowane pola"; + Text[ portuguese_brazilian ] = "involved fields"; + Text[ japanese ] = "関連フィールド"; + Text[ korean ] = "관련 필드"; + Text[ chinese_simplified ] = "有关联的字段"; + Text[ chinese_traditional ] = "相關的欄位"; + Text[ arabic ] = " "; + Text[ turkish ] = "lgili alanlar"; + Text[ catalan ] = "campos implicados"; + Text[ finnish ] = "beteiligte Felder"; + }; + }; + FixedLine FL_JOIN { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 191 , 8 ) ; - Text = "Optionen" ; - Text [ ENGLISH ] = "Options" ; + Pos = MAP_APPFONT ( 6 , 114 ) ; + Size = MAP_APPFONT ( 191 , 8 ) ; + Text = "Optionen" ; + Text [ ENGLISH ] = "Options" ; Text[ english_us ] = "Options"; Text[ portuguese ] = "Opes"; Text[ russian ] = ""; @@ -109,160 +190,68 @@ ModalDialog DLG_QRY_JOIN Text[ finnish ] = "Asetukset"; }; - RadioButton RB_INNER - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 63 , 10 ) ; - HelpId = HID_DLG_QRY_INNER ; - Text = "~Innerer" ; - Text [ ENGLISH ] = "~Inner" ; - Text[ english_us ] = "~Inner join"; - Text[ portuguese ] = "~Interna"; - Text[ russian ] = " "; - Text[ dutch ] = "~Binnenste"; - Text[ french ] = "~Interne"; - Text[ spanish ] = "~Interior"; - Text[ italian ] = "Rela~zione interna"; - Text[ danish ] = "~Indre"; - Text[ swedish ] = "~Inre"; - Text[ polish ] = "Wewntrzne zczenie"; - Text[ portuguese_brazilian ] = "~Inner"; - Text[ japanese ] = "内部結合(~I)"; - Text[ chinese_simplified ] = "内部连结(~I)"; - Text[ chinese_traditional ] = "內部連結(~I)"; - Text[ dutch ] = "~Binnenste"; - Text[ chinese_simplified ] = "内部连结(~I)"; - Text[ greek ] = "~"; - Text[ korean ] = "내부 조인(~I)"; - Text[ arabic ] = " "; - Text[ turkish ] = "~"; - Text[ language_user1 ] = " "; - Text[ catalan ] = "Uni ~interior"; - Text[ finnish ] = "~Sisempi liitos"; - }; - RadioButton RB_LEFT + FixedText FT_LISTBOXTITLE { - Pos = MAP_APPFONT ( 12 , 30 ) ; - Size = MAP_APPFONT ( 63 , 10 ) ; - HelpId = HID_DLG_QRY_LEFT ; - Text = "~Linker" ; - Text [ ENGLISH ] = "~Left" ; - Text[ english_us ] = "~Left join"; - Text[ portuguese ] = "~Esquerda"; - Text[ russian ] = " "; - Text[ dutch ] = "~Linker"; - Text[ french ] = "~Gauche"; - Text[ spanish ] = "~Izquierda"; - Text[ italian ] = "Relazione ~sinistra"; - Text[ danish ] = "~Venstre"; - Text[ swedish ] = "~Vnster"; - Text[ polish ] = "Lewe zczenie"; - Text[ portuguese_brazilian ] = "~Left"; - Text[ japanese ] = "左結合(~L)"; - Text[ chinese_simplified ] = "左向连结(~L)"; - Text[ chinese_traditional ] = "左向連結(~L)"; - Text[ dutch ] = "~Linker"; - Text[ chinese_simplified ] = "左向连结(~L)"; - Text[ greek ] = ""; - Text[ korean ] = "왼쪽 조인(~L)"; - Text[ arabic ] = " "; - Text[ turkish ] = "~Sol"; - Text[ language_user1 ] = " "; - Text[ catalan ] = "Uni ~esquerra"; - Text[ finnish ] = "~Vasen liitos"; - }; - RadioButton RB_RIGHT - { - Pos = MAP_APPFONT ( 12 , 46 ) ; - Size = MAP_APPFONT ( 63 , 10 ) ; - HelpId = HID_DLG_QRY_RIGHT ; - Text = "~Rechter" ; - Text [ ENGLISH ] = "~Right" ; - Text[ english_us ] = "~Right join"; - Text[ portuguese ] = "~Direita"; - Text[ russian ] = " "; - Text[ dutch ] = "~Rechter"; - Text[ french ] = "~Droite"; - Text[ spanish ] = "~Derecha"; - Text[ italian ] = "Relazione ~destra"; - Text[ danish ] = "~Hjre"; - Text[ swedish ] = "~Hger"; - Text[ polish ] = "Prawe zczenie"; - Text[ portuguese_brazilian ] = "~Right"; - Text[ japanese ] = "右結合(~R)"; - Text[ chinese_simplified ] = "右向连结(~R)"; - Text[ chinese_traditional ] = "右向連結(~R)"; - Text[ dutch ] = "~Rechter"; - Text[ chinese_simplified ] = "右向连结(~R)"; - Text[ greek ] = ""; - Text[ korean ] = "오른쪽 조인(~R)"; - Text[ arabic ] = " "; - Text[ turkish ] = "~Sa"; - Text[ language_user1 ] = " "; - Text[ catalan ] = "Uni ~dreta"; - Text[ finnish ] = "~Oikea liitos"; + Pos = MAP_APPFONT ( 12 , 127 ) ; + Size = MAP_APPFONT ( 89 , 8 ) ; + + Text = "~Art" ; + Text [ ENGLISH ] = "~Type" ; }; - RadioButton RB_FULL + + ListBox LB_JOINTYPE { - Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 63 , 10 ) ; - HelpId = HID_DLG_QRY_FULL ; - Text = "~Vollstndiger" ; - Text [ ENGLISH ] = "~Full" ; - Text[ english_us ] = "~Full (outer) join"; - Text[ portuguese ] = "Co~mpleta"; - Text[ russian ] = " "; - Text[ dutch ] = "~Volledige"; - Text[ french ] = "~Complte"; - Text[ spanish ] = "~Completa"; - Text[ italian ] = "Relazione ~completa"; - Text[ danish ] = "~Fuldstndig"; - Text[ swedish ] = "~Fullstndig"; - Text[ polish ] = "Pene zczenie"; - Text[ portuguese_brazilian ] = "~Full"; - Text[ japanese ] = "完全結合(~F)"; - Text[ chinese_simplified ] = "完整连结(~F)"; - Text[ chinese_traditional ] = "完整的連結(~F)"; - Text[ language_user1 ] = " "; - Text[ dutch ] = "~Volledige"; - Text[ chinese_simplified ] = "完整连结(~F)"; - Text[ greek ] = ""; - Text[ korean ] = "풀 조인(~F)"; - Text[ arabic ] = " "; - Text[ turkish ] = "Tam"; - Text[ catalan ] = "Uni ~completa (exterior)"; - Text[ finnish ] = "~Tydellinen (ulko)liitos"; + Pos = MAP_APPFONT ( 101 , 125 ) ; + Size = MAP_APPFONT ( 90 , 60 ) ; + HelpId = HID_DLG_QRY_JOINTYPE ; + + StringList = + { + < "Innerer" ; Default; > ; + < "Linker" ; Default; > ; + < "Rechter" ; Default; > ; + < "Vollstndiger" ; Default; > ; + }; + StringList [ ENGLISH ] = + { + < "Inner" ; Default; > ; + < "Left" ; Default; > ; + < "Right" ; Default; > ; + < "Full" ; Default; > ; + }; + DropDown = TRUE; + DDExtraWidth = TRUE; }; MultiLineEdit ML_HELPTEXT { - Pos = MAP_APPFONT ( 81 , 14 ) ; - Size = MAP_APPFONT ( 110 , 58 ) ; + Pos = MAP_APPFONT ( 12 , 145 ) ; + Size = MAP_APPFONT ( 179 , 49 ) ; HelpId = HID_DLG_QRY_HELPTEXT ; ReadOnly = TRUE; SVLook = TRUE; - Border = TRUE; }; OKButton PB_OK { - Pos = MAP_APPFONT ( 6 , 87 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; + Pos = MAP_APPFONT ( 206 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; }; CancelButton PB_CANCEL { - Pos = MAP_APPFONT ( 59 , 87 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; + Pos = MAP_APPFONT ( 206 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; }; HelpButton PB_HELP { - Pos = MAP_APPFONT ( 147 , 87 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; + Pos = MAP_APPFONT ( 206 , 43 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; }; + Text[ english_us ] = "Join Properties"; Text[ portuguese ] = "Propriedades relacionais"; Text[ russian ] = " "; |