From 5ea2cd44c1766710bf6c944a1889e1e47c8bd15d Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Tue, 3 Oct 2006 15:04:51 -0700 Subject: [PATCH] msi: Subscribe the SelectionTree control to the SelectionPath event. --- dlls/msi/dialog.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index ff9e1467fb0..2ffc3dbff08 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -147,6 +147,7 @@ static const WCHAR szDirectoryList[] = { 'D','i','r','e','c','t','o','r','y','L' static const WCHAR szVolumeCostList[] = { 'V','o','l','u','m','e','C','o','s','t','L','i','s','t',0 }; static const WCHAR szSelectionDescription[] = {'S','e','l','e','c','t','i','o','n','D','e','s','c','r','i','p','t','i','o','n',0}; static const WCHAR szSelectionPath[] = {'S','e','l','e','c','t','i','o','n','P','a','t','h',0}; +static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0}; static UINT msi_dialog_checkbox_handler( msi_dialog *, msi_control *, WPARAM ); static void msi_dialog_checkbox_sync_state( msi_dialog *, msi_control * ); @@ -155,7 +156,7 @@ static UINT msi_dialog_edit_handler( msi_dialog *, msi_control *, WPARAM ); static UINT msi_dialog_radiogroup_handler( msi_dialog *, msi_control *, WPARAM param ); static UINT msi_dialog_evaluate_control_conditions( msi_dialog *dialog ); static LRESULT WINAPI MSIRadioGroup_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); - +static MSIFEATURE *msi_seltree_get_selected_feature( msi_control *control ); /* dialog sequencing */ @@ -578,6 +579,11 @@ void msi_dialog_handle_event( msi_dialog* dialog, LPCWSTR control, break; } } + else if ( !lstrcmpW(attribute, szProperty) ) + { + MSIFEATURE *feature = msi_seltree_get_selected_feature( ctrl ); + MSI_SetPropertyW( dialog->package, ctrl->property, feature->Directory ); + } else { FIXME("Attribute %s not being set\n", debugstr_w(attribute)); @@ -1770,6 +1776,12 @@ msi_seltree_menu( HWND hwnd, HTREEITEM hItem ) return 0; } +static MSIFEATURE *msi_seltree_get_selected_feature( msi_control *control ) +{ + struct msi_selection_tree_info *info = GetPropW(control->hwnd, szButtonData); + return msi_seltree_feature_from_item( control->hwnd, info->selected ); +} + static LRESULT WINAPI MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -1973,6 +1985,9 @@ static UINT msi_dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec ) (LONG_PTR)MSISelectionTree_WndProc ); SetPropW( control->hwnd, szButtonData, info ); + ControlEvent_SubscribeToEvent( dialog->package, dialog, + szSelectionPath, control->name, szProperty ); + /* initialize it */ msi_seltree_create_imagelist( control->hwnd ); msi_seltree_add_child_features( package, control->hwnd, NULL, NULL );