Some debug code.
Removed flicker form wxTreeCtrl. Changes.txt update. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6,6 +6,11 @@ Who has a BigEndian computer (e.g. Sparc) that runs a 15 and/or
|
|||||||
person could help me by running a small testprogram and sending
|
person could help me by running a small testprogram and sending
|
||||||
me the output.
|
me the output.
|
||||||
|
|
||||||
|
Added support for multiple font and colour support to item in
|
||||||
|
list ctrls and tree ctrls.
|
||||||
|
|
||||||
|
Added support for multiple-selection file dialog.
|
||||||
|
|
||||||
Implemented wxMenuBar::Insert() and wxMenu::Insert(). There is
|
Implemented wxMenuBar::Insert() and wxMenu::Insert(). There is
|
||||||
also a Remove() method now, but the GTK doesn't really like that.
|
also a Remove() method now, but the GTK doesn't really like that.
|
||||||
|
|
||||||
@@ -18,11 +23,14 @@ certain circumstances (Karsten Ballueder).
|
|||||||
wxGTK no longer gives warnings if the application shows a dialog
|
wxGTK no longer gives warnings if the application shows a dialog
|
||||||
before entering the main loop.
|
before entering the main loop.
|
||||||
|
|
||||||
|
Added string to long/ulong/float conversion routines and some
|
||||||
|
more string related things.
|
||||||
|
|
||||||
Updated documentation for wxFile, wxFFile and their respective
|
Updated documentation for wxFile, wxFFile and their respective
|
||||||
stream classes. Documented some more stream classes.
|
stream classes. Documented some more stream classes.
|
||||||
|
|
||||||
Improved wxHTML and its help system. Options dialog, better printing,
|
Improved wxHTML and its help system. Options dialog, better printing,
|
||||||
history index.
|
history index. Also implemented more (cite, definition lists, etc).
|
||||||
|
|
||||||
Corrected wxRegion::GetBox().
|
Corrected wxRegion::GetBox().
|
||||||
|
|
||||||
@@ -42,7 +50,8 @@ wxSpinCtrl now has its own event, intercepted using EVT_SPINCTRL.
|
|||||||
The ODBC classes can now be configured at run-time if they
|
The ODBC classes can now be configured at run-time if they
|
||||||
are to use forward-only cursors or not.
|
are to use forward-only cursors or not.
|
||||||
|
|
||||||
Added wxDateTime class.
|
Added wxDateTime class. The existing classes wxTime and wxDate
|
||||||
|
have been reimplemented and corrected using wxDatTime.
|
||||||
|
|
||||||
Rewritten wxThread to have a flag controlling if the
|
Rewritten wxThread to have a flag controlling if the
|
||||||
thread will delete its C++ class itself ("delete this") or
|
thread will delete its C++ class itself ("delete this") or
|
||||||
@@ -53,11 +62,12 @@ Added TIFF reading code, PCX writing code.
|
|||||||
Minor compile and build fixes for different architectures.
|
Minor compile and build fixes for different architectures.
|
||||||
|
|
||||||
Added more flags to wxSizer for proportional sizing and
|
Added more flags to wxSizer for proportional sizing and
|
||||||
centering and alignment combination.
|
centering and alignment combination and a wxNotebookSizer.
|
||||||
|
|
||||||
Added controls to wxToolBars (e.g. combobox) and DeleteTool.
|
Added controls to wxToolBars (e.g. combobox) and DeleteTool.
|
||||||
|
|
||||||
Fixed problem with reading flushable streams.
|
Fixed several problems with buffered streams. Added support for
|
||||||
|
setting the end-of-line mode (Mac,DOS,Unix) in wxTextOutputStream.
|
||||||
|
|
||||||
Added code to send events from one thread to another and added
|
Added code to send events from one thread to another and added
|
||||||
function to wake up idle system (needed for sending inter-thread
|
function to wake up idle system (needed for sending inter-thread
|
||||||
@@ -69,14 +79,16 @@ Also corrected navigation on wxRadioBox.
|
|||||||
Corrected segfaults in wxGLCanvas and stupid race when using
|
Corrected segfaults in wxGLCanvas and stupid race when using
|
||||||
several such canvasses.
|
several such canvasses.
|
||||||
|
|
||||||
Some minor updates to wxSockets.
|
Some minor updates to wxSockets. Fixed timeout problem.
|
||||||
|
|
||||||
Speed-up for new encoding related font code.
|
Speed-up for new encoding related font code.
|
||||||
|
|
||||||
Changed wxListBox to send deferred events, i.e. events emitted by
|
Changed wxListBox to send deferred events, i.e. events emitted by
|
||||||
the listbox won't get processed before the next idle message.
|
the listbox won't get processed before the next idle message.
|
||||||
|
|
||||||
Some more minor changes.
|
More minor changes and fixes.
|
||||||
|
|
||||||
|
Began work on a new dialog and resource editor (wxDesigner).
|
||||||
|
|
||||||
7st November '99: wxWindows 2.1.11 released
|
7st November '99: wxWindows 2.1.11 released
|
||||||
|
|
||||||
|
@@ -154,8 +154,8 @@ MyCanvas::MyCanvas( wxScrolledWindow *parent, wxWindowID id,
|
|||||||
{
|
{
|
||||||
m_owner = parent;
|
m_owner = parent;
|
||||||
|
|
||||||
(void)new wxButton( this, -1, "Hallo I", wxPoint(0,50), wxSize(100,25) );
|
// (void)new wxButton( this, -1, "Hallo I", wxPoint(0,50), wxSize(100,25) );
|
||||||
(void)new wxButton( this, -1, "Hallo II", wxPoint(200,50), wxSize(100,25) );
|
// (void)new wxButton( this, -1, "Hallo II", wxPoint(200,50), wxSize(100,25) );
|
||||||
|
|
||||||
SetBackgroundColour( *wxWHITE );
|
SetBackgroundColour( *wxWHITE );
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
// Has the region an screen been exposed?
|
// Has the region an screen been exposed?
|
||||||
if (IsExposed(0,0,100,25))
|
if (IsExposed(0,0,100,25))
|
||||||
{
|
{
|
||||||
printf( "Redraw first cell\n" );
|
wxLogMessage( "Redraw first cell" );
|
||||||
dc.DrawRectangle( 0, 0, 100, 25 );
|
dc.DrawRectangle( 0, 0, 100, 25 );
|
||||||
dc.DrawText( "First Cell", 5, 5 );
|
dc.DrawText( "First Cell", 5, 5 );
|
||||||
}
|
}
|
||||||
@@ -216,7 +216,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
// Has the region an screen been exposed?
|
// Has the region an screen been exposed?
|
||||||
if (IsExposed(200,0,100,25))
|
if (IsExposed(200,0,100,25))
|
||||||
{
|
{
|
||||||
printf( "Redraw second cell\n" );
|
wxLogMessage( "Redraw second cell" );
|
||||||
dc.DrawRectangle( 200, 0, 100, 25 );
|
dc.DrawRectangle( 200, 0, 100, 25 );
|
||||||
dc.DrawText( "Second Cell", 205, 5 );
|
dc.DrawText( "Second Cell", 205, 5 );
|
||||||
}
|
}
|
||||||
|
@@ -263,8 +263,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxNotifyEvent)
|
|||||||
wxTreeEvent::wxTreeEvent( wxEventType commandType, int id )
|
wxTreeEvent::wxTreeEvent( wxEventType commandType, int id )
|
||||||
: wxNotifyEvent( commandType, id )
|
: wxNotifyEvent( commandType, id )
|
||||||
{
|
{
|
||||||
m_code = 0;
|
m_code = 0;
|
||||||
m_itemOld = (wxGenericTreeItem *)NULL;
|
m_itemOld = (wxGenericTreeItem *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -278,121 +278,120 @@ wxGenericTreeItem::wxGenericTreeItem(wxGenericTreeItem *parent,
|
|||||||
wxTreeItemData *data)
|
wxTreeItemData *data)
|
||||||
: m_text(text)
|
: m_text(text)
|
||||||
{
|
{
|
||||||
m_images[wxTreeItemIcon_Normal] = image;
|
m_images[wxTreeItemIcon_Normal] = image;
|
||||||
m_images[wxTreeItemIcon_Selected] = selImage;
|
m_images[wxTreeItemIcon_Selected] = selImage;
|
||||||
m_images[wxTreeItemIcon_Expanded] = NO_IMAGE;
|
m_images[wxTreeItemIcon_Expanded] = NO_IMAGE;
|
||||||
m_images[wxTreeItemIcon_SelectedExpanded] = NO_IMAGE;
|
m_images[wxTreeItemIcon_SelectedExpanded] = NO_IMAGE;
|
||||||
|
|
||||||
m_data = data;
|
m_data = data;
|
||||||
m_x = m_y = 0;
|
m_x = m_y = 0;
|
||||||
m_xCross = m_yCross = 0;
|
m_xCross = m_yCross = 0;
|
||||||
|
|
||||||
m_level = 0;
|
m_level = 0;
|
||||||
|
|
||||||
m_isCollapsed = TRUE;
|
m_isCollapsed = TRUE;
|
||||||
m_hasHilight = FALSE;
|
m_hasHilight = FALSE;
|
||||||
m_hasPlus = FALSE;
|
m_hasPlus = FALSE;
|
||||||
m_isBold = FALSE;
|
m_isBold = FALSE;
|
||||||
|
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
|
|
||||||
m_attr = (wxTreeItemAttr *)NULL;
|
m_attr = (wxTreeItemAttr *)NULL;
|
||||||
|
|
||||||
m_width = 0;
|
// We don't know the height here yet.
|
||||||
m_height = 0;
|
m_width = 0;
|
||||||
|
m_height = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGenericTreeItem::~wxGenericTreeItem()
|
wxGenericTreeItem::~wxGenericTreeItem()
|
||||||
{
|
{
|
||||||
delete m_data;
|
delete m_data;
|
||||||
|
|
||||||
delete m_attr;
|
delete m_attr;
|
||||||
|
|
||||||
wxASSERT_MSG( m_children.IsEmpty(),
|
wxASSERT_MSG( m_children.IsEmpty(),
|
||||||
wxT("please call DeleteChildren() before deleting the item") );
|
wxT("please call DeleteChildren() before deleting the item") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeItem::DeleteChildren(wxTreeCtrl *tree)
|
void wxGenericTreeItem::DeleteChildren(wxTreeCtrl *tree)
|
||||||
{
|
{
|
||||||
size_t count = m_children.Count();
|
size_t count = m_children.Count();
|
||||||
for ( size_t n = 0; n < count; n++ )
|
for ( size_t n = 0; n < count; n++ )
|
||||||
{
|
|
||||||
wxGenericTreeItem *child = m_children[n];
|
|
||||||
if ( tree )
|
|
||||||
{
|
{
|
||||||
tree->SendDeleteEvent(child);
|
wxGenericTreeItem *child = m_children[n];
|
||||||
|
if (tree)
|
||||||
|
tree->SendDeleteEvent(child);
|
||||||
|
|
||||||
|
child->DeleteChildren(tree);
|
||||||
|
delete child;
|
||||||
}
|
}
|
||||||
|
|
||||||
child->DeleteChildren(tree);
|
m_children.Empty();
|
||||||
delete child;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_children.Empty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeItem::SetText( const wxString &text )
|
void wxGenericTreeItem::SetText( const wxString &text )
|
||||||
{
|
{
|
||||||
m_text = text;
|
m_text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeItem::Reset()
|
void wxGenericTreeItem::Reset()
|
||||||
{
|
{
|
||||||
m_text.Empty();
|
m_text.Empty();
|
||||||
for ( int i = 0; i < wxTreeItemIcon_Max; i++ )
|
for ( int i = 0; i < wxTreeItemIcon_Max; i++ )
|
||||||
{
|
{
|
||||||
m_images[i] = NO_IMAGE;
|
m_images[i] = NO_IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_data = NULL;
|
m_data = NULL;
|
||||||
m_x = m_y =
|
m_x = m_y =
|
||||||
m_height = m_width = 0;
|
m_height = m_width = 0;
|
||||||
m_xCross =
|
m_xCross =
|
||||||
m_yCross = 0;
|
m_yCross = 0;
|
||||||
|
|
||||||
m_level = 0;
|
m_level = 0;
|
||||||
|
|
||||||
DeleteChildren();
|
DeleteChildren();
|
||||||
m_isCollapsed = TRUE;
|
m_isCollapsed = TRUE;
|
||||||
|
|
||||||
m_parent = (wxGenericTreeItem *)NULL;
|
m_parent = (wxGenericTreeItem *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxGenericTreeItem::GetChildrenCount(bool recursively) const
|
size_t wxGenericTreeItem::GetChildrenCount(bool recursively) const
|
||||||
{
|
{
|
||||||
size_t count = m_children.Count();
|
size_t count = m_children.Count();
|
||||||
if ( !recursively )
|
if ( !recursively )
|
||||||
return count;
|
return count;
|
||||||
|
|
||||||
size_t total = count;
|
size_t total = count;
|
||||||
for ( size_t n = 0; n < count; ++n )
|
for ( size_t n = 0; n < count; ++n )
|
||||||
{
|
{
|
||||||
total += m_children[n]->GetChildrenCount();
|
total += m_children[n]->GetChildrenCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeItem::SetCross( int x, int y )
|
void wxGenericTreeItem::SetCross( int x, int y )
|
||||||
{
|
{
|
||||||
m_xCross = x;
|
m_xCross = x;
|
||||||
m_yCross = y;
|
m_yCross = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericTreeItem::GetSize( int &x, int &y, const wxTreeCtrl *theTree )
|
void wxGenericTreeItem::GetSize( int &x, int &y, const wxTreeCtrl *theTree )
|
||||||
{
|
{
|
||||||
int bottomY=m_y+theTree->GetLineHeight(this);
|
int bottomY=m_y+theTree->GetLineHeight(this);
|
||||||
if ( y < bottomY ) y = bottomY;
|
if ( y < bottomY ) y = bottomY;
|
||||||
int width = m_x + m_width;
|
int width = m_x + m_width;
|
||||||
if ( x < width ) x = width;
|
if ( x < width ) x = width;
|
||||||
|
|
||||||
if (IsExpanded())
|
if (IsExpanded())
|
||||||
{
|
|
||||||
size_t count = m_children.Count();
|
|
||||||
for ( size_t n = 0; n < count; ++n )
|
|
||||||
{
|
{
|
||||||
m_children[n]->GetSize( x, y, theTree );
|
size_t count = m_children.Count();
|
||||||
|
for ( size_t n = 0; n < count; ++n )
|
||||||
|
{
|
||||||
|
m_children[n]->GetSize( x, y, theTree );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point,
|
wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point,
|
||||||
@@ -497,12 +496,12 @@ int wxGenericTreeItem::GetCurrentImage() const
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxScrolledWindow)
|
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxScrolledWindow)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxTreeCtrl,wxScrolledWindow)
|
BEGIN_EVENT_TABLE(wxTreeCtrl,wxScrolledWindow)
|
||||||
EVT_PAINT (wxTreeCtrl::OnPaint)
|
EVT_PAINT (wxTreeCtrl::OnPaint)
|
||||||
EVT_MOUSE_EVENTS (wxTreeCtrl::OnMouse)
|
EVT_MOUSE_EVENTS (wxTreeCtrl::OnMouse)
|
||||||
EVT_CHAR (wxTreeCtrl::OnChar)
|
EVT_CHAR (wxTreeCtrl::OnChar)
|
||||||
EVT_SET_FOCUS (wxTreeCtrl::OnSetFocus)
|
EVT_SET_FOCUS (wxTreeCtrl::OnSetFocus)
|
||||||
EVT_KILL_FOCUS (wxTreeCtrl::OnKillFocus)
|
EVT_KILL_FOCUS (wxTreeCtrl::OnKillFocus)
|
||||||
EVT_IDLE (wxTreeCtrl::OnIdle)
|
EVT_IDLE (wxTreeCtrl::OnIdle)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -511,33 +510,33 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
void wxTreeCtrl::Init()
|
void wxTreeCtrl::Init()
|
||||||
{
|
{
|
||||||
m_current =
|
m_current =
|
||||||
m_key_current =
|
m_key_current =
|
||||||
m_anchor = (wxGenericTreeItem *) NULL;
|
m_anchor = (wxGenericTreeItem *) NULL;
|
||||||
m_hasFocus = FALSE;
|
m_hasFocus = FALSE;
|
||||||
m_dirty = FALSE;
|
m_dirty = FALSE;
|
||||||
|
|
||||||
m_xScroll = 0;
|
m_xScroll = 0;
|
||||||
m_yScroll = 0;
|
m_yScroll = 0;
|
||||||
m_lineHeight = 10;
|
m_lineHeight = 10;
|
||||||
m_indent = 15;
|
m_indent = 15;
|
||||||
m_spacing = 18;
|
m_spacing = 18;
|
||||||
|
|
||||||
m_hilightBrush = new wxBrush
|
m_hilightBrush = new wxBrush
|
||||||
(
|
(
|
||||||
wxSystemSettings::GetSystemColour(wxSYS_COLOUR_HIGHLIGHT),
|
wxSystemSettings::GetSystemColour(wxSYS_COLOUR_HIGHLIGHT),
|
||||||
wxSOLID
|
wxSOLID
|
||||||
);
|
);
|
||||||
|
|
||||||
m_imageListNormal =
|
m_imageListNormal =
|
||||||
m_imageListState = (wxImageList *) NULL;
|
m_imageListState = (wxImageList *) NULL;
|
||||||
|
|
||||||
m_dragCount = 0;
|
m_dragCount = 0;
|
||||||
|
|
||||||
m_renameTimer = new wxTreeRenameTimer( this );
|
m_renameTimer = new wxTreeRenameTimer( this );
|
||||||
|
|
||||||
m_normalFont = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT );
|
m_normalFont = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT );
|
||||||
m_boldFont = wxFont( m_normalFont.GetPointSize(),
|
m_boldFont = wxFont( m_normalFont.GetPointSize(),
|
||||||
m_normalFont.GetFamily(),
|
m_normalFont.GetFamily(),
|
||||||
m_normalFont.GetStyle(),
|
m_normalFont.GetStyle(),
|
||||||
wxBOLD,
|
wxBOLD,
|
||||||
@@ -552,28 +551,28 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
#endif
|
#endif
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
wxScrolledWindow::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name );
|
wxScrolledWindow::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name );
|
||||||
|
|
||||||
#if wxUSE_VALIDATORS
|
#if wxUSE_VALIDATORS
|
||||||
SetValidator( validator );
|
SetValidator( validator );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetBackgroundColour( *wxWHITE );
|
SetBackgroundColour( *wxWHITE );
|
||||||
// m_dottedPen = wxPen( "grey", 0, wxDOT );
|
// m_dottedPen = wxPen( "grey", 0, wxDOT ); too slow under XFree86
|
||||||
m_dottedPen = wxPen( "grey", 0, 0 );
|
m_dottedPen = wxPen( "grey", 0, 0 );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTreeCtrl::~wxTreeCtrl()
|
wxTreeCtrl::~wxTreeCtrl()
|
||||||
{
|
{
|
||||||
wxDELETE( m_hilightBrush );
|
wxDELETE( m_hilightBrush );
|
||||||
|
|
||||||
DeleteAllItems();
|
DeleteAllItems();
|
||||||
|
|
||||||
delete m_renameTimer;
|
delete m_renameTimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -1075,46 +1074,51 @@ void wxTreeCtrl::Collapse(const wxTreeItemId& itemId)
|
|||||||
|
|
||||||
void wxTreeCtrl::CollapseAndReset(const wxTreeItemId& item)
|
void wxTreeCtrl::CollapseAndReset(const wxTreeItemId& item)
|
||||||
{
|
{
|
||||||
Collapse(item);
|
Collapse(item);
|
||||||
DeleteChildren(item);
|
DeleteChildren(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTreeCtrl::Toggle(const wxTreeItemId& itemId)
|
void wxTreeCtrl::Toggle(const wxTreeItemId& itemId)
|
||||||
{
|
{
|
||||||
wxGenericTreeItem *item = itemId.m_pItem;
|
wxGenericTreeItem *item = itemId.m_pItem;
|
||||||
|
|
||||||
if ( item->IsExpanded() )
|
if (item->IsExpanded())
|
||||||
Collapse(itemId);
|
Collapse(itemId);
|
||||||
else
|
else
|
||||||
Expand(itemId);
|
Expand(itemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTreeCtrl::Unselect()
|
void wxTreeCtrl::Unselect()
|
||||||
{
|
{
|
||||||
if ( m_current )
|
if (m_current)
|
||||||
{
|
{
|
||||||
m_current->SetHilight( FALSE );
|
m_current->SetHilight( FALSE );
|
||||||
RefreshLine( m_current );
|
RefreshLine( m_current );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTreeCtrl::UnselectAllChildren(wxGenericTreeItem *item)
|
void wxTreeCtrl::UnselectAllChildren(wxGenericTreeItem *item)
|
||||||
{
|
{
|
||||||
item->SetHilight(FALSE);
|
if (item->IsSelected())
|
||||||
RefreshLine(item);
|
|
||||||
|
|
||||||
if (item->HasChildren())
|
|
||||||
{
|
{
|
||||||
wxArrayGenericTreeItems& children = item->GetChildren();
|
item->SetHilight(FALSE);
|
||||||
size_t count = children.Count();
|
RefreshLine(item);
|
||||||
for ( size_t n = 0; n < count; ++n )
|
}
|
||||||
UnselectAllChildren(children[n]);
|
|
||||||
|
if (item->HasChildren())
|
||||||
|
{
|
||||||
|
wxArrayGenericTreeItems& children = item->GetChildren();
|
||||||
|
size_t count = children.Count();
|
||||||
|
for ( size_t n = 0; n < count; ++n )
|
||||||
|
{
|
||||||
|
UnselectAllChildren(children[n]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTreeCtrl::UnselectAll()
|
void wxTreeCtrl::UnselectAll()
|
||||||
{
|
{
|
||||||
UnselectAllChildren(GetRootItem().m_pItem);
|
UnselectAllChildren(GetRootItem().m_pItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursive function !
|
// Recursive function !
|
||||||
@@ -1127,8 +1131,8 @@ bool wxTreeCtrl::TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem
|
|||||||
{
|
{
|
||||||
wxGenericTreeItem *parent = crt_item->GetParent();
|
wxGenericTreeItem *parent = crt_item->GetParent();
|
||||||
|
|
||||||
if ( parent == NULL ) // This is root item
|
if (parent == NULL) // This is root item
|
||||||
return TagAllChildrenUntilLast(crt_item, last_item, select);
|
return TagAllChildrenUntilLast(crt_item, last_item, select);
|
||||||
|
|
||||||
wxArrayGenericTreeItems& children = parent->GetChildren();
|
wxArrayGenericTreeItems& children = parent->GetChildren();
|
||||||
int index = children.Index(crt_item);
|
int index = children.Index(crt_item);
|
||||||
@@ -1136,24 +1140,30 @@ bool wxTreeCtrl::TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem
|
|||||||
|
|
||||||
size_t count = children.Count();
|
size_t count = children.Count();
|
||||||
for (size_t n=(size_t)(index+1); n<count; ++n)
|
for (size_t n=(size_t)(index+1); n<count; ++n)
|
||||||
if (TagAllChildrenUntilLast(children[n], last_item, select)) return TRUE;
|
{
|
||||||
|
if (TagAllChildrenUntilLast(children[n], last_item, select)) return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return TagNextChildren(parent, last_item, select);
|
return TagNextChildren(parent, last_item, select);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select)
|
bool wxTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select)
|
||||||
{
|
{
|
||||||
crt_item->SetHilight(select);
|
crt_item->SetHilight(select);
|
||||||
RefreshLine(crt_item);
|
RefreshLine(crt_item);
|
||||||
|
|
||||||
if (crt_item==last_item) return TRUE;
|
if (crt_item==last_item)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
if (crt_item->HasChildren())
|
if (crt_item->HasChildren())
|
||||||
{
|
{
|
||||||
wxArrayGenericTreeItems& children = crt_item->GetChildren();
|
wxArrayGenericTreeItems& children = crt_item->GetChildren();
|
||||||
size_t count = children.Count();
|
size_t count = children.Count();
|
||||||
for ( size_t n = 0; n < count; ++n )
|
for ( size_t n = 0; n < count; ++n )
|
||||||
if (TagAllChildrenUntilLast(children[n], last_item, select)) return TRUE;
|
{
|
||||||
|
if (TagAllChildrenUntilLast(children[n], last_item, select))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -3330,6 +3330,10 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
|
|
||||||
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
|
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
|
||||||
|
|
||||||
|
/*
|
||||||
|
printf( "ScrollWindow: %d %d\n", dx, dy );
|
||||||
|
*/
|
||||||
|
|
||||||
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
|
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -3330,6 +3330,10 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
|
|
||||||
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
|
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
|
||||||
|
|
||||||
|
/*
|
||||||
|
printf( "ScrollWindow: %d %d\n", dx, dy );
|
||||||
|
*/
|
||||||
|
|
||||||
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
|
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user