Full mouse functions in normal Window

Just starting out? Need help? Post your questions and find answers here.
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Full mouse functions in normal Window

Post by coder14 »

PureBasic already has a powerful set of mouse functions in its built-in mouse library, but for some reason they are not accessible from normal windows. Is there any way around this, and call them from an OpenWindow instead of an OpenScreen? Or maybe from an implementation of OpenWindowedScreen?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Full mouse functions in normal Window

Post by ts-soft »

WindowMouseX()
WindowMouseY() ?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
atomo
User
User
Posts: 65
Joined: Thu May 22, 2008 10:32 pm

Re: Full mouse functions in normal Window

Post by atomo »

Try the new CanvasGadget or this include file : http://www.purebasic.fr/english/viewtop ... 12&t=45830
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Full mouse functions in normal Window

Post by coder14 »

PB's WindowMouseX/Y and click/doubleclick states are just not enough. Short of using API calls, we're left with OpenScreen/OpenWindowedScreen, and they use DirectX.

And atomo, your mouse include file is really great, but it entirely depends on the GetAsyncKeyState API function. I believe it works only in Windows. But the CanvasGadget is news to me. If it includes all the mouse events/states, it could be a real solution. Thanks for the info!
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Full mouse functions in normal Window

Post by coder14 »

Thank you atomo. CanvasGadget is the answer - full mouse handling, keyboard focus and persistent graphics. Any idea on when the final release of PB4.6 will be available?

OFF-TOPIC: Since compilers only "translate" the functions that we use in our code, is it fair to say that buggy functions that are not called would not affect our projects? If CanvasGadget works well, would there be any reason not to use the beta version to build our project releases?
PureLust
Enthusiast
Enthusiast
Posts: 477
Joined: Mon Apr 16, 2007 3:57 am
Location: Germany, NRW

Re: Full mouse functions in normal Window

Post by PureLust »

Hi coder14,

if you are looking for full Mouse-Event Support for all Gadgets, you may have a look at atomos 'MouseEvent-Include.

Greetz, PL.
[Dynamic-Dialogs] - create complex GUIs the easy way
[DeFlicker] - easily deflicker your resizeable Windows
[WinFX] - Window Effects (incl. 'click-through' Window)
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Full mouse functions in normal Window

Post by coder14 »

PureLust wrote:if you are looking for full Mouse-Event Support for all Gadgets, you may have a look at atomos 'MouseEvent-Include.
coder14 wrote:And atomo, your mouse include file is really great, but it entirely depends on the GetAsyncKeyState API function. I believe it works only in Windows.
Thanks PL - appreciate the pointer.
Post Reply