Welcome Guest.   Make a donation to an author on the site October 25, 2014, 05:12:03 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: Replace Hourglass with Quote from text file  (Read 7257 times)
skooter1121
Participant
*
Posts: 25

View Profile Give some DonationCredits to this forum member
« on: April 20, 2009, 09:54:27 AM »

Occasionally when I load a large program or a huge data file  from a file server the omnipresent hourglass appears and spins away and away .....

IDEA:

HourGlassPane, or WaitData, or  LoadInfo or IdleWhile:

A program that displays as a tooltip or message box a line from a text file instead. A text file containing a  quote, joke, reminder, any little tidbit of information.  It shouldn't slowdown the loading but just replace the hourglass only when it is on the screen, with the ability to click on it to freeze the display.
Logged
Coeluh
Supporting Member
**
Posts: 273


Family Guy ^^

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: April 21, 2009, 08:19:41 AM »

Occasionally when I load a large program or a huge data file  from a file server the omnipresent hourglass appears and spins away and away .....

IDEA:

HourGlassPane, or WaitData, or  LoadInfo or IdleWhile:

A program that displays as a tooltip or message box a line from a text file instead. A text file containing a  quote, joke, reminder, any little tidbit of information.  It shouldn't slowdown the loading but just replace the hourglass only when it is on the screen, with the ability to click on it to freeze the display.
How would you click on a tooltip that is following your mouse?
Logged
skooter1121
Participant
*
Posts: 25

View Profile Give some DonationCredits to this forum member
« Reply #2 on: April 21, 2009, 05:42:16 PM »

The ckickable feature : (not necessarily ON the tooltip itself), with a right mouse button, or key command could freeze the note so you could read it, if you so wished, Otherwise it would disappear as normal and load the application.

I just thought a program such as this that could be providing some kind of information while the hourglass was working could be useful. Anything would be better than the mindless WAIT icon.

Don't you think so?
Logged
Coeluh
Supporting Member
**
Posts: 273


Family Guy ^^

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: April 22, 2009, 03:37:51 AM »

The ckickable feature : (not necessarily ON the tooltip itself), with a right mouse button, or key command could freeze the note so you could read it, if you so wished, Otherwise it would disappear as normal and load the application.

I just thought a program such as this that could be providing some kind of information while the hourglass was working could be useful. Anything would be better than the mindless WAIT icon.

Don't you think so?
Yeah that would be cool! I think it shouldn't be that hard to do. Random quotes, funny facts, system information like cpu usage...
Logged
rjbull
Charter Member
***
Posts: 2,778

View Profile Give some DonationCredits to this forum member
« Reply #4 on: April 22, 2009, 04:35:40 AM »

Reminds me of an old tagline.  "Windows loading.  Come back tomorrow." 

Logged
nosh
Supporting Member
**
Posts: 1,388


View Profile Give some DonationCredits to this forum member
« Reply #5 on: April 22, 2009, 05:09:26 AM »

Random quotes, funny facts, system information like cpu usage...

Little (expandable) thumbnails of girlie pix!!!
No? OK, I'll just shut up.
Logged
r0bertdenir0
Supporting Member
**
Posts: 49


View Profile Give some DonationCredits to this forum member
« Reply #6 on: April 29, 2009, 10:25:11 AM »

Something like this maybe...
That's the basic structure I think - you'd just have to modify the IF statements that generate the tooltip so that it reads from a joke file, shows weather info, or even show reads nosh's My Pictures folder to show those girlie pix in a splash screen...


#SingleInstance,Force
#UseHook On
SetBatchLines,-1


IDC_APPSTARTING := 32650
IDC_WAIT := 32514

