Applied patch from SF on menu command not blocked
if they are disabled but still emitted by an accelerator First attempt at adding wxSizer::Clear(). Further testing pending :-) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -48,6 +48,8 @@ public:
|
|||||||
|
|
||||||
~wxSizerItem();
|
~wxSizerItem();
|
||||||
|
|
||||||
|
virtual void DeleteWindows();
|
||||||
|
|
||||||
virtual wxSize GetSize();
|
virtual wxSize GetSize();
|
||||||
virtual wxSize CalcMin();
|
virtual wxSize CalcMin();
|
||||||
virtual void SetDimension( wxPoint pos, wxSize size );
|
virtual void SetDimension( wxPoint pos, wxSize size );
|
||||||
@@ -144,6 +146,9 @@ public:
|
|||||||
virtual bool Remove( wxSizer *sizer );
|
virtual bool Remove( wxSizer *sizer );
|
||||||
virtual bool Remove( int pos );
|
virtual bool Remove( int pos );
|
||||||
|
|
||||||
|
virtual void Clear( bool delete_windows=FALSE );
|
||||||
|
virtual void DeleteWindows();
|
||||||
|
|
||||||
void SetMinSize( int width, int height )
|
void SetMinSize( int width, int height )
|
||||||
{ DoSetMinSize( width, height ); }
|
{ DoSetMinSize( width, height ); }
|
||||||
void SetMinSize( wxSize size )
|
void SetMinSize( wxSize size )
|
||||||
|
@@ -182,12 +182,17 @@ bool wxFrameBase::ProcessCommand(int id)
|
|||||||
commandEvent.SetEventObject(this);
|
commandEvent.SetEventObject(this);
|
||||||
|
|
||||||
wxMenuItem *item = bar->FindItem(id);
|
wxMenuItem *item = bar->FindItem(id);
|
||||||
if ( item && item->IsCheckable() )
|
if (item)
|
||||||
{
|
{
|
||||||
item->Toggle();
|
if (!item->IsEnabled())
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
// use the new value
|
if (item->IsCheckable())
|
||||||
commandEvent.SetInt(item->IsChecked());
|
{
|
||||||
|
item->Toggle();
|
||||||
|
// use the new value
|
||||||
|
commandEvent.SetInt(item->IsChecked());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetEventHandler()->ProcessEvent(commandEvent);
|
return GetEventHandler()->ProcessEvent(commandEvent);
|
||||||
|
@@ -232,6 +232,15 @@ void wxSizerItem::SetDimension( wxPoint pos, wxSize size )
|
|||||||
m_size = size;
|
m_size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxSizerItem::DeleteWindows()
|
||||||
|
{
|
||||||
|
if (m_window)
|
||||||
|
m_window->Destroy();
|
||||||
|
|
||||||
|
if (m_sizer)
|
||||||
|
m_sizer->DeleteWindows();
|
||||||
|
}
|
||||||
|
|
||||||
bool wxSizerItem::IsWindow()
|
bool wxSizerItem::IsWindow()
|
||||||
{
|
{
|
||||||
return (m_window != NULL);
|
return (m_window != NULL);
|
||||||
@@ -355,6 +364,25 @@ bool wxSizer::Remove( int pos )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxSizer::Clear( bool delete_windows )
|
||||||
|
{
|
||||||
|
if (delete_windows)
|
||||||
|
DeleteWindows();
|
||||||
|
|
||||||
|
m_children.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxSizer::DeleteWindows()
|
||||||
|
{
|
||||||
|
wxNode *node = m_children.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxSizerItem *item = (wxSizerItem*)node->Data();
|
||||||
|
item->DeleteWindows();
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxSizer::Fit( wxWindow *window )
|
void wxSizer::Fit( wxWindow *window )
|
||||||
{
|
{
|
||||||
wxSize size;
|
wxSize size;
|
||||||
|
Reference in New Issue
Block a user