She says they help, but you don't notice an egg timer has timed out till you look at it, so I thought I'd write an on-screen egg timer for her, as the work she is timing is on a PC.
The app is profilable and can run for any amount of time.
The profiles are for period, colour, orientation (horizontal/vertical), and there are radio buttons to make the hourglass (progress bar) invisible until 50%, 70%, 80%, 90% of time has elapsed. There are check-boxes for audio warnings at 50%, 70%, 80%, 90% and "Time up". The selections are made when starting the app.
I made the GUI first, then the audio warnings, and that all works fine. Then I turned my attention to the progress bar that I had envisaged for the visual timer - but I can't find what I want, so any help to get me going would be appreciated.
I want the timer (progress bar) to be as unobtrusive as possible. As such, a simple wire-frame, black, horizontal oblong for the border of the progress bar would do fine, with a coloured in-fill to show the progress, and no Windows Title bar because that makes it bigger. However, if it is getting in the way of other things on the screen, then I'd like it to be movable - and there's a problem there.
I tried ...
Code: Select all
Progress, b1 m Zx5 Cbgreen w200 Zh8 h18
Progress, 50 ; Set the position
sleep 2000
The AHK manual says
M: The window will be movable by the user (except if borderless).
- so if I want to move it, I need a border.
B: Borderless: The window will have no border and no title bar. To have a border but no title bar, use B1 for a thin border or B2 for a dialog style border.
I find that B1 / B2 look the same, and neither gives a movable progress bar.
If I use ...
Code: Select all
Gui, Add, Progress, hwndProgress1 vProgress1 -Smooth w250 h18
; Gui, Add, Button, vChangeStyle w100 x75 y40, Change Style
Gui, Show ; , , Please wait...
GuiControl,, Progress1, 50
Return
If I make a vertical bar, keeping it as small as possible ...
Code: Select all
Gui, Add, Progress, Vertical vMyProgress
Gui, Show
return
sleep 3000
GuiControl,, MyProgress, +10
Then I thought of having a wire frame, with a colour in-fill to show progress - both by using splashimage, suitably sized.
I drew a wire frame with MS_Paint and saved it as a .bmp, in the expectation of being able to display it with ...
Code: Select all
SplashImage, progress_frame.bmp, h40 w500
Sleep, 4000
SplashImage, Off
I just don't know enough about this language without reading the manual enough times to memorise it, so please, somebody who has already done that, is what I want a viable thing to do?
If I manage to draw a custom progress bar, can I move it by detecting a left-click, then starting a timer to follow the mouse and keep erasing/redrawing the control?
Sorry this is all a bit rambling, but although I believe there is a way to do it, it's frustrating trying to find it.