2 short fixes

14 views
Skip to first unread message

Dmitri

unread,
Apr 4, 2014, 11:31:31 AM4/4/14
to virtual-...@googlegroups.com
1. in themed VCL application, scrollbar(s) may not be properly adjusted and fails to handle mouse clicks.
I fixed this problem by adding WM_MOVE and WM_WINDOWPOSCHANGED handlers to TVclStyleScrollBarsHook (just like XE2 ) and copied code from WM_SIZE handler:
 
procedure TVclStyleScrollBarsHook.WMMove(var Msg: TMessage);
begin
  CallDefaultProc(TMessage(Msg));
  if not (tsWindowCreating in TBaseVirtualTree(Control).FStates) then begin
    CalcScrollBarsRect;
    UpdateScrollBarWindow;
    PaintScrollBars;
  end;
  Handled := True;
end;
 
2. When scrollbar is not properly placed/adjusted, it may appear that hint falls into endless recursion while moving mouse around scrollbar. I got stack overflow quite reliably.
Fix is trivial:
check that mouse is still in CursorRect (which is stored in FLastHintRect)
 
procedure TVirtualTreeHintWindow.ActivateHint(Rect: TRect; const AHint: string);
var
  DC: HDC;
  MonitorRect: TRect;
  StopLastAnimation: Boolean;
  Cp: TPoint;
begin
  if IsRectEmpty(Rect) or
    not Assigned(FHintData.Tree) or
    not Assigned(FHintData.Tree) or
    not GetCursorPos(Cp) or
    not PtInRect(FHintData.Tree.FLastHintRect, FHintData.Tree.ScreenToClient(Cp))
  then
    Application.CancelHint
  else
  begin
...
 
 

Joachim Marder

unread,
Apr 6, 2014, 4:46:01 PM4/6/14
to virtual-...@googlegroups.com
Hi Dmitri.

Thanks for the fixes, I just committed them to the repository.

Regards,

Joachim




--
You received this message because you are subscribed to the Google Groups "Virtual Treeview" group.
To unsubscribe from this group and stop receiving emails from it, send an email to virtual-treevi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages