From: Julian Smart <julian@anthemion.co.uk>
Date: Wed, 5 May 1999 08:57:41 +0000 (+0000)
Subject: wxNotebook fixes for Win16;  VC++ 4 fixes for OLE files; wxGA_SMOOTH flag (wxMSW);
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/aeab10d07c1f4ef78c0c9152de115fa216922e6c?ds=inline

wxNotebook fixes for Win16;  VC++ 4 fixes for OLE files; wxGA_SMOOTH flag (wxMSW);
wxFRAME_FLOAT_ON_PARENT style for frames (wxMSW) to get traditional MSW behaviour.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/docs/gtk/todo.txt b/docs/gtk/todo.txt
index 1db16e96c2..60b2b0d642 100644
Binary files a/docs/gtk/todo.txt and b/docs/gtk/todo.txt differ
diff --git a/docs/latex/wx/frame.tex b/docs/latex/wx/frame.tex
index ebe13b0449..274958d01a 100644
--- a/docs/latex/wx/frame.tex
+++ b/docs/latex/wx/frame.tex
@@ -33,6 +33,12 @@ the remaining size available to application windows.
 \twocolitem{\windowstyle{wxSYSTEM\_MENU}}{Displays a system menu (Windows and Motif only).}
 \twocolitem{\windowstyle{wxTHICK\_FRAME}}{Displays a thick frame around the window (Windows and Motif only).}
 \twocolitem{\windowstyle{wxRESIZE\_BORDER}}{Displays a resizeable border around the window (Motif only).}
+\twocolitem{\windowstyle{wxFRAME\_FLOAT\_ON\_PARENT}}{Windows only. Causes the frame to be above the parent window in the
+z-order and not shown in the taskbar. Without this style, frames are created as top-level windows that may be obscured by
+the parent window, and frame titles are shown in the taskbar. On Motif and GTK, the behaviour is always as if this
+style is not specified.}
+\twocolitem{\windowstyle{wxFRAME\_TOOL\_WINDOW}}{Windows only. Causes a frame with a small titlebar to be created;
+the frame title does not appear in the taskbar.}
 \end{twocollist}
 
 See also \helpref{window styles overview}{windowstyles}. Currently the GTK port of wxWindows
diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex
index e267566210..d2abf20559 100644
--- a/docs/latex/wx/window.tex
+++ b/docs/latex/wx/window.tex
@@ -721,6 +721,12 @@ only be called within an \helpref{OnPaint}{wxwindowonpaint} event handler.
 
 \helpref{wxRegion}{wxregion}, \helpref{wxRegionIterator}{wxregioniterator}, \helpref{wxWindow::OnPaint}{wxwindowonpaint}
 
+\membersection{wxWindow::GetValidator}\label{wxwindowgetvalidator}
+
+\constfunc{wxValidator*}{GetValidator}{\void}
+
+Returns a pointer to the current validator for the window, or NULL if there is none.
+
 \membersection{wxWindow::GetWindowStyleFlag}
 
 \constfunc{long}{GetWindowStyleFlag}{\void}
@@ -2118,7 +2124,14 @@ Sets the window's title. Applicable only to frames and dialogs.
 
 \helpref{wxWindow::GetTitle}{wxwindowgettitle}
 
-\membersection{wxWindow::Show}
+\membersection{wxWindow::SetValidator}\label{wxwindowsetvalidator}
+
+\func{virtual void}{SetValidator}{\param{const wxValidator\&}{ validator}}
+
+Deletes the current validator (if any) and sets the window validator, having called wxValidator::Clone to
+create a new validator of this type.
+
+\membersection{wxWindow::Show}\label{wxwindowshow}
 
 \func{virtual bool}{Show}{\param{const bool}{ show}}
 
diff --git a/docs/symbols.txt b/docs/symbols.txt
index 1b2865d1cf..e23aa1d023 100644
Binary files a/docs/symbols.txt and b/docs/symbols.txt differ
diff --git a/include/wx/defs.h b/include/wx/defs.h
index 90ac41fb0a..2b51d4fae6 100644
--- a/include/wx/defs.h
+++ b/include/wx/defs.h
@@ -397,6 +397,8 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
 #define wxRESIZE_BORDER         0x0040
 #define wxDIALOG_MODAL          0x0020
 #define wxDIALOG_MODELESS       0x0000
+/* Add for normal Windows frame behaviour */
+#define wxFRAME_FLOAT_ON_PARENT 0x0020
 
 #define wxDEFAULT_FRAME_STYLE    (wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN)
 
@@ -498,6 +500,8 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
 #define wxGA_PROGRESSBAR     0x0004
 #define wxGA_HORIZONTAL      wxHORIZONTAL
 #define wxGA_VERTICAL        wxVERTICAL
