AutoHotkey Community

It is currently May 27th, 2012, 12:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: January 4th, 2006, 12:52 pm 
Offline

Joined: August 15th, 2005, 7:15 am
Posts: 107
Location: North Carolina
IMHO, most often we don't provide enough help for our apps. Maybe it is because we usually wait until the app is complete, then we don't want to take the time. We probably also assume that people using them will understand.

I came up with this very simple system, for GUI's, wherein the context help is written right along with the addition of controls. Using it means you don't have to worry over it later.

Also provided, is what is, again imho, a better alternative than SetTimer, and guessing how long it will take someone to read something, for ToolTips.

The user just right-clicks anywhere in a GUI for an appropriate tooltip, and upon left-clicking anywhere on the screen, the tooltip disappears. Or a subsequent right-click without the 'WhichToolTip' parameter seems to clear a tooltip and display thenew, appropriate one, built into AHK already.

I'm not at all sure this hasn't been done by someone else before, or that there isn't a problem with it somewhere. You'd need to check OS version as it hooks the mouse. Also, an actual context MENU could be set up if a_guicontrol = null (clicked on gui background).

Code:
#SingleInstance force

;====== This is just an example gui with 'built-in' help.
Gui, Add, GroupBox, x6 y20 w200 r8 vgb1, Test
Gui, Add, CheckBox, xp+6 yp+20 vcb1, Another Test
cb1help = Left-click here to see a very nice check mark.`nIf you get tired of it
, just click again and it will go away.
Gui, Add, radio, vrb1, <---- Radio Button 1
rb1help = Click this big empty circle and it won't be empty any longer.
Gui, Add, DDL, yp+60 vMyDDL, Choose Please||red|blue|green|purple|yellow|orange
MyDDLhelp = Click this box, then click on your favorite color.
Gui, Add, Button, Default vBtnExit gClose yp+60, E&xit
BtnExitHelp = Click to close the program.
Gui, Show, , Helpful
guihelp = This is the Main Window
return

Close:
ExitApp
;======== AHK's built-in GUI right-click label
GuiContextMenu:
{
   If a_GuiControl =
      help = This is the Main Window
   help := %a_GuiControl%help
   ToolTipMon()
   ToolTip, %help%
return
}

;======== and the tooltip monitor, which turns off tooltips the
;======== next time the user left-clicks.  The splat might best
;======== be omitted.
ToolTipMon()
{
HotKey, *~LButton, KillTip
HotKey, *~LButton, On
return

KillTip:
{
   HotKey, *~LButton, Off
   ToolTip
   return
}
}

_________________
When it comes to Binary, there are 10 types of people. Those who get it and those who don't. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2006, 4:02 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Nicely presented and documented. I think this will definitely make adding context-sensitive help less of a chore for people who make a lot of GUIs.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2006, 11:22 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Great idea. I will use it. Thanks for sharing.
I have simplified the code a bit.
Code:
GuiContextMenu:
  If A_GuiControl is space
      help = %GuiHelp%
  else
      help := %A_GuiControl%help
  HotKey, *~LButton, KillGuiHelpTip , On
  ToolTip, %help%
Return

KillGuiHelpTip:
  HotKey, *~LButton, Off
  ToolTip
Return

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 16th, 2008, 5:17 pm 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
thanks terrapin an toralf for sharing. This code is great. I use it on a Gui that has 50 controls.

DataLife


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2008, 2:05 pm 
Offline

Joined: May 21st, 2007, 3:44 pm
Posts: 176
Location: USA
When I do the copy from the first post I get errors at run time (no recognized action on the line on lines 23-27 and also 42-44).

When I looked in hex there were x'a0' characters on those lines. Changing them to 20 fixed the errors.

_________________
-------------
Scott Mattes
Image
My small, and slowly growing, collection of scripts.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2008, 1:56 pm 
Offline

Joined: May 21st, 2007, 3:44 pm
Posts: 176
Location: USA
I saw the same thing today, in another post. I tried the 'copy' from an IE window and didn't get it, so it must be google chrome.

_________________
-------------
Scott Mattes
Image
My small, and slowly growing, collection of scripts.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2008, 3:15 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
You are right, scottmates. I am able to reproduce it. :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: fincs and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group