Apply more suggestions from code review
This commit removes an attempt to initially hide a frame which was unnecessary since frames are initially hidden by defautlt, removes an unncecessary destructor that only performed actions that would happen anyway, and replaces a Freeze/Thaw pair with wxWindowUpdateLocker.
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
#include "wx/renderer.h"
|
#include "wx/renderer.h"
|
||||||
#include "wx/hashset.h"
|
#include "wx/hashset.h"
|
||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
|
#include "wx/wupdlock.h"
|
||||||
|
|
||||||
#ifdef wxHAS_RAW_BITMAP
|
#ifdef wxHAS_RAW_BITMAP
|
||||||
#include "wx/rawbmp.h"
|
#include "wx/rawbmp.h"
|
||||||
@@ -2126,19 +2127,11 @@ PRectangle Window::GetMonitorRect(Point pt) {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
wxSTCPopupBase::wxSTCPopupBase(wxWindow* parent):wxFrame()
|
wxSTCPopupBase::wxSTCPopupBase(wxWindow* parent)
|
||||||
{
|
:wxFrame(parent, wxID_ANY, wxEmptyString,
|
||||||
// Make sure the frame is initially hidden. However, GTK+ will hide the
|
|
||||||
// frame initially and doesn't like trying to hide it before it's
|
|
||||||
// created, so don't do it there.
|
|
||||||
#if !defined(__WXGTK__)
|
|
||||||
Hide();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxFrame::Create(parent, wxID_ANY, wxEmptyString,
|
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxFRAME_FLOAT_ON_PARENT | wxBORDER_NONE);
|
wxFRAME_FLOAT_ON_PARENT | wxBORDER_NONE)
|
||||||
|
{
|
||||||
#if defined(__WXGTK__)
|
#if defined(__WXGTK__)
|
||||||
gtk_window_set_accept_focus(GTK_WINDOW(this->GetHandle()), FALSE);
|
gtk_window_set_accept_focus(GTK_WINDOW(this->GetHandle()), FALSE);
|
||||||
#endif
|
#endif
|
||||||
@@ -2566,7 +2559,6 @@ class wxSTCListBox : public wxSystemThemedControl<wxVListBox>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxSTCListBox(wxWindow*, wxSTCListBoxVisualData*, int);
|
wxSTCListBox(wxWindow*, wxSTCListBoxVisualData*, int);
|
||||||
virtual ~wxSTCListBox();
|
|
||||||
|
|
||||||
// wxWindow overrides
|
// wxWindow overrides
|
||||||
virtual bool AcceptsFocus() const wxOVERRIDE;
|
virtual bool AcceptsFocus() const wxOVERRIDE;
|
||||||
@@ -2668,12 +2660,6 @@ wxSTCListBox::wxSTCListBox(wxWindow* parent, wxSTCListBoxVisualData* v, int ht)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSTCListBox::~wxSTCListBox()
|
|
||||||
{
|
|
||||||
m_labels.clear();
|
|
||||||
m_imageNos.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxSTCListBox::AcceptsFocus() const
|
bool wxSTCListBox::AcceptsFocus() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -2785,7 +2771,7 @@ void wxSTCListBox::SetDoubleClickAction(CallBackAction action, void *data)
|
|||||||
|
|
||||||
void wxSTCListBox::SetList(const char* list, char separator, char typesep)
|
void wxSTCListBox::SetList(const char* list, char separator, char typesep)
|
||||||
{
|
{
|
||||||
Freeze();
|
wxWindowUpdateLocker noUpdates(this);
|
||||||
Clear();
|
Clear();
|
||||||
SetOfInts bitmapNos;
|
SetOfInts bitmapNos;
|
||||||
wxStringTokenizer tkzr(stc2wx(list), (wxChar)separator);
|
wxStringTokenizer tkzr(stc2wx(list), (wxChar)separator);
|
||||||
@@ -2806,8 +2792,6 @@ void wxSTCListBox::SetList(const char* list, char separator, char typesep)
|
|||||||
|
|
||||||
if ( m_imageAreaHeight > 0 )
|
if ( m_imageAreaHeight > 0 )
|
||||||
RecalculateItemHeight();
|
RecalculateItemHeight();
|
||||||
|
|
||||||
Thaw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSTCListBox::AppendHelper(const wxString& text, int type)
|
void wxSTCListBox::AppendHelper(const wxString& text, int type)
|
||||||
|
Reference in New Issue
Block a user