projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wxchar.h doesn't have to be C file anymore, it's C++
[wxWidgets.git]
/
src
/
univ
/
combobox.cpp
diff --git
a/src/univ/combobox.cpp
b/src/univ/combobox.cpp
index 28ae78ee6d4f6d545a0af13498fc1be5da241cd9..f347cfe1b97082e25b9b7ae5489365306bf2368d 100644
(file)
--- a/
src/univ/combobox.cpp
+++ b/
src/univ/combobox.cpp
@@
-122,8
+122,8
@@
bool wxComboListBox::Create(wxWindow* parent)
if ( !wxListBox::Create(parent, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
0, NULL,
if ( !wxListBox::Create(parent, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
0, NULL,
- wxBORDER_SIMPLE |
wxLB_INT_HEIGHT |
-
m_combo->GetWindowStyle() & wxCB_SORT ? wxLB_SORT : 0
) )
+ wxBORDER_SIMPLE |
+
( m_combo->GetWindowStyle() & wxCB_SORT ? wxLB_SORT : 0 )
) )
return false;
// we don't react to the mouse events outside the window at all
return false;
// we don't react to the mouse events outside the window at all
@@
-145,9
+145,9
@@
void wxComboListBox::SetStringValue(const wxString& value)
{
if ( !value.empty() )
{
{
if ( !value.empty() )
{
-
if (FindString(value) != wxNOT_FOUND)
-
wxListBox::SetStringSelection(value);
-
}
+ if (FindString(value) != wxNOT_FOUND)
+ wxListBox::SetStringSelection(value);
+ }
else
wxListBox::SetSelection(-1);
}
else
wxListBox::SetSelection(-1);
}
@@
-386,10
+386,15
@@
int wxComboBox::FindString(const wxString& s, bool bCase) const
void wxComboBox::SetSelection(int n)
{
void wxComboBox::SetSelection(int n)
{
- wxCHECK_RET(
IsValid(n
), _T("invalid index in wxComboBox::Select") );
+ wxCHECK_RET(
(n == wxNOT_FOUND || IsValid(n)
), _T("invalid index in wxComboBox::Select") );
GetLBox()->SetSelection(n);
GetLBox()->SetSelection(n);
- if ( GetTextCtrl() ) GetTextCtrl()->SetValue(GetLBox()->GetString(n));
+
+ wxString str;
+ if ( n != wxNOT_FOUND )
+ str = GetLBox()->GetString(n);
+
+ SetText(str);
}
int wxComboBox::GetSelection() const
}
int wxComboBox::GetSelection() const