Detect index of selection from droplistbox

Started by stevengraff, April 10, 2014, 10:21:46 AM

Previous topic - Next topic

JTaylor

Sorry...Bad documentation.  Intended to get the "Parts" stuff working on the StatusBar but apparently never got back to it.  The following should work.   Basically ignore/leave off the last parameter.  What you did is fine but can save the second step.

   sbHandle = sbCreateStatusBar(DlgHandle,"Playing with ToolTips... maybe over-kill?",1)

Jim

Quote from: stevengraff on April 25, 2014, 02:29:18 PM
OK; this:

   sbHandle = sbCreateStatusBar(DlgHandle,1,0)
   sbSetText(sbHandle,0,"Playing with ToolTips... maybe over-kill?")

works.

JTaylor

I don't see a way to set different colors for different tips.   You could use the Title option to make one stand out.    The ToolTip Control "controls" what happens with the display so no way to display it to a different place...at least not using that Control.  Talk the WinBatch folks into implementing a Mouseover event and then you could make that happen...or if you are ambitious enough you could still make it happen.

Jim


Quote from: stevengraff on April 25, 2014, 02:46:14 PM
I appreciate that I'm taking the thread somewhat diagonal here, but... can you provide an option for ToolTips such that mousing over a control displays the tip in the status bar instead of a bubble?

And I like being able to change the color, but it looks like an all or nothing deal. If I wanted one ToolTip to stand out from the crowd by being in red, for example, I don't think that's presently possible.

ditto re: ToolTip title.

stevengraff

From what I could see the Title option is "all or none" also, no?

Quote from: JTaylor on April 25, 2014, 04:06:44 PM
I don't see a way to set different colors for different tips.   You could use the Title option to make one stand out.   


JTaylor

You can't change the color but you can have it display an Icon.

Jim

Quote from: stevengraff on April 25, 2014, 04:32:03 PM
From what I could see the Title option is "all or none" also, no?


stevengraff

The result I am seeing is that the Title and Icon appear in every ToolTip on the dialog.

It looks like the 2nd parameter in

ttSetTitle(TTHandle,ControlHandle,Icon,Title)

is not being enforced.

JTaylor

I think I have it straightened out...The main thing is that my examples were bad and my documentation a bit misleading.   The trick is to Create the tooltip based on the control and not the dialog.   This will allow you to do what you are wanting...that is, doing different things with different tips.

Hopefully I corrected the documentation in all the needed places and the example script should work so looking at that code might help.

I have also tweaked the StatusBar so you can create Parts and set the Text for each part.



Jim

Quote from: stevengraff on April 25, 2014, 05:33:23 PM
The result I am seeing is that the Title and Icon appear in every ToolTip on the dialog.

It looks like the 2nd parameter in

ttSetTitle(TTHandle,ControlHandle,Icon,Title)

is not being enforced.

stevengraff

Quote from: JTaylor on April 25, 2014, 07:32:54 PM
The trick is to Create the tooltip based on the control and not the dialog.   This will allow you to do what you are wanting...that is, doing different things with different tips.
Got it!

The interesting thing is that the original way I was doing it (sort of) worked!

===========

sbCreateStatusBar still seems to require 3 parameters. And sbSetText can no longer use 0 as the 2nd parameter.

JTaylor

Arrrggghhhh....thought I had it all sorted....

Yes.  The issues is that it was creating one tooltip and the text was being set for the control so all the settings were the same except the text.   I figured out we needed to create separate tooltip handles for each control to do what you were wanting.  Not sure what is the best way but this allows for individual settings.

Guess I missed the one thing.   When I got the Parts working for the statusbar the sbSetText now requires a one-based index so it puts the text in the right part.


Deana, would you please replace what is in the Tech Database?



Jim


Quote from: stevengraff on April 25, 2014, 08:23:05 PM

Got it!

The interesting thing is that the original way I was doing it (sort of) worked!

===========

sbCreateStatusBar still seems to require 3 parameters. And sbSetText can no longer use 0 as the 2nd parameter.

stevengraff

This being my 1st experience with 3rd-party extenders... is there something I need to do to get the Shift-F1 key to bring up the help file?

JTaylor

I'll have to defer to someone else on that question...I assume you are speaking of Studio but I don't use it so not sure how that all works.

I gather that last post fixed everything to this point?

Jim

stevengraff


Deana

Deana F.
Technical Support
Wilson WindowWare Inc.

Deana

Quote from: stevengraff on April 26, 2014, 07:34:06 AM
This being my 1st experience with 3rd-party extenders... is there something I need to do to get the Shift-F1 key to bring up the help file?

Some special setup is required to allow WinBatch Studio to handle this. First you must create a .WEH file that contains all of the indexed functions ( see attached ). Then copy this file here:
C:\Program Files (x86)\WinBatch\System\Help\CommCtrl.weh

Next you will need to modify WSHELP.INI located here: C:\Program Files (x86)\WinBatch\System\Help\WSHELP.INI. Add a new data item to the [WIL} section in the format

QuoteHFx <equals> HelpFileName  HelpFileType

In this case in might look something like:

HF40 = CommCtrl.chm 4

You should now be able to right click on any of the CommCtrl (Dialog Control) extender functions in WinBatch studio and do a keyword look up.
Deana F.
Technical Support
Wilson WindowWare Inc.

JTaylor

Anything I need to do with Help File to make that work well?

Jim

Deana

Quote from: JTaylor on April 28, 2014, 09:23:39 AM
Anything I need to do with Help File to make that work well?

Jim

Simply make sure all the functions names are in the Index of the help file.
Deana F.
Technical Support
Wilson WindowWare Inc.

JTaylor

Most were but found 3-4 that weren't...

Jim


Deana

Quote from: JTaylor on April 28, 2014, 09:55:13 AM
Most were but found 3-4 that weren't...

Jim

Okay Jim, I have updated the latest zip file with your CHM file update...
Deana F.
Technical Support
Wilson WindowWare Inc.

stevengraff

An embarrassment of riches... now two of them pop up for a shift-F1!

Deana

Quote from: stevengraff on April 29, 2014, 01:20:37 PM
An embarrassment of riches... now two of them pop up for a shift-F1!

Not exactly sure why this occurs with Jims CHM Help file. Jim maybe try naming the main window of your helpfile to "$global_main".
Deana F.
Technical Support
Wilson WindowWare Inc.

JTaylor

Hmmmmmmm...may need a bit more clarification on that suggestion.   Attached is an image of where I *think* you suggest the change but not certain.   It predefines "Main" and doesn't let me change that.  I can define a secondary Window.  Does this look like what you mean or am I looking in the wrong place?  Guess I could fire up Studio and see what happens.

Jim

JTaylor

What I see is that it opens the main help file to the Intro page and then opens a Keyword lookup window with the function info displayed.   So it is "sort of" working.  I'm trying to see if there is some option to make it open to the topic in the main help file.

Jim

Deana

Quote from: JTaylor on April 29, 2014, 01:46:29 PM
Hmmmmmmm...may need a bit more clarification on that suggestion.   Attached is an image of where I *think* you suggest the change but not certain.   It predefines "Main" and doesn't let me change that.  I can define a secondary Window.  Does this look like what you mean or am I looking in the wrong place?  Guess I could fire up Studio and see what happens.

Jim

This issue has to do with how the help file is loaded from wshelp.dll in WinBatch Studio. Either change your help file project to use the '$global_main' window name or modify 'wshelp.dll' to make an exception for your specific help file. I recommend the former option of naming the help window  '$global_main' 

Add a new Window Named '$global_main' to your help file project and use that window name instead. Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/ms670148(v=vs.85).aspx
Deana F.
Technical Support
Wilson WindowWare Inc.

JTaylor

I think I've done what you have suggested.  But I don't see any behavior change.   Can't say for certain that I am "us[ing] that window name instead" as I don't see any way to reference it other than select it from the Setup page I posted earlier and then "Publish" the project.  Sorry if I am being an idiot.  I've read through the Help in my Help tool (Help & Manual), that page at Microsoft and did some Googling but still not clear if I've done what you want.

Jim

Quote from: Deana on April 29, 2014, 02:13:09 PM

This issue has to do with how the help file is loaded from wshelp.dll in WinBatch Studio. Either change your help file project to use the '$global_main' window name or modify 'wshelp.dll' to make an exception for your specific help file. I recommend the former option of naming the help window  '$global_main' 

Add a new Window Named '$global_main' to your help file project and use that window name instead. Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/ms670148(v=vs.85).aspx

Deana

Quote from: JTaylor on April 29, 2014, 02:38:54 PM
I think I've done what you have suggested.  But I don't see any behavior change.   Can't say for certain that I am "us[ing] that window name instead" as I don't see any way to reference it other than select it from the Setup page I posted earlier and then "Publish" the project.  Sorry if I am being an idiot.  I've read through the Help in my Help tool (Help & Manual), that page at Microsoft and did some Googling but still not clear if I've done what you want.

Jim

Quote from: Deana on April 29, 2014, 02:13:09 PM

This issue has to do with how the help file is loaded from wshelp.dll in WinBatch Studio. Either change your help file project to use the '$global_main' window name or modify 'wshelp.dll' to make an exception for your specific help file. I recommend the former option of naming the help window  '$global_main' 

Add a new Window Named '$global_main' to your help file project and use that window name instead. Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/ms670148(v=vs.85).aspx

Okay so you added the new window named $global_main', compiled the help file and placed the newly compiled help file in the WinBatch subdirectory then tested from WinBatch Studio? yet you are still getting two windows displayed?

Works for me. Attached is a recompiled version of your help file. Place this in your WinBatch subdirectory then test again.
Deana F.
Technical Support
Wilson WindowWare Inc.

JTaylor

Odd.   I still see the same behavior.   Opens the main file at Intro and then opens a second window with a Keyword Search pane and then the selected Topic opens in the other pane.  I've attached an image.

So, maybe it isn't an issue with the settings on my Help file publishing???  Not sure what else it could be.   Personally it isn't an issue for me but don't want to put something out there that creates problems for anyone or creates extra work for you.   Any other suggestions?  Any related settings in Studio?

Jim

JTaylor

Went back and double-checked the WEH file and noticed it had the wrong name under LOOKUP.  I changed that and now it seems to work so guess I'm doing something wrong in the Publish settings.

Jim