Sign in Join

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

Mailing lists / lazarus / 2019-01

how to show hourglass on windows 10 with touch screen?

12 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Luca Olivetti

This isn't strictly a lazarus issue, but my google fu is failing me. It turns out that windows 10 with a touch screen hides the mouse cursor, so Screen.Cursor=crHourGlass does nothing.
I found that there isn't a setting to force the mouse cursor on (https://answers.microsoft.com/en-us/windows/forum/all/show-mouse-cursor-also-when-using-touch-screen/e9a7ab79-baeb-4b47-afee-4d8fed4cfbcb), is there an alternative way to show that the application is busy? In my case I'm launching another application and, since the pc is rather slow, it could take 2-3 seconds or more for the application to show after pressing the button.

TIA

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email

Luca Olivetti
to Graeme Geldenhuys

El 24/1/19 a les 10:23, Graeme Geldenhuys via lazarus ha escrit:

Show quoted text 6 lines
On 23/01/2019 14:49, Luca Olivetti via lazarus wrote: > is there an alternative way to show that the application is busy? A small borderless dialog with a short message? Think in the lines of a splashscreen-like dialog. I use this often in my applications to convey updates to long running tasks.

I was hoping for a system-provided facility (just like the crHourGlass but for windows 10 *with* touch screen. With a physical mouse crHourGlass works fine).
If there isn't one I will consider using a splash screen but I don't like it very much.

Regards

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email

Giuliano Colla
to Luca Olivetti: This isn't strictly a lazarus issue, but my google fu is failing me. It turns out that…

Il 23/01/2019 15:49, Luca Olivetti via lazarus ha scritto:

This isn't strictly a lazarus issue, but my google fu is failing me. It turns out that windows 10 with a touch screen hides the mouse cursor, so Screen.Cursor=crHourGlass does nothing.

Did you try taking advantage of such Windows API's as ClipCursor() and SetCursorPos()?
Maybe the cursor is hidden just because of the way the clipping area is defined in presence of a touch screen, or because the cursor position is set outside the screen coordinates.
Just an idea, I never tried myself.

Giuliano

Do not do to others as you would have them do to you.They might have different tastes.

Reply by email

Sven Barth
to Giuliano Colla

Am Do., 24. Jan. 2019, 13:52 hat Giuliano Colla via lazarus <

Show quoted text 15 lines
geschrieben: Il 23/01/2019 15:49, Luca Olivetti via lazarus ha scritto: > This isn't strictly a lazarus issue, but my google fu is failing me. > It turns out that windows 10 with a touch screen hides the mouse > cursor, so Screen.Cursor=crHourGlass does nothing. Did you try taking advantage of such Windows API's as ClipCursor() and SetCursorPos()? Maybe the cursor is hidden just because of the way the clipping area is defined in presence of a touch screen, or because the cursor position is set outside the screen coordinates. Just an idea, I never tried myself.

No, Windows 10 hides the cursor if no input device (mouse, touchpad) besides a touchscreen is detected. Cause in that case a cursor "makes no sense". Note: this does not mean I agree with that, only that Microsoft thinks that.

Regards,
Sven

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190124/c45d563a/attachment.html>

Reply by email

Giuliano Colla
to Sven Barth

Il 24/01/2019 14:34, Sven Barth via lazarus ha scritto:

Show quoted text 5 lines
No, Windows 10 hides the cursor if no input device (mouse, touchpad) besides a touchscreen is detected. Cause in that case a cursor "makes no sense". Note: this does not mean I agree with that, only that Microsoft thinks that.

Just for the record. In our company we manufacture control systems for automatic machines, and we provide a touch-screen industrial computer, for easy operator interaction.

In the operating instructions we write:

"If you have difficulties with touch screen, please touch anywhere on the screen and watch the cursor position, If it happens not to be exactly at the location you touched, please perform the touch screen calibration procedure explained below"

Of course we're not using Windows, but rather Linux for a lot of reasons, the main one being that we need real-time responsiveness. However this one adds one more reason to the list.

To be honest I must admit that industrial grade touch screens have dramatically improved during the years, and nowadays the recalibration is seldom required, nonetheless...

Giuliano

Do not do to others as you would have them do to you.They might have different tastes.

Reply by email

Sven Barth
to Giuliano Colla

Am Do., 24. Jan. 2019, 18:31 hat Giuliano Colla via lazarus <