ShowWaitCursorTip:
{
   loop
   {
      hCurAppStarting := DllCall("LoadCursor", "Uint", NULL, "Int", IDC_APPSTARTING, "Uint")
      hCurWait := DllCall("LoadCursor", "Uint", NULL, "Int", IDC_WAIT, "Uint")
      
      VarSetCapacity(CurrentCursorStruct, 20, 0)
      NumPut(20, CurrentCursorStruct)
      result := DllCall("GetCursorInfo", "str", CurrentCursorStruct)
      hCursor := NumGet(CurrentCursorStruct, Cool
      
      sTip :=
      If(hCursor==hCurAppStarting)
      {
         sTip := "This should just take a sec..."
      }
      If(hCursor==hCurWait)
      {
         sTip := "This may take some time.... probably lots..."
      }
      
      ToolTip, %sTip%
      
      Sleep, 20
      
   }
   
Return
}


^!X::Gosub, EXIT

EXIT:
ExitApp
« Last Edit: April 29, 2009, 10:26:49 AM by r0bertdenir0 » Logged
skooter1121
Participant
*
Posts: 25

View Profile Give some DonationCredits to this forum member
« Reply #7 on: May 09, 2009, 04:30:27 PM »

Thanks (TaxiDriverWithStuckCapsLockKey)

But, I was unable to get your script to work.

I tried to load OpenOffice as a test case, but your "This should just take a sec..." would not show.

I've attached a text file of Oscar Wilde quotes I have created. I'd like to use it if possible.


-S


* Oscar Wilde Quotes.txt (35.31 KB - downloaded 294 times.)
« Last Edit: May 09, 2009, 04:54:45 PM by skooter1121 » Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: May 10, 2009, 08:59:49 AM »

 smiley Try HourglassQuotes!

It displays a quote when the PC is busy, either from a file or from www.quotableonline.com.

Place the quotes in a text file and edit the files= and timer= lines.

To keep the quote from dissapearing, just click inside the window. It dissappears when it loses focus.

Skrommel

[copy or print]
;HourglassQuotes.ahk
; Displays a quote when the PC is busy
;Skrommel @ 2009

delay=9                                                             ;seconds to show the quote
file=                                                               ;file with quotes. if empty, retrieve quote from internet
internet=http://www.quotableonline.com/index.php                    ;url to page with random quote
html1:="<div class=leftnavText><blockquote id=blockquote > &nbsp; " ;text to look for before the quote
html2:="</blockquote>"                                              ;text to look for after the quote
filter:="  "                                                        ;string to remove from the quote

#NoEnv
#SingleInstance,Force

applicationname=HourglassQuotes

IniRead,counter,%applicationname%.ini,Settings,counter
If (counter="Error" Or counter<1 Or counter>999999)
  counter=1

If file=
  Gosub,DOWNLOAD
Else
  Gosub,READ

Loop
{
  Sleep,1000
  ;Stolen from Sean at http://www.autohotkey.com/forum/topic32959.html
  VarSetCapacity(ci,20,0),NumPut(20,ci)
  DllCall("GetCursorInfo","Uint",&ci)
  hCursor:=NumGet(ci,8)
  If showing<>1
  If hCursor In 65575,65557  ;65575=appstarting 65557=wait
  {
    Gui,Destroy
    Gui,+ToolWindow +AlwaysOntop
    Gui,Color,FFFFFF
    Gui,Add,Text,w200,%quote%
    Gui,Show,x0 y0 NoActivate,%applicationname%
    Gui,+LastFound
    guiid:=WinExist()
    SetTimer,QUOTEOFF,% delay*-1000
    showing=1
    If file=
      Gosub,DOWNLOAD
    Else
      Gosub,READ
    If quote=
      Continue
  }
}
ExitApp


READ:
FileReadLine,quote,%file%,%counter%
If ErrorLevel=1
{
  counter=1
  FileReadLine,quote,%file%,%counter%
}
Else
  counter+=1
IniWrite,%counter%,%applicationname%.ini,Settings,counter
Return


DOWNLOAD:
UrlDownloadToFile,% internet,quote.htm
FileRead,quote,quote.htm
StringGetPos,pos,quote,% html1
StringTrimLeft,quote,quote,% pos+StrLen(html1)
StringGetPos,pos,quote,% html2
StringLeft,quote,quote,% pos
StringReplace,quote,quote,% filter,,All
Return


QUOTEOFF:
active:=WinExist("A")
If (active=guiid)
{
  SetTimer,QUOTEOFF,-1000
  Return
}
showing=0
Gui,Destroy
Return

« Last Edit: May 11, 2009, 02:29:52 PM by skrommel » Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: May 11, 2009, 11:01:06 AM »

smiley Try HourglassQuotes!

It displays a quote when the PC is busy.

cool, works nicely. thumbs up
Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: May 11, 2009, 11:16:32 AM »

Great work skrommel, and much credit also to r0bertdenir0, who basically showed the way.  thumbs up thumbs up
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: May 11, 2009, 02:31:11 PM »

 smiley Just updated HourglassQuote above!

If the file= is empty, it goes online to retrieve a quote.

Also, you can click inside the quote window to keep it from dissappearing.

Skrommel
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: May 11, 2009, 02:44:53 PM »

one thing that might be nice skrommel, is if you can support the file formats i use in my various quote programs (popup wisdom and multiphoto quotes).
you can download quote files here:
http://www.donationcoder....er/PopUpWisdom/books.html

there are basically 2 formats:
1) standard fortune file format, which uses % on newlines to separate quotes
2) single quote per line format (and i use first line of file for extra info)
Logged
skooter1121
Participant
*
Posts: 25

View Profile Give some DonationCredits to this forum member
« Reply #13 on: May 14, 2009, 07:54:25 PM »

skrommel,

Great thought to get a quote online if txt file not found.  I wonder what other online text data is available? Word of the hour/day perhaps? CNN Headlines? (Please no joke of the day!)

I like the choice of the MessageBox rather than the ToolTip. The ToolTip limits the quotes to 256 Char and I'd need to edit all my text files. Plus I dislike that anoying POP sound, although easily disabled. 

I am running into a problem, with the default settings, as  I cannot drag the QuoteBox and have it stay, and a ghost image of the box remains on the screen. I've also seen a significant slow down of the PC when your Gone in 60 Seconds program is also running. (This is running on a fresh install XP Pro, and when 60 sec is closed the PC responds as usual.)

I tried to eliminate the Caption completely, with a single click to freeze, a double-click to close but was unsuccessful.(Not even close.)  A fade in and out were also beyond my meager 4 months AHK experience.

-Thanks for your expert assistance.
-Skooter1121

I have dozens of Quote/Trivia/Puzzle txt files I have created over the years. If you wish to add some to your script.

As another thought; my grandson is now learning the multiplication tables. A scrolling window where 5x9 =  eventually displays 45 might help him.
Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: May 14, 2009, 08:24:52 PM »

also another request, can you move 'file=' setting to an INI file? it will be a tad easier to edit. smiley
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.039s | Server load: 0.14 ]