// We have to dispatch our own notify messages because the multiple inheritance of CCSHDialog prevents
// the message map from compiling properly for ON_NOTIFY messages.
BOOL CFailingRulesDialog::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult )
{
  LPNMHDR pHdr=(LPNMHDR)lParam;
  bool bHandled=false;
  switch(pHdr->idFrom){
    case IDC_LIST1:
      switch (pHdr->code) {
        case LVN_ITEMCHANGED: 
          bHandled=OnItemChanged(wParam, (LPNMLISTVIEW)lParam, pResult);
          break;
        case NM_CLICK: 
          bHandled=OnClick(wParam, (LPNMLISTVIEW)lParam, pResult);
          break;
        case NM_RCLICK: 
          bHandled=OnRClick(wParam, (LPNMITEMACTIVATE)lParam, pResult);
          break;
        default:
          break;
      }
      break;
    case IDC_LIST2:
      switch (pHdr->code) {
        case LVN_ITEMCHANGED: 
          bHandled=OnSolutionItemChanged(wParam,(LPNMLISTVIEW)lParam, pResult);
          break;
        default:
          break;
      }
      break;
  }
  return bHandled || CeCosDialog::OnNotify(wParam,lParam,pResult);
}
void CListCtrlEx::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	OnItemChanged (pNMListView);	
	*pResult = 0;
}
Exemple #3
0
	//--------------------------------------------------------------------------------
	long CTreeView::OnNotify( NotificationMessageHeader* pHdr )
	{
		_WINQ_FCONTEXT( "CTreeView::OnNotify" );
		long lResult = 0;

		if( pHdr != 0 )
		{
			switch ( pHdr->m_uiCode )
			{
			case NM_CLICK:
				{
					lResult = static_cast< long >( OnClick( pHdr ) ? 0 : 1 );
				}
				break;
			case NM_CUSTOMDRAW:
				{
					lResult = OnCustomDraw( reinterpret_cast< NMTVCUSTOMDRAW* >( pHdr ) );
				}
				break;
			case NM_DBLCLK:
				{
					lResult = static_cast< long >( OnDblClick( pHdr ) ? 0 : 1 );
				}
				break;
			case NM_KILLFOCUS:
				{
					OnKillFocus( pHdr );
				}
				break;
			case NM_RCLICK:
				{
					lResult = static_cast< long >( OnRClick( pHdr ) ? 0 : 1 );
				}
				break;
			case NM_RDBLCLK:
				{
					lResult = static_cast< long >( OnRDblClick( pHdr ) ? 0 : 1 );
				}
				break;
			case NM_RETURN:
				{
					lResult = static_cast< long >( OnReturn( pHdr ) ? 0 : 1 );
				}
				break;
#if		( _WIN32_IE >= 0x0400 )
			case NM_SETCURSOR:
				{
					lResult = static_cast< long >( OnSetCursor( reinterpret_cast< NMMOUSE* >( pHdr ) ) ? 0 : 1 );
				}
				break;
#endif//( _WIN32_IE >= 0x0400 )
			case NM_SETFOCUS:
				{
					OnSetFocus( pHdr );
				}
				break;
#if		( _WIN32_IE >= 0x0600 )
			case TVN_ASYNCDRAW:
				{
					OnAsyncDraw( reinterpret_cast< NMTVASYNCDRAW* >( pHdr ) );
				}
				break;
#endif//( _WIN32_IE >= 0x0600 )
			case TVN_BEGINDRAG:
				{
					OnBeginDrag( reinterpret_cast< NMTREEVIEW* >( pHdr ) );
				}
				break;
			case TVN_BEGINLABELEDIT:
				{
					lResult = static_cast< long >( OnBeginLabelEdit( reinterpret_cast< NMTVDISPINFO* >( pHdr ) ) ? 0 : 1 );
				}
				break;
			case TVN_BEGINRDRAG:
				{
					OnBeginRDrag( reinterpret_cast< NMTREEVIEW* >( pHdr ) );
				}
				break;
			case TVN_DELETEITEM:
				{
					OnDeleteItem( reinterpret_cast< NMTREEVIEW* >( pHdr ) );
				}
				break;
			case TVN_ENDLABELEDIT:
				{
					lResult = static_cast< long >( OnEndLabelEdit( reinterpret_cast< NMTVDISPINFO* >( pHdr ) ) ? 1 : 0 );
				}
				break;
			case TVN_GETDISPINFO:
				{
					OnGetDispInfo( reinterpret_cast< NMTVDISPINFO* >( pHdr ) );
				}
				break;
#if		( _WIN32_IE >= 0x0400 )
			case TVN_GETINFOTIP:
				{
					OnGetInfoTip( reinterpret_cast< NMTVGETINFOTIP* >( pHdr ) );
				}
				break;
#endif//( _WIN32_IE >= 0x0400 )
#if		( _WIN32_IE > 0x0600 )
			case TVN_ITEMCHANGED:
				{
					lResult = static_cast< long >( OnItemChanged( reinterpret_cast< NMTVITEMCHANGE* >( pHdr ) ) ? 0 : 1 );
				}
				break;
			case TVN_ITEMCHANGING:
				{
					lResult = static_cast< long >( OnItemChanging( reinterpret_cast< NMTVITEMCHANGE* >( pHdr ) ) ? 0 : 1 );
				}
				break;
#endif//( _WIN32_IE > 0x0600 )
			case TVN_ITEMEXPANDED:
				{
					OnItemExpanded( reinterpret_cast< NMTREEVIEW* >( pHdr ) );
				}
				break;
			case TVN_ITEMEXPANDING:
				{
					lResult = static_cast< long >( OnItemExpanding( reinterpret_cast< NMTREEVIEW* >( pHdr ) ) ? 0 : 1 );
				}
				break;
			case TVN_KEYDOWN:
				{
					lResult = static_cast< long >( OnKeyDown( reinterpret_cast< NMTVKEYDOWN* >( pHdr ) ) ? 0 : 1 );
				}
				break;
			case TVN_SELCHANGED:
				{
					OnSelChanged( reinterpret_cast< NMTREEVIEW* >( pHdr ) );
				}
				break;
			case TVN_SELCHANGING:
				{
					lResult = static_cast< long >( OnSelChanging( reinterpret_cast< NMTREEVIEW* >( pHdr ) ) ? 0 : 1 );
				}
				break;
			case TVN_SETDISPINFO:
				{
					OnSetDispInfo( reinterpret_cast< NMTVDISPINFO* >( pHdr ) );
				}
				break;
#if		( _WIN32_IE >= 0x0400 )
			case TVN_SINGLEEXPAND:
				{
					lResult = OnSingleExpand( reinterpret_cast< NMTREEVIEW* >( pHdr ) );
				}
				break;
#endif//( _WIN32_IE >= 0x0400 )
			default:
				{
					lResult = OnUnknownNotification( pHdr );
				}
				break;
			}
		}
		return lResult;
	}
