summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-02-28 08:18:30 +0000
committerFrank Schönheit <fs@openoffice.org>2001-02-28 08:18:30 +0000
commit94138662db3f25dd40ee714252383e19bf3b4efe (patch)
tree50212771043e4ee88f3b77a718474e3f5bffba1e /extensions
parent31c596b4888f1750fcf46fbe025efe194da950f6 (diff)
finalized the list/combo wizard
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.cxx117
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.hxx65
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.src141
-rw-r--r--extensions/source/dbpilots/controlwizard.cxx80
-rw-r--r--extensions/source/dbpilots/controlwizard.hxx13
-rw-r--r--extensions/source/dbpilots/dbpilots.src52
-rw-r--r--extensions/source/dbpilots/dbpresid.hrc16
-rw-r--r--extensions/source/dbpilots/groupboxpages.src189
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx108
-rw-r--r--extensions/source/dbpilots/groupboxwiz.hxx60
-rw-r--r--extensions/source/dbpilots/listcombopages.src33
-rw-r--r--extensions/source/dbpilots/listcombowizard.cxx110
-rw-r--r--extensions/source/dbpilots/listcombowizard.hxx39
13 files changed, 650 insertions, 373 deletions
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx
index f76757fdb3fa..6c3f41560eef 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: commonpagesdbp.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -199,7 +199,8 @@ namespace dbp
rContext.xForm->setPropertyValue(::rtl::OUString::createFromAscii("Command"), makeAny(::rtl::OUString(m_aTable.GetSelectEntry())));
rContext.xForm->setPropertyValue(::rtl::OUString::createFromAscii("CommandType"), makeAny((sal_Int32)CommandType::TABLE));
- updateContext();
+ if (!updateContext())
+ return sal_False;
}
catch(Exception&)
{
@@ -327,6 +328,113 @@ namespace dbp
}
}
+ //=====================================================================
+ //= OMaybeListSelectionPage
+ //=====================================================================
+ //---------------------------------------------------------------------
+ OMaybeListSelectionPage::OMaybeListSelectionPage( OControlWizard* _pParent, const ResId& _rId )
+ :OControlWizardPage(_pParent, _rId)
+ ,m_pYes(NULL)
+ ,m_pNo(NULL)
+ ,m_pList(NULL)
+ {
+ }
+
+ //---------------------------------------------------------------------
+ void OMaybeListSelectionPage::announceControls(RadioButton& _rYesButton, RadioButton& _rNoButton, ListBox& _rSelection)
+ {
+ m_pYes = &_rYesButton;
+ m_pNo = &_rNoButton;
+ m_pList = &_rSelection;
+
+ m_pYes->SetClickHdl(LINK(this, OMaybeListSelectionPage, OnRadioSelected));
+ m_pNo->SetClickHdl(LINK(this, OMaybeListSelectionPage, OnRadioSelected));
+ implEnableWindows();
+ }
+
+ //---------------------------------------------------------------------
+ IMPL_LINK( OMaybeListSelectionPage, OnRadioSelected, RadioButton*, NOTINTERESTEDIN )
+ {
+ implEnableWindows();
+ return 0L;
+ }
+
+ //---------------------------------------------------------------------
+ void OMaybeListSelectionPage::implInitialize(const String& _rSelection)
+ {
+ DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::implInitialize: no controls announced!");
+ sal_Bool bIsSelection = (0 != _rSelection.Len());
+ m_pYes->Check(bIsSelection);
+ m_pNo->Check(!bIsSelection);
+ m_pList->Enable(bIsSelection);
+
+ m_pList->SelectEntry(bIsSelection ? _rSelection : String());
+ }
+
+ //---------------------------------------------------------------------
+ void OMaybeListSelectionPage::implCommit(String& _rSelection)
+ {
+ _rSelection = m_pYes->IsChecked() ? m_pList->GetSelectEntry() : String();
+ }
+
+ //---------------------------------------------------------------------
+ void OMaybeListSelectionPage::implEnableWindows()
+ {
+ m_pList->Enable(m_pYes->IsChecked());
+ }
+
+ //---------------------------------------------------------------------
+ void OMaybeListSelectionPage::ActivatePage()
+ {
+ OControlWizardPage::ActivatePage();
+
+ DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::ActivatePage: no controls announced!");
+ if (m_pYes->IsChecked())
+ m_pList->GrabFocus();
+ else
+ m_pNo->GrabFocus();
+ }
+
+ //=====================================================================
+ //= ODBFieldPage
+ //=====================================================================
+ //---------------------------------------------------------------------
+ ODBFieldPage::ODBFieldPage( OControlWizard* _pParent )
+ :OMaybeListSelectionPage(_pParent, ModuleRes(RID_PAGE_OPTION_DBFIELD))
+ ,m_aFrame (this, ResId(FL_DATABASEFIELD_EXPL))
+ ,m_aDescription (this, ResId(FT_DATABASEFIELD_EXPL))
+ ,m_aQuestion (this, ResId(FT_DATABASEFIELD_QUEST))
+ ,m_aStoreYes (this, ResId(RB_STOREINFIELD_YES))
+ ,m_aStoreNo (this, ResId(LB_STOREINFIELD))
+ ,m_aStoreWhere (this, ResId(RB_STOREINFIELD_NO))
+ {
+ FreeResource();
+ announceControls(m_aStoreYes, m_aStoreNo, m_aStoreWhere);
+ m_aStoreWhere.SetDropDownLineCount(10);
+ }
+
+ //---------------------------------------------------------------------
+ void ODBFieldPage::initializePage()
+ {
+ OMaybeListSelectionPage::initializePage();
+
+ // fill the fields page
+ fillListBox(m_aStoreWhere, getContext().aFieldNames);
+
+ implInitialize(getDBFieldSetting());
+ }
+
+ //---------------------------------------------------------------------
+ sal_Bool ODBFieldPage::commitPage(COMMIT_REASON _eReason)
+ {
+ if (!OMaybeListSelectionPage::commitPage(_eReason))
+ return sal_False;
+
+ implCommit(getDBFieldSetting());
+
+ return sal_True;
+ }
+
//.........................................................................
} // namespace dbp
//.........................................................................
@@ -334,6 +442,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:21:36 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx
index 59ee1316079f..0ce72967f448 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: commonpagesdbp.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -118,6 +118,64 @@ namespace dbp
virtual sal_Bool determineNextButtonState();
};
+ //=====================================================================
+ //= OMaybeListSelectionPage
+ //=====================================================================
+ class OMaybeListSelectionPage : public OControlWizardPage
+ {
+ protected:
+ RadioButton* m_pYes;
+ RadioButton* m_pNo;
+ ListBox* m_pList;
+
+ public:
+ OMaybeListSelectionPage( OControlWizard* _pParent, const ResId& _rId );
+
+ protected:
+ DECL_LINK( OnRadioSelected, RadioButton* );
+
+ // TabPage overridables
+ void ActivatePage();
+
+ // own helper
+ void announceControls(
+ RadioButton& _rYesButton,
+ RadioButton& _rNoButton,
+ ListBox& _rSelection);
+
+ void implEnableWindows();
+
+ void implInitialize(const String& _rSelection);
+ void implCommit(String& _rSelection);
+ };
+
+ //=====================================================================
+ //= ODBFieldPage
+ //=====================================================================
+ class ODBFieldPage : public OMaybeListSelectionPage
+ {
+ protected:
+ FixedLine m_aFrame;
+ FixedText m_aDescription;
+ FixedText m_aQuestion;
+ RadioButton m_aStoreYes;
+ RadioButton m_aStoreNo;
+ ListBox m_aStoreWhere;
+
+ public:
+ ODBFieldPage( OControlWizard* _pParent );
+
+ protected:
+ void setDescriptionText(const String& _rDesc) { m_aDescription.SetText(_rDesc); }
+
+ // OWizardPage overridables
+ virtual void initializePage();
+ virtual sal_Bool commitPage(COMMIT_REASON _eReason);
+
+ // own overridables
+ virtual String& getDBFieldSetting() = 0;
+ };
+
//.........................................................................
} // namespace dbp
//.........................................................................
@@ -128,6 +186,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:21:45 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/commonpagesdbp.src b/extensions/source/dbpilots/commonpagesdbp.src
index 0a4edef0228b..40eb6328b37d 100644
--- a/extensions/source/dbpilots/commonpagesdbp.src
+++ b/extensions/source/dbpilots/commonpagesdbp.src
@@ -2,9 +2,9 @@
*
* $RCSfile: commonpagesdbp.src,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -132,9 +132,146 @@ TabPage RID_PAGE_TABLESELECTION
};
};
+TabPage RID_PAGE_OPTION_DBFIELD
+{
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ;
+ Text = "Datenbankfeld";
+ Text [ english ] = "Database Field";
+ Text [ english_us ] = "Database Field";
+ Text [ portuguese ] = "Campo da base de dados";
+ Text [ russian ] = " ";
+ Text [ dutch ] = "databaseveld";
+ Text [ french ] = "Champ de base de donnes";
+ Text [ spanish ] = "Campo de base de datos";
+ Text [ italian ] = "Campo database";
+ Text [ danish ] = "Databasefelt";
+ Text [ swedish ] = "Databasflt";
+ Text [ polish ] = "Pole bazy danych";
+ Text [ portuguese_brazilian ] = "Datenbankfeld";
+ Text [ japanese ] = "ްް̨";
+ Text [ chinese_simplified ] = "ݿֶ";
+ Text [ chinese_traditional ] = "GƮw";
+ Text [ arabic ] = " ";
+ Text [ dutch ] = "databaseveld";
+ Text [ chinese_simplified ] = "ݿֶ";
+ Text [ greek ] = " ";
+ Text [ korean ] = "ͺ̽ ʵ";
+ Text [ turkish ] = "Veritaban alan";
+
+ FixedLine FL_DATABASEFIELD_EXPL
+ {
+ Pos = MAP_APPFONT ( 4 , 3 ) ;
+ Size = MAP_APPFONT ( WINDOW_SIZE_X - 8 , 8 ) ;
+ };
+ FixedText FT_DATABASEFIELD_EXPL
+ {
+ Pos = MAP_APPFONT ( 7 , 15 ) ;
+ Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 16 ) ;
+ WordBreak = TRUE;
+ };
+ FixedText FT_DATABASEFIELD_QUEST
+ {
+ Pos = MAP_APPFONT ( 7 , 34 ) ;
+ Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 16 ) ;
+ WordBreak = TRUE;
+ Text = "Mchten Sie den Wert in einem Datenbankfeld speichern?";
+ Text [ english ] = "Do you want to save the value in a database field?";
+ Text [ english_us ] = "Do you want to save the value in a database field?";
+ Text [ portuguese ] = "Guardar o valor num campo da base de dados?";
+ Text [ russian ] = " ?";
+ Text [ dutch ] = "Wilt u de waarde opslaan in een databaseveld ?";
+ Text [ french ] = "Souhaitez-vous enregistrer la valeur dans un champ de base de donnes ?";
+ Text [ spanish ] = "Desea guardar el valor en un campo de base de datos?";
+ Text [ italian ] = "Volete salvare il valore in un campo database ?";
+ Text [ danish ] = "Vil du gemme vrdien i et databasefelt?";
+ Text [ swedish ] = "Vill Du spara vrdet i ett databasflt ?";
+ Text [ polish ] = "Czy zapisa t warto w polu bazy danych ?";
+ Text [ portuguese_brazilian ] = "Mchten Sie den Wert in einem Datenbankfeld speichern ?";
+ Text [ japanese ] = "lްް̨ނɕۑ܂B";
+ Text [ chinese_simplified ] = "Ҫ̵ֵһݿڣ";
+ Text [ chinese_traditional ] = "znbƮw줺xsoӼƭȡH";
+ Text [ arabic ] = " ʿ";
+ Text [ dutch ] = "Wilt u de waarde opslaan in een databaseveld ?";
+ Text [ chinese_simplified ] = "Ҫ̵ֵһݿڣ";
+ Text [ greek ] = " ;";
+ Text [ korean ] = "ͺ̽ ʵ Ͻðڽϱ?";
+ Text [ turkish ] = "Deeri bir veritaban alannda kaydetmek istiyor musunuz?";
+ };
+ RadioButton RB_STOREINFIELD_YES
+ {
+ Pos = MAP_APPFONT ( 7 , 53 ) ;
+ Size = MAP_APPFONT ( WINDOW_HALF_SIZE_X - 10, 10 ) ;
+ Group = TRUE;
+ TabStop = TRUE;
+ Text = "~Ja, und zwar in folgendem Datenbankfeld :";
+ Text [ english ] = "~Yes, save it in the following database field:";
+ Text [ english_us ] = "~Yes, save it in the following database field:";
+ Text [ portuguese ] = "Sim, no seguinte:";
+ Text [ russian ] = ". :";
+ Text [ dutch ] = "Ja, en wel in het volgende databaseveld :";
+ Text [ french ] = "Oui, dans le champ suivant :";
+ Text [ spanish ] = "S, en el siguiente campo :";
+ Text [ italian ] = "S, nel seguente campo database :";
+ Text [ danish ] = "Ja, den skal gemmes i flgende databasefelt:";
+ Text [ swedish ] = "Ja, i fljande databasflt :";
+ Text [ polish ] = "Tak, jest to moliwe w nastpujcym polu bazy danych :";
+ Text [ portuguese_brazilian ] = "Ja, und zwar in folgendem Datenbankfeld :";
+ Text [ japanese ] = "͂Aްް̨ނɂɂ܂:";
+ Text [ chinese_simplified ] = "ǣµݿ";
+ Text [ chinese_traditional ] = "OAUCƮwG";
+ Text [ arabic ] = " :";
+ Text [ dutch ] = "Ja, en wel in het volgende databaseveld :";
+ Text [ chinese_simplified ] = "ǣµݿ";
+ Text [ greek ] = ", :";
+ Text [ korean ] = ", ͺ̽ ʵ忡 Ͻʽÿ:";
+ Text [ turkish ] = "Evet, aadaki veritaban alannda kaydedebilirsiniz :";
+ };
+ ListBox LB_STOREINFIELD
+ {
+ Pos = MAP_APPFONT ( WINDOW_HALF_SIZE_X + 3 , 51 ) ;
+ Size = MAP_APPFONT ( WINDOW_HALF_SIZE_X - 10, 14 ) ;
+ TabStop = TRUE;
+ SVLook = TRUE ;
+ Border = TRUE ;
+ DropDown = TRUE;
+ AutoHScroll = TRUE ;
+ };
+ RadioButton RB_STOREINFIELD_NO
+ {
+ Pos = MAP_APPFONT ( 7 , 68 ) ;
+ Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 10 ) ;
+ TabStop = FALSE;
+ Text = "~Nein, ich mchte den Wert nur im Formular speichern.";
+ Text [ english ] = "~No, I only want to save the value in the form.";
+ Text [ english_us ] = "~No, I only want to save the value in the form.";
+ Text [ portuguese ] = "No. Guardar apenas no formulrio.";
+ Text [ russian ] = ". ";
+ Text [ dutch ] = "Nee, ik wil de waarde alleen opslaan in het formulier.";
+ Text [ french ] = "Non, je souhaite enregistrer la valeur uniquement dans le formulaire.";
+ Text [ spanish ] = "No, deseo guardar el valor solo en el formulario.";
+ Text [ italian ] = "Salva il valore solo nel formulario.";
+ Text [ danish ] = "Nej, jeg vil kun gemme vrdien i formularen.";
+ Text [ swedish ] = "Nej, jag vill bara spara vrdet i formulret.";
+ Text [ polish ] = "Nie, ja chciabym zapisa t warto tylko w formularzu.";
+ Text [ portuguese_brazilian ] = "Nein, ich mchte den Wert nur im Formular speichern.";
+ Text [ japanese ] = "Al̫тɕۑ܂B";
+ Text [ chinese_simplified ] = "ֻ뽫ֵ";
+ Text [ chinese_traditional ] = "_AusJ@Ӫ椺C";
+ Text [ arabic ] = "ǡ .";
+ Text [ dutch ] = "Nee, ik wil de waarde alleen opslaan in het formulier.";
+ Text [ chinese_simplified ] = "ֻ뽫ֵ";
+ Text [ greek ] = ", .";
+ Text [ korean ] = "ƴϿ, Ŀ ϰڽϴ.";
+ Text [ turkish ] = "Hayr, deeri yalnzca form iinde kaydetmek istiyorum.";
+ };
+};
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:21:55 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index ebaf5d7b9e15..497eabb63323 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: controlwizard.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,9 @@
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
+#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#endif
#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
#endif
@@ -98,6 +101,12 @@
#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
#include <com/sun/star/sdb/CommandType.hpp>
#endif
+#ifndef _COM_SUN_STAR_SDBC_SQLWARNING_HPP_
+#include <com/sun/star/sdbc/SQLWarning.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_
+#include <com/sun/star/sdb/SQLContext.hpp>
+#endif
#ifndef _COMPHELPER_TYPES_HXX_
#include <comphelper/types.hxx>
#endif
@@ -107,6 +116,12 @@
#ifndef _SV_MSGBOX_HXX
#include <vcl/msgbox.hxx>
#endif
+#ifndef _COMPHELPER_INTERACTION_HXX_
+#include <comphelper/interaction.hxx>
+#endif
+#ifndef _VCL_STDTEXT_HXX
+#include <vcl/stdtext.hxx>
+#endif
//.........................................................................
namespace dbp
@@ -125,7 +140,9 @@ namespace dbp
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::sheet;
using namespace ::com::sun::star::form;
+ using namespace ::com::sun::star::task;
using namespace ::svt;
+ using namespace ::comphelper;
//=====================================================================
//= OAccessRegulator
@@ -154,9 +171,9 @@ namespace dbp
}
//---------------------------------------------------------------------
- void OControlWizardPage::updateContext()
+ sal_Bool OControlWizardPage::updateContext()
{
- getDialog()->updateContext(OAccessRegulator());
+ return getDialog()->updateContext(OAccessRegulator());
}
//---------------------------------------------------------------------
@@ -377,17 +394,17 @@ namespace dbp
}
//---------------------------------------------------------------------
- void OControlWizard::updateContext(const OAccessRegulator&)
+ sal_Bool OControlWizard::updateContext(const OAccessRegulator&)
{
- initContext();
+ return initContext();
}
//---------------------------------------------------------------------
- void OControlWizard::initContext()
+ sal_Bool OControlWizard::initContext()
{
DBG_ASSERT(m_aContext.xObjectModel.is(), "OGroupBoxWizard::initContext: have no control model to work with!");
if (!m_aContext.xObjectModel.is())
- return;
+ return sal_False;
// reset the context
m_aContext.xForm.clear();
@@ -397,6 +414,8 @@ namespace dbp
m_aContext.xObjectShape.clear();
m_aContext.aFieldNames.realloc(0);
+ Any aSQLException;
+ Reference< XPreparedStatement > xStatement;
try
{
// get the datasource context
@@ -412,7 +431,6 @@ namespace dbp
implDetermineShape();
// get the columns of the object the settins refer to
- Reference< XPreparedStatement > xStatement;
Reference< XNameAccess > xColumns;
if (m_aContext.xForm.is())
@@ -475,13 +493,50 @@ namespace dbp
if (xColumns.is())
m_aContext.aFieldNames = xColumns->getElementNames();
-
- ::comphelper::disposeComponent(xStatement);
}
+ catch(SQLContext& e) { aSQLException <<= e; }
+ catch(SQLWarning& e) { aSQLException <<= e; }
+ catch(SQLException& e) { aSQLException <<= e; }
catch(Exception&)
{
DBG_ERROR("OControlWizard::initContext: could not retrieve the control context (caught an exception)!");
}
+
+ ::comphelper::disposeComponent(xStatement);
+
+ if (aSQLException.hasValue())
+ { // an SQLException (or derivee) was thrown ...
+
+ // prepend an extra SQLContext explaining what we were doing
+ SQLContext aContext;
+ aContext.Message = String(ModuleRes(RID_STR_COULDNOTOPENTABLE));
+ aContext.NextException = aSQLException;
+
+ // create an interaction handler to display this exception
+ const ::rtl::OUString sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.sdb.InteractionHandler");
+ Reference< XInteractionHandler > xHandler;
+ try
+ {
+ if (getServiceFactory().is())
+ xHandler = Reference< XInteractionHandler >(getServiceFactory()->createInstance(sInteractionHandlerServiceName), UNO_QUERY);
+ }
+ catch(Exception&) { }
+ if (!xHandler.is())
+ {
+ ShowServiceNotAvailableError(this, sInteractionHandlerServiceName, sal_True);
+ return sal_False;
+ }
+
+ Reference< XInteractionRequest > xRequest = new OInteractionRequest(makeAny(aContext));
+ try
+ {
+ xHandler->handle(xRequest);
+ }
+ catch(Exception&) { }
+ return sal_False;
+ }
+
+ return 0 != m_aContext.aFieldNames.getLength();
}
//---------------------------------------------------------------------
@@ -576,6 +631,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:22:07 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx
index d8d9f1678956..de3fff1908a1 100644
--- a/extensions/source/dbpilots/controlwizard.hxx
+++ b/extensions/source/dbpilots/controlwizard.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: controlwizard.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -177,7 +177,7 @@ namespace dbp
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
getServiceFactory();
const OControlWizardContext& getContext();
- void updateContext();
+ sal_Bool updateContext();
public:
OControlWizardPage( OControlWizard* _pParent, const ResId& _rResId );
@@ -224,7 +224,7 @@ namespace dbp
getServiceFactory() const { return m_xORB; }
const OControlWizardContext& getContext() const { return m_aContext; }
- void updateContext(const OAccessRegulator&);
+ sal_Bool updateContext(const OAccessRegulator&);
protected:
// initialize the derivees settings (which have to be derived from OControlWizardSettings)
@@ -241,7 +241,7 @@ namespace dbp
virtual short Execute();
private:
- void initContext();
+ sal_Bool initContext();
void implGetDSContext();
void implDetermineForm();
@@ -261,6 +261,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:22:18 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/dbpilots.src b/extensions/source/dbpilots/dbpilots.src
index 4f5a18c68d52..368773bd28d5 100644
--- a/extensions/source/dbpilots/dbpilots.src
+++ b/extensions/source/dbpilots/dbpilots.src
@@ -2,9 +2,9 @@
*
* $RCSfile: dbpilots.src,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,6 +96,15 @@ ModalDialog RID_DLG_GROUPBOXWIZARD
ModalDialog RID_DLG_LISTCOMBOWIZARD
{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Hide = TRUE;
+};
+
+String RID_STR_LISTWIZARD_TITLE
+{
Text = "AutoPilot Listenfeld";
Text [ english ] = "Auto Pilot List field";
Text [ english_us ] = "Auto Pilot List field";
@@ -118,18 +127,47 @@ ModalDialog RID_DLG_LISTCOMBOWIZARD
Text[ greek ] = "AutoPilot ";
Text[ korean ] = "ڵϷ ʵ";
Text[ turkish ] = "OtoPilot Liste alan";
+};
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Hide = TRUE;
+String RID_STR_COMBOWIZARD_TITLE
+{
+ Text = "AutoPilot Kombinationsfeld";
+ Text [ english_us ] = "AutoPilot Combo Box";
+ Text [ portuguese ] = "AutoPiloto Caixa de combinao";
+ Text [ russian ] = " ";
+ Text [ dutch ] = "AutoPiloot Combinatieveld";
+ Text [ french ] = "AutoPilote Zone combine";
+ Text [ spanish ] = "AutoPiloto Campo combinado";
+ Text [ italian ] = "Pilota automatico Casella combinata";
+ Text [ danish ] = "AutoPilot kombinationsboks";
+ Text [ swedish ] = "AutoPilot kombinationsflt";
+ Text [ polish ] = "Pole kombi AutoPilota";
+ Text [ portuguese_brazilian ] = "Option Group AutoPilot";
+ Text [ japanese ] = "߲ۯ ޯ";
+ Text [ chinese_simplified ] = "Զļ ";
+ Text [ chinese_traditional ] = "۰ɮקUz զX";
+ Text [ arabic ] = " ";
+ Text [ dutch ] = "AutoPiloot Combinatieveld";
+ Text [ chinese_simplified ] = "Զļ ";
+ Text [ greek ] = " AutoPilot";
+ Text [ korean ] = "ڵϷ: ޺ڽ";
+ Text [ turkish ] = "OtoPilot Kombinasyon alan";
+ Text [ language_user1 ] = " ";
};
+String RID_STR_COULDNOTOPENTABLE
+{
+ Text = "Die Tabelle Verbindung zur Datenquelle konnte nicht hergestellt werden.";
+ Text [ english ] = "The connection to the data source could not be established.";
+ Text [ english_us ] = "The connection to the data source could not be established.";
+};
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:22:40 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/dbpresid.hrc b/extensions/source/dbpilots/dbpresid.hrc
index 543af12ae4b0..56e5f2d4a3f8 100644
--- a/extensions/source/dbpilots/dbpresid.hrc
+++ b/extensions/source/dbpilots/dbpresid.hrc
@@ -2,9 +2,9 @@
*
* $RCSfile: dbpresid.hrc,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,6 +79,15 @@
//========================================================================
// dialogs
+#define RID_STR_GROUPWIZ_DBFIELD (RID_STRING_START + 1 )
+#define RID_STR_COMBOWIZ_DBFIELD (RID_STRING_START + 2 )
+#define RID_STR_LISTWIZARD_TITLE (RID_STRING_START + 3 )
+#define RID_STR_COMBOWIZARD_TITLE (RID_STRING_START + 4 )
+#define RID_STR_COULDNOTOPENTABLE (RID_STRING_START + 5 )
+
+//========================================================================
+// dialogs
+
#define RID_DLG_GROUPBOXWIZARD ( RID_DIALOG_START + 1 )
#define RID_DLG_LISTCOMBOWIZARD ( RID_DIALOG_START + 2 )
@@ -200,6 +209,9 @@
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:22:51 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/groupboxpages.src b/extensions/source/dbpilots/groupboxpages.src
index b399eda2eca1..492f915b29fe 100644
--- a/extensions/source/dbpilots/groupboxpages.src
+++ b/extensions/source/dbpilots/groupboxpages.src
@@ -2,9 +2,9 @@
*
* $RCSfile: groupboxpages.src,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: fs $ $Date: 2001-02-21 09:23:45 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -296,162 +296,6 @@ TabPage RID_PAGE_OPTIONVALUES
};
};
-TabPage RID_PAGE_OPTION_DBFIELD
-{
- SVLook = TRUE ;
- Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ;
- Text = "Datenbankfeld";
- Text [ english ] = "Database Field";
- Text [ english_us ] = "Database Field";
- Text [ portuguese ] = "Campo da base de dados";
- Text [ russian ] = " ";
- Text [ dutch ] = "databaseveld";
- Text [ french ] = "Champ de base de donnes";
- Text [ spanish ] = "Campo de base de datos";
- Text [ italian ] = "Campo database";
- Text [ danish ] = "Databasefelt";
- Text [ swedish ] = "Databasflt";
- Text [ polish ] = "Pole bazy danych";
- Text [ portuguese_brazilian ] = "Datenbankfeld";
- Text [ japanese ] = "ްް̨";
- Text [ chinese_simplified ] = "ݿֶ";
- Text [ chinese_traditional ] = "GƮw";
- Text [ arabic ] = " ";
- Text [ dutch ] = "databaseveld";
- Text [ chinese_simplified ] = "ݿֶ";
- Text [ greek ] = " ";
- Text [ korean ] = "ͺ̽ ʵ";
- Text [ turkish ] = "Veritaban alan";
-
- FixedLine FL_DATABASEFIELD_EXPL
- {
- Pos = MAP_APPFONT ( 4 , 3 ) ;
- Size = MAP_APPFONT ( WINDOW_SIZE_X - 8 , 8 ) ;
- };
- FixedText FT_DATABASEFIELD_EXPL
- {
- Pos = MAP_APPFONT ( 7 , 15 ) ;
- Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 16 ) ;
- WordBreak = TRUE;
- Text = "Sie knnen den Wert der Optionsgruppe entweder in einem Datenbankfeld speichern oder ihn fr eine sptere Aktion verwenden.";
- Text [ english ] = "You can either save the value of the option group in a database field or use it for a subsequent action.";
- Text [ english_us ] = "You can either save the value of the option group in a database field or use it for a subsequent action.";
- Text [ portuguese ] = "Poder guardar o valor do grupo de opes num campo da base de dados ou utiliz-lo para uma aco posterior.";
- Text [ russian ] = " , .";
- Text [ dutch ] = "U kunt de waarde van de optiegroep opslaan in een databaseveld of hem een andere keer gebruiken.";
- Text [ french ] = "Vous pouvez soit enregistrer la valeur du groupe d'options dans un champ de base de donnes, soit l'utiliser pour une action ultrieure.";
- Text [ spanish ] = "Puede guardar el valor del grupo de opciones en un campo de base de datos o usarlo para una accin posterior.";
- Text [ italian ] = "Potete salvare il valore del gruppo di opzioni in un campo database oppure utilizzarlo per un'operazione successiva.";
- Text [ danish ] = "Du kan enten gemme alternativgruppens vrdi i et databasefelt eller bruge den til en senere handling.";
- Text [ swedish ] = "Du kan antingen spara alternativgruppens vrde i ett databasflt eller anvnda det till en senare tgrd.";
- Text [ polish ] = "Warto grupy opcji mona zapisa w polu bazy danych lub uy jej w pniejszej akcji.";
- Text [ portuguese_brazilian ] = "Sie knnen den Wert der Optionsgruppe entweder in einem Datenbankfeld speichern oder ihn fr eine sptere Aktion verwenden.";
- Text [ japanese ] = "߼ݸٰ߂̒ĺAްް̨ނɕۑA܂͌̍ƂɎgpł܂B";
- Text [ chinese_simplified ] = "ܹѡСֵһݿԺ";
- Text [ chinese_traditional ] = "zb@ӸƮwxsﶵsժƭȡAHƤϥΥC";
- Text [ arabic ] = " .";
- Text [ dutch ] = "U kunt de waarde van de optiegroep opslaan in een databaseveld of hem een andere keer gebruiken.";
- Text [ chinese_simplified ] = "ܹѡСֵһݿԺ";
- Text [ greek ] = " .";
- Text [ korean ] = "ɼ ׷ ͺ̽ ʵ忡 ϰų ۾ ֽϴ.";
- Text [ turkish ] = "Seenek alannn deerini bir veritaban alannda kaydedebilir ya da bu deeri daha sonra yaplacak bir ilemde kullanabilirsiniz.";
- };
- FixedText FT_DATABASEFIELD_QUEST
- {
- Pos = MAP_APPFONT ( 7 , 34 ) ;
- Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 16 ) ;
- WordBreak = TRUE;
- Text = "Mchten Sie den Wert in einem Datenbankfeld speichern?";
- Text [ english ] = "Do you want to save the value in a database field?";
- Text [ english_us ] = "Do you want to save the value in a database field?";
- Text [ portuguese ] = "Guardar o valor num campo da base de dados?";
- Text [ russian ] = " ?";
- Text [ dutch ] = "Wilt u de waarde opslaan in een databaseveld ?";
- Text [ french ] = "Souhaitez-vous enregistrer la valeur dans un champ de base de donnes ?";
- Text [ spanish ] = "Desea guardar el valor en un campo de base de datos?";
- Text [ italian ] = "Volete salvare il valore in un campo database ?";
- Text [ danish ] = "Vil du gemme vrdien i et databasefelt?";
- Text [ swedish ] = "Vill Du spara vrdet i ett databasflt ?";
- Text [ polish ] = "Czy zapisa t warto w polu bazy danych ?";
- Text [ portuguese_brazilian ] = "Mchten Sie den Wert in einem Datenbankfeld speichern ?";
- Text [ japanese ] = "lްް̨ނɕۑ܂B";
- Text [ chinese_simplified ] = "Ҫ̵ֵһݿڣ";
- Text [ chinese_traditional ] = "znbƮw줺xsoӼƭȡH";
- Text [ arabic ] = " ʿ";
- Text [ dutch ] = "Wilt u de waarde opslaan in een databaseveld ?";
- Text [ chinese_simplified ] = "Ҫ̵ֵһݿڣ";
- Text [ greek ] = " ;";
- Text [ korean ] = "ͺ̽ ʵ Ͻðڽϱ?";
- Text [ turkish ] = "Deeri bir veritaban alannda kaydetmek istiyor musunuz?";
- };
- RadioButton RB_STOREINFIELD_YES
- {
- Pos = MAP_APPFONT ( 7 , 53 ) ;
- Size = MAP_APPFONT ( WINDOW_HALF_SIZE_X - 10, 10 ) ;
- Group = TRUE;
- TabStop = TRUE;
- Text = "~Ja, und zwar in folgendem Datenbankfeld :";
- Text [ english ] = "~Yes, save it in the following database field:";
- Text [ english_us ] = "~Yes, save it in the following database field:";
- Text [ portuguese ] = "Sim, no seguinte:";
- Text [ russian ] = ". :";
- Text [ dutch ] = "Ja, en wel in het volgende databaseveld :";
- Text [ french ] = "Oui, dans le champ suivant :";
- Text [ spanish ] = "S, en el siguiente campo :";
- Text [ italian ] = "S, nel seguente campo database :";
- Text [ danish ] = "Ja, den skal gemmes i flgende databasefelt:";
- Text [ swedish ] = "Ja, i fljande databasflt :";
- Text [ polish ] = "Tak, jest to moliwe w nastpujcym polu bazy danych :";
- Text [ portuguese_brazilian ] = "Ja, und zwar in folgendem Datenbankfeld :";
- Text [ japanese ] = "͂Aްް̨ނɂɂ܂:";
- Text [ chinese_simplified ] = "ǣµݿ";
- Text [ chinese_traditional ] = "OAUCƮwG";
- Text [ arabic ] = " :";
- Text [ dutch ] = "Ja, en wel in het volgende databaseveld :";
- Text [ chinese_simplified ] = "ǣµݿ";
- Text [ greek ] = ", :";
- Text [ korean ] = ", ͺ̽ ʵ忡 Ͻʽÿ:";
- Text [ turkish ] = "Evet, aadaki veritaban alannda kaydedebilirsiniz :";
- };
- ListBox LB_STOREINFIELD
- {
- Pos = MAP_APPFONT ( WINDOW_HALF_SIZE_X + 3 , 51 ) ;
- Size = MAP_APPFONT ( WINDOW_HALF_SIZE_X - 10, 14 ) ;
- TabStop = TRUE;
- SVLook = TRUE ;
- Border = TRUE ;
- DropDown = TRUE;
- AutoHScroll = TRUE ;
- };
- RadioButton RB_STOREINFIELD_NO
- {
- Pos = MAP_APPFONT ( 7 , 68 ) ;
- Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 10 ) ;
- TabStop = FALSE;
- Text = "~Nein, ich mchte den Wert nur im Formular speichern.";
- Text [ english ] = "~No, I only want to save the value in the form.";
- Text [ english_us ] = "~No, I only want to save the value in the form.";
- Text [ portuguese ] = "No. Guardar apenas no formulrio.";
- Text [ russian ] = ". ";
- Text [ dutch ] = "Nee, ik wil de waarde alleen opslaan in het formulier.";
- Text [ french ] = "Non, je souhaite enregistrer la valeur uniquement dans le formulaire.";
- Text [ spanish ] = "No, deseo guardar el valor solo en el formulario.";
- Text [ italian ] = "Salva il valore solo nel formulario.";
- Text [ danish ] = "Nej, jeg vil kun gemme vrdien i formularen.";
- Text [ swedish ] = "Nej, jag vill bara spara vrdet i formulret.";
- Text [ polish ] = "Nie, ja chciabym zapisa t warto tylko w formularzu.";
- Text [ portuguese_brazilian ] = "Nein, ich mchte den Wert nur im Formular speichern.";
- Text [ japanese ] = "Al̫тɕۑ܂B";
- Text [ chinese_simplified ] = "ֻ뽫ֵ";
- Text [ chinese_traditional ] = "_AusJ@Ӫ椺C";
- Text [ arabic ] = "ǡ .";
- Text [ dutch ] = "Nee, ik wil de waarde alleen opslaan in het formulier.";
- Text [ chinese_simplified ] = "ֻ뽫ֵ";
- Text [ greek ] = ", .";
- Text [ korean ] = "ƴϿ, Ŀ ϰڽϴ.";
- Text [ turkish ] = "Hayr, deeri yalnzca form iinde kaydetmek istiyorum.";
- };
-};
TabPage RID_PAGE_OPTIONS_FINAL
{
SVLook = TRUE ;
@@ -550,9 +394,38 @@ TabPage RID_PAGE_OPTIONS_FINAL
};
};
+String RID_STR_GROUPWIZ_DBFIELD
+{
+ Text = "Sie knnen den Wert der Optionsgruppe entweder in einem Datenbankfeld speichern oder ihn fr eine sptere Aktion verwenden.";
+ Text [ english ] = "You can either save the value of the option group in a database field or use it for a subsequent action.";
+ Text [ english_us ] = "You can either save the value of the option group in a database field or use it for a subsequent action.";
+ Text [ portuguese ] = "Poder guardar o valor do grupo de opes num campo da base de dados ou utiliz-lo para uma aco posterior.";
+ Text [ russian ] = " , .";
+ Text [ dutch ] = "U kunt de waarde van de optiegroep opslaan in een databaseveld of hem een andere keer gebruiken.";
+ Text [ french ] = "Vous pouvez soit enregistrer la valeur du groupe d'options dans un champ de base de donnes, soit l'utiliser pour une action ultrieure.";
+ Text [ spanish ] = "Puede guardar el valor del grupo de opciones en un campo de base de datos o usarlo para una accin posterior.";
+ Text [ italian ] = "Potete salvare il valore del gruppo di opzioni in un campo database oppure utilizzarlo per un'operazione successiva.";
+ Text [ danish ] = "Du kan enten gemme alternativgruppens vrdi i et databasefelt eller bruge den til en senere handling.";
+ Text [ swedish ] = "Du kan antingen spara alternativgruppens vrde i ett databasflt eller anvnda det till en senare tgrd.";
+ Text [ polish ] = "Warto grupy opcji mona zapisa w polu bazy danych lub uy jej w pniejszej akcji.";
+ Text [ portuguese_brazilian ] = "Sie knnen den Wert der Optionsgruppe entweder in einem Datenbankfeld speichern oder ihn fr eine sptere Aktion verwenden.";
+ Text [ japanese ] = "߼ݸٰ߂̒ĺAްް̨ނɕۑA܂͌̍ƂɎgpł܂B";
+ Text [ chinese_simplified ] = "ܹѡСֵһݿԺ";
+ Text [ chinese_traditional ] = "zb@ӸƮwxsﶵsժƭȡAHƤϥΥC";
+ Text [ arabic ] = " .";
+ Text [ dutch ] = "U kunt de waarde van de optiegroep opslaan in een databaseveld of hem een andere keer gebruiken.";
+ Text [ chinese_simplified ] = "ܹѡСֵһݿԺ";
+ Text [ greek ] = " .";
+ Text [ korean ] = "ɼ ׷ ͺ̽ ʵ忡 ϰų ۾ ֽϴ.";
+ Text [ turkish ] = "Seenek alannn deerini bir veritaban alannda kaydedebilir ya da bu deeri daha sonra yaplacak bir ilemde kullanabilirsiniz.";
+};
+
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.1 2001/02/21 09:23:45 fs
+ * initial checkin - form control auto pilots
+ *
*
* Revision 1.0 14.02.01 12:47:37 fs
************************************************************************/
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 4442caa6f8f3..ddc2db3a4634 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: groupboxwiz.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -373,73 +373,6 @@ namespace dbp
}
//=====================================================================
- //= OMaybeListSelectionPage
- //=====================================================================
- //---------------------------------------------------------------------
- OMaybeListSelectionPage::OMaybeListSelectionPage( OControlWizard* _pParent, const ResId& _rId )
- :OGBWPage(_pParent, _rId)
- ,m_pYes(NULL)
- ,m_pNo(NULL)
- ,m_pList(NULL)
- {
- }
-
- //---------------------------------------------------------------------
- void OMaybeListSelectionPage::announceControls(RadioButton& _rYesButton, RadioButton& _rNoButton, ListBox& _rSelection)
- {
- m_pYes = &_rYesButton;
- m_pNo = &_rNoButton;
- m_pList = &_rSelection;
-
- m_pYes->SetClickHdl(LINK(this, OMaybeListSelectionPage, OnRadioSelected));
- m_pNo->SetClickHdl(LINK(this, OMaybeListSelectionPage, OnRadioSelected));
- implEnableWindows();
- }
-
- //---------------------------------------------------------------------
- IMPL_LINK( OMaybeListSelectionPage, OnRadioSelected, RadioButton*, NOTINTERESTEDIN )
- {
- implEnableWindows();
- return 0L;
- }
-
- //---------------------------------------------------------------------
- void OMaybeListSelectionPage::implInitialize(const String& _rSelection)
- {
- DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::implInitialize: no controls announced!");
- sal_Bool bIsSelection = (0 != _rSelection.Len());
- m_pYes->Check(bIsSelection);
- m_pNo->Check(!bIsSelection);
- m_pList->Enable(bIsSelection);
-
- m_pList->SelectEntry(bIsSelection ? _rSelection : String());
- }
-
- //---------------------------------------------------------------------
- void OMaybeListSelectionPage::implCommit(String& _rSelection)
- {
- _rSelection = m_pYes->IsChecked() ? m_pList->GetSelectEntry() : String();
- }
-
- //---------------------------------------------------------------------
- void OMaybeListSelectionPage::implEnableWindows()
- {
- m_pList->Enable(m_pYes->IsChecked());
- }
-
- //---------------------------------------------------------------------
- void OMaybeListSelectionPage::ActivatePage()
- {
- OGBWPage::ActivatePage();
-
- DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::ActivatePage: no controls announced!");
- if (m_pYes->IsChecked())
- m_pList->GrabFocus();
- else
- m_pNo->GrabFocus();
- }
-
- //=====================================================================
//= ODefaultFieldSelectionPage
//=====================================================================
//---------------------------------------------------------------------
@@ -481,8 +414,10 @@ namespace dbp
{
if (!OMaybeListSelectionPage::commitPage(_eReason))
return sal_False;
+
OOptionGroupSettings& rSettings = getSettings();
implCommit(rSettings.sDefaultField);
+
return sal_True;
}
@@ -578,41 +513,19 @@ namespace dbp
}
//=====================================================================
- //= OOptionValuesPage
+ //= OOptionDBFieldPage
//=====================================================================
//---------------------------------------------------------------------
OOptionDBFieldPage::OOptionDBFieldPage( OControlWizard* _pParent )
- :OMaybeListSelectionPage(_pParent, ModuleRes(RID_PAGE_OPTION_DBFIELD))
- ,m_aFrame (this, ResId(FL_DATABASEFIELD_EXPL))
- ,m_aDescription (this, ResId(FT_DATABASEFIELD_EXPL))
- ,m_aQuestion (this, ResId(FT_DATABASEFIELD_QUEST))
- ,m_aStoreYes (this, ResId(RB_STOREINFIELD_YES))
- ,m_aStoreNo (this, ResId(LB_STOREINFIELD))
- ,m_aStoreWhere (this, ResId(RB_STOREINFIELD_NO))
+ :ODBFieldPage(_pParent)
{
- FreeResource();
- announceControls(m_aStoreYes, m_aStoreNo, m_aStoreWhere);
- m_aStoreWhere.SetDropDownLineCount(10);
+ setDescriptionText(String(ModuleRes(RID_STR_GROUPWIZ_DBFIELD)));
}
//---------------------------------------------------------------------
- void OOptionDBFieldPage::initializePage()
+ String& OOptionDBFieldPage::getDBFieldSetting()
{
- OMaybeListSelectionPage::initializePage();
-
- // fill the fields page
- fillListBox(m_aStoreWhere, getContext().aFieldNames);
-
- const OOptionGroupSettings& rSettings = getSettings();
- implInitialize(rSettings.sDBField);
- }
-
- //---------------------------------------------------------------------
- sal_Bool OOptionDBFieldPage::commitPage(COMMIT_REASON _eReason)
- {
- if (!OMaybeListSelectionPage::commitPage(_eReason))
- return sal_False;
- return sal_True;
+ return getSettings().sDBField;
}
//=====================================================================
@@ -663,6 +576,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:23:55 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx
index a50f871ea6d1..fbfb690fb578 100644
--- a/extensions/source/dbpilots/groupboxwiz.hxx
+++ b/extensions/source/dbpilots/groupboxwiz.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: groupboxwiz.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:08 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,9 @@
#ifndef _EXTENSIONS_DBP_CONTROLWIZARD_HXX
#include "controlwizard.hxx"
#endif
+#ifndef _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_
+#include "commonpagesdbp.hxx"
+#endif
//.........................................................................
namespace dbp
@@ -131,37 +134,6 @@ namespace dbp
};
//=====================================================================
- //= OMaybeListSelectionPage
- //=====================================================================
- class OMaybeListSelectionPage : public OGBWPage
- {
- protected:
- RadioButton* m_pYes;
- RadioButton* m_pNo;
- ListBox* m_pList;
-
- public:
- OMaybeListSelectionPage( OControlWizard* _pParent, const ResId& _rId );
-
- protected:
- DECL_LINK( OnRadioSelected, RadioButton* );
-
- // TabPage overridables
- void ActivatePage();
-
- // own helper
- void announceControls(
- RadioButton& _rYesButton,
- RadioButton& _rNoButton,
- ListBox& _rSelection);
-
- void implEnableWindows();
-
- void implInitialize(const String& _rSelection);
- void implCommit(String& _rSelection);
- };
-
- //=====================================================================
//= ORadioSelectionPage
//=====================================================================
class ORadioSelectionPage : public OGBWPage
@@ -212,6 +184,8 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
virtual sal_Bool commitPage(COMMIT_REASON _eReason);
+
+ OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
};
//=====================================================================
@@ -249,23 +223,16 @@ namespace dbp
//=====================================================================
//= OOptionDBFieldPage
//=====================================================================
- class OOptionDBFieldPage : public OMaybeListSelectionPage
+ class OOptionDBFieldPage : public ODBFieldPage
{
- protected:
- FixedLine m_aFrame;
- FixedText m_aDescription;
- FixedText m_aQuestion;
- RadioButton m_aStoreYes;
- RadioButton m_aStoreNo;
- ListBox m_aStoreWhere;
-
public:
OOptionDBFieldPage( OControlWizard* _pParent );
protected:
- // OWizardPage overridables
- virtual void initializePage();
- virtual sal_Bool commitPage(COMMIT_REASON _eReason);
+ OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
+
+ // ODBFieldPage overridables
+ virtual String& getDBFieldSetting();
};
//=====================================================================
@@ -300,6 +267,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.2 2001/02/23 15:19:08 fs
+ * some changes / centralizations - added the list-/combobox wizard
+ *
* Revision 1.1 2001/02/21 09:24:04 fs
* initial checkin - form control auto pilots
*
diff --git a/extensions/source/dbpilots/listcombopages.src b/extensions/source/dbpilots/listcombopages.src
index bdd9346903a8..97e07a2a54a2 100644
--- a/extensions/source/dbpilots/listcombopages.src
+++ b/extensions/source/dbpilots/listcombopages.src
@@ -2,9 +2,9 @@
*
* $RCSfile: listcombopages.src,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:19:54 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -381,9 +381,38 @@ TabPage RID_PAGE_LCW_FIELDLINK
};
};
+String RID_STR_COMBOWIZ_DBFIELD
+{
+ Text = "Sie knnen den Wert des Kombinationsfeldes entweder in einem Datenbankfeld speichern oder ihn nur zum Anzeigen verwenden.";
+ Text [ english ] = "You can either save the value of the combo box field in a database field or use it for display purposes.";
+ Text [ english_us ] = "You can either save the value of the combo box field in a database field or use it for display purposes.";
+ Text [ portuguese ] = "Poder guardar o valor da caixa de combinao num campo da base de dados ou utiliz-lo apenas para visualizao.";
+ Text [ russian ] = " .";
+ Text [ dutch ] = "U kunt de waarde van het combinatieveld in een databaseveld opslaan of deze alleen laten weergeven.";
+ Text [ french ] = "Vous pouvez soit enregistrer la valeur de la zone combine dans un champ de base de donnes, soit l'utiliser seulement pour l'affichage.";
+ Text [ spanish ] = "Puede guardar el valor del campo combinado en un campo de base de datos o usarlo solo para mostrarlo.";
+ Text [ italian ] = "Potete salvare il valore della casella combinata in un campo database oppure utilizzarlo solo per visualizzarlo.";
+ Text [ danish ] = "Du kan enten gemme kombinationsboksens vrdi i et databasefelt eller kun bruge den til visning.";
+ Text [ swedish ] = "Du kan antingen spara kombinationsfltets vrde i ett databasflt eller bara anvnda det fr visning.";
+ Text [ polish ] = "Warto pola kombi mona zapisa w polu bazy danych lub uy jej tylko do wywietlenia.";
+ Text [ portuguese_brazilian ] = "Yes, in the following database:";
+ Text [ japanese ] = "ޯ̒lްް̨ނɕۑA邢͕\\邽߂Ɏgpł܂B";
+ Text [ chinese_simplified ] = "ܹеֵݿڻʾ";
+ Text [ chinese_traditional ] = "zNզX쪺ƭȦsJ@ӸƮwܳoǼƾڡC";
+ Text [ arabic ] = " ʡ .";
+ Text [ dutch ] = "U kunt de waarde van het combinatieveld in een databaseveld opslaan of deze alleen laten weergeven.";
+ Text [ chinese_simplified ] = "ܹеֵݿڻʾ";
+ Text [ greek ] = " .";
+ Text [ korean ] = "޺ڽ ͺ̽ ʵ忡 ϰų Ÿ⿡ ֽϴ.";
+ Text [ turkish ] = "Kombinasyon alannn deerini bir veritaban alannda kaydedebilir ya da yalnzca grntleme iin kullanabilirsiniz.";
+};
+
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.1 2001/02/23 15:19:54 fs
+ * initial checkin - list-/combobox wizard (not comlpletely finished yet)
+ *
*
* Revision 1.0 21.02.01 16:16:18 fs
************************************************************************/
diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx
index 3a4b64a89971..24534bd0aff1 100644
--- a/extensions/source/dbpilots/listcombowizard.cxx
+++ b/extensions/source/dbpilots/listcombowizard.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: listcombowizard.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:20:11 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,11 +87,6 @@
#include <connectivity/dbtools.hxx>
#endif
-#define LCW_STATE_DATASOURCE_SELECTION 0
-#define LCW_STATE_TABLESELECTION 1
-#define LCW_STATE_FIELDSELECTION 2
-#define LCW_STATE_FIELDLINK 3
-
//.........................................................................
namespace dbp
{
@@ -134,9 +129,11 @@ namespace dbp
{
case FormComponentType::LISTBOX:
m_bListBox = sal_True;
+ setTitleBase(String(ModuleRes(RID_STR_LISTWIZARD_TITLE)));
return sal_True;
case FormComponentType::COMBOBOX:
m_bListBox = sal_False;
+ setTitleBase(String(ModuleRes(RID_STR_COMBOWIZARD_TITLE)));
return sal_True;
}
return sal_False;
@@ -145,7 +142,6 @@ namespace dbp
//---------------------------------------------------------------------
OWizardPage* OListComboWizard::createPage(sal_uInt16 _nState)
{
- // TODO
switch (_nState)
{
case LCW_STATE_DATASOURCE_SELECTION:
@@ -156,6 +152,8 @@ namespace dbp
return new OContentFieldSelection(this);
case LCW_STATE_FIELDLINK:
return new OLinkFieldsPage(this);
+ case LCW_STATE_COMBODBFIELD:
+ return new OComboDBFieldPage(this);
}
return NULL;
@@ -171,10 +169,9 @@ namespace dbp
case LCW_STATE_TABLESELECTION:
return LCW_STATE_FIELDSELECTION;
case LCW_STATE_FIELDSELECTION:
- return LCW_STATE_FIELDLINK;
+ return getFinalState();
}
- // TODO
return WZS_INVALID_STATE;
}
@@ -184,11 +181,11 @@ namespace dbp
OControlWizard::enterState(_nState);
enableButtons(WZB_PREVIOUS, m_bHadDataSelection ? (LCW_STATE_DATASOURCE_SELECTION < _nState) : LCW_STATE_TABLESELECTION < _nState);
- enableButtons(WZB_NEXT, LCW_STATE_FIELDLINK != _nState);
- if (_nState < LCW_STATE_FIELDLINK)
+ enableButtons(WZB_NEXT, getFinalState() != _nState);
+ if (_nState < getFinalState())
enableButtons(WZB_FINISH, sal_False);
- if (LCW_STATE_FIELDLINK == _nState)
+ if (getFinalState() == _nState)
defaultButton(WZB_FINISH);
}
@@ -198,7 +195,7 @@ namespace dbp
if (!OControlWizard::leaveState(_nState))
return sal_False;
- if (LCW_STATE_FIELDLINK == _nState)
+ if (getFinalState() == _nState)
defaultButton(WZB_NEXT);
return sal_True;
@@ -209,30 +206,30 @@ namespace dbp
{
try
{
+ // for quoting identifiers, we need the connection meta data
+ Reference< XConnection > xConn;
+ getContext().xForm->getPropertyValue(::rtl::OUString::createFromAscii("ActiveConnection")) >>= xConn;
+ DBG_ASSERT(xConn.is(), "OListComboWizard::implApplySettings: no connection, unable to quote!");
+ Reference< XDatabaseMetaData > xMetaData;
+ if (xConn.is())
+ xMetaData = xConn->getMetaData();
+
+ // do some quotings
+ if (xMetaData.is())
+ {
+ getSettings().sLinkedListField = quoteTableName(xMetaData, getSettings().sLinkedListField);
+ getSettings().sListContentTable = quoteTableName(xMetaData, getSettings().sListContentTable);
+ getSettings().sListContentField = quoteTableName(xMetaData, getSettings().sListContentField);
+ }
+
+ // ListSourceType: SQL
+ getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("ListSourceType"), makeAny((sal_Int32)ListSourceType_SQL));
+
if (isListBox())
{
- // some defaults:
- // ListSourceType: SQL
- getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("ListSourceType"), makeAny((sal_Int32)ListSourceType_SQL));
// BoundColumn: 1
getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("BoundColumn"), makeAny((sal_Int16)1));
- // for quoting identifiers, we need the connection meta data
- Reference< XConnection > xConn;
- getContext().xForm->getPropertyValue(::rtl::OUString::createFromAscii("ActiveConnection")) >>= xConn;
- DBG_ASSERT(xConn.is(), "OListComboWizard::implApplySettings: no connection, unable to quote!");
- Reference< XDatabaseMetaData > xMetaData;
- if (xConn.is())
- xMetaData = xConn->getMetaData();
-
- // do some quotings
- if (xMetaData.is())
- {
- getSettings().sLinkedListField = quoteTableName(xMetaData, getSettings().sLinkedListField);
- getSettings().sListContentTable = quoteTableName(xMetaData, getSettings().sListContentTable);
- getSettings().sListContentField = quoteTableName(xMetaData, getSettings().sListContentField);
- }
-
// build the statement to set as list source
String sStatement;
sStatement.AppendAscii("SELECT ");
@@ -241,18 +238,23 @@ namespace dbp
sStatement += getSettings().sLinkedListField;
sStatement.AppendAscii(" FROM ");
sStatement += getSettings().sListContentTable;
- // TODO: Identifier quoting
Sequence< ::rtl::OUString > aListSource(1);
aListSource[0] = sStatement;
getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("ListSource"), makeAny(aListSource));
-
- // the bound field
- getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("DataField"), makeAny(::rtl::OUString(getSettings().sLinkedFormField)));
}
else
{
- // TODO
+ // build the statement to set as list source
+ String sStatement;
+ sStatement.AppendAscii("SELECT DISTINCT ");
+ sStatement += getSettings().sListContentField;
+ sStatement.AppendAscii(" FROM ");
+ sStatement += getSettings().sListContentTable;
+ getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("ListSource"), makeAny(::rtl::OUString(sStatement)));
}
+
+ // the bound field
+ getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("DataField"), makeAny(::rtl::OUString(getSettings().sLinkedFormField)));
}
catch(Exception&)
{
@@ -558,6 +560,35 @@ namespace dbp
return sal_True;
}
+ //=====================================================================
+ //= OComboDBFieldPage
+ //=====================================================================
+ //---------------------------------------------------------------------
+ OComboDBFieldPage::OComboDBFieldPage( OControlWizard* _pParent )
+ :ODBFieldPage(_pParent)
+ {
+ setDescriptionText(String(ModuleRes(RID_STR_COMBOWIZ_DBFIELD)));
+ }
+
+ //---------------------------------------------------------------------
+ String& OComboDBFieldPage::getDBFieldSetting()
+ {
+ return getSettings().sLinkedFormField;
+ }
+
+ //---------------------------------------------------------------------
+ void OComboDBFieldPage::ActivatePage()
+ {
+ ODBFieldPage::ActivatePage();
+ getDialog()->enableButtons(WZB_FINISH, sal_True);
+ }
+
+ //---------------------------------------------------------------------
+ sal_Bool OComboDBFieldPage::determineNextButtonState()
+ {
+ // we're on the last page here, no travelNext allowed ...
+ return sal_False;
+ }
//.........................................................................
} // namespace dbp
@@ -566,6 +597,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.1 2001/02/23 15:20:11 fs
+ * initial checkin - list-/combobox wizard (not comlpletely finished yet)
+ *
*
* Revision 1.0 21.02.01 15:51:07 fs
************************************************************************/
diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx
index 1541660e23be..dead1716923c 100644
--- a/extensions/source/dbpilots/listcombowizard.hxx
+++ b/extensions/source/dbpilots/listcombowizard.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: listcombowizard.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: fs $ $Date: 2001-02-23 15:20:18 $
+ * last change: $Author: fs $ $Date: 2001-02-28 09:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,12 +65,21 @@
#ifndef _EXTENSIONS_DBP_CONTROLWIZARD_HXX
#include "controlwizard.hxx"
#endif
+#ifndef _EXTENSIONS_DBP_COMMONPAGESDBP_HXX_
+#include "commonpagesdbp.hxx"
+#endif
//.........................................................................
namespace dbp
{
//.........................................................................
+#define LCW_STATE_DATASOURCE_SELECTION 0
+#define LCW_STATE_TABLESELECTION 1
+#define LCW_STATE_FIELDSELECTION 2
+#define LCW_STATE_FIELDLINK 3
+#define LCW_STATE_COMBODBFIELD 4
+
//=====================================================================
//= OListComboSettings
//=====================================================================
@@ -114,6 +123,8 @@ namespace dbp
virtual sal_Bool approveControlType(sal_Int16 _nClassId);
+ sal_uInt16 getFinalState() const { return isListBox() ? LCW_STATE_FIELDLINK : LCW_STATE_COMBODBFIELD; }
+
private:
void implApplySettings();
};
@@ -225,6 +236,27 @@ namespace dbp
DECL_LINK(OnSelectionModified, void*);
};
+ //=====================================================================
+ //= OComboDBFieldPage
+ //=====================================================================
+ class OComboDBFieldPage : public ODBFieldPage
+ {
+ public:
+ OComboDBFieldPage( OControlWizard* _pParent );
+
+ protected:
+ OListComboSettings& getSettings() { return static_cast<OListComboWizard*>(getDialog())->getSettings(); }
+
+ // TabPage overridables
+ virtual void ActivatePage();
+
+ // OWizardPage overridables
+ virtual sal_Bool determineNextButtonState();
+
+ // ODBFieldPage overridables
+ virtual String& getDBFieldSetting();
+ };
+
//.........................................................................
} // namespace dbp
//.........................................................................
@@ -234,6 +266,9 @@ namespace dbp
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.1 2001/02/23 15:20:18 fs
+ * initial checkin - list-/combobox wizard (not comlpletely finished yet)
+ *
*
* Revision 1.0 21.02.01 15:46:59 fs
************************************************************************/