+/* Windows only */
+#define wxGA_SMOOTH          0x0008
 
 /*
  * wxSlider flags
diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp
index 90782f4545..e33702a3d5 100644
--- a/src/generic/notebook.cpp
+++ b/src/generic/notebook.cpp
@@ -146,10 +146,13 @@ int wxNotebook::SetSelection(int nPage)
 
     wxASSERT( IS_VALID_PAGE(nPage) );
 
+#if defined (__WIN16__)
+    m_tabView->SetTabSelection(nPage);
+#else
     wxNotebookPage* pPage = GetPage(nPage);
 
     m_tabView->SetTabSelection((int) (long) pPage);
-
+#endif
     // TODO
     return 0;
 }
@@ -167,7 +170,11 @@ void wxNotebook::AdvanceSelection(bool bForward)
 bool wxNotebook::SetPageText(int nPage, const wxString& strText)
 {
     wxASSERT( IS_VALID_PAGE(nPage) );
-
+#if defined (__WIN16__)
+	m_tabView->SetTabText(nPage, strText);
+    Refresh();
+    return TRUE;
+#else
     wxNotebookPage* page = GetPage(nPage);
     if (page)
     {
@@ -175,7 +182,7 @@ bool wxNotebook::SetPageText(int nPage, const wxString& strText)
         Refresh();
         return TRUE;
     }
-
+#endif
     return FALSE;
 }
 
@@ -183,11 +190,15 @@ wxString wxNotebook::GetPageText(int nPage) const
 {
     wxASSERT( IS_VALID_PAGE(nPage) );
 
+#if defined (__WIN16__)
+    return m_tabView->GetTabText(nPage);
+#else
     wxNotebookPage* page = ((wxNotebook*)this)->GetPage(nPage);
     if (page)
         return m_tabView->GetTabText((int) (long) page);
     else
         return wxEmptyString;
+#endif
 }
 
 int wxNotebook::GetPageImage(int nPage) const
@@ -228,7 +239,11 @@ bool wxNotebook::DeletePage(int nPage)
     }
 
     wxNotebookPage* pPage = GetPage(nPage);
+#if defined (__WIN16__)
+    m_tabView->RemoveTab(nPage);
+#else
     m_tabView->RemoveTab((int) (long) pPage);
+#endif
 
     delete m_aPages[nPage];
     m_aPages.Remove(nPage);
@@ -241,7 +256,11 @@ bool wxNotebook::DeletePage(int nPage)
     else if (m_nSelection > -1)
     {
       m_nSelection = -1;
+#if defined (__WIN16__)
+      m_tabView->SetTabSelection(0, FALSE);
+#else
       m_tabView->SetTabSelection((int) (long) GetPage(0), FALSE);
+#endif
       if (m_nSelection != 0)
         ChangePage(-1, 0);
     }
@@ -269,7 +288,11 @@ bool wxNotebook::RemovePage(int nPage)
     //    m_aPages[nPage]->Lower();
 
     wxNotebookPage* pPage = GetPage(nPage);
+#if defined (__WIN16__)
+    m_tabView->RemoveTab(nPage);
+#else
     m_tabView->RemoveTab((int) (long) pPage);
+#endif
 
     m_aPages.Remove(nPage);
 
@@ -357,7 +380,12 @@ bool wxNotebook::InsertPage(int nPage,
     wxASSERT( pPage != NULL );
     wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE );
 
+// For 16 bit integers (tabs limited to 32768)
+#if defined (__WIN16__)
+    m_tabView->AddTab(nPage, strText);
+#else
     m_tabView->AddTab((int) (long) pPage, strText);
+#endif
     if (!bSelect)
       pPage->Show(FALSE);
 
@@ -367,7 +395,11 @@ bool wxNotebook::InsertPage(int nPage,
     if (bSelect)
     {
         // This will cause ChangePage to be called, via OnSelPage
+#if defined (__WIN16__)
+        m_tabView->SetTabSelection(nPage, TRUE);
+#else
         m_tabView->SetTabSelection((int) (long) pPage, TRUE);
+#endif
     }
 
     // some page must be selected: either this one or the first one if there is
@@ -601,11 +633,6 @@ wxRect wxNotebook::GetAvailableClientSize()
     return rect;
 }
 
-void wxNotebook::SetTabSize(const wxSize& sz)
-{
-    // TODO
-}
-
 /*
  * wxNotebookTabView
  */
@@ -638,6 +665,10 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
   wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
 #endif
 
+#if defined (__WIN16__)
+  int activatePos = activateId;
+  int deactivatePos = deactivateId;
+#else
   // Translate from wxTabView's ids (which aren't position-dependent)
   // to wxNotebook's (which are).
   wxNotebookPage* pActive = (wxNotebookPage*) activateId;
@@ -646,6 +677,7 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
   int activatePos = m_notebook->FindPagePosition(pActive);
   int deactivatePos = m_notebook->FindPagePosition(pDeactive);
 
+#endif
   event.SetEventObject(m_notebook);
   event.SetSelection(activatePos);
   event.SetOldSelection(deactivatePos);
diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp
index a96d6d99b6..c16843cb8a 100644
--- a/src/msw/frame.cpp
+++ b/src/msw/frame.cpp
@@ -119,7 +119,12 @@ bool wxFrame::Create(wxWindow *parent,
 
   // we pass NULL as parent to MSWCreate because frames with parents behave
   // very strangely under Win95 shell
-  MSWCreate(m_windowId, NULL, wxFrameClassName, this, title,
+  // Alteration by JACS: keep normal Windows behaviour (float on top of parent)
+  // with this style.
+  if ((m_windowStyle & wxFRAME_FLOAT_ON_PARENT) == 0)
+    parent = NULL;
+
+  MSWCreate(m_windowId, parent, wxFrameClassName, this, title,
             x, y, width, height, style);
 
   wxModelessWindows.Append(this);
diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp
index d287e72444..9e16993a83 100644
--- a/src/msw/gauge95.cpp
+++ b/src/msw/gauge95.cpp
@@ -68,6 +68,11 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id,
   int height = size.y;
 
   long msFlags = WS_CHILD | WS_VISIBLE | WS_TABSTOP;
+  if (m_windowStyle & wxGA_VERTICAL)
+    msFlags |= PBS_VERTICAL;
+
+  if (m_windowStyle & wxGA_SMOOTH)
+    msFlags |= PBS_SMOOTH;
 
   HWND wx_button =
       CreateWindowEx(MakeExtendedStyle(m_windowStyle), PROGRESS_CLASS, NULL, msFlags,
diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp
index 108c2948b0..6dff2255e4 100644
--- a/src/msw/ole/automtn.cpp
+++ b/src/msw/ole/automtn.cpp
@@ -540,7 +540,7 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
     {
         oleVariant.vt = VT_BOOL;
         // 'bool' required for VC++ 4 apparently
-#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER <= 1000))
+#if defined(__WATCOMC__) || (defined(__VISUALC__) && (__VISUALC__ <= 1000))
         oleVariant.bool = variant.GetBool();
 #else
         oleVariant.boolVal = variant.GetBool();
@@ -668,7 +668,7 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
 
 	case VT_BOOL:
 		{
-#ifdef __WATCOMC__
+#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER <= 1000)) //GC
 			variant = (bool) (oleVariant.bool != 0);
 #else
 			variant = (bool) (oleVariant.boolVal != 0);
diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp
index e67ac95611..58b3cd8a16 100644
--- a/src/msw/ole/oleutils.cpp
+++ b/src/msw/ole/oleutils.cpp
@@ -184,6 +184,24 @@ void wxLogRelease(const char *szInterface, ULONG cRef)
   wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
 }
 
+#elif defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ <= 1000)
+
+// For VC++ 4
+void wxLogQueryInterface(const char *szInterface, REFIID riid)
+{
+  wxLogTrace("%s::QueryInterface", szInterface);
+}
+
+void wxLogAddRef(const char *szInterface, ULONG cRef)
+{
+  wxLogTrace("After %s::AddRef: m_cRef = %d", szInterface, cRef + 1);
+}
+
+void wxLogRelease(const char *szInterface, ULONG cRef)
+{
+  wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
+}
+
 #endif  //WXDEBUG
 
 #endif
diff --git a/utils/makefile.vc b/utils/makefile.vc
index 7679e9d9a7..ece8395fe1 100644
--- a/utils/makefile.vc
+++ b/utils/makefile.vc
@@ -1,5 +1,5 @@
 #
-# File:		makefile.nt
+# File:		makefile.vc
 # Author:	Julian Smart
 # Created:	1993
 # Updated:	
@@ -23,74 +23,70 @@ LINK_DEBUG_FLAGS="/RELEASE"
 
 all:
         cd $(WXDIR)\utils\dialoged\src
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
-        cd $(WXDIR)\utils\wxprop\src
-        nmake -f makefile.nt test DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\hytext\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\mfutils\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\tex2rtf\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxbuild\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxgraph\src
-#        nmake -f makefile.nt test DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc test DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxtree\src
-#        nmake -f makefile.nt test DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc test DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxhelp\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wximage\win
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxweb\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxhelp2\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\clockwrk\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxanim\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\colours
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\ogl\src
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 #        cd $(WXDIR)\utils\wxchart\src
-#        nmake -f makefile.nt test DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.vc test DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
 
 clean:
-        cd $(WXDIR)\utils\wxprop\src
-        nmake -f makefile.nt clean
         cd $(WXDIR)\utils\dialoged\src
-        nmake -f makefile.nt clean
+        nmake -f makefile.vc clean
         cd $(WXDIR)\utils\nplugin
-        nmake -f makefile.nt clean
+        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\hytext\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\mfutils\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\tex2rtf\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxbuild\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxgraph\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxtree\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxhelp\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxhelp2\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\clockwrk\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxanim\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\colours
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\ogl\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxchart\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wxweb\src
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean
 #        cd $(WXDIR)\utils\wximage\win
-#        nmake -f makefile.nt clean
+#        nmake -f makefile.vc clean