Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-08

SynEdit onMouseWell

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

waldo kitty
to Junior
Junior wrote
Hello all. How to implement onMouseWell in SynEdit ?

do you mean onMouseWheel?

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

waldo kitty
to Junior
Junior wrote 9 lines
Em 22-08-2013 14:01, waldo kitty escreveu: > On 8/22/2013 12:20, Junior wrote: >> Hello all. >> >> How to implement onMouseWell in SynEdit ? > > do you mean onMouseWheel? > Yes, sorry for the speed on writing.

no problem... i was just thinking that if it existed and you were misspelling it like above, you would be missing it ;)

i'll let others provide further on this since i know nothing about it...

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Martin
to Martin
Martin wrote 7 lines
On 22/08/2013 17:20, Junior wrote: > Hello all. > > How to implement onMouseWell in SynEdit ? looks like a bug

try to change it to the below. (int synedit.pp

I have not tested it yet... will do later

procedure TCustomSynEdit.WMMouseWheel(var Message: TLMMouseEvent);
var
   lState: TShiftState;
   MousePos: TPoint;
begin
   if ((sfHorizScrollbarVisible in fStateFlags) and (Message.Y >
ClientHeight)) or
      ((sfVertScrollbarVisible in fStateFlags) and (Message.X >
ClientWidth))
    then begin
      inherited;
      exit;
    end;
   MousePos.X := Message.X;
   MousePos.Y := Message.Y;
   if DoMouseWheel(lState, Message.WheelDelta, MousePos) then begin
     Message.Result := 1; // handled
     exit;
   end;
   lState := Message.State - [ssCaps, ssNum, ssScroll]; // Remove
unreliable states, see http://bugs.freepascal.org/view.php?id=20065
   FMouseClickDoPopUp := False;
   IncPaintLock;
   try
     if Message.WheelDelta > 0 then begin
       FindAndHandleMouseAction(mbXWheelUp, lState, Message.X,
Message.Y, ccSingle, cdDown, Message.WheelDelta);
     end
     else begin
       // send megative delta
       FindAndHandleMouseAction(mbXWheelDown, lState, Message.X,
Message.Y, ccSingle, cdDown, Message.WheelDelta);
     end;
   finally
     DecPaintLock;
   end;
   if FMouseClickDoPopUp and (PopupMenu  nil) then begin
     PopupMenu.PopupComponent:=self;
     PopupMenu.PopUp;
   end;
   Message.Result := 1 // handled, skip further handling by interface
end;

Reply by email

Junior
to Martin: looks like a bug procedure TCustomSynEdit.WMMouseWheel(var Message: TLMMouseEvent); only…

The bars work, I wanted to implement the event because they appear in the Object Inspector.

Martin wrote 23 lines
On 22/08/2013 17:20, Junior wrote: > Hello all. > > How to implement onMouseWell in SynEdit ? looks like a bug procedure TCustomSynEdit.WMMouseWheel(var Message: TLMMouseEvent); only calls inherited, if there are no scrollbars. -- just change it to always call inherited. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Martin
to Junior
Junior wrote
The bars work, I wanted to implement the event because they appear in the Object Inspector.

Really? They do not here. What version are you running?

They appear in code completion. but not OI.

I will publish them though.

Show quoted text 8 lines
Em 22-08-2013 15:36, Martin escreveu: > On 22/08/2013 17:20, Junior wrote: >> Hello all. >> >> How to implement onMouseWell in SynEdit ? >

Reply by email

Junior
to Martin

Lazarus 1.1 r42442M FPC 2.6.2 i386-linux-gtk 2

Martin wrote 26 lines
On 23/08/2013 01:58, Junior wrote: > The bars work, I wanted to implement the event because they appear in > the Object Inspector. Really? They do not here. What version are you running? They appear in code completion. but not OI. I will publish them though. > > > Em 22-08-2013 15:36, Martin escreveu: >> On 22/08/2013 17:20, Junior wrote: >>> Hello all. >>> >>> How to implement onMouseWell in SynEdit ? >> -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email