Jump to content

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

Gui help box


  • Please log in to reply
17 replies to this topic
xx3nvyxx
  • Members
  • 93 posts
  • Last active: Jan 21 2016 09:33 AM
  • Joined: 05 Sep 2005
Is there any way to get that little question mark box on my gui? You know, like the on in the display poperties window that turns your mouse funny and causes everything you click to go to the associated piece of the help file?

As far as I can tell it isn't possible as of yet in AHk. But it would really improve my script.
Now the world has gone to bed,
Darkness won't engulf my head,
I can see by infra-red,
How I hate the night.

Now I lay me down to sleep,
Try to count electric sheep,
Sweet dream wishes you can keep,
How I hate the night.

ODrTPj
  • Members
  • 14 posts
  • Last active: Aug 09 2006 07:28 PM
  • Joined: 30 Sep 2005
I am not sure if you would be able to do exactly that, but you could add a menu with an option for help.

Then when selected you can use the mouse coordinates to add an image of a ? in the position you desire beside the pointer.

Then have a variable that when the help option is selected all of your buttons and such will not activate (except one to turn help off), but instead jump to a section for help.

After that when something is clicked on, find out what has the focus and just display the tooltiptext for that itme, a small gui with text on it and a transparent background...etc. your choice.

Hope that helps.

If you have another question, let me know. I have messed with a help section before, so I have some experience.

xx3nvyxx
  • Members
  • 93 posts
  • Last active: Jan 21 2016 09:33 AM
  • Joined: 05 Sep 2005
That's seems a bit complicated compared to my current help structure. Unfortunately it's only text controls with gosubs that lead to the help. I was hoping I could replace it with the more recognisable question mark box type structure.
Now the world has gone to bed,
Darkness won't engulf my head,
I can see by infra-red,
How I hate the night.

Now I lay me down to sleep,
Try to count electric sheep,
Sweet dream wishes you can keep,
How I hate the night.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
I could have sworn that I saw something in the manual to do with sending WM_HELP messages to controls when in a certain mode, rather like the question mark mouse pointer behaves. Can't seem to find it now - maybe Chris will know what I'm referring to.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
I don't think there's anything in the Help about it, nor much in the forum either. I think the question mark button can be added to a window via some window style number. After that, perhaps OnMessage() could be used to detect the user's clicks on the button, and subsequent clicks on control inside the window.

Unless someone here knows how to do this and posts the info, some R&D would be involved.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Remembered where I came across it now.

See SC_CONTEXTHELP here: WM_SYSCOMMAND Notification

xx3nvyxx
  • Members
  • 93 posts
  • Last active: Jan 21 2016 09:33 AM
  • Joined: 05 Sep 2005
That looks like exactly what I need, but how would I impliment it into my gui? I'm not very good at that kind of stuff. As far as I can tell the gui add command would have to be modified for the control to accept that type of system message.
Now the world has gone to bed,
Darkness won't engulf my head,
I can see by infra-red,
How I hate the night.

Now I lay me down to sleep,
Try to count electric sheep,
Sweet dream wishes you can keep,
How I hate the night.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
OnMessage can be used to monitor for certain message types sent to the script's process.

xx3nvyxx
  • Members
  • 93 posts
  • Last active: Jan 21 2016 09:33 AM
  • Joined: 05 Sep 2005
Okay, I found the style I need, but the docs don't tell me what number it is. The name is WS_EX_CONTEXTHELP but I need the number to be able to put it into an AHK gui. I've sorta run into a brick wall.....
Now the world has gone to bed,
Darkness won't engulf my head,
I can see by infra-red,
How I hate the night.

Now I lay me down to sleep,
Try to count electric sheep,
Sweet dream wishes you can keep,
How I hate the night.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
I looked it up, it's:

WS_EX_CONTEXTHELP 0x00000400L



xx3nvyxx
  • Members
  • 93 posts
  • Last active: Jan 21 2016 09:33 AM
  • Joined: 05 Sep 2005
Is it just me or does this not seem to work?

#singleinstance, force
Gui, +E0x00000400L
Gui, add, text, y50 w100 h50 +center, Test
Gui, show,, 1
Return

GuiEscape:
GuiClose:
Gui, destroy
Gui, 2:+0x00000400L
Gui, 2:add, text, y50 w100 h50 +center, Test
Gui, 2:show,, 2
Return


2Guiescape:
2Guiclose:
ExitApp

Just run and press escape. One or both of them should have the WS_EX_CONTEXTHELP style. But neither of them do for me. I'm going to try to remove any of the styles that are known to conflict with this one next, but if somebody else has any suggestions...


Note: The help file says: "If the sign is omitted, a plus sign is assumed." But when I try to omit the sign, it gives me an error. Maybe AHK doesn't recognise that style? Or maybe that function is broken...
Now the world has gone to bed,
Darkness won't engulf my head,
I can see by infra-red,
How I hate the night.

Now I lay me down to sleep,
Try to count electric sheep,
Sweet dream wishes you can keep,
How I hate the night.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Try:
Gui, +E0x400

(dropped the L - not sure what that was doing there - not a valid hex value so I tried it without and it seemed to work).

It adds the question mark box although doesn't seem to "react" to clicking on it.

xx3nvyxx
  • Members
  • 93 posts
  • Last active: Jan 21 2016 09:33 AM
  • Joined: 05 Sep 2005
Lol. I should have known L isn't a hex value... Don't know where my mind is. Probably still tired from school. Anyway, the reason it doesn't react is because the Maximize and Minimize buttons conflict with it. This should work, but I have yet to figure out exactly how to do the onmessage part.
#singleinstance, force

Gui, -MaximizeBox -MinimizeBox +E0x00000400

Gui, add, text, y50 w100 h50 +center, Test

Gui, show,, Test

Return



GuiEscape:

GuiClose:

ExitApp

Now the world has gone to bed,
Darkness won't engulf my head,
I can see by infra-red,
How I hate the night.

Now I lay me down to sleep,
Try to count electric sheep,
Sweet dream wishes you can keep,
How I hate the night.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Edit:

#singleinstance, force 
OnMessage(0x53, "WM_HELP")
Gui, -MaximizeBox -MinimizeBox +E0x00000400 
Gui, add, edit, y50 w100 h50 +center, Test 
Gui, show,, 1 
Return 

GuiEscape: 
GuiClose: 
ExitApp



WM_HELP(wParam, lParam, msg, hwnd)
{
traytip,, %wParam% %lParam%
}


xx3nvyxx
  • Members
  • 93 posts
  • Last active: Jan 21 2016 09:33 AM
  • Joined: 05 Sep 2005
Well, here's what I have. It doesn't seem to do exactly what I want though. I would like to recieve the name of the control that the user clicked on, but it just gives me a blank variable...

#singleinstance, force
Gui, -MaximizeBox -MinimizeBox +E0x00000400
Gui, add, text, y50 w100 h50 +center, Test
Gui, show,, Test
OnMessage(0x0053, "Help")
Return

GuiEscape:
GuiClose:
ExitApp


Help()
	{
	Msgbox, %A_GuiControl%
	}

Edit: It seems to successfully get the value of A_Gui. Maybe the message isn't being sent to a the control, rather from it. If this is true, is there any way to find out the source of the message?
Now the world has gone to bed,
Darkness won't engulf my head,
I can see by infra-red,
How I hate the night.

Now I lay me down to sleep,
Try to count electric sheep,
Sweet dream wishes you can keep,
How I hate the night.