Author Topic: Detect index of selection from droplistbox  (Read 26626 times)

JTaylor

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #35 on: April 25, 2014, 03:31:37 pm »
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

OK; this:

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

works.

JTaylor

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #36 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.    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


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

  • Sr. Member
  • ****
  • Posts: 271
Re: Detect index of selection from droplistbox
« Reply #37 on: April 25, 2014, 04:32:03 pm »
From what I could see the Title option is "all or none" also, no?

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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #38 on: April 25, 2014, 04:52:45 pm »
You can't change the color but you can have it display an Icon.

Jim

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


stevengraff

  • Sr. Member
  • ****
  • Posts: 271
Re: Detect index of selection from droplistbox
« Reply #39 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.

JTaylor

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #40 on: April 25, 2014, 07:32:54 pm »
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

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

  • Sr. Member
  • ****
  • Posts: 271
Re: Detect index of selection from droplistbox
« Reply #41 on: April 25, 2014, 08:23:05 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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #42 on: April 26, 2014, 04:38:21 am »
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



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

  • Sr. Member
  • ****
  • Posts: 271
Re: Detect index of selection from droplistbox
« Reply #43 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?

JTaylor

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #44 on: April 26, 2014, 12:45:47 pm »
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

  • Sr. Member
  • ****
  • Posts: 271
Re: Detect index of selection from droplistbox
« Reply #45 on: April 26, 2014, 12:59:41 pm »
Yes, thanks, we're looking good!


Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Deana F.
Technical Support
Wilson WindowWare Inc.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Detect index of selection from droplistbox
« Reply #47 on: April 28, 2014, 09:11:21 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

Quote
HFx <equals> HelpFileName  HelpFileType

In this case in might look something like:

Code: [Select]
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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #48 on: April 28, 2014, 09:23:39 am »
Anything I need to do with Help File to make that work well?

Jim

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Detect index of selection from droplistbox
« Reply #49 on: April 28, 2014, 09:25:00 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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #50 on: April 28, 2014, 09:55:13 am »
Most were but found 3-4 that weren't...

Jim


Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Detect index of selection from droplistbox
« Reply #51 on: April 28, 2014, 09:59:30 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

  • Sr. Member
  • ****
  • Posts: 271
Re: Detect index of selection from droplistbox
« Reply #52 on: April 29, 2014, 01:20:37 pm »
An embarrassment of riches... now two of them pop up for a shift-F1!

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Detect index of selection from droplistbox
« Reply #53 on: April 29, 2014, 01:32:40 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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #54 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

JTaylor

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #55 on: April 29, 2014, 01:59:26 pm »
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

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Detect index of selection from droplistbox
« Reply #56 on: April 29, 2014, 02:13:09 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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #57 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


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

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Detect index of selection from droplistbox
« Reply #58 on: April 29, 2014, 03:05:07 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


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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #59 on: April 29, 2014, 05:48:23 pm »
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

  • Pundit
  • *****
  • Posts: 907
    • Data & Stuff Inc.
Re: Detect index of selection from droplistbox
« Reply #60 on: April 29, 2014, 06:41:07 pm »
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