Hi, All
I'am using a common frame, and need to deal with drag event. I want to know
if there is any default event type that can handle Mouse_Down + Mouse_Move
(Mouse dragging) event, just like wx.EVT_LEFT_DOWN used to handle leftmouse
click event.
As Robin had mentioned, it is a good idea to look at how dragging and moving
something is done in the splitter that comes with wxPython. To do
that, you have
to look at that code. But it is not in the demo--the demo just has a
little demo file
that refers to the splitter class code. So find the splitter class
code on your computer.
Mine is located here:
C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\lib\
The .py file is called splitter.py and can be opened with a text
editor, IDLE, etc.
In that, notice the event binding to mouse events generally:
self.Bind(wx.EVT_MOUSE_EVENTS, self._OnMouse)
That binds it to the following event handler:
def _OnMouse(self, evt):
So if you ctrl-F search for the above line, you can read just how Robin did
it in the original splitter class. You can then see (if I understand this
correctly myself) where he draws a rectangle for the sash, and around
there is where you would want to instead put an image of your decorative
border (if that is what you are still trying to do). Or at least get
some ideas
as to how to approach this concept in your own custom "image sash" class.
It's not a trivial thing to do if you're new to wxPython/Python/programming,
it's not going to happen overnight (probably). But in the end it is not that
complex, I think, if you sort of work through it a bit at a time.
BTW, I am not using splitterwindow or something else with sash, It's just
common frame, common panel. So I guess I need to write my own event to do
this, is that right?
Your own event *handler*? Yes. Your own event, no, you can't, AFAIK.
Che
···
On Sat, Nov 22, 2008 at 2:50 AM, Roy Liu <jingeelio@gmail.com> wrote: