]> git.saurik.com Git - wxWidgets.git/commitdiff
wxNotebook fixes for Win16; VC++ 4 fixes for OLE files; wxGA_SMOOTH flag (wxMSW);
authorJulian Smart <julian@anthemion.co.uk>
Wed, 5 May 1999 08:57:41 +0000 (08:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 5 May 1999 08:57:41 +0000 (08:57 +0000)
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

docs/gtk/todo.txt
docs/latex/wx/frame.tex
docs/latex/wx/window.tex
docs/symbols.txt
include/wx/defs.h
src/generic/notebook.cpp
src/msw/frame.cpp
src/msw/gauge95.cpp
src/msw/ole/automtn.cpp
src/msw/ole/oleutils.cpp
utils/makefile.vc

index 1db16e96c2a58580eea6e00c398b00ffad095455..60b2b0d642ece9f969e2f6f660447c08e335cd9a 100644 (file)
Binary files a/docs/gtk/todo.txt and b/docs/gtk/todo.txt differ
index ebe13b0449be8c8481510352f946a674b010e4c8..274958d01a4f617eb3aab0aca6c9a3310fa3f827 100644 (file)
@@ -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
index e26756621098750603cad501fd8d403ac3859352..d2abf2055977c5f1f6de28a7b22cf4059701ae5f 100644 (file)
@@ -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}}
 
index 1b2865d1cf8cd49680309865a622ac07acf3b1e9..e23aa1d02348a179cb5678b9fbdbae4a1efae4f2 100644 (file)
Binary files a/docs/symbols.txt and b/docs/symbols.txt differ
index 90ac41fb0ab3afc5cf2c2317e63b1a24aceebc34..2b51d4fae644e06d15028c853103c223baee0921 100644 (file)
@@ -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
index 90782f45457acf2afbdbef48298007c9054ae4bc..e33702a3d58ca94912afd616fea9d4dcaa765d3f 100644 (file)
@@ -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);
index a96d6d99b677ab84d197dcbfa5030b6288664b25..c16843cb8afa6d110e97a3383cc94dce04f785c6 100644 (file)
@@ -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);
index d287e72444c665de2409b5d0607c12c10f5f12f2..9e16993a8336ed78b772708b53595e0028cfda5d 100644 (file)
@@ -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,
index 108c2948b0a47cf246d54ef0a8bb19b6a095e922..6dff2255e48711cdc2d749bdb7ce86f75259f15a 100644 (file)
@@ -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);
index e67ac95611d5bf550910d6856ef95b9d97b5c821..58b3cd8a1687f9757c073faf0c8bcac1156c04bc 100644 (file)
@@ -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
index 7679e9d9a7da242105fc98b7fc76f2a8fa0da748..ece8395fe1fa0cef38fe6f2a072e5ddd7a6395a2 100644 (file)
@@ -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