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:
Julian Smart 1999-03-21 22:39:45 +00:00
parent aeab6775d8
commit 58a8ab8868
8 changed files with 79 additions and 11 deletions

View File

@ -36,6 +36,8 @@ src/generic/*.cpp
src/generic/*.c
src/generic/*.inc
src/unix/*.cpp
src/png/*.c
src/png/*.h
src/png/makefile*
@ -66,6 +68,7 @@ include/wx/protocol/*.h
include/wx/wx_setup.vms
include/wx/common/*.h
include/wx/generic/*.h
include/wx/unix/*.h
lib/dummy
bin/*.*

View File

@ -1,6 +1,23 @@
wxWindows 2 Change Log
----------------------
2.0.2, March ?? 1999
---------------------
wxGTK:
wxMSW:
- wxNotebook changes: can add image only; wxNB_FIXEDWIDTH added;
SetTabSize added.
wxMotif:
General:
2.0.1 (release), March 1st 1999
-------------------------------

View File

@ -591,17 +591,16 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
* wxTabCtrl flags
*/
#define wxTAB_MULTILINE 0x0000
#define wxTAB_RIGHTJUSTIFY 0x0004
#define wxTAB_FIXEDWIDTH 0x0008
#define wxTAB_OWNERDRAW 0x0010
// Sorry, I changed my mind about these names...
#define wxTC_MULTILINE 0x0000
#define wxTC_RIGHTJUSTIFY 0x0004
#define wxTC_FIXEDWIDTH 0x0008
#define wxTC_OWNERDRAW 0x0010
/*
* wxNotebook flags
*/
#define wxNB_FIXEDWIDTH 0x0008
/*
* wxStatusBar95 flags
*/

View File

@ -166,6 +166,10 @@ public:
// get the panel which represents the given page
wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; }
// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
// style.
void SetTabSize(const wxSize& sz);
// callbacks
// ---------
void OnSize(wxSizeEvent& event);

View File

@ -253,6 +253,9 @@ public:
// the item will be shown in bold
void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
// the item will be shown with a drop highlight
void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = TRUE);
// item status inquiries
// ---------------------

View File

@ -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 )

View File

@ -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));
}

View File

@ -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() )
{