Added wxTreeCtrl::SetItemDropHighlight (wxMSW only);
added WS_CLIPCHILDREN style to wxNotebook. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,6 +36,9 @@ extern "C" {
|
||||
#include "wx/intl.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
// For memcpy
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __SALFORDC__
|
||||
#ifdef FAR
|
||||
#undef FAR
|
||||
@@ -256,9 +259,11 @@ char unsigned *wxImage::GetData() const
|
||||
return M_IMGDATA->m_data;
|
||||
}
|
||||
|
||||
void wxImage::SetData( char unsigned *WXUNUSED(data) )
|
||||
void wxImage::SetData( char unsigned *data )
|
||||
{
|
||||
wxCHECK_RET( Ok(), "invalid image" );
|
||||
|
||||
memcpy(M_IMGDATA->m_data, data, M_IMGDATA->m_width * M_IMGDATA->m_height * 3);
|
||||
}
|
||||
|
||||
void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b )
|
||||
|
@@ -133,11 +133,13 @@ bool wxNotebook::Create(wxWindow *parent,
|
||||
// style
|
||||
m_windowStyle = style | wxTAB_TRAVERSAL;
|
||||
|
||||
long tabStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TABS;
|
||||
long tabStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TABS | WS_CLIPCHILDREN;
|
||||
if ( m_windowStyle & wxTC_MULTILINE )
|
||||
tabStyle |= TCS_MULTILINE;
|
||||
if ( m_windowStyle & wxBORDER )
|
||||
tabStyle &= WS_BORDER;
|
||||
if (m_windowStyle & wxNB_FIXEDWIDTH)
|
||||
tabStyle |= TCS_FIXEDWIDTH ;
|
||||
|
||||
// create the tab control.
|
||||
m_hWnd = (WXHWND)CreateWindowEx
|
||||
@@ -332,9 +334,23 @@ bool wxNotebook::InsertPage(int nPage,
|
||||
|
||||
// add the tab to the control
|
||||
TC_ITEM tcItem;
|
||||
tcItem.mask = TCIF_TEXT | TCIF_IMAGE;
|
||||
tcItem.pszText = (char *)strText.c_str();
|
||||
tcItem.iImage = imageId;
|
||||
tcItem.mask = 0;
|
||||
|
||||
if (imageId != -1)
|
||||
{
|
||||
tcItem.mask |= TCIF_IMAGE;
|
||||
tcItem.iImage = imageId;
|
||||
}
|
||||
else
|
||||
tcItem.iImage = 0;
|
||||
|
||||
if (!strText.IsEmpty())
|
||||
{
|
||||
tcItem.mask |= TCIF_TEXT;
|
||||
tcItem.pszText = (char *)strText.c_str();
|
||||
}
|
||||
else
|
||||
tcItem.pszText = (char *) NULL;
|
||||
|
||||
if ( TabCtrl_InsertItem(m_hwnd, nPage, &tcItem) == -1 ) {
|
||||
wxLogError("Can't create the notebook page '%s'.", strText.c_str());
|
||||
@@ -525,3 +541,10 @@ void wxNotebook::OnEraseBackground(wxEraseEvent& event)
|
||||
Default();
|
||||
}
|
||||
|
||||
// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
|
||||
// style.
|
||||
void wxNotebook::SetTabSize(const wxSize& sz)
|
||||
{
|
||||
::SendMessage((HWND) GetHWND(), TCM_SETITEMSIZE, 0, MAKELPARAM(sz.x, sz.y));
|
||||
}
|
||||
|
||||
|
@@ -377,6 +377,13 @@ void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
|
||||
DoSetItem(&tvItem);
|
||||
}
|
||||
|
||||
void wxTreeCtrl::SetItemDropHighlight(const wxTreeItemId& item, bool highlight)
|
||||
{
|
||||
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_DROPHILITED);
|
||||
tvItem.state = highlight ? TVIS_DROPHILITED : 0;
|
||||
DoSetItem(&tvItem);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Item status
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -522,6 +529,13 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parent,
|
||||
TV_INSERTSTRUCT tvIns;
|
||||
tvIns.hParent = (HTREEITEM) (WXHTREEITEM)parent;
|
||||
tvIns.hInsertAfter = (HTREEITEM) (WXHTREEITEM) hInsertAfter;
|
||||
|
||||
// This is how we insert the item as the first child: supply a NULL hInsertAfter
|
||||
if (tvIns.hInsertAfter == (HTREEITEM) 0)
|
||||
{
|
||||
tvIns.hInsertAfter = TVI_FIRST;
|
||||
}
|
||||
|
||||
UINT mask = 0;
|
||||
if ( !text.IsEmpty() )
|
||||
{
|
||||
|
Reference in New Issue
Block a user