[fpc-devel] Video.CursorX/Y 1-based under UNIX

Michalis Kamburelis michalis at camelot.homedns.org
Sat Dec 11 19:16:06 CET 2004


Hi.

I'm just playing with unit Video and I found some strange thing. It 
looks like a bug in my opinion, but it's so obviously implemented in 
Video unit that I fear that it's some "feature" :

Under UNIXes CursorX / CursorY are 1-based. While SetCursorPos takes 
0-based parameters on all OSes, and CursorX / CursorY are 0-based on Win32.

Although docs never explicitly say that CursorX and CursorY should be 
0-based, I think that they should be, because
- SetCursorPos takes 0-based params, so obviously CursorX and CursorY 
should follow the same convention,
- under Win32 CursorX and CursorY are 0-based, and rtl/win32/video.pp is 
clearly implemented to keep this assumption.

What's strange is that looking at sources rtl/unix/video.pp, it looks 
like someone intended that behavior, i.e. that CursorX and CursorY are 
1-based.

-- 
Michalis




More information about the fpc-devel mailing list