Added ability to call wxWindow::OnPaint under Windows (experimental).
Added wxTR_NO_LINES to remove lines from tree control (MSW only). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,6 +22,10 @@ To intercept events from a tree control, use the event table macros described in
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{\windowstyle{wxTR\_HAS\_BUTTONS}}{Use this style to show + and - buttons to the
|
||||
left of parent items. Win32 only. }
|
||||
\twocolitem{\windowstyle{wxTR\_NO\_LINES}}{Use this style to hide vertical lines.
|
||||
Win32 only. }
|
||||
\twocolitem{\windowstyle{wxTR\_LINES\_AT\_ROOT}}{Use this style to show lines at the
|
||||
tree root. Win32 only.}
|
||||
\twocolitem{\windowstyle{wxTR\_EDIT\_LABELS}}{Use this style if you wish the user to be
|
||||
able to edit labels in the tree control.}
|
||||
\twocolitem{\windowstyle{wxTR\_MULTIPLE}}{Use this style to allow the user to
|
||||
|
@@ -1087,6 +1087,7 @@ enum wxStretch
|
||||
#define wxTR_MULTIPLE 0x0020
|
||||
#define wxTR_EXTENDED 0x0040
|
||||
#define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080
|
||||
#define wxTR_NO_LINES 0x0100
|
||||
|
||||
/*
|
||||
* wxListCtrl flags
|
||||
|
@@ -74,6 +74,9 @@ public:
|
||||
|
||||
virtual ~wxPaintDC();
|
||||
|
||||
// find the entry for this DC in the cache (keyed by the window)
|
||||
static WXHDC FindDCInCache(wxWindow* win);
|
||||
|
||||
protected:
|
||||
static wxArrayDCInfo ms_cache;
|
||||
|
||||
|
@@ -185,6 +185,7 @@ public:
|
||||
void OnSetFocus(wxFocusEvent& event);
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
public:
|
||||
// For implementation purposes - sometimes decorations make the client area
|
||||
|
@@ -262,3 +262,20 @@ wxPaintDCInfo *wxPaintDC::FindInCache(size_t *index) const
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
// find the entry for this DC in the cache (keyed by the window)
|
||||
WXHDC wxPaintDC::FindDCInCache(wxWindow* win)
|
||||
{
|
||||
wxPaintDCInfo *info = NULL;
|
||||
size_t nCache = ms_cache.GetCount();
|
||||
for ( size_t n = 0; n < nCache; n++ )
|
||||
{
|
||||
info = &ms_cache[n];
|
||||
if ( info->hwnd == win->GetHWND() )
|
||||
{
|
||||
return info->hdc;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -519,8 +519,10 @@ bool wxTreeCtrl::Create(wxWindow *parent,
|
||||
return FALSE;
|
||||
|
||||
DWORD wstyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP |
|
||||
TVS_HASLINES | TVS_SHOWSELALWAYS /* | WS_CLIPSIBLINGS */;
|
||||
TVS_SHOWSELALWAYS /* | WS_CLIPSIBLINGS */;
|
||||
|
||||
if ((m_windowStyle & wxTR_NO_LINES) == 0)
|
||||
wstyle |= TVS_HASLINES;
|
||||
if ( m_windowStyle & wxTR_HAS_BUTTONS )
|
||||
wstyle |= TVS_HASBUTTONS;
|
||||
|
||||
|
@@ -2952,6 +2952,16 @@ bool wxWindow::HandlePaint()
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
// Can be called from an application's OnPaint handler
|
||||
void wxWindow::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
HDC hDC = (HDC) wxPaintDC::FindDCInCache((wxWindow*) event.GetEventObject());
|
||||
if (hDC != 0)
|
||||
{
|
||||
MSWDefWindowProc(WM_PAINT, (WPARAM) hDC, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool wxWindow::HandleEraseBkgnd(WXHDC hdc)
|
||||
{
|
||||
// Prevents flicker when dragging
|
||||
|
Reference in New Issue
Block a user