If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
DSoM
Experienced Solver
Posts: 56 Joined: Sat Mar 29, 2008 12:34 am
Post
by DSoM » Fri Oct 10, 2008 4:00 am
I need to include wxTE_PROCESS_ENTER, and also wxCB_READONLY into a ComboBox. But adding both flags, only wxCB_READONLY works.
I tried this:
Code: Select all
cbCidadeUF = new wxComboBox(bb, ID_CIDADEUF, wxEmptyString, wxPoint(254,24), wxSize(90,21), 0, 0, wxTE_PROCESS_ENTER | wxCB_READONLY, wxDefaultValidator, _T("ID_CIDADEUF"));
Could some one give me a little help?
Thanks again
!
Grrr
Earned some good credits
Posts: 126 Joined: Fri Apr 11, 2008 8:48 am
Location: Netherlands
Post
by Grrr » Fri Oct 10, 2008 9:15 am
Are you on Windows? The docs say wxTE_PROCESS_ENTER works on Windows only.
jmason1182
Earned some good credits
Posts: 149 Joined: Fri Dec 14, 2007 3:40 pm
Location: Midland, TX
Post
by jmason1182 » Fri Oct 10, 2008 12:55 pm
You are doing it all correctly. It is just a matter of whether those options mean anything on the platform you are on.
How are you sure that it isn't firing?
John A. Mason
Midland, TX
DSoM
Experienced Solver
Posts: 56 Joined: Sat Mar 29, 2008 12:34 am
Post
by DSoM » Fri Oct 10, 2008 7:18 pm
Grrr wrote: Are you on Windows? The docs say wxTE_PROCESS_ENTER works on Windows only.
Exactly, I'm on Windows.
jmason1182 wrote: You are doing it all correctly. It is just a matter of whether those options mean anything on the platform you are on.
How are you sure that it isn't firing?
Take a look, I did this to make Enter key be processed by that combobox:
Code: Select all
BEGIN_EVENT_TABLE(CadCidade,wxMDIChildFrame)
EVT_TEXT_ENTER(CadCidade::ID_CIDADEUF, CadCidade::OnApertaEnteremUF)
END_EVENT_TABLE()
Code: Select all
void CadCidade::OnApertaEnteremUF(wxCommandEvent &event)
{
cbCidadeUF->Navigate();
}
wxTE_PROCESS_ENTER should give the capability of Enter key processing to my combobox, but if I put this together with wxCB_READONLY, it can't process that key. However, wxCB_READONLY works perfectly.
Really don't know what I'm doing wrong...
doublemax
Moderator
Posts: 19163 Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2
Post
by doublemax » Fri Oct 10, 2008 7:35 pm
taking a quick look at the wx sources i'd say you're not doing anything wrong. It's just not intended that a read-only control creates a wxTE_PROCESS_ENTER event.
Use the source, Luke!