Source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: combog.cpp
|
// Name: src/generic/combog.cpp
|
||||||
// Purpose: Generic wxComboControl
|
// Purpose: Generic wxComboControl
|
||||||
// Author: Jaakko Salli
|
// Author: Jaakko Salli
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#if wxUSE_COMBOCONTROL
|
#if wxUSE_COMBOCONTROL
|
||||||
|
|
||||||
|
#include "wx/combo.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/combobox.h"
|
#include "wx/combobox.h"
|
||||||
@@ -34,9 +36,6 @@
|
|||||||
|
|
||||||
#include "wx/dcbuffer.h"
|
#include "wx/dcbuffer.h"
|
||||||
|
|
||||||
#include "wx/combo.h"
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Some constant adjustments to make the generic more bearable
|
// Some constant adjustments to make the generic more bearable
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: odcombo.cpp
|
// Name: src/generic/odcombo.cpp
|
||||||
// Purpose: wxOwnerDrawnComboBox, wxVListBoxComboPopup
|
// Purpose: wxOwnerDrawnComboBox, wxVListBoxComboPopup
|
||||||
// Author: Jaakko Salli
|
// Author: Jaakko Salli
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#if wxUSE_OWNERDRAWNCOMBOBOX
|
#if wxUSE_OWNERDRAWNCOMBOBOX
|
||||||
|
|
||||||
|
#include "wx/odcombo.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/combobox.h"
|
#include "wx/combobox.h"
|
||||||
@@ -34,8 +36,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/combo.h"
|
#include "wx/combo.h"
|
||||||
#include "wx/odcombo.h"
|
|
||||||
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
@@ -465,9 +465,8 @@ wxString wxVListBoxComboPopup::GetStringValue() const
|
|||||||
|
|
||||||
void wxVListBoxComboPopup::SetSelection( int item )
|
void wxVListBoxComboPopup::SetSelection( int item )
|
||||||
{
|
{
|
||||||
// This seems to be necessary (2.5.3 w/ MingW atleast)
|
wxCHECK_RET( item == wxNOT_FOUND || ((unsigned int)item < GetCount()),
|
||||||
if ( item < -1 || item >= (int)m_strings.GetCount() )
|
wxT("invalid index in wxVListBoxComboPopup::SetSelection") );
|
||||||
item = -1;
|
|
||||||
|
|
||||||
m_value = item;
|
m_value = item;
|
||||||
|
|
||||||
@@ -683,7 +682,7 @@ void wxOwnerDrawnComboBox::Clear()
|
|||||||
|
|
||||||
void wxOwnerDrawnComboBox::Delete(unsigned int n)
|
void wxOwnerDrawnComboBox::Delete(unsigned int n)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( n < GetCount(), _T("invalid index in wxOwnerDrawnComboBox::Delete") );
|
wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Delete") );
|
||||||
|
|
||||||
if ( GetSelection() == (int) n )
|
if ( GetSelection() == (int) n )
|
||||||
SetValue(wxEmptyString);
|
SetValue(wxEmptyString);
|
||||||
@@ -699,13 +698,13 @@ unsigned int wxOwnerDrawnComboBox::GetCount() const
|
|||||||
|
|
||||||
wxString wxOwnerDrawnComboBox::GetString(unsigned int n) const
|
wxString wxOwnerDrawnComboBox::GetString(unsigned int n) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( n < GetCount(), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") );
|
wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") );
|
||||||
return m_popupInterface->GetString(n);
|
return m_popupInterface->GetString(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxOwnerDrawnComboBox::SetString(unsigned int n, const wxString& s)
|
void wxOwnerDrawnComboBox::SetString(unsigned int n, const wxString& s)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( n < GetCount(), _T("invalid index in wxOwnerDrawnComboBox::SetString") );
|
wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::SetString") );
|
||||||
m_popupInterface->SetString(n,s);
|
m_popupInterface->SetString(n,s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -717,7 +716,7 @@ int wxOwnerDrawnComboBox::FindString(const wxString& s) const
|
|||||||
|
|
||||||
void wxOwnerDrawnComboBox::Select(int n)
|
void wxOwnerDrawnComboBox::Select(int n)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( (n >= -1) && (n < (int)GetCount()), _T("invalid index in wxOwnerDrawnComboBox::Select") );
|
wxCHECK_RET( (n == wxNOT_FOUND) || IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Select") );
|
||||||
EnsurePopupControl();
|
EnsurePopupControl();
|
||||||
|
|
||||||
m_popupInterface->SetSelection(n);
|
m_popupInterface->SetSelection(n);
|
||||||
@@ -751,7 +750,7 @@ int wxOwnerDrawnComboBox::DoAppend(const wxString& item)
|
|||||||
int wxOwnerDrawnComboBox::DoInsert(const wxString& item, unsigned int pos)
|
int wxOwnerDrawnComboBox::DoInsert(const wxString& item, unsigned int pos)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
|
wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
|
||||||
wxCHECK_MSG(pos<=GetCount(), -1, wxT("invalid index"));
|
wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
|
||||||
|
|
||||||
EnsurePopupControl();
|
EnsurePopupControl();
|
||||||
m_popupInterface->Insert(item,pos);
|
m_popupInterface->Insert(item,pos);
|
||||||
|
Reference in New Issue
Block a user