Author Topic: Not all events are showing for objects  (Read 671 times)

Offline Twincity9

  • Single posting newcomer
  • *
  • Posts: 2
Not all events are showing for objects
« on: January 25, 2019, 12:25:15 am »
Hello,

I am using wxWidgets in CodeBlocks (I am both a beginner in wxWidgets and a beginner in CodeBlocks). I've added a wxTextCtrl object to my application and I now want to use its paint event to draw a line in the text window. What I don't understand is that the paint event is not visible in the event list window. The list only shows the events from the last descendant (wxTextCtrl), it does not show the events from its wxWindow ancestor nor from any other ancestor. Is this normal behavior? How do I access the paint event?

I've added a screenshot as an attachment.

My operating system is Windows10, I am using wxWidgets 3.0 and CodeBlocks 17.12

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2567
Re: Not all events are showing for objects
« Reply #1 on: January 25, 2019, 07:06:55 am »
You simply add them by hand... Either in the event table or (preferable)  with connect functionality. Yous be sure not to add the code in the marked area of wxSmith or it will get deleted every time you open the wxSmith editor.

At the moment "child"  events are not supported by the wxSmith UI, because they clutter the UI and are not needed so often. If you need them add them by hand. It is not that much work. But you can create a feature request on the source forge bug tracker to add this. There it won't get lost and if someone finds the time he can add it.

Offline Twincity9

  • Single posting newcomer
  • *
  • Posts: 2
Re: Not all events are showing for objects
« Reply #2 on: January 25, 2019, 01:05:58 pm »

Ok, I've added the paint event handler by adding it manually to the source files. It sort of works, but not quite yet.

The paint event is not called when the wxTextCtrl is resized, the drawn line dissapears when that happens (it is redrawn but the paint event is somehow bypassed). Enabling wxFULL_REPAINT_ON_RESIZE for the wxTextCtrl has no effect. So I also added a Size event handler, that problem is solved. But the wxTextCtrl is inside a wxNoteBook as a page. When I switch pages the line also dissapears. Redrawing the line in the notebook's page-changed or page-chaging-event handler has no effect.

Am I overlooking something? Isn't there one location where I can add the code so that it always affects the look of the wxTextCtrl?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2567
Re: Not all events are showing for objects
« Reply #3 on: January 25, 2019, 02:19:32 pm »
This question is not the scope of this forum. You have to ask this on the wxWidgets forum. We give support for Codeblocks and wxSmith, but not for wxWidgets...

greetings

Offline sodev

  • Regular
  • ***
  • Posts: 334
Re: Not all events are showing for objects
« Reply #4 on: January 25, 2019, 06:18:36 pm »
Do not draw on native controls, it just doesnt work. But this is indeed beyond the scope of this forum.