Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

EZ Help System for our GUIs


  • Please log in to reply
7 replies to this topic
Terrapin
  • Members
  • 107 posts
  • Last active: Feb 06 2007 03:38 PM
  • Joined: 15 Aug 2005
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).

#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. :)

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
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.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Great idea. I will use it. Thanks for sharing.
I have simplified the code a bit.
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
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

DataLife
  • Members
  • 1022 posts
  • Last active: Nov 27 2015 01:09 AM
  • Joined: 27 Apr 2008
thanks terrapin an toralf for sharing. This code is great. I use it on a Gui that has 50 controls.

DataLife

ScottMattes
  • Members
  • 195 posts
  • Last active: Feb 16 2015 01:43 AM
  • Joined: 21 May 2007
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.

ScottMattes
  • Members
  • 195 posts
  • Last active: Feb 16 2015 01:43 AM
  • Joined: 21 May 2007
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.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
You are right, scottmates. I am able to reproduce it. :)
kWo4Lk1.png

PMForkin
  • Members
  • 21 posts
  • Last active: Feb 26 2014 10:10 AM
  • Joined: 11 Dec 2012

Hallo!

I would like to take contact with the person or persons who wrote the EZ Help System for our GUI s.

i am trying to make use of CSV files for List Views.

The documentation for the Help System for GUI s. could be what I need.

If there are any simple scripts which I could have access to, which would help me I would be grateful.

I will describe the tasks I am involved in when I hear from you.

Kind regards and have a nice weekend PMForkin.