From 3953eb3d83f4bb2f388eb1853f1f4976b150bab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Palenik=20Mih=C3=A1ly?= Date: Thu, 14 Aug 2014 15:39:05 +0200 Subject: [PATCH] Convert RID_PAGE_OPTION_DBFIELD tabpage to .ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5ab4c42cf5467254423396ce4f56390fc2fb5276 Reviewed-on: https://gerrit.libreoffice.org/10920 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- extensions/UIConfig_sabpilot.mk | 1 + extensions/source/dbpilots/commonpagesdbp.cxx | 21 ++-- extensions/source/dbpilots/commonpagesdbp.hxx | 12 +- extensions/source/dbpilots/commonpagesdbp.src | 52 +------- extensions/source/dbpilots/dbpresid.hrc | 28 +---- .../uiconfig/sabpilot/ui/optiondbfieldpage.ui | 111 ++++++++++++++++++ 6 files changed, 130 insertions(+), 95 deletions(-) create mode 100644 extensions/uiconfig/sabpilot/ui/optiondbfieldpage.ui diff --git a/extensions/UIConfig_sabpilot.mk b/extensions/UIConfig_sabpilot.mk index 045665565892..8dfe1462c1c8 100644 --- a/extensions/UIConfig_sabpilot.mk +++ b/extensions/UIConfig_sabpilot.mk @@ -19,6 +19,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sabpilot,\ extensions/uiconfig/sabpilot/ui/gridfieldsselectionpage \ extensions/uiconfig/sabpilot/ui/groupradioselectionpage \ extensions/uiconfig/sabpilot/ui/invokeadminpage \ + extensions/uiconfig/sabpilot/ui/optiondbfieldpage \ extensions/uiconfig/sabpilot/ui/optionsfinalpage \ extensions/uiconfig/sabpilot/ui/optionvaluespage \ extensions/uiconfig/sabpilot/ui/selecttablepage \ diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 414b5e3cf090..25090d8678ce 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -456,17 +456,16 @@ namespace dbp ODBFieldPage::ODBFieldPage( OControlWizard* _pParent ) - :OMaybeListSelectionPage(_pParent, ModuleRes(RID_PAGE_OPTION_DBFIELD)) - ,m_aFrame (this, ModuleRes(FL_DATABASEFIELD_EXPL)) - ,m_aDescription (this, ModuleRes(FT_DATABASEFIELD_EXPL)) - ,m_aQuestion (this, ModuleRes(FT_DATABASEFIELD_QUEST)) - ,m_aStoreYes (this, ModuleRes(RB_STOREINFIELD_YES)) - ,m_aStoreNo (this, ModuleRes(LB_STOREINFIELD)) - ,m_aStoreWhere (this, ModuleRes(RB_STOREINFIELD_NO)) + :OMaybeListSelectionPage(_pParent, "OptionDBField", "modules/sabpilot/ui/optiondbfieldpage.ui") { - FreeResource(); - announceControls(m_aStoreYes, m_aStoreNo, m_aStoreWhere); - m_aStoreWhere.SetDropDownLineCount(10); + get(m_pDescription, "explLabel"); + get(m_pStoreYes, "yesRadiobutton"); + get(m_pStoreNo, "noRadiobutton"); + get(m_pStoreWhere, "storeInFieldCombobox"); + SetText(ModuleRes(RID_STR_OPTION_DB_FIELD_TITLE)); + + announceControls(*m_pStoreYes, *m_pStoreNo, *m_pStoreWhere); + m_pStoreWhere->SetDropDownLineCount(10); } @@ -475,7 +474,7 @@ namespace dbp OMaybeListSelectionPage::initializePage(); // fill the fields page - fillListBox(m_aStoreWhere, getContext().aFieldNames); + fillListBox(*m_pStoreWhere, getContext().aFieldNames); implInitialize(getDBFieldSetting()); } diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx index 09ccc77e5cd6..d8da4185c5ce 100644 --- a/extensions/source/dbpilots/commonpagesdbp.hxx +++ b/extensions/source/dbpilots/commonpagesdbp.hxx @@ -106,18 +106,16 @@ namespace dbp class ODBFieldPage : public OMaybeListSelectionPage { protected: - FixedLine m_aFrame; - FixedText m_aDescription; - FixedText m_aQuestion; - RadioButton m_aStoreYes; - RadioButton m_aStoreNo; - ListBox m_aStoreWhere; + FixedText* m_pDescription; + RadioButton* m_pStoreYes; + RadioButton* m_pStoreNo; + ListBox* m_pStoreWhere; public: ODBFieldPage( OControlWizard* _pParent ); protected: - void setDescriptionText(const OUString& _rDesc) { m_aDescription.SetText(_rDesc); } + void setDescriptionText(const OUString& _rDesc) { m_pDescription->SetText(_rDesc); } // OWizardPage overridables virtual void initializePage() SAL_OVERRIDE; diff --git a/extensions/source/dbpilots/commonpagesdbp.src b/extensions/source/dbpilots/commonpagesdbp.src index d40c75954046..896bc0e6dc4c 100644 --- a/extensions/source/dbpilots/commonpagesdbp.src +++ b/extensions/source/dbpilots/commonpagesdbp.src @@ -32,59 +32,9 @@ Image IMG_QUERY MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; -TabPage RID_PAGE_OPTION_DBFIELD +String RID_STR_OPTION_DB_FIELD_TITLE { - HelpID = "extensions:TabPage:RID_PAGE_OPTION_DBFIELD"; - SVLook = TRUE ; - Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; Text [ en-US ] = "Database Field"; - - 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 [ en-US ] = "Do you want to save the value in a database field?"; - }; - RadioButton RB_STOREINFIELD_YES - { - HelpID = "extensions:RadioButton:RID_PAGE_OPTION_DBFIELD:RB_STOREINFIELD_YES"; - Pos = MAP_APPFONT ( 7 , 53 ) ; - Size = MAP_APPFONT ( WINDOW_HALF_SIZE_X + 20, 10 ) ; - Group = TRUE; - TabStop = TRUE; - Text [ en-US ] = "~Yes, I want to save it in the following database field:"; - }; - ListBox LB_STOREINFIELD - { - HelpID = "extensions:ListBox:RID_PAGE_OPTION_DBFIELD:LB_STOREINFIELD"; - Pos = MAP_APPFONT ( WINDOW_HALF_SIZE_X + 23, 51 ) ; - Size = MAP_APPFONT ( WINDOW_HALF_SIZE_X - 30, 14 ) ; - TabStop = TRUE; - SVLook = TRUE ; - Border = TRUE ; - DropDown = TRUE; - AutoHScroll = TRUE ; - }; - RadioButton RB_STOREINFIELD_NO - { - HelpID = "extensions:RadioButton:RID_PAGE_OPTION_DBFIELD:RB_STOREINFIELD_NO"; - Pos = MAP_APPFONT ( 7 , 68 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 14, 10 ) ; - TabStop = FALSE; - Text [ en-US ] = "~No, I only want to save the value in the form."; - }; }; String RID_STR_TYPE_TABLE diff --git a/extensions/source/dbpilots/dbpresid.hrc b/extensions/source/dbpilots/dbpresid.hrc index 503059af88a3..2f38f993b68e 100644 --- a/extensions/source/dbpilots/dbpresid.hrc +++ b/extensions/source/dbpilots/dbpresid.hrc @@ -46,20 +46,14 @@ #define RID_STR_FIELDINFO_COMBOBOX (RID_STRING_START + 12 ) #define RID_STR_GRIDWIZARD_TITLE (RID_STRING_START + 13 ) #define RID_STR_GROUPWIZARD_TITLE (RID_STRING_START + 14 ) +#define RID_STR_OPTION_DB_FIELD_TITLE (RID_STRING_START + 15 ) // please adjust RID_STRING_END (below) when adding new strings -#define RID_STRING_END RID_STR_TIMEPOSTFIX +#define RID_STRING_END RID_STR_OPTION_DB_FIELD_TITLE // please adjust RID_DIALOG_END (below) when adding new dialogs #define RID_DIALOG_END ( RID_DIALOG_START + 3 ) -// tab pages - -#define RID_PAGE_OPTION_DBFIELD ( RID_PAGE_START + 5 ) - -// please adjust RID_PAGE_END (below) when adding new tab pages -#define RID_PAGE_END RID_PAGE_OPTION_DBFIELD - // ErrorBox #define RID_ERR_INVALID_FORM_CONNECTION ( RID_ERRORBOX_START + 1 ) @@ -75,9 +69,6 @@ #if RID_DIALOG_END > RID_DBP_END #error "please adjust the resource id ranges!!" #endif -#if RID_PAGE_END > RID_DBP_END - #error "please adjust the resource id ranges!!" -#endif #if RID_ERRORBOX_END > RID_DBP_END #error "please adjust the resource id ranges!!" #endif @@ -85,24 +76,9 @@ // local ids // FixedLine -#define FL_DATABASEFIELD_EXPL 4 #define FL_FRAME 6 #define FL_FORMSETINGS 7 -// FixedText - -#define FT_DATABASEFIELD_EXPL 8 -#define FT_DATABASEFIELD_QUEST 9 - -// ListBox - -#define LB_STOREINFIELD 4 - -// RadioButton - -#define RB_STOREINFIELD_YES 3 -#define RB_STOREINFIELD_NO 4 - // Image #define IMG_TABLE ( RID_DIALOG_START + 1 ) diff --git a/extensions/uiconfig/sabpilot/ui/optiondbfieldpage.ui b/extensions/uiconfig/sabpilot/ui/optiondbfieldpage.ui new file mode 100644 index 000000000000..3560f223ebff --- /dev/null +++ b/extensions/uiconfig/sabpilot/ui/optiondbfieldpage.ui @@ -0,0 +1,111 @@ + + + + + + True + False + True + True + 6 + vertical + 12 + + + True + False + start + start + True + 0 + True + 82 + + + False + True + 0 + + + + + True + False + start + Do you want to save the value in a database field? + + + False + True + 1 + + + + + True + False + True + True + 6 + 12 + + + _Yes, I want to save it in the following database field: + False + True + True + False + True + 0 + True + True + noRadiobutton + + + 0 + 0 + 1 + 1 + + + + + _No, I only want to save the value in the form. + False + True + True + False + True + 0 + True + yesRadiobutton + + + 0 + 1 + 2 + 1 + + + + + True + False + True + + + 1 + 0 + 1 + 1 + + + + + False + True + 2 + + + +