LRESULT MainWindowPageScripts::MainWindowPageProc(UINT uMsg, WPARAM wParam, LPARAM lParam) {
    switch(uMsg) {
        case WM_SETFOCUS: {
            CHARRANGE cr = { 0, 0 };
            ::SendMessage(hWndPageItems[REDT_SCRIPTS_ERRORS], EM_EXSETSEL, 0, (LPARAM)&cr);
            ::SetFocus(hWndPageItems[REDT_SCRIPTS_ERRORS]);
            return 0;
		}
        case WM_WINDOWPOSCHANGED: {
            RECT rcMain = { 0, 0, ((WINDOWPOS*)lParam)->cx, ((WINDOWPOS*)lParam)->cy };
            SetSplitterRect(&rcMain);

            return 0;
        }
        case WM_COMMAND:
            switch(LOWORD(wParam)) {
                case BTN_OPEN_SCRIPT_EDITOR: {
                    OpenScriptEditor();
                    return 0;
                }
                case BTN_REFRESH_SCRIPTS:
                    RefreshScripts();
                    return 0;
                case BTN_MOVE_UP:
                    MoveUp();
                    return 0;
                case BTN_MOVE_DOWN:
                    MoveDown();
                    return 0;
                case BTN_RESTART_SCRIPTS:
                    RestartScripts();
                    return 0;
                case IDC_OPEN_IN_EXT_EDITOR:
                    OpenInExternalEditor();
                    return 0;
                case IDC_OPEN_IN_SCRIPT_EDITOR:
                    OpenInScriptEditor();
                    return 0;
                case IDC_DELETE_SCRIPT:
                    DeleteScript();
                    return 0;
            }

            if(RichEditCheckMenuCommands(hWndPageItems[REDT_SCRIPTS_ERRORS], LOWORD(wParam)) == true) {
                return 0;
            }

            break;
        case WM_CONTEXTMENU:
            OnContextMenu((HWND)wParam, lParam);
            break;
        case WM_NOTIFY:
            if(((LPNMHDR)lParam)->hwndFrom == hWndPageItems[LV_SCRIPTS]) {
                if(((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) {
                    OnItemChanged((LPNMLISTVIEW)lParam);
                } else if(((LPNMHDR)lParam)->code == NM_DBLCLK) {
                    if(((LPNMITEMACTIVATE)lParam)->iItem == -1) {
                        break;
                    }

                    OnDoubleClick((LPNMITEMACTIVATE)lParam);

                    return 0;
                }
            } else if(((LPNMHDR)lParam)->hwndFrom == hWndPageItems[REDT_SCRIPTS_ERRORS] && ((LPNMHDR)lParam)->code == EN_LINK) {
                if(((ENLINK *)lParam)->msg == WM_LBUTTONUP) {
                    RichEditOpenLink(pMainWindowPageScripts->hWndPageItems[MainWindowPageScripts::REDT_SCRIPTS_ERRORS], (ENLINK *)lParam);
                    return 1;
                }
            }

            break;
        case WM_DESTROY:
            g_GuiSettingManager->SetInteger(GUISETINT_SCRIPTS_SPLITTER, iPercentagePos);
            g_GuiSettingManager->SetInteger(GUISETINT_SCRIPT_NAMES, (int)::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_GETCOLUMNWIDTH, 0, 0));
            g_GuiSettingManager->SetInteger(GUISETINT_SCRIPT_MEMORY_USAGES, (int)::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_GETCOLUMNWIDTH, 1, 0));

            break;
    }

    if(BasicSplitterProc(uMsg, wParam, lParam) == true) {
    	return 0;
    }

	return ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
}