Hi,
My requirement is fill a ListBox in runtime and display the description of the Selected item in a Text control. Please help.....
Hari
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
ListBox in a custom Dialog with Selection Event
Started by
tohareee
, Jan 24 2006 16:14
6 replies to this topic
Posted 24 January 2006 - 21:07
It shouldn't be too hard to fill a listbox at run-time, you need to write a custom action that adds records to the listbox table. For an example see http://www.installsi...s/MultiListBox/
Showing a 'description text' for the selected item is almost impossible. The one solution I can think of is dynamically generating labels, for every listbox item one label, all at the same position, same size etc. Every label gets a description gets two subscriptions to the listbox property, to show when the listbox property gets the corresponding value, and to hide for every other value.
I never tested whether this concept works (I tend to think it does), the requirement was dropped...
Showing a 'description text' for the selected item is almost impossible. The one solution I can think of is dynamically generating labels, for every listbox item one label, all at the same position, same size etc. Every label gets a description gets two subscriptions to the listbox property, to show when the listbox property gets the corresponding value, and to hide for every other value.
I never tested whether this concept works (I tend to think it does), the requirement was dropped...
Posted 25 January 2006 - 10:44
Ehhh
"Every label gets a description gets two subscriptions..."
should be
"Every label gets a description and two control conditions..."
"Every label gets a description gets two subscriptions..."
should be
"Every label gets a description and two control conditions..."
Posted 11 August 2008 - 04:03
HI All,
I can write some thing into text but, I need event to do that.
In fact, selecting item from listbox, then click one button to call Custom action so i can set that item's information to text description.
some thing like that
---------------------------------------------------------------
query = "SELECT * FROM `Control` WHERE `Dialog_` = 'LicenseAgreementDlg' AND `Control` = 'LicenseText'"
Set view = database.OpenView(query)
view.Execute
Set record = view.Fetch
If Not record Is Nothing Then
'Msgbox("DATA: "& record.StringData(10))
view.Modify msiViewModifyDelete, record
End if
record.StringData(10) = "Press Accept Button to change, Text there"
'Msgbox("DATA: "& record.StringData(10))
view.Modify msiViewModifyInsertTemp, record
--------------------------------------------------------------
But Selecting directly item i can not call my custom action.
Anybody can help me
I can write some thing into text but, I need event to do that.
In fact, selecting item from listbox, then click one button to call Custom action so i can set that item's information to text description.
some thing like that
---------------------------------------------------------------
query = "SELECT * FROM `Control` WHERE `Dialog_` = 'LicenseAgreementDlg' AND `Control` = 'LicenseText'"
Set view = database.OpenView(query)
view.Execute
Set record = view.Fetch
If Not record Is Nothing Then
'Msgbox("DATA: "& record.StringData(10))
view.Modify msiViewModifyDelete, record
End if
record.StringData(10) = "Press Accept Button to change, Text there"
'Msgbox("DATA: "& record.StringData(10))
view.Modify msiViewModifyInsertTemp, record
--------------------------------------------------------------
But Selecting directly item i can not call my custom action.
Anybody can help me
Posted 11 August 2008 - 12:37
A change of selection in a list box will not fire an event, so you can't get Windows Installer to call your CA. So you should either stick to your solution with an extra button (label it "More information..." just might do it) or use a workaround like I stated above.
Posted 12 August 2008 - 06:22
Thanks for answer so much
I tried to create listbox's event following
<Control Id="ListedApp" Type="ListBox" X="125" Y="20" Width="240" Height="90"
Sunken="yes" >
<Publish Event="DoAction"
Value="DescribeModel"><![CDATA[1]]>
</Publish>
</Control>
But it seem to dialog's event. Because, although i clicked nothing from listbox, but when my dialog appear, that event (my Custom action) is called.
furthermore, when i click another button, that event one more time is called.
Have you any ideal for that,
looking forward your answer
THINH
I tried to create listbox's event following
<Control Id="ListedApp" Type="ListBox" X="125" Y="20" Width="240" Height="90"
Sunken="yes" >
<Publish Event="DoAction"
Value="DescribeModel"><![CDATA[1]]>
</Publish>
</Control>
But it seem to dialog's event. Because, although i clicked nothing from listbox, but when my dialog appear, that event (my Custom action) is called.
furthermore, when i click another button, that event one more time is called.
Have you any ideal for that,
looking forward your answer
THINH
Posted 12 August 2008 - 07:18
HI everyone,
in fact there are no event for only listbox, but we can use dialog event for anything we want.
Firstly you must set Listbox's property as LISTBOX_PRO
when you click on LISTBOX's Item the value of item will set to LISTBOX_PRO.
then, you have use remember LISTBOX_PRO after clicked on that item on property PV_ LISTBOX_PRO
Just when LISTBOX_PRO is different form PV_ LISTBOX_PRO, It will call your Custom Action
you can refer my code following
<Control Id="ListedApp" Type="ListBox" X="125" Y="20" Width="240" Height="90"
Property="LISTBOX_PRO" Sunken="yes" >
<Publish Event="DoAction"
Value="Your C.A"><![CDATA[LISTBOX_PRO <> PV_ LISTBOX_PRO]]>
</Publish>
</Control>
Have enjoined
Good luck
THINH
in fact there are no event for only listbox, but we can use dialog event for anything we want.
Firstly you must set Listbox's property as LISTBOX_PRO
when you click on LISTBOX's Item the value of item will set to LISTBOX_PRO.
then, you have use remember LISTBOX_PRO after clicked on that item on property PV_ LISTBOX_PRO
Just when LISTBOX_PRO is different form PV_ LISTBOX_PRO, It will call your Custom Action
you can refer my code following
<Control Id="ListedApp" Type="ListBox" X="125" Y="20" Width="240" Height="90"
Property="LISTBOX_PRO" Sunken="yes" >
<Publish Event="DoAction"
Value="Your C.A"><![CDATA[LISTBOX_PRO <> PV_ LISTBOX_PRO]]>
</Publish>
</Control>
Have enjoined
Good luck
THINH
Edited by thinhtx, 12 August 2008 - 07:19.