Search found 136 matches

by Slyde
Wed Apr 10, 2024 2:19 am
Forum: C++ Development
Topic: Capturing keys
Replies: 7
Views: 10124

Re: Capturing keys

@OONEYEMAN - Traversal works fine. But there are other things that I want to happen when the Tab key's pressed. That's why I needed the ability to catch it.

And I still think that's buggy, the way a wxMessageBox() causes the
1) switch to repeat itself 4 times, or
2) the method to loop 4 times.
by Slyde
Tue Apr 09, 2024 11:17 pm
Forum: C++ Development
Topic: Capturing keys
Replies: 7
Views: 10124

Re: Capturing keys

That's weird. I would even say buggy. But you were right. I omitted the wxMessageBox() and used std::cout instead, and it worked as expected. I wonder why a message box would cause such behavior?

Oh well, thanks doublemax.
by Slyde
Tue Apr 09, 2024 10:03 pm
Forum: C++ Development
Topic: Capturing keys
Replies: 7
Views: 10124

Re: Capturing keys

This is the Bind():

Code: Select all

Bind(wxEVT_CHAR_HOOK, &MyFrame::OnChar, this);
I tried wxEVT_KEY_DOWN and wxEVT_CHAR, but they were dead.

I'll look at the keyboard sample. That will probably show me what I need to do.
by Slyde
Tue Apr 09, 2024 9:42 pm
Forum: C++ Development
Topic: Capturing keys
Replies: 7
Views: 10124

Capturing keys

While this code I wrote does capture the three assigned keys, the wxMessageBox() pops up four times per click. If I click the Tab key, I'll get four message boxes. Same with the Alt and Ctrl keys, which I added just for testing. void MyFrame::OnChar(wxKeyEvent &event) { switch ( event.GetKeyCode...
by Slyde
Sun Apr 07, 2024 2:43 pm
Forum: C++ Development
Topic: Two queries slowing down things
Replies: 2
Views: 9409

Re: Two queries slowing down things

CallAfter() works fine. However, I started reading about threads after I posted here and believe I'll try to use one, per your suggestion. Much appreciated, doublemax. Thanks.
by Slyde
Sun Apr 07, 2024 12:01 pm
Forum: C++ Development
Topic: Two queries slowing down things
Replies: 2
Views: 9409

Two queries slowing down things

I have a method that does a few things, most importantly setting TextCtrl bg colors where needed. And at the end of this method, there are two other methods that are called that write to the db: writeHistory() and writeProgress() . I put them at the end because I wanted them to be the very last thin...
by Slyde
Fri Mar 08, 2024 12:35 am
Forum: C++ Development
Topic: Partial background color
Replies: 14
Views: 9511

Re: Partial background color

I'm of the opinion that this is a bug. But whether it gets treated as such doesn't matter anymore. I fixed it with a workaround. Through all of this, I've had a feeling that the culprit was the vector, a vector of wxString no less. So I added 4 more variables and proved myself right. wxString mca1{}...
by Slyde
Wed Mar 06, 2024 3:57 pm
Forum: C++ Development
Topic: Partial background color
Replies: 14
Views: 9511

Re: Partial background color

Your code works fine on my box. I'm not using a VM. My box dual-boots to either Win X or Mint 21.3. How can I send you a zip file of my work? I'm not very far along with it, so I'm not tripping on you snagging some of my code :D I use CMake. Please advise. Thank you, PB. I just placed the zip file i...
by Slyde
Tue Mar 05, 2024 11:24 pm
Forum: C++ Development
Topic: Partial background color
Replies: 14
Views: 9511

Re: Partial background color

Thank you both for responding. PB: Your code works fine. Just as expected. I've traced through everything regarding my 4 TextCtrls and don't see anything that cld be causing this. Let me show you all my code that handles these 4 misfiring widgets. Hopefully you'll see what's messing me up. In the Ct...
by Slyde
Tue Mar 05, 2024 5:42 pm
Forum: C++ Development
Topic: Partial background color
Replies: 14
Views: 9511

Re: Partial background color

wxTextCtrl* mcAnswer1; wxTextCtrls are not transparent, you'll need to set their background color, too. I did. Scroll up and you'll see that I'm doing exactly that. My problem is that the background of the text itself isn't changing,as shown in my original post. But I believe I'm setting the wxText...
by Slyde
Tue Mar 05, 2024 5:14 pm
Forum: C++ Development
Topic: Partial background color
Replies: 14
Views: 9511

Re: Partial background color

My apologies, doublemax. from the header: wxTextCtrl* mcAnswer1; wxTextCtrl* mcAnswer2; wxTextCtrl* mcAnswer3; wxTextCtrl* mcAnswer4; and from the main: void MyFrame::DisplayToScreen(const std::vector<wxString> &values) { mcQuestion->SetValue(values[0]); mcAnswer1->SetValue("1. " + val...
by Slyde
Tue Mar 05, 2024 8:35 am
Forum: C++ Development
Topic: Partial background color
Replies: 14
Views: 9511

Re: Partial background color

Is the content custom painted, or are these two different controls? Here's the method in full: void MyFrame::verifyMC_Answer(wxCommandEvent &event) { const wxColour myGreen = {128,255,0}; const wxColor myRed = {255,42,0}; const wxColor myWhite = {255,255,255}; btnVerifyClicked = true; if (mcThe...
by Slyde
Tue Mar 05, 2024 8:02 am
Forum: C++ Development
Topic: Partial background color
Replies: 14
Views: 9511

Partial background color

I'm working on a trivia app. The user gets a question right, the background of the right answer goes green. They get it wrong and the correct answer's background goes green and the user selection background goes red. But that's not happening...not entirely. Screenshot from 2024-03-05 01-56-36.png Wh...
by Slyde
Tue Mar 05, 2024 7:41 am
Forum: C++ Development
Topic: How using my own sizer
Replies: 12
Views: 4407

Re: How using my own sizer

@Size: Watch this. It'll help you with sizers.
by Slyde
Sun Feb 25, 2024 6:39 pm
Forum: Compiler / Linking / IDE Related
Topic: Debug vs. Release
Replies: 3
Views: 7906

Re: Debug vs. Release

Good information on that link, PB. I appreciate it.