diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-03-07 21:18:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-03-08 13:42:32 +0000 |
commit | 6df8417b98a74f58638b5fce7459c64f18ddedb4 (patch) | |
tree | 61dad6b61b3b77e04ba0513abba809c81b0ebcac /vcl | |
parent | 3e3dc223e0337f974123ba687cddb7e2e6df2b28 (diff) |
set action and content area via their internal-child ids
rather than based on their names, which changes if
there are more than one dialog in a .ui
set them explicitly in the manual-build-dialog
case of the SfxTabDialogs
Change-Id: I293c77df05d9e11e3f1cf3b358a9dd27fe668b0f
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/dialog.hxx | 7 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 18 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 16 |
3 files changed, 35 insertions, 6 deletions
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx index 1f14ae144948..4c7149a5493b 100644 --- a/vcl/inc/vcl/dialog.hxx +++ b/vcl/inc/vcl/dialog.hxx @@ -54,6 +54,8 @@ private: bool mbIsDefferedInit; bool mbIsCalculatingInitialLayoutSize; Timer maLayoutTimer; + VclButtonBox* mpActionArea; + VclBox* mpContentArea; SAL_DLLPRIVATE void ImplInitDialogData(); SAL_DLLPRIVATE void ImplInitSettings(); @@ -83,6 +85,11 @@ protected: Dialog( Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription, WindowType nType ); virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ); +protected: + friend class VclBuilder; + void set_action_area(VclButtonBox *pBox); + void set_content_area(VclBox *pBox); + public: Dialog( Window* pParent, WinBits nStyle = WB_STDDIALOG ); Dialog( Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription ); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9355c9eba2a6..d466f4275ae7 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1448,11 +1448,10 @@ bool VclBuilder::sortIntoBestTabTraversalOrder::operator()(const Window *pA, con void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) { Window *pCurrentChild = NULL; - bool bIsInternalChild = false; xmlreader::Span name; int nsId; - OString sType; + OString sType, sInternalChild; while (reader.nextAttribute(&nsId, &name)) { @@ -1463,7 +1462,8 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) } else if (name.equals("internal-child")) { - bIsInternalChild = true; + name = reader.getAttributeValue(false); + sInternalChild = OString(name.begin, name.length); } } @@ -1491,7 +1491,7 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) { //Internal-children default in glade to not having their visible bits set //even though they are visible (generally anyway) - if (bIsInternalChild) + if (!sInternalChild.isEmpty()) pCurrentChild->Show(); //Select the first page if its a notebook @@ -1512,6 +1512,16 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) if (VclFrame *pFrameParent = dynamic_cast<VclFrame*>(pParent)) pFrameParent->designate_label(pCurrentChild); } + if (sInternalChild.equals("vbox")) + { + if (Dialog *pBoxParent = dynamic_cast<Dialog*>(pParent)) + pBoxParent->set_content_area(static_cast<VclBox*>(pCurrentChild)); + } + else if (sInternalChild.equals("action_area")) + { + if (Dialog *pBoxParent = dynamic_cast<Dialog*>(pParent)) + pBoxParent->set_action_area(static_cast<VclButtonBox*>(pCurrentChild)); + } //To-Do make reorder a virtual in Window, move this foo //there and see above diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index a756b27e99fa..30e757170b4f 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -354,6 +354,8 @@ void Dialog::ImplInitDialogData() mbOldSaveBack = sal_False; mbInClose = sal_False; mbModalMode = sal_False; + mpContentArea = NULL; + mpActionArea = NULL; mbIsCalculatingInitialLayoutSize = false; mnMousePositioned = 0; mpDialogImpl = new DialogImpl; @@ -559,12 +561,22 @@ WinBits Dialog::init(Window *pParent, const ResId& rResId) VclButtonBox* Dialog::get_action_area() { - return m_pUIBuilder ? m_pUIBuilder->get<VclButtonBox>("dialog-action_area1") : NULL; + return mpActionArea; +} + +void Dialog::set_action_area(VclButtonBox* pActionArea) +{ + mpActionArea = pActionArea; } VclBox* Dialog::get_content_area() { - return m_pUIBuilder ? m_pUIBuilder->get<VclBox>("dialog-vbox1") : NULL; + return mpContentArea; +} + +void Dialog::set_content_area(VclBox* pContentArea) +{ + mpContentArea = pContentArea; } // ----------------------------------------------------------------------- |