From aed0ed3c420d6821e81ca6243482e620c4aeeffd Mon Sep 17 00:00:00 2001
From: Julian Smart <julian@anthemion.co.uk>
Date: Fri, 12 Feb 1999 22:00:14 +0000
Subject: [PATCH] Small Tex2RTF fixes; wxMotif compile fixes (motif.inc,
 wxCheckListBox); wxMSW wxWindow::IsShown fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/changes.txt               | 19 ++++++++++++++++++-
 docs/latex/wx/socket.tex       |  9 ++++-----
 docs/latex/wx/strmmem.tex      |  5 ++++-
 include/wx/defs.h              | 19 ++++++++++++++-----
 include/wx/motif/dataobj.h     |  2 +-
 src/generic/gridg.cpp          |  2 +-
 src/motif.inc                  |  1 +
 src/msw/app.cpp                |  2 --
 src/msw/radiobox.cpp           |  1 +
 src/msw/window.cpp             |  9 +++++++--
 utils/tex2rtf/src/rtfutils.cpp |  4 ++--
 utils/tex2rtf/src/tex2rtf.cpp  |  2 +-
 12 files changed, 54 insertions(+), 21 deletions(-)

diff --git a/docs/changes.txt b/docs/changes.txt
index 0cec649ba2..d204172b50 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -1,11 +1,28 @@
 wxWindows 2 Change Log
 ----------------------
 
-Beta 4, February 1999
+Beta 5, February ??  1999
 -------------------------
 
 wxGTK:
 
+
+wxMSW:
+
+- Fixed wxWindow::IsShown (::IsWindowVisible doesn't behave as
+  expected).
+
+wxMotif:
+
+
+General:
+
+
+Beta 4, February 12th 1999
+--------------------------
+
+wxGTK:
+
 - Miscellaneous fixes.
 
 wxMSW:
diff --git a/docs/latex/wx/socket.tex b/docs/latex/wx/socket.tex
index 70fdb9dc50..f4e8f7df05 100644
--- a/docs/latex/wx/socket.tex
+++ b/docs/latex/wx/socket.tex
@@ -481,7 +481,7 @@ Sets an event handler to be called when a socket event occured.
 
 Constructs a new wxSocketClient.
 
-{\bf Warning !} The created socket client needs to be registered to a socket handler (See \helpref{wxSocketHandler}{wxsockethandler}).
+{\bf Warning !} The new socket client needs to be registered to a socket handler (See \helpref{wxSocketHandler}{wxsockethandler}).
 
 \wxheading{Parameters}
 
@@ -494,7 +494,7 @@ Constructs a new wxSocketClient.
 
 \func{}{\destruct{wxSocketClient}}{\void}
 
-Destructs a wxSocketClient object.
+Destroys a wxSocketClient object.
 
 %
 % Connect
@@ -609,7 +609,7 @@ many sockets.
 
 \func{}{\destruct{wxSocketHandler}}{\void}
 
-Destructs a wxSocketHandler object.
+Destroys a wxSocketHandler object.
 
 %
 % Register
@@ -763,7 +763,7 @@ Constructs a new wxSocketServer.
 
 \func{}{\destruct{wxSocketServer}}{\void}
 
