Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_RCLICK
If $fEdit Then
_Editor_LV_Save()
EndIf
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$iIndexItem = DllStructGetData($tInfo, 'Index')
$iIndexSubItem = DllStructGetData($tInfo, 'SubItem')
If $iIndexSubItem <> -1 Then
$iLast_LV_SubIndex = $iIndexSubItem
EndIf
If $iIndexItem <> -1 Then
$iLast_LV_Index = $iIndexItem
For $i = 0 To $iCountRow
GUICtrlSetState($aChangeSubMenu[$i], $GUI_ENABLE)
Next
GUICtrlSetState($aChangeSubMenu[$iIndexItem], $GUI_DISABLE)
ShowMenu($hWnd, $nContextMenu, $hListView, 1)
EndIf
Case $NM_DBLCLK
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$iIndexItem = DllStructGetData($tInfo, 'Index')
$iIndexSubItem = DllStructGetData($tInfo, 'SubItem')
If $iIndexSubItem <> -1 Then
$iLast_LV_SubIndex = $iIndexSubItem
EndIf
If $iIndexItem <> -1 Then
$iLast_LV_Index = $iIndexItem
EndIf
If Not $fEdit Then
_Editor_LV_Show()
EndIf
Case $NM_CLICK, $NM_KILLFOCUS, $LVN_COLUMNCLICK
If $fEdit Then
_Editor_LV_Save()
EndIf
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func WM_NOTIFY2($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTreeview, $fChecked
$hWndTreeview = $hTreeView
If Not IsHWnd($hTreeView) Then $hWndTreeview = GUICtrlGetHandle($hTreeView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
Case $hWndTreeview
Switch $iCode
Case $NM_CUSTOMDRAW
For $i = 1 To $a_hItem[0][0]
$a_hItem[$i][$a_hItem[0][1] + 2] = _GUICtrlTreeView_GetChecked($hWndFrom, $a_hItem[$i][0])
If $a_hItem[$i][$a_hItem[0][1] + 1] <> $a_hItem[$i][$a_hItem[0][1] + 2] Then
$a_hItem[$i][$a_hItem[0][1] + 1] = $a_hItem[$i][$a_hItem[0][1] + 2]
For $j = 1 To $a_hItem[0][1]
If $a_hItem[$i][$j] = True Then
_GUICtrlTreeView_SetChecked($hWndFrom, $a_hItem[$i][$j], $a_hItem[$i][$a_hItem[0][1] + 1])
EndIf
Next
EndIf
Next
Return 0
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iCode, $tNMHDR, $hWndListView, $tInfo, $hWndTreeview, $fChecked
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
$hWndTreeview = $hTreeView
If Not IsHWnd($hTreeView) Then $hWndTreeview = GUICtrlGetHandle($hTreeView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_RCLICK
If $fEdit Then
_Editor_LV_Save()
EndIf
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$iIndexItem = DllStructGetData($tInfo, 'Index')
$iIndexSubItem = DllStructGetData($tInfo, 'SubItem')
If $iIndexSubItem <> -1 Then
$iLast_LV_SubIndex = $iIndexSubItem
EndIf
If $iIndexItem <> -1 Then
$iLast_LV_Index = $iIndexItem
For $i = 0 To $iCountRow
GUICtrlSetState($aChangeSubMenu[$i], $GUI_ENABLE)
Next
GUICtrlSetState($aChangeSubMenu[$iIndexItem], $GUI_DISABLE)
ShowMenu($hWnd, $nContextMenu, $hListView, 1)
EndIf
Case $NM_DBLCLK
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$iIndexItem = DllStructGetData($tInfo, 'Index')
$iIndexSubItem = DllStructGetData($tInfo, 'SubItem')
If $iIndexSubItem <> -1 Then
$iLast_LV_SubIndex = $iIndexSubItem
EndIf
If $iIndexItem <> -1 Then
$iLast_LV_Index = $iIndexItem
EndIf
If Not $fEdit Then
_Editor_LV_Show()
EndIf
Case $NM_CLICK, $NM_KILLFOCUS, $LVN_COLUMNCLICK
If $fEdit Then
_Editor_LV_Save()
EndIf
EndSwitch
Case $hWndTreeview
Switch $iCode
Case $NM_CUSTOMDRAW
For $i = 1 To $a_hItem[0][0]
$a_hItem[$i][$a_hItem[0][1] + 2] = _GUICtrlTreeView_GetChecked($hWndFrom, $a_hItem[$i][0])
If $a_hItem[$i][$a_hItem[0][1] + 1] <> $a_hItem[$i][$a_hItem[0][1] + 2] Then
$a_hItem[$i][$a_hItem[0][1] + 1] = $a_hItem[$i][$a_hItem[0][1] + 2]
For $j = 1 To $a_hItem[0][1]
If $a_hItem[$i][$j] = True Then
_GUICtrlTreeView_SetChecked($hWndFrom, $a_hItem[$i][$j], $a_hItem[$i][$a_hItem[0][1] + 1])
EndIf
Next
EndIf
Next
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Автор темы | Похожие темы | Форум | Ответы | Дата |
---|---|---|---|---|
#pragma compile не работает | Общие вопросы по AutoIt | 4 | ||
R | cURL не работает в билде | Общие вопросы по AutoIt | 0 | |
R | _ScreenCapture_Capture не работает в цикле. | Общие вопросы по AutoIt | 2 | |
I | Цикл работает не правильно | Общие вопросы по AutoIt | 2 | |
W | Не работает Au3info | Общие вопросы по AutoIt | 1 |