From a8573fe5ef0e541f9ab643d6cd705f1cc50b6ec3 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Wed, 11 Mar 2015 03:45:22 +0800 Subject: [PATCH] remove physical dependency between msgbox and filebox --- include/nana/gui/msgbox.hpp | 9 ++++----- source/gui/filebox.cpp | 1 + source/gui/msgbox.cpp | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/nana/gui/msgbox.hpp b/include/nana/gui/msgbox.hpp index 6fbec87c..1534c7c7 100644 --- a/include/nana/gui/msgbox.hpp +++ b/include/nana/gui/msgbox.hpp @@ -14,10 +14,12 @@ #define NANA_GUI_MSGBOX_HPP #include -#include namespace nana { + //Forward declaration of filebox for msgbox + class filebox; + /// Prefabricated modal dialog box (with text, icon and actions buttons) that inform and instruct the user. class msgbox { @@ -43,11 +45,8 @@ namespace nana /// Construct that creates a message box with a specified title and default button. msgbox(const nana::string&); - /// Construct that creates a message box with an owner window and a specified title. - msgbox(window, const nana::string&); - /// Construct that creates a message box with an owner windoow, a specified title and buttons. - msgbox(window, const nana::string&, button_t); + msgbox(window, const nana::string&, button_t = ok); /// Sets an icon for informing user. msgbox& icon(icon_t); diff --git a/source/gui/filebox.cpp b/source/gui/filebox.cpp index 78a40a3f..f889a872 100644 --- a/source/gui/filebox.cpp +++ b/source/gui/filebox.cpp @@ -11,6 +11,7 @@ */ #include +#include #include #if defined(NANA_WINDOWS) diff --git a/source/gui/msgbox.cpp b/source/gui/msgbox.cpp index e43a5ee7..89c1aee4 100644 --- a/source/gui/msgbox.cpp +++ b/source/gui/msgbox.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #if defined(NANA_WINDOWS) #include @@ -354,10 +355,6 @@ namespace nana : wd_(nullptr), title_(title), button_(ok), icon_(icon_none) {} - msgbox::msgbox(window wd, const nana::string& title) - : wd_(wd), title_(title), button_(ok), icon_(icon_none) - {} - msgbox::msgbox(window wd, const nana::string& title, button_t b) : wd_(wd), title_(title), button_(b), icon_(icon_none) {}