textctrl.cpp: Removed assert from CanRedo/CanUndo since the best behaviour is
to return FALSE (Redo/Undo functions are unimplemented) treectrlg.cpp: in InsertItem, allow previous item to be null in order to insert at first position of possibly-empty child list dcclient.cpp: allow setting of null font (common espec. on Windows) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1246,9 +1246,13 @@ wxTreeItemId wxGenericTreeCtrl::InsertItem(const wxTreeItemId& parentId,
|
|||||||
return AddRoot(text, image, selImage, data);
|
return AddRoot(text, image, selImage, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = parent->GetChildren().Index((wxGenericTreeItem*) idPrevious.m_pItem);
|
int index = -1;
|
||||||
wxASSERT_MSG( index != wxNOT_FOUND,
|
if (idPrevious.IsOk())
|
||||||
wxT("previous item in wxGenericTreeCtrl::InsertItem() is not a sibling") );
|
{
|
||||||
|
index = parent->GetChildren().Index((wxGenericTreeItem*) idPrevious.m_pItem);
|
||||||
|
wxASSERT_MSG( index != wxNOT_FOUND,
|
||||||
|
wxT("previous item in wxGenericTreeCtrl::InsertItem() is not a sibling") );
|
||||||
|
}
|
||||||
|
|
||||||
return DoInsertItem(parentId, (size_t)++index, text, image, selImage, data);
|
return DoInsertItem(parentId, (size_t)++index, text, image, selImage, data);
|
||||||
}
|
}
|
||||||
|
@@ -1594,7 +1594,9 @@ void wxWindowDC::Clear()
|
|||||||
|
|
||||||
void wxWindowDC::SetFont( const wxFont &font )
|
void wxWindowDC::SetFont( const wxFont &font )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") );
|
// It is common practice to set the font to wxNullFont, so
|
||||||
|
// don't consider it to be an error
|
||||||
|
// wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") );
|
||||||
|
|
||||||
m_font = font;
|
m_font = font;
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
@@ -929,14 +929,14 @@ void wxTextCtrl::Redo()
|
|||||||
bool wxTextCtrl::CanUndo() const
|
bool wxTextCtrl::CanUndo() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") );
|
//wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::CanRedo() const
|
bool wxTextCtrl::CanRedo() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") );
|
//wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1594,7 +1594,9 @@ void wxWindowDC::Clear()
|
|||||||
|
|
||||||
void wxWindowDC::SetFont( const wxFont &font )
|
void wxWindowDC::SetFont( const wxFont &font )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") );
|
// It is common practice to set the font to wxNullFont, so
|
||||||
|
// don't consider it to be an error
|
||||||
|
// wxCHECK_RET( font.Ok(), _T("invalid font in wxWindowDC::SetFont") );
|
||||||
|
|
||||||
m_font = font;
|
m_font = font;
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
@@ -929,14 +929,14 @@ void wxTextCtrl::Redo()
|
|||||||
bool wxTextCtrl::CanUndo() const
|
bool wxTextCtrl::CanUndo() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") );
|
//wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::CanRedo() const
|
bool wxTextCtrl::CanRedo() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") );
|
//wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user