wxTextCtrl behavior has changed.
-
- Earned a small fee
- Posts: 12
- Joined: Mon Mar 23, 2009 10:21 am
- Location: Slayton, MN, USA
wxTextCtrl behavior has changed.
Under V2.8.12, wxTextCtrls allowed me to press the arrow keys, delete and backspace inside the widget,
but under V3.0.2 these keys are being ignored!
This is how the control is being created:
FieldsTC = new wxTextCtrl( mainFrame, ID_FieldsTC, wxEmptyString, wxDefaultPosition,
wxSize(1000, -1), wxTE_PROCESS_ENTER|wxTE_LEFT|wxSIMPLE_BORDER );
Here's the entry in the event table:
EVT_TEXT_ENTER( ID_FieldsTC, DbaseEditorGen::OnFieldsTCTextEntered )
Is there some new flag I should supply to the new wxTextCtrl() function to enable editing keys inside the control?
but under V3.0.2 these keys are being ignored!
This is how the control is being created:
FieldsTC = new wxTextCtrl( mainFrame, ID_FieldsTC, wxEmptyString, wxDefaultPosition,
wxSize(1000, -1), wxTE_PROCESS_ENTER|wxTE_LEFT|wxSIMPLE_BORDER );
Here's the entry in the event table:
EVT_TEXT_ENTER( ID_FieldsTC, DbaseEditorGen::OnFieldsTCTextEntered )
Is there some new flag I should supply to the new wxTextCtrl() function to enable editing keys inside the control?
Time flies like an Arrow. Fruit flies like a banana.
Re: wxTextCtrl behavior has changed.
Hi,
You shouldn't need to do anything - those keys will be handled by the OS.
What OS/version you are running? Can you reproduce the behavior in the text sample?
Thank you.
You shouldn't need to do anything - those keys will be handled by the OS.
What OS/version you are running? Can you reproduce the behavior in the text sample?
Thank you.
-
- Earned a small fee
- Posts: 12
- Joined: Mon Mar 23, 2009 10:21 am
- Location: Slayton, MN, USA
Re: wxTextCtrl behavior has changed.
I'm currently using Linux Mint V17.1 on my PC.
I assume the text sample you're referring to is located in wxWidgets/samples/text.
I compiled the samples/text executable and it does indeed allow arrows, backspace, delete.
I don't get it.
I assume the text sample you're referring to is located in wxWidgets/samples/text.
I compiled the samples/text executable and it does indeed allow arrows, backspace, delete.
I don't get it.
Time flies like an Arrow. Fruit flies like a banana.
Re: wxTextCtrl behavior has changed.
OK, so now all you need is to look for the difference between your code and the sample.
Are you using any hook events? Are you using any char/key events? Did you call event.Skip() for non-wxCommand events?
Thank you.
Are you using any hook events? Are you using any char/key events? Did you call event.Skip() for non-wxCommand events?
Thank you.
-
- Earned a small fee
- Posts: 12
- Joined: Mon Mar 23, 2009 10:21 am
- Location: Slayton, MN, USA
Re: wxTextCtrl behavior has changed.
Only the following functions call event.Skip()
IMPLEMENT_CLASS( DbaseEditorGen, wxFrame )
BEGIN_EVENT_TABLE( DbaseEditorGen, wxFrame )
EVT_CLOSE( DbaseEditorGen::OnCloseWindow ) // this one just cleans up and exits the program.
EVT_LISTBOX( ID_DbasesLB, DbaseEditorGen::OnDbasesLBSelected )
EVT_LISTBOX( ID_TablesLB, DbaseEditorGen::OnTablesLBSelected )
EVT_GRID_CELL_LEFT_CLICK( DbaseEditorGen::OnFieldsGridClicked )
EVT_TEXT_ENTER( ID_DBaseTC, DbaseEditorGen::OnDBaseTCTextUpdated )
EVT_TEXT_ENTER( ID_TableTC, DbaseEditorGen::OnTableTCTextUpdated )
EVT_TEXT_ENTER( ID_FieldsTC, DbaseEditorGen::OnFieldsTCTextUpdated )
EVT_MENU( ID_NEW_MI, DbaseEditorGen::OnNewMIClicked )
EVT_MENU( ID_OPEN_MI, DbaseEditorGen::OnOpenMIClicked )
EVT_MENU( ID_SAVE_MI, DbaseEditorGen::OnSaveMIClicked )
EVT_MENU( ID_GEN_MI, DbaseEditorGen::OnGenerateMIClicked )
EVT_MENU( ID_HELP_MI, DbaseEditorGen::OnHelpMIClicked )
EVT_MENU( ID_QUIT_MI, DbaseEditorGen::OnQuitMIClicked ) // this one just cleans up and exits the program.
END_EVENT_TABLE()
I don't know what hook events are, and neither do I use Char/Key events.
The GUI code was generated by dialogBlocks, which does things slightly differently
than code::Blocks. I wrote a small test program to just check the TextCtrl operation,
and it worked correctly. Since even the wxDialogs are not allowing editing of strings,
I might have a problem with the wxFrame creation code, but there is nothing in it that
I haven't used before.
IMPLEMENT_CLASS( DbaseEditorGen, wxFrame )
BEGIN_EVENT_TABLE( DbaseEditorGen, wxFrame )
EVT_CLOSE( DbaseEditorGen::OnCloseWindow ) // this one just cleans up and exits the program.
EVT_LISTBOX( ID_DbasesLB, DbaseEditorGen::OnDbasesLBSelected )
EVT_LISTBOX( ID_TablesLB, DbaseEditorGen::OnTablesLBSelected )
EVT_GRID_CELL_LEFT_CLICK( DbaseEditorGen::OnFieldsGridClicked )
EVT_TEXT_ENTER( ID_DBaseTC, DbaseEditorGen::OnDBaseTCTextUpdated )
EVT_TEXT_ENTER( ID_TableTC, DbaseEditorGen::OnTableTCTextUpdated )
EVT_TEXT_ENTER( ID_FieldsTC, DbaseEditorGen::OnFieldsTCTextUpdated )
EVT_MENU( ID_NEW_MI, DbaseEditorGen::OnNewMIClicked )
EVT_MENU( ID_OPEN_MI, DbaseEditorGen::OnOpenMIClicked )
EVT_MENU( ID_SAVE_MI, DbaseEditorGen::OnSaveMIClicked )
EVT_MENU( ID_GEN_MI, DbaseEditorGen::OnGenerateMIClicked )
EVT_MENU( ID_HELP_MI, DbaseEditorGen::OnHelpMIClicked )
EVT_MENU( ID_QUIT_MI, DbaseEditorGen::OnQuitMIClicked ) // this one just cleans up and exits the program.
END_EVENT_TABLE()
I don't know what hook events are, and neither do I use Char/Key events.
The GUI code was generated by dialogBlocks, which does things slightly differently
than code::Blocks. I wrote a small test program to just check the TextCtrl operation,
and it worked correctly. Since even the wxDialogs are not allowing editing of strings,
I might have a problem with the wxFrame creation code, but there is nothing in it that
I haven't used before.
Time flies like an Arrow. Fruit flies like a banana.
Re: wxTextCtrl behavior has changed.
Hi,
Like I said - try to compare the code in question with the code in the sample or the test code you wrote.
If that's too hard, try to bring the pieces of you code to the sample and see what function breaks the code.
I'm afraid this is the only way.
BTW all you EVT_TEXT_ENTER() handlers have only one exit point, correct?
Thank you.
Like I said - try to compare the code in question with the code in the sample or the test code you wrote.
If that's too hard, try to bring the pieces of you code to the sample and see what function breaks the code.
I'm afraid this is the only way.
BTW all you EVT_TEXT_ENTER() handlers have only one exit point, correct?
Thank you.
-
- Earned a small fee
- Posts: 12
- Joined: Mon Mar 23, 2009 10:21 am
- Location: Slayton, MN, USA
Re: wxTextCtrl behavior has changed.
You know what, I was able to re-generate the entire GUI using wxGlade in 2 days! Sure beats fooling around with either
dialogBlocks or code::Blocks for over 10 days, trying to fix a problem within wxWidgets 3.0.2
wxGlade currently does not use V3.0.2, and there was NO problem using editing keys inside a TextCtrl
As far as I'm concerned, "my problem" (more like wxWidgets3.0.2's problem!) is fixed.
dialogBlocks or code::Blocks for over 10 days, trying to fix a problem within wxWidgets 3.0.2
wxGlade currently does not use V3.0.2, and there was NO problem using editing keys inside a TextCtrl
As far as I'm concerned, "my problem" (more like wxWidgets3.0.2's problem!) is fixed.
Time flies like an Arrow. Fruit flies like a banana.
Re: wxTextCtrl behavior has changed.
I also switched to version 3.x from 2.8 and my wxTextCtrl developed the edit key (backspace, etc) problem. In my case however, the sample code has the same problem, e.g. the 2.8 sample works as expected while the 3.x does not. What happens is when an edit key is press, the dialog containing the control loses focus. If the dialog is clicked, the edit takes effect.
I am running Debian 9.1 within VirtualBox.
There are many post about loosing focus, If my dialog regained focus it might fix this but how to do this is not clear to me.
I read many posts and one mentioned that it has to do with the OS. How can that be?
I am running Debian 9.1 within VirtualBox.
There are many post about loosing focus, If my dialog regained focus it might fix this but how to do this is not clear to me.
I read many posts and one mentioned that it has to do with the OS. How can that be?
Re: wxTextCtrl behavior has changed.
Hi,
I'm using wx3.1.2. Which wx version failed for you? And is it happening in one particular textctrl or all of them?
Regards,
David
That's strange. I just tested the 'text' sample in a debian stretch vbox guest and couldn't make it fail.2.8 sample works as expected while the 3.x does not. What happens is when an edit key is press, the dialog containing the control loses focus.
I'm using wx3.1.2. Which wx version failed for you? And is it happening in one particular textctrl or all of them?
Regards,
David
Re: wxTextCtrl behavior has changed.
The Debian 9.1 released version (3.0.2) and my built version, 3.1.2. The text sample and the dialogs sample both have the same problem on my platform.
Thanks for looking at this.
Thanks for looking at this.
Re: wxTextCtrl behavior has changed.
I'm using KDE, though I'd not expect the DE to be relevant. One thing that might affect it though is your locale etc: see this bug-report.
Does that apply to you?
Does that apply to you?
Re: wxTextCtrl behavior has changed.
Possibly of importance: my version 3 install is wxWidgets3.1.2 while my version 2 install is wxGTK2.8.12. I have always used the GTK code set but it doesn't seem to be available for version 3. I assumed there was a consolidation or does the GTK variant release lag?
Re: wxTextCtrl behavior has changed.
On 2nd thought, I do have a build of wxWidgets2.8.12 and the sample code also works fine.
Re: wxTextCtrl behavior has changed.
Unless you went out of your way to create a wxX11 or wxQT build, it will still be wxGTK.
You can be sure by running a wx program (in this case, 'text') and doing Ctl-Alt-Middleclick inside it. The resulting dialog will very likely mention GTK.
You can be sure by running a wx program (in this case, 'text') and doing Ctl-Alt-Middleclick inside it. The resulting dialog will very likely mention GTK.
Re: wxTextCtrl behavior has changed.
Sorry I missed your previous post. This bug report could definitely be related but I did not grasp the fix.
My environment is MATE
My environment is MATE