Exemple #1
0
void CFolderDialog::CallbackFunction(HWND hWnd, UINT uMsg,	LPARAM lParam)
{
	// Save the window handle. The Set* functions need it and they may
	//	be called by the virtual funtions.
	m_hDialogBox = hWnd;

	// Dispatch the two message types to the virtual functions
	switch (uMsg)
	{
	case BFFM_INITIALIZED:
		OnInitDialog();
		break;
	case BFFM_SELCHANGED:
		OnSelChanged((ITEMIDLIST*) lParam);
		break;
	}
}
Exemple #2
0
void HKWidgetListbox::SetSelection(int item)
{
	if(item >= (int)children.size())
		item = -1;

	if(selection != item)
	{
		if(selection > -1)
			children[selection].pChild->GetRenderer()->SetProperty("background_colour", "0,0,0,0");
		if(item > -1)
			children[item].pChild->GetRenderer()->SetProperty("background_colour", "0,0,1,0.6f");

		selection = item;

		HKWidgetSelectEvent ev(this, item);
		OnSelChanged(*this, ev);
	}
}
Exemple #3
0
//////////////////
// Handle notification from browser window: parse args and pass to specific
// virtual handler function.
//
int CFolderDialog::OnMessage(UINT msg, LPARAM lp)
{
	switch (msg) {
	case BFFM_INITIALIZED:
		OnInitialized();
		return 0;
	case BFFM_IUNKNOWN:
		OnIUnknown((IUnknown*)lp);
		return 0;
	case BFFM_SELCHANGED:
		OnSelChanged((LPCITEMIDLIST)lp);
		return 0;
	case BFFM_VALIDATEFAILED:
		return OnValidateFailed((LPCTSTR)lp);
	default:
		TRACE(_T("***Warning: unknown message %d in CFolderDialog::OnMessage\n"));
	}
	return 0;
}
// When we receive notification
//
BOOL CInfoListBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
{
	// If the notification is in the tree control
	if( ((NMHDR*) lParam)->idFrom == (UINT) m_wndMyListCtrl.GetDlgCtrlID() )
	{
		switch( ((NMHDR*) lParam)->code )
		{
		case NM_RCLICK:
			OnListRightClick();
			// Call the base class
			//return CSizingControlBar::OnNotify(wParam, lParam, pResult);
			return true;
		case NM_CLICK:
			OnListLeftClick();
			// Call the base class
			return CSizingControlBar::OnNotify(wParam, lParam, pResult);
		case NM_DBLCLK:
			OnListDblClick();
			return true;
		case TVN_KEYDOWN:
			OnKeyDown( ((LPNMLISTVIEW) lParam)->iItem );
			// Call the base class
			return CSizingControlBar::OnNotify(wParam, lParam, pResult);
		case TVN_SELCHANGED:
			OnSelChanged( (NMLISTVIEW*) lParam );
			return CSizingControlBar::OnNotify(wParam, lParam, pResult);
			break;
		default:
			// Call the base class
			// TRACE("notif : %i\n", ((NMHDR*) lParam)->code );
			return CSizingControlBar::OnNotify(wParam, lParam, pResult);
		}
	}
	else
	{
		// Call the base class
		return CSizingControlBar::OnNotify(wParam, lParam, pResult);
	}
	
}
Exemple #5
0
	void OnUp(wxCommandEvent& event)
	{
		wxCheckListBox* pListBox = XRCCTRL(*this, "ID_ACTIVE", wxCheckListBox);
		int sel = pListBox->GetSelection();
		if (sel < 2)
			return;

		int tmp;
		tmp = m_order[sel - 1];
		m_order[sel - 1] = m_order[sel];
		m_order[sel] = tmp;

		wxString name = pListBox->GetString(sel);
		bool checked = pListBox->IsChecked(sel);
		pListBox->Delete(sel);
		pListBox->Insert(name, sel - 1);
		pListBox->Check(sel - 1, checked);
		pListBox->SetSelection(sel - 1);

		wxCommandEvent evt;
		OnSelChanged(evt);
	}
Exemple #6
0
    void SComboBase::OnDestroyDropDown(SDropDownWnd *pDropDown)
    {
        if (!m_bDropdown && m_pEdit)
        {
            m_pEdit->SetFocus();
        }

        m_dwBtnState = WndState_Normal;
        m_pDropDownWnd=NULL;
        CRect rcBtn;
        GetDropBtnRect(&rcBtn);
        InvalidateRect(rcBtn);
        ModifyState(0,WndState_Hover,TRUE);
        CPoint pt;
        GetCursorPos(&pt);
        ScreenToClient(GetContainer()->GetHostHwnd(),&pt);
        ::PostMessage(GetContainer()->GetHostHwnd(),WM_MOUSEMOVE,0,MAKELPARAM(pt.x,pt.y));

        if(pDropDown->GetExitCode()==IDOK)
        {
            OnSelChanged();
        }

    }
Exemple #7
0
INT_PTR CALLBACK stats_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
    HWND dlg;
    LPNMHDR lpn = (LPNMHDR) lParam; 
    switch (uMsg) {
        case WM_INITDIALOG:
            dlg = CreateDialog(plugin.hDllInstance,
                               MAKEINTRESOURCE(IDD_PROCESSING),
                               hwndDlg, process_dlgproc);

            memset(tmp, 0, sizeof(tmp));
            GetPrivateProfileString("ml_stats", "query", "type = \"0\"",
                                    tmp, sizeof(tmp), iniFile);
            SetDlgItemText(hwndDlg, IDC_QUERY, tmp);
            m_pRecords = getRecords(tmp);

            TCITEM tie;
            m_hwndDlg = hwndDlg;
            m_hwndTab = GetDlgItem(hwndDlg, IDC_STATS_TABS);
            tie.mask = TCIF_TEXT;
            for (int i = 0; i < sizeof(tabs) / sizeof(pref_tab); i++) {
                tie.pszText = tabs[i].title;
                TabCtrl_InsertItem(m_hwndTab, i, &tie);
            }

            DestroyWindow(dlg);
            TabCtrl_SetCurSel(m_hwndTab, 0);
            OnSelChanged(hwndDlg);
            break;

        case WM_NOTIFY:
            if(lpn) if(lpn->code==TCN_SELCHANGE) OnSelChanged(hwndDlg);
            break;

		case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_ABOUT:
                    LoadString(plugin.hDllInstance, IDS_ABOUTBOX, tmp, sizeof(tmp));
                    MessageBox(hwndDlg, tmp, "Media Library Stastics",
                               MB_OK | MB_ICONINFORMATION);
                    break;

                case IDC_FILTER:
                    dlg = CreateDialog(plugin.hDllInstance,
                                       MAKEINTRESOURCE(IDD_PROCESSING),
                                       hwndDlg, process_dlgproc);
                    memset(tmp, 0, sizeof(tmp));
                    GetDlgItemText(hwndDlg, IDC_QUERY, tmp, sizeof(tmp));
                    m_pRecords = getRecords(tmp);
                    DestroyWindow(dlg);
                    OnSelChanged(hwndDlg);
                    break;

               case IDOK:
                    memset(tmp, 0, sizeof(tmp));
                    GetDlgItemText(hwndDlg, IDC_QUERY, tmp, sizeof(tmp));
                    WritePrivateProfileString("ml_stats", "query", tmp, iniFile);
                case IDCANCEL:
                    EndDialog(hwndDlg, 0);
					break;
            }
            break;
    }

    return 0;
}
Exemple #8
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;
	}