User forums > General (but related to Code::Blocks)

Combobox cannot capture the Enter command.

(1/2) > >>

cyuyan:
Hello!

I'm using C::B 20.03 and wxWidgets 3.2.4. on Windows 10 (64 bit).
I have an example of wxsmith, see the link below.
https://wiki.codeblocks.org/index.php/WxSmith_tutorial:_Keyboard_Input_and_Displaying_Results

void Tutorial_9Frame::OnCmdBoxTextEnter(wxCommandEvent& event)
{
    wxString textFCB = CmdBox->GetValue();
    CmdBox->Insert(textFCB, 0);
    CmdBox->SetValue(wxT(""));
    if(CmdBox->GetCount() == 10)
        CmdBox->Delete(9);
    Results->AppendText(textFCB);
    Results->AppendText(_("\n"));

    strncpy(inbuf, (const char*) textFCB.mb_str(wxConvUTF8), 239);
    // anything(); //We will be using this later.
}
The above code captures the ENTER event, but my program cannot run properly.

Miguel Gimenez:

--- Quote ---My program cannot run properly
--- End quote ---

Please clarify what are you expecting and what is happening. Did you check wxTE_PROCESS_ENTER?

cyuyan:
Looking at the picture below, I typed some letters and then pressed the Enter key, but the program didn't respond.

Miguel Gimenez:
Can you attach your current cpp file?

cyuyan:
Please see attach. Thank you!

Navigation

[0] Message Index

[#] Next page

Go to full version