summaryrefslogtreecommitdiff
path: root/vcl/source/window/layout.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-01 20:22:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-04 20:22:57 +0000
commit4b9c6542f7107be7536f239ca061fd363395b3d4 (patch)
tree49586dcf8bbe98bb9018bff47686be4da74ab703 /vcl/source/window/layout.cxx
parenta2045ea778ee0191528bdc69165ad382cc7c1cb1 (diff)
fdo#74104 fdo#73904 backport Message dialog creation from message strings
Original title: "allow simple MessageDialogs to be created from just message strings" Commit 9b6b03542df7f6b0feecf60a13bab7e885ef3587 upgraded sd/source/ui/view/Outliner.cxx to use a MessageDialog created from just a message string, but was done before the existence of this commit -- it's presumably safest to backport this commit to ensure that any other such changed dialogs will work as expected. (cherry picked from commit 257d1f4ff3094a42952663d620d7c49e3e7c747f) Conflicts: basctl/source/basicide/moduldl2.cxx Change-Id: I9f8324d1c61bd55ccc78e67699ebdfa946e48af6 Reviewed-on: https://gerrit.libreoffice.org/7859 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/layout.cxx')
-rw-r--r--vcl/source/window/layout.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 27746c3020e4..35e76a468db0 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1897,6 +1897,17 @@ bool VclSizeGroup::set_property(const OString &rKey, const OString &rValue)
return true;
}
+void MessageDialog::create_owned_areas()
+{
+ set_border_width(12);
+ m_pOwnedContentArea = new VclVBox(this, false, 24);
+ set_content_area(m_pOwnedContentArea);
+ m_pOwnedContentArea->Show();
+ m_pOwnedActionArea = new VclHButtonBox(m_pOwnedContentArea);
+ set_action_area(m_pOwnedActionArea);
+ m_pOwnedActionArea->Show();
+}
+
MessageDialog::MessageDialog(Window* pParent, WinBits nStyle)
: Dialog(pParent, nStyle)
, m_eButtonsType(VCL_BUTTONS_NONE)
@@ -1907,6 +1918,7 @@ MessageDialog::MessageDialog(Window* pParent, WinBits nStyle)
, m_pSecondaryMessage(NULL)
{
SetType(WINDOW_MESSBOX);
+ create_owned_areas();
}
MessageDialog::MessageDialog(Window* pParent,
@@ -1924,12 +1936,15 @@ MessageDialog::MessageDialog(Window* pParent,
, m_sPrimaryString(rMessage)
{
SetType(WINDOW_MESSBOX);
+ create_owned_areas();
}
MessageDialog::MessageDialog(Window* pParent, const OString& rID, const OUString& rUIXMLDescription)
: Dialog(pParent, rID, rUIXMLDescription, WINDOW_MESSBOX)
, m_eButtonsType(VCL_BUTTONS_NONE)
, m_eMessageType(VCL_MESSAGE_INFO)
+ , m_pOwnedContentArea(NULL)
+ , m_pOwnedActionArea(NULL)
, m_pGrid(NULL)
, m_pImage(NULL)
, m_pPrimaryMessage(NULL)
@@ -1945,6 +1960,8 @@ MessageDialog::~MessageDialog()
delete m_pPrimaryMessage;
delete m_pImage;
delete m_pGrid;
+ delete m_pOwnedActionArea;
+ delete m_pOwnedContentArea;
}
IMPL_LINK(MessageDialog, ButtonHdl, Button *, pButton)
@@ -2080,6 +2097,7 @@ short MessageDialog::Execute()
VclButtonBox *pButtonBox = get_action_area();
assert(pButtonBox);
+
PushButton *pBtn;
switch (m_eButtonsType)
{
@@ -2135,7 +2153,6 @@ short MessageDialog::Execute()
setButtonHandlers(pButtonBox);
pButtonBox->sort_native_button_order();
m_pGrid->Show();
-
}
return Dialog::Execute();
}