From 96c5bd7fc45bdebc013e0621574840294e3ecfa0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Sun, 13 Jun 1999 16:04:54 +0000 Subject: [PATCH] Added missing wxGetFullHostName() and wxNO_DEFAULT for generic msgdialog git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 11 ++++++----- include/wx/utils.h | 1 + samples/richedit/wxlwindow.cpp | 1 + src/common/utilscmn.cpp | 15 +++++++++++++++ src/generic/msgdlgg.cpp | 12 ++++++++++-- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index f0d84c9a8b..3bc4487512 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -905,11 +905,12 @@ typedef enum #define wxCANCEL 0x0004 #define wxYES 0x0008 #define wxNO 0x0010 - -#define wxICON_EXCLAMATION 0x0020 -#define wxICON_HAND 0x0040 -#define wxICON_QUESTION 0x0080 -#define wxICON_INFORMATION 0x0100 +#define wxNO_DEFAULT 0x0020 +#define wxYES_DEFAULT 0x0000 // has no effect +#define wxICON_EXCLAMATION 0x0040 +#define wxICON_HAND 0x0080 +#define wxICON_QUESTION 0x0100 +#define wxICON_INFORMATION 0x0200 #define wxICON_STOP wxICON_HAND #define wxICON_ASTERISK wxICON_INFORMATION diff --git a/include/wx/utils.h b/include/wx/utils.h index 02ce0c4099..4a11fd3316 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -196,6 +196,7 @@ WXDLLEXPORT wxString wxGetHostName(); // Get FQDN WXDLLEXPORT wxString wxGetFullHostName(); +WXDLLEXPORT bool wxGetFullHostName(wxChar *buf, int maxSize); // Get user ID e.g. jacs (this is known as login name under Unix) WXDLLEXPORT bool wxGetUserId(wxChar *buf, int maxSize); diff --git a/samples/richedit/wxlwindow.cpp b/samples/richedit/wxlwindow.cpp index 07e6e01cde..db44c83da3 100644 --- a/samples/richedit/wxlwindow.cpp +++ b/samples/richedit/wxlwindow.cpp @@ -208,6 +208,7 @@ wxLayoutWindow::Clear(int family, { GetLayoutList()->Clear(family,size,style,weight,underline,fg,bg); SetBackgroundColour(GetLayoutList()->GetDefaultStyleInfo().GetBGColour()); + wxScrolledWindow::Clear(); ResizeScrollbars(true); SetDirty(); SetModified(false); diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 68f0d945f5..1dffad113c 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -901,3 +901,18 @@ wxString wxGetHostName() return buf; } +wxString wxGetFullHostName() +{ + static const size_t hostnameSize = 257; + + wxString buf; + bool ok = wxGetFullHostName(buf.GetWriteBuf(hostnameSize), hostnameSize); + + buf.UngetWriteBuf(); + + if ( !ok ) + buf.Empty(); + + return buf; +} + diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index 7cf987fd15..996646d915 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -131,8 +131,16 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString } else if (yes) { - yes->SetDefault(); - yes->SetFocus(); + if(style & wxNO_DEFAULT) + { + no->SetDefault(); + no->SetFocus(); + } + else + { + yes->SetDefault(); + yes->SetFocus(); + } } int w = m_buttons.GetCount() * 100; -- 2.45.2