diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-30 20:44:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-01 14:42:05 +0100 |
commit | 9e5c35454d07f880a2cb52d9a808633b908bb859 (patch) | |
tree | b436edac62601268ffa16841720faf857c859c9e /include | |
parent | 26bda9f4a82c9b1956a10e3dc52a99bc2f850ada (diff) |
create a HIG compliant MessageDialog and map to GtkMessageDialog
Change-Id: If86387619ff00a652ea418292fbb0026b867a431
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/builder.hxx | 29 | ||||
-rw-r--r-- | include/vcl/layout.hxx | 26 |
2 files changed, 55 insertions, 0 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 83532dd77c32..fc7a28690bc4 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -50,6 +50,13 @@ private: //exist for the duration of the dialog vcl::detail::ModuleMap m_aModuleMap; + //If the toplevel window has any properties which need to be set on it, + //but the toplevel is the owner of the builder, then its ctor + //has not been completed during the building, so properties for it + //are collected here and need to be set afterwards, e.g. during + //Show or Execute + stringmap m_aDeferredProperties; + struct PackingData { bool m_bVerticalOrient; @@ -65,10 +72,12 @@ private: { OString m_sID; Window *m_pWindow; + short m_nResponseId; PackingData m_aPackingData; WinAndId(const OString &rId, Window *pWindow, bool bVertical) : m_sID(rId) , m_pWindow(pWindow) + , m_nResponseId(RET_CANCEL) , m_aPackingData(bVertical) { } @@ -215,6 +224,7 @@ private: ResHookProc m_pStringReplace; Window *m_pParent; bool m_bToplevelHasDeferredInit; + bool m_bToplevelHasDeferredProperties; bool m_bToplevelParentFound; ParserState *m_pParserState; @@ -266,14 +276,23 @@ public: //sID may not exist PopupMenu* get_menu(OString sID); + //given an sID return the response value for that widget + short get_response(const Window *pWindow) const; + OString get_by_window(const Window *pWindow) const; void delete_by_window(const Window *pWindow); + //apply the properties of rProps to pWindow + static void set_properties(Window *pWindow, const stringmap &rProps); + //Convert _ gtk markup to ~ vcl markup static OString convertMnemonicMarkup(const OString &rIn); static OString extractCustomProperty(stringmap &rMap); + //see m_aDeferredProperties + void setDeferredProperties(); + private: Window *insertObject(Window *pParent, const OString &rClass, const OString &rID, stringmap &rProps, stringmap &rPangoAttributes, @@ -322,12 +341,16 @@ private: void handleAtkObject(xmlreader::XmlReader &reader, const OString &rID, Window *pWindow); + void handleActionWidget(xmlreader::XmlReader &reader); + PackingData get_window_packing_data(const Window *pWindow) const; void set_window_packing_position(const Window *pWindow, sal_Int32 nPosition); Window* prepareWidgetOwnScrolling(Window *pParent, WinBits &rWinStyle); void cleanupWidgetOwnScrolling(Window *pScrollParent, Window *pWindow, stringmap &rMap); + void set_response(OString sID, short nResponse); + //Helpers to retrofit all the existing code to the builder static void reorderWithinParent(Window &rWindow, sal_uInt16 nNewPosition); }; @@ -368,6 +391,12 @@ public: { return m_pUIBuilder->get_menu(sID); } + void setDeferredProperties() + { + if (!m_pUIBuilder) + return; + m_pUIBuilder->setDeferredProperties(); + } }; /* diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index c6b6a1274fa7..f45fcb239089 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -12,7 +12,10 @@ #include <vcl/dllapi.h> #include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> #include <vcl/scrbar.hxx> +#include <vcl/vclmedit.hxx> #include <vcl/window.hxx> #include <boost/multi_array.hpp> #include <set> @@ -638,6 +641,29 @@ public: bool set_property(const OString &rKey, const OString &rValue); }; +class VCL_DLLPUBLIC MessageDialog : public Dialog +{ +private: + VclGrid* m_pGrid; + FixedImage* m_pImage; + VclMultiLineEdit* m_pPrimaryMessage; + VclMultiLineEdit* m_pSecondaryMessage; + OUString m_sPrimaryString; + OUString m_sSecondaryString; + DECL_DLLPRIVATE_LINK(ButtonHdl, Button *); + void setButtonHandlers(); +public: + MessageDialog(Window* pParent, WinBits nStyle); + MessageDialog(Window* pParent, const OString& rID, const OUString& rUIXMLDescription); + virtual bool set_property(const OString &rKey, const OString &rValue); + virtual short Execute(); + OUString get_primary_text() const; + OUString get_secondary_text() const; + void set_primary_text(const OUString &rPrimaryString); + void set_secondary_text(const OUString &rSecondaryString); + ~MessageDialog(); +}; + VCL_DLLPUBLIC Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize); //Get first window of a pTopLevel window as |