Recent

Author Topic: How to set cursor for TSplitter ?  (Read 1541 times)

jamie

  • Hero Member
  • *****
  • Posts: 5141
How to set cursor for TSplitter ?
« on: May 30, 2021, 11:43:51 pm »
It seems the Cursor property for the TSplitter does nothing?

I can not set the cursor I want for some reason.. ?

Drop a Tsplitter on a blank form and set the cursor to what ever, it uses its own cursor and ignores me? I am use to this from my wife but not coding. :(

 Anyone got ideas other than me doing something I shouldn't need to ?
The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 9174
Re: How to set cursor for TSplitter ?
« Reply #1 on: May 31, 2021, 12:22:52 am »
The cursor for the vertical splitter seems to be working, but not the one for the horizontal splitter. See attached demo: both cursors should be crHandPoint, but only the vertical one obeys.
(Win 10)
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

dsiders

  • Hero Member
  • *****
  • Posts: 563
Re: How to set cursor for TSplitter ?
« Reply #2 on: May 31, 2021, 12:35:52 am »
It seems the Cursor property for the TSplitter does nothing?

I can not set the cursor I want for some reason.. ?

Drop a Tsplitter on a blank form and set the cursor to what ever, it uses its own cursor and ignores me? I am use to this from my wife but not coding. :(

 Anyone got ideas other than me doing something I shouldn't need to ?

If you do anything in TSplitter that changes Align, ResizeAnchor, or Enabled  the only cursors you'll see are crVSplit, crHSplit, or crDefault. Check out UpdateCursor for the culprit.

@wp saw crHandPoint only because the splitter did not set Align, ResizeAnchor, or Enabled.

Maybe you could try TPairSplitter... it seems to have better support for cursors.
Lazarus 2.0.12, 2.2.0, 2.3.0 (Git) / FPC 3.2.0, 3.2.2 / x86 64-bit / Windows 8.1

jamie

  • Hero Member
  • *****
  • Posts: 5141
Re: How to set cursor for TSplitter ?
« Reply #3 on: May 31, 2021, 01:32:06 am »
Then this must be a bug then...

I am surprise no one has seen this before. I found this in an older Laz and its still there in the trunk.

I must be one of the few that dares to stretch the simple limits. %)
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 5141
Re: How to set cursor for TSplitter ?
« Reply #4 on: May 31, 2021, 01:48:46 am »
This smells like some one called the RecreateWindow or RecreateWnd again!
I just set the cursor during the form.onCreate and it works then so this means the window is getting recreated and cursor is receiving the default one..


P.S.

  Yes, I looked in the UpdateCursor! why is this being done? I don't see any reason for this..
 
« Last Edit: May 31, 2021, 02:03:06 am by jamie »
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 5141
Re: How to set cursor for TSplitter ?
« Reply #5 on: June 05, 2021, 12:41:09 am »
that seems to work in my Delphi.. I set the cursor and that what's used.

It simply defaults at startup before the resource is read..

I guess It can be fixed but this is just strange why someone would do that ?
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018