Initial
This commit is contained in:
47
guitar/MessageBox.hpp
Normal file
47
guitar/MessageBox.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef _GUITAR_MESSAGE_HPP_
|
||||
#define _GUITAR_MESSAGE_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_GUIWINDOW_HPP_
|
||||
#include <common/guiwnd.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_VERSIONINFO_HPP_
|
||||
#include <common/versioninfo.hpp>
|
||||
#endif
|
||||
|
||||
class MessageBox
|
||||
{
|
||||
public:
|
||||
static LRESULT messageBox(GUIWindow &parent,const String &strCaption,const String &strText,UINT type=MB_OK);
|
||||
static LRESULT messageBox(const String &strCaption,const String &strText,UINT type=MB_OK);
|
||||
private:
|
||||
MessageBox();
|
||||
static String getProductVersion(const VersionInfo &versionInfo);
|
||||
};
|
||||
|
||||
inline
|
||||
MessageBox::MessageBox()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LRESULT MessageBox::messageBox(GUIWindow &parent,const String &strCaption,const String &strText,UINT type)
|
||||
{
|
||||
VersionInfo versionInfo;
|
||||
return ::MessageBox(parent,strText,getProductVersion(versionInfo)+String(" ")+strCaption,type);
|
||||
}
|
||||
|
||||
inline
|
||||
LRESULT MessageBox::messageBox(const String &strCaption,const String &strText,UINT type)
|
||||
{
|
||||
VersionInfo versionInfo;
|
||||
return ::MessageBox(0,strText,getProductVersion(versionInfo)+String(" ")+strCaption,type);
|
||||
}
|
||||
|
||||
inline
|
||||
String MessageBox::getProductVersion(const VersionInfo &versionInfo)
|
||||
{
|
||||
return String("[")+versionInfo.getProductNameString()+String(" ")+versionInfo.getProductVersion()+String("]");
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user