Menu

ControlShape with composite windows

DekarGuy
2010-02-25
2013-04-08
  • DekarGuy

    DekarGuy - 2010-02-25

    I seem to be running into an issue with the shapeframework using a composite window inside a wxSFControlShape

    I have a wxPanel with a sizer containing a wxStaticText and a wxTreeCtrl that I wanted to put in the wxSFControlShape. Adding it works fine, but I stop getting OnKeyDown events on the wxSFShapeCanvas, as well as some mouse event quirkyness. Using any of those controls by itself in the wxSFControlShape has the normal behavior of any other shape.

    My guess is that whatever events are being eaten are only happening on the top level wxWindow, and not any children

     
  • Michal Bližňák

    Have you tried to use wxSFControlShape::SetEventProcessing function? It allows you to set where GUI control's events will be processed ( by shape canvas and/or by GUI control itself).

     
  • DekarGuy

    DekarGuy - 2010-02-25

    I had sfsMOUSE2CANVAS and sfsKEY2CANVAS set up and yeah, it works for top-level controls, but not any nested ones. I looked into SetControl and it seems that looping through all children and setting up the EventSink events fixes the problem.

    It is really odd that setting sfsKEY2GUI without also setting sfsKEY2CANVAS on a ControlShape will eat keyboard events for the entire canvas, sfsMOUSE2GUI and sfsMOUSE2CANVAS don't have the same behavior.

     

Log in to post a comment.