From c0de7af40b81699af98095d782617b517d76699e Mon Sep 17 00:00:00 2001 From: Patrick Albert Date: Mon, 14 Jun 1999 09:43:38 +0000 Subject: [PATCH] Correct some minor compile pbs with VC++1.52c & VC++4.1 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/treectrl.h | 2 +- src/generic/treectrl.cpp | 14 +++++++------- src/msw/utilsexc.cpp | 20 +++++++++++++++++++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/include/wx/generic/treectrl.h b/include/wx/generic/treectrl.h index 6a8a31c707..5f51dafd8b 100644 --- a/include/wx/generic/treectrl.h +++ b/include/wx/generic/treectrl.h @@ -435,7 +435,7 @@ public: void Unselect(); void UnselectAll(); // select this item - void SelectItem(const wxTreeItemId& item, bool unselect_others=true, bool extended_select=false); + void SelectItem(const wxTreeItemId& item, bool unselect_others=TRUE, bool extended_select=FALSE); // make sure this item is visible (expanding the parent item and/or // scrolling to this item if necessary) void EnsureVisible(const wxTreeItemId& item); diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index 181c65b069..67fe811ede 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -957,7 +957,7 @@ bool wxTreeCtrl::TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem size_t count = children.Count(); for (size_t n=(size_t)(index+1); nSetHilight(select); RefreshLine(crt_item); - if (crt_item==last_item) return true; + if (crt_item==last_item) return TRUE; if (crt_item->HasChildren()) { wxArrayGenericTreeItems& children = crt_item->GetChildren(); size_t count = children.Count(); for ( size_t n = 0; n < count; ++n ) - if (TagAllChildrenUntilLast(children[n], last_item, select)) return true; + if (TagAllChildrenUntilLast(children[n], last_item, select)) return TRUE; } - return false; + return FALSE; } void wxTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2) @@ -1016,8 +1016,8 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& itemId, // to keep going anyhow !!! if (is_single) { - unselect_others=true; - extended_select=false; + unselect_others=TRUE; + extended_select=FALSE; } wxGenericTreeItem *item = itemId.m_pItem; @@ -1047,7 +1047,7 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& itemId, } else { - bool select=true; // the default + bool select=TRUE; // the default // Check if we need to toggle hilight (ctrl mode) if (!unselect_others) diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 77802caee3..9f23fca1f4 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -341,13 +341,31 @@ long wxExecute(char **argv, bool sync, wxProcess *handler) bool wxGetFullHostName(wxChar *buf, int maxSize) { - DWORD nSize = maxSize; +#if defined(__WIN32__) && !defined(__TWIN32__) + DWORD nSize = maxSize ; if ( !::GetComputerName(buf, &nSize) ) { wxLogLastError("GetComputerName"); return FALSE; } +#else + char *sysname; + const char *default_host = "noname"; +static const char WX_SECTION[] = "wxWindows"; +static const char eHOSTNAME[] = "HostName"; + if ((sysname = getenv("SYSTEM_NAME")) == NULL) { + GetProfileString(WX_SECTION, eHOSTNAME, default_host, buf, maxSize - 1); + } else + strncpy(buf, sysname, maxSize - 1); + buf[maxSize] = '\0'; + if ( *buf == '\0' ) + { + wxLogLastError("GetComputerName"); + + return FALSE; + } +#endif return TRUE; }