-Destructs a wxSocketServer object (it doesn't close the accepted connection).
+Destroys a wxSocketServer object (it doesn't close the accepted connection).
 
 %
 % Accept
@@ -800,4 +800,3 @@ This is useful when someone wants to inherit wxSocketBase.
 
 Returns TRUE if no error occurs, else FALSE.
 
-
diff --git a/docs/latex/wx/strmmem.tex b/docs/latex/wx/strmmem.tex
index ebf0bcaf9d..194478288e 100644
--- a/docs/latex/wx/strmmem.tex
+++ b/docs/latex/wx/strmmem.tex
@@ -14,6 +14,7 @@
 \wxheading{Remark}
 
 You can create a similar stream by this way:
+
 \begin{verbatim}
   wxStreamBuffer *sb = new wxStreamBuffer(wxStreamBuffer::read);
   wxInputStream *input = new wxInputStream(sb);
@@ -52,10 +53,10 @@ Destructor.
 
 \helpref{wxStreamBuffer}{wxstreamBuffer}
 
-
 \wxheading{Remark}
 
 You can create a similar stream by this way:
+
 \begin{verbatim}
   wxStreamBuffer *sb = new wxStreamBuffer(wxStreamBuffer::write);
   wxOutputStream *input = new wxOutputStream(sb);
@@ -67,6 +68,7 @@ You can create a similar stream by this way:
 \end{verbatim}
 
 This way is also useful to create read/write memory stream:
+
 \begin{verbatim}
   wxStreamBuffer *sb = new wxStreamBuffer(wxStreamBuffer::read\_write);
   wxOutputStream *output = new wxOutputStream(sb);
@@ -100,3 +102,4 @@ stream.
 \func{}{\destruct{wxMemoryOutputStream}}{\void}
 
 Destructor.
+
diff --git a/include/wx/defs.h b/include/wx/defs.h
index 76a0bd8981..10fe0fa316 100644
--- a/include/wx/defs.h
+++ b/include/wx/defs.h
@@ -201,6 +201,7 @@ typedef int wxWindowID;
 
 #ifdef __WXMSW__
 
+/*
 #ifdef __BORLANDC__
 
 #  ifdef WXMAKINGDLL
@@ -218,14 +219,18 @@ typedef int wxWindowID;
 #  endif
 
 #else
+*/
+
+// _declspec works in BC++ 5 and later, as well as VC++
+#if defined(__VISUALC__) || defined(__BORLANDC__)
 
 #  ifdef WXMAKINGDLL
-#    define WXDLLEXPORT __declspec( dllexport )
-#    define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
-#    define WXDLLEXPORT_CTORFN // __declspec( dllexport )
+#    define WXDLLEXPORT _declspec( dllexport )
+#    define WXDLLEXPORT_DATA(type) _declspec( dllexport ) type
+#    define WXDLLEXPORT_CTORFN
 #  elif defined(WXUSINGDLL)
-#    define WXDLLEXPORT __declspec( dllimport )
-#    define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type
+#    define WXDLLEXPORT _declspec( dllimport )
+#    define WXDLLEXPORT_DATA(type) _declspec( dllimport ) type
 #    define WXDLLEXPORT_CTORFN
 #  else
 #    define WXDLLEXPORT
@@ -233,6 +238,10 @@ typedef int wxWindowID;
 #    define WXDLLEXPORT_CTORFN
 #  endif
 
+#else
+#  define WXDLLEXPORT
+#  define WXDLLEXPORT_DATA(type) type
+#  define WXDLLEXPORT_CTORFN
 #endif
 
 #else
diff --git a/include/wx/motif/dataobj.h b/include/wx/motif/dataobj.h
index 8c8150a8b1..02daba2b37 100644
--- a/include/wx/motif/dataobj.h
+++ b/include/wx/motif/dataobj.h
@@ -11,7 +11,7 @@
 #define _WX_DATAOBJ_H_
 
 #ifdef __GNUG__
-#pragma interface
+#pragma interface "dataobj.h"
 #endif
 
 #include "wx/defs.h"
diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp
index 34da5b84a3..624cac6ad1 100644
--- a/src/generic/gridg.cpp
+++ b/src/generic/gridg.cpp
@@ -222,7 +222,7 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
   m_hScrollBar = new wxScrollBar(this, wxGRID_HSCROLL, wxPoint(0, 0), wxSize(20, 100), wxHORIZONTAL);
   m_vScrollBar = new wxScrollBar(this, wxGRID_VSCROLL, wxPoint(0, 0), wxSize(100, 20), wxVERTICAL);
 
-  SetSize(-1, -1, size.x, size.y);
+//  SetSize(pos.x, pos.y, size.x, size.y);
 
   return TRUE;
 }
diff --git a/src/motif.inc b/src/motif.inc
index 4736d0f71f..169888d98c 100644
--- a/src/motif.inc
+++ b/src/motif.inc
@@ -83,6 +83,7 @@ LIB_CPP_SRC=\
  motif/combobox.cpp \
  motif/cursor.cpp \
  motif/data.cpp \
+ motif/dataobj.cpp \
  motif/dc.cpp \
  motif/dcclient.cpp \
  motif/dcmemory.cpp \
diff --git a/src/msw/app.cpp b/src/msw/app.cpp
index 8488c2d14f..134f594a65 100644
--- a/src/msw/app.cpp
+++ b/src/msw/app.cpp
@@ -319,8 +319,6 @@ bool wxApp::RegisterWindowClasses()
 // Register the panel window class.
   WNDCLASS wndclass2;   // Structure used to register Windows class.
   memset(&wndclass2, 0, sizeof(WNDCLASS));   // start with NULL defaults
-  // Use CS_OWNDC to avoid messing about restoring the context
-  // for every graphic operation.
   wndclass2.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS ;
   wndclass2.lpfnWndProc   = (WNDPROC)wxWndProc;
   wndclass2.cbClsExtra    = 0;
diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp
index d80bc66391..934e190a30 100644
--- a/src/msw/radiobox.cpp
+++ b/src/msw/radiobox.cpp
@@ -792,6 +792,7 @@ void wxRadioBox::SetFocus(void)
 
 bool wxRadioBox::Show(bool show)
 {
+    m_isShown = show;
     int cshow;
     if (show)
         cshow = SW_SHOW;
diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index 6bc6898c49..1aff70f753 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -770,13 +770,14 @@ void wxWindow::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags)
 
 bool wxWindow::Show(bool show)
 {
+    m_isShown = show;
     HWND hWnd = (HWND) GetHWND();
     int cshow;
     if (show)
         cshow = SW_SHOW;
     else
         cshow = SW_HIDE;
-    ShowWindow(hWnd, (BOOL)cshow);
+    ShowWindow(hWnd, cshow);
     if (show)
     {
         BringWindowToTop(hWnd);
@@ -788,7 +789,11 @@ bool wxWindow::Show(bool show)
 
 bool wxWindow::IsShown(void) const
 {
-    return (::IsWindowVisible((HWND) GetHWND()) != 0);
+    // Can't rely on IsWindowVisible, since it will return FALSE
+    // if the parent is not visible.
+    return m_isShown;
+//    int ret = ::IsWindowVisible((HWND) GetHWND()) ;
+//    return (ret != 0);
 }
 
 int wxWindow::GetCharHeight(void) const
diff --git a/utils/tex2rtf/src/rtfutils.cpp b/utils/tex2rtf/src/rtfutils.cpp
index d58191aa95..dfd45ccde9 100644
--- a/utils/tex2rtf/src/rtfutils.cpp
+++ b/utils/tex2rtf/src/rtfutils.cpp
@@ -536,8 +536,8 @@ bool WriteHPJ(char *filename)
   if (!helpTitle)
     helpTitle = "Untitled";
     
-  char *thePath = wxPathOnly(InputFile);
-  if (!thePath)
+  wxString thePath = wxPathOnly(InputFile);
+  if (thePath.IsEmpty())
     thePath = ".";
   fprintf(fd, "[OPTIONS]\n");
   fprintf(fd, "BMROOT=%s ; Assume that bitmaps are where the source is\n", thePath);
diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp
index e115c0d4dc..a61db85708 100644
--- a/utils/tex2rtf/src/tex2rtf.cpp
+++ b/utils/tex2rtf/src/tex2rtf.cpp
@@ -647,7 +647,7 @@ void ChooseOutputFile(bool force)
   char extensionBuf[10];
   char wildBuf[10];
   strcpy(wildBuf, "*.");
-  char *path = NULL;
+  wxString path;
   if (OutputFile)
     path = wxPathOnly(OutputFile);
   else if (InputFile)
-- 
2.50.0

