[lazarus] MWEDIT not taking click events

Marc Weustink Marc.Weustink at cuperus.nl
Wed Dec 29 11:24:21 EST 1999


+ From: Shane Miller [mailto:SMiller1 at stvgb.org]
+
+ Marc,
+
+ Should we add a gtkeventbox by default when we create a gtk
+ bitmap so it can take the onclick events?

??? on a bitmap. I dont think a bitamp needs click events.
But as far as I know, mwEdit gets mouse events. It only don't set the focus
when you click on it. You can see clickevents if you do de following:
If it has the focus (by tabbing into it) type some text, do a mouseclick
somewhere in your text and type again (and look). Your insertion point
wouldn't move if you didn't get click events.

+ When that event box gets the events it can simply call the
+ windowproc because it's part of the object.
+
+ Also, do you know why it takes 2 arrow keys to move anywhere?
+  Two ups to move one line up and two down to move one line
+ down.

Eehhh... the reason I thought is that gtk moves the focus out of our editor
:-) Didn't examin that.

+ Also, the parenthesis "(" causes it to go DOWN one
+ line before printing the parenthesis.  Odd...

:-) :-) Not odd. Thats something I'm working on, so if you have some ideas..

In a keypress event gtk returns the char of the key pressed. Delphi wants in
a WM_KeyDown event a virtual keycode (VK_...) and in a WM_Char the char of
the key pressed. In most cases I was able to convert a gtk_keycode to a
VK_... except for  VK_0 to VK_9.
The reason is that this is keyboard layout dependent. In my case shft-2
results in a @, on other keyboards maybe something else (I know that spanish
keyboards have the @ on another key :-)
So I get a @ from gtk and have to translate this to a VK_ .....

For now it should work if no VK_ is sent for unknown translations (I'll look
at it tomorrow)

The reason for your down is that a VK_DOWN has the same value as a "(" (I
guess)

Marc







More information about the Lazarus mailing list