PDA

View Full Version : How to create more than one File Browse Dialog within the same dialog panel



klosezhang
09-17-2013, 11:40 PM
Hi all,

I had a read for creating File Browse Dialog according to http://helpnet.installshield.com/installshield16helplib/FileOpenDialog-HowTo.htm
which is great.

However, my problem is I need to create more than one file browse dialog within the same panel. And when I implement the solution as mentioned in the above link, it always set the selected file path into the first editable text field, even I have multiple "browse“ buttons appended after other text fields. And I cannot find the solution to specify the target text field from "FileBrowse.dll"

Please advise.

Thank you.

hidenori
09-18-2013, 01:48 PM
You can accomplish your requirement by using a different property for each text field control. For example, associate IS_BROWSE_FILEBROWSED1 with the first text field, and IS_BROWSE_FILEBROWSED2 with the second one. Also, you need to change the behavior of the browse buttons to set the new properties from the value of the IS_BROWSE_FILEBROWSED property after FileBrowse dialog is finished.

To do so, add a new event with the following settings to the first browse button :

Event: [IS_BROWSE_FILEBROWSED]
Argument: [IS_BROWSE_FILEBROWSED1]
Condition: 1

To the second browse button, add a new event with the following settings :

Event: [IS_BROWSE_FILEBROWSED]
Argument: [IS_BROWSE_FILEBROWSED2]
Condition: 1

Note that the new events needs to be called after the event that launches the FileBrowse dialog.

Hope that helps.

klosezhang
09-18-2013, 08:35 PM
Thank you very much for the reply! However, the solution requires creating a new event which receives argument to specify the text field name. I am not able to find where I can create event in InstallShield Spring 2012.

Thank you very much.
Regards,



You can accomplish your requirement by using a different property for each text field control. For example, acoociate IS_BROWSE_FILEBROWSED1 with the first text field, and IS_BROWSE_FILEBROWSED2 with the second one. Also, you need to change the behavior of the browse buttons to set the new properties from the value of the IS_BROWSE_FILEBROWSED property after FileBrowse dialog is finished.

To do so, add a new event with the following settings to the first browse button :

Event: [IS_BROWSE_FILEBROWSED]
Argument: [IS_BROWSE_FILEBROWSED1]
Condition: 1

To the second browse button, add a new event with the following settings :

Event: [IS_BROWSE_FILEBROWSED]
Argument: [IS_BROWSE_FILEBROWSED2]
Condition: 1

Note that the new events needs to be called after the event that launches the FileBrowse dialog.

Hope that helps.

hidenori
09-19-2013, 01:43 PM
Please check out the "To add the Open dialog functionality to an end-user dialog:" section of the Launch a File Open Dialog (http://helpnet.installshield.com/installshield16helplib/HelpLib.htm#FileOpenDialog-HowTo.htm) help topic. The step 2. illustrates how to add a new event to your browse buttons.

klosezhang
09-19-2013, 07:37 PM
Thank you hidenori

Yes I saw that part, however, it requires to choose the event as "DoAction", with Argument "FileBrowser" which points to "<ISProductFolder>\redist\language independent\i386\FileBrowse.dll"

While your solution is
Event: [IS_BROWSE_FILEBROWSED]
Argument: [IS_BROWSE_FILEBROWSED1]
Condition: 1

I don't know how to create event "[IS_BROWSE_FILEBROWSED]" as it is not listed in the event select drop down list, and I doubt if it will work if I just enter "[IS_BROWSE_FILEBROWSED]" into Event dropdown list as it is yet not defined.

Thanks.
Regards


Please check out the "To add the Open dialog functionality to an end-user dialog:" section of the Launch a File Open Dialog (http://helpnet.installshield.com/installshield16helplib/HelpLib.htm#FileOpenDialog-HowTo.htm) help topic. The step 2. illustrates how to add a new event to your browse buttons.

hidenori
09-19-2013, 08:42 PM
You can simply type "[IS_BROWSE_FILEBROWSED]" into the Event setting. The syntax for the SetProperty event is different than for other ControlEvents. See the SetProperty ControlEvent (http://msdn.microsoft.com/en-us/library/windows/desktop/aa371695(v=vs.85).aspx) help topic for more information.

klosezhang
09-20-2013, 12:56 AM
Hi I have tried with type in with you suggested, along with argument and condition, but it does not work. The button doesn't response when pressed.

The I tried with inserting "DoAction" with argument "FileBrowse" before event "[IS_BROWSE_FILEBROWSED]", the file browser then launches, but still only set to the first editable text field, instead of what I have specified (Argument: [IS_BROWSE_FILEBROWSED1]) in event "[IS_BROWSE_FILEBROWSED]"






You can simply type "[IS_BROWSE_FILEBROWSED]" into the Event setting. The syntax for the SetProperty event is different than for other ControlEvents. See the SetProperty ControlEvent (http://msdn.microsoft.com/en-us/library/windows/desktop/aa371695(v=vs.85).aspx) help topic for more information.

hidenori
09-20-2013, 10:47 AM
Since you want to set IS_BROWSE_FILEBROWSED1 and IS_BROWSE_FILEBROWSED2 to the value of IS_BROWSE_FILEBROWSED, the Event and Argument settings may need to be switched as follows. Can you try?

Event: [IS_BROWSE_FILEBROWSED1]
Argument: [IS_BROWSE_FILEBROWSED]
Condition: 1

Event: [IS_BROWSE_FILEBROWSED2]
Argument: [IS_BROWSE_FILEBROWSED]
Condition: 1

klosezhang
09-22-2013, 11:34 PM
Thank you Hidenori,

I did try with that. And the behavior I observed is:
When the 1st browse button is pressed (And the file is then selected), the 1st edit field (IS_BROWSE_FILEBROWSED1) is set.
Then 2nd browse button is pressed, the 1st and the 2nd edit field (IS_BROWSE_FILEBROWSED2) are both set.

Then I go back to press the 1st browse button, the 1st edit field is set, the 2nd edit field remains the same (Unchanged).

Thanks.



Since you want to set IS_BROWSE_FILEBROWSED1 and IS_BROWSE_FILEBROWSED2 to the value of IS_BROWSE_FILEBROWSED, the Event and Argument settings may need to be switched as follows. Can you try?

Event: [IS_BROWSE_FILEBROWSED1]
Argument: [IS_BROWSE_FILEBROWSED]
Condition: 1

Event: [IS_BROWSE_FILEBROWSED2]
Argument: [IS_BROWSE_FILEBROWSED]
Condition: 1

Seuliommvf
11-28-2016, 04:33 AM
What a bug I found the solution alone. InstallShield is not cheap at all and is a giant bug I get an internal error just when I choose more than one language and you know why? Just because I dont suply the product version.

???? GTA http://sanandreasgames.ru/