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
This commit is contained in:
Julian Smart
1999-05-05 08:57:41 +00:00
parent e716ca3d3b
commit aeab10d07c
11 changed files with 129 additions and 50 deletions

View 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);

View 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);

View 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,

View 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);

View 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