Show quoted text 28 lines
geschrieben: Il 24/01/2019 14:34, Sven Barth via lazarus ha scritto: > No, Windows 10 hides the cursor if no input device (mouse, touchpad) > besides a touchscreen is detected. Cause in that case a cursor "makes > no sense". Note: this does not mean I agree with that, only that > Microsoft thinks that. > Just for the record. In our company we manufacture control systems for automatic machines, and we provide a touch-screen industrial computer, for easy operator interaction. In the operating instructions we write: "If you have difficulties with touch screen, please touch anywhere on the screen and watch the cursor position, If it happens not to be exactly at the location you touched, please perform the touch screen calibration procedure explained below" Of course we're not using Windows, but rather Linux for a lot of reasons, the main one being that we need real-time responsiveness. However this one adds one more reason to the list. To be honest I must admit that industrial grade touch screens have dramatically improved during the years, and nowadays the recalibration is seldom required, nonetheless...

I take it those are resistive touch screens? For those calibration is sometimes necessary (especially older ones as you said). For capacitive touch panels (be it smartphone or tablet) I haven't found the need for that.

Regards,
Sven

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190124/fd196ca5/attachment-0001.html>

Reply by email

Luca Olivetti
to Sven Barth: Am Do., 24. Jan. 2019, 13:52 hat Giuliano Colla via lazarus < No, Windows 10 hides the…

El 24/1/19 a les 14:34, Sven Barth via lazarus ha escrit:

No, Windows 10 hides the cursor if no input device (mouse, touchpad) besides a touchscreen is detected. Cause in that case a cursor "makes no sense". Note: this does not mean I agree with that, only that Microsoft thinks that.

If only they provided at least an alternative way to provide feedback when the application is busy...

@Giuliano, in my case it just manages the UI, but I didn't decide the OS.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email

Alexander Hofmann
to Luca Olivetti

Hi,

I've been looking for something like this, too, some time ago, and I decided to go for a self-built solution, to be independent of the underlying widget-set.
(I grayed-out all important widgets, which can be done automatically by walking, recursively, through the Controls property, and displayed a "throbber" with a few spinning dots on top of the form)

Anyway,

Luca Olivetti wrote
If only they provided at least an alternative way to provide feedback when the application is busy...

They do, though not for the "classic" style APIs like Win32 or Windows.Forms. There's an UWP class
(https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.ProgressRing) I think is intended for this.

See also:
https://stackoverflow.com/questions/44054195/windows-is-there-a-built-in-loading-animation-i-can-reference-as-a-visual-c-r

In Android it's called "Loading Spinner" IMHO and is somewhat OS-Supplied, although as I saw in many projects, in the end it's mostly self-built solutions.

A quick search didn't bring up something similar for other widgetsets, too (at least GTK and Qt don't seem to support it natively ?)

Best regards,

Alex

Reply by email

Giuliano Colla
to Luca Olivetti: El 24/1/19 a les 14:34, Sven Barth via lazarus ha escrit: If only they provided at least…

Il 24/01/2019 21:42, Luca Olivetti via lazarus ha scritto:

@Giuliano, in my case it just manages the UI, but I didn't decide the OS.

That's the reason why, some decades ago, tired of being conditioned by technical decisions taken by non-technical people, me and two other guys with a similar problem did put together all our savings and started our own company.

As we're still kicking and alive, even if rather old, while our competitors, handled with just finance in mind, have collapsed since a long time, I infer that our decision was not so bad, and I would encourage anybody in a similar position to do the same!

Giuliano

Do not do to others as you would have them do to you.They might have different tastes.

Reply by email

Giuliano Colla
to Sven Barth: Am Do., 24. Jan. 2019, 18:31 hat Giuliano Colla via lazarus < I take it those are…

Il 24/01/2019 20:52, Sven Barth via lazarus ha scritto:

I take it those are resistive touch screens? For those calibration is sometimes necessary (especially older ones as you said). For capacitive touch panels (be it smartphone or tablet) I haven't found the need for that.

Yes they are. In a harsh industrial environment where dirt and dust are unavoidable I'm told they're preferable, also because you may use them with gloves or with any kind of stylus you happen to have available.

However we rely on the choices of our industrial PC supplier. It's a small Italian manufacturer, but selling all over the world. We considered that if US Railways and US Cost Guard come to Italy to buy their PC's there must be a reason!

Giuliano

Do not do to others as you would have them do to you.They might have different tastes.

Reply by email

Luca Olivetti
to Alexander Hofmann: I've been looking for something like this, too, some time ago, and I decided to go for a…

El 25/1/19 a les 10:21, Alexander Hofmann via lazarus ha escrit:

Show quoted text 8 lines
Hi, I've been looking for something like this, too, some time ago, and I decided to go for a self-built solution, to be independent of the underlying widget-set. (I grayed-out all important widgets, which can be done automatically by walking, recursively, through the Controls property, and displayed a "throbber" with a few spinning dots on top of the form)

Thank you, probably that's the best option, considering that using UWP from win32 is not going to be easy (it at all possible, besides, I only found some tutorials on how to do it for ms development tools) and not portable.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email