Kaydet (Commit) d29529cf authored tarafından Caolán McNamara's avatar Caolán McNamara

add get_content_area and get_action_area to Dialog

Change-Id: I147cea986b8152e54586a0296e446652bd695a18
üst 4ce2602b
......@@ -65,7 +65,7 @@ friend class SfxTabDialogController;
SfxViewFrame* pFrame;
VclVBox *m_pVBox;
VclBox *m_pBox;
TabControl *m_pTabCtrl;
OKButton *m_pOKBtn;
......@@ -114,7 +114,7 @@ protected:
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
virtual long Notify( NotifyEvent& rNEvt );
VclHButtonBox* m_pActionArea;
VclButtonBox* m_pActionArea;
SfxItemSet* pExampleSet;
SfxItemSet* GetInputSetImpl();
SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const;
......
......@@ -513,7 +513,7 @@ SfxTabDialog::~SfxTabDialog()
if (m_bOwnsTabCtrl)
delete m_pTabCtrl;
if (m_bOwnsVBox)
delete m_pVBox;
delete m_pBox;
}
// -----------------------------------------------------------------------
......@@ -526,26 +526,26 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
*/
{
m_pVBox = m_pUIBuilder ? m_pUIBuilder->get<VclVBox>("dialog-vbox1") : NULL;
m_bOwnsVBox = m_pVBox == NULL;
m_pBox = get_content_area();
m_bOwnsVBox = m_pBox == NULL;
if (m_bOwnsVBox)
{
m_pVBox = new VclVBox(this, false, 7);
m_pVBox->set_expand(true);
m_pBox = new VclVBox(this, false, 7);
m_pBox->set_expand(true);
}
m_pTabCtrl = m_pUIBuilder ? m_pUIBuilder->get<TabControl>(SAL_STRINGIFY(ID_TABCONTROL)) : NULL;
m_bOwnsTabCtrl = m_pTabCtrl == NULL;
if (m_bOwnsTabCtrl)
{
m_pTabCtrl = new TabControl(m_pVBox, ResId(ID_TABCONTROL, *rResId.GetResMgr()));
m_pTabCtrl = new TabControl(m_pBox, ResId(ID_TABCONTROL, *rResId.GetResMgr()));
m_pTabCtrl->set_expand(true);
}
m_pActionArea = m_pUIBuilder ? m_pUIBuilder->get<VclHButtonBox>("dialog-action_area1") : NULL;
m_pActionArea = get_action_area();
m_bOwnsActionArea = m_pActionArea == NULL;
if (m_bOwnsActionArea)
m_pActionArea = new VclHButtonBox(m_pVBox);
m_pActionArea = new VclHButtonBox(m_pBox);
m_pOKBtn = m_pUIBuilder ? m_pUIBuilder->get<OKButton>("ok") : NULL;
m_bOwnsOKBtn = m_pOKBtn == NULL;
......@@ -593,7 +593,7 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
m_pTabCtrl->SetDeactivatePageHdl(
LINK( this, SfxTabDialog, DeactivatePageHdl ) );
m_pActionArea->Show();
m_pVBox->Show();
m_pBox->Show();
m_pTabCtrl->Show();
m_pOKBtn->Show();
m_pCancelBtn->Show();
......@@ -1084,7 +1084,7 @@ IMPL_LINK_NOARG(SfxTabDialog, OkHdl)
Handler of the Ok-Buttons
This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>.
Returns <SfxTabPage::LEAVE_PAGE>, <SfxTabDialog::Ok()> is called
anf the Dialog is ended.
and the Dialog is ended.
*/
{
......
......@@ -208,7 +208,7 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog(Window *pParent,
, pViewSh(pViewShell)
, pOptions(pSet->Clone())
{
VclContainer *pVBox = m_pUIBuilder->get<VclVBox>("dialog-vbox1");
VclContainer *pVBox = get_content_area();
// Insert TabPage
pPage = pViewSh->CreatePrintOptionsPage(pVBox, *pOptions);
......
......@@ -34,6 +34,8 @@
// - Dialog -
// ----------
struct DialogImpl;
class VclBox;
class VclButtonBox;
class VclContainer;
class VCL_DLLPUBLIC Dialog
......@@ -95,6 +97,8 @@ public:
void setInitialLayoutSize();
void queue_layout();
virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
VclButtonBox* get_action_area();
VclBox* get_content_area();
virtual sal_Bool Close();
......
......@@ -560,6 +560,16 @@ WinBits Dialog::init(Window *pParent, const ResId& rResId)
return nStyle;
}
VclButtonBox* Dialog::get_action_area()
{
return m_pUIBuilder ? m_pUIBuilder->get<VclButtonBox>("dialog-action_area1") : NULL;
}
VclBox* Dialog::get_content_area()
{
return m_pUIBuilder ? m_pUIBuilder->get<VclBox>("dialog-vbox1") : NULL;
}
// -----------------------------------------------------------------------
Dialog::~Dialog()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment