Beispiel #1
0
void dsp_preset_switcher::syncSelection( const int idx ) const
{
	for( t_size i = 0 , imax = dsp_preset_switcher::PARENT_HWND_LIST.get_count(); i < imax ; ++i )
	{
		uPostMessage( dsp_preset_switcher::PARENT_HWND_LIST[i] , WM_USER_SYNC_CHANGE , idx , 0 );
	}
	return;
}
Beispiel #2
0
VOID CALLBACK dspConfigCb::dsp_core_change_message( PVOID lpParameter , BOOLEAN TimerOrWaitFired )
{
	//console::printf( CONSOLE_HEADER "dsp_preset_switcher::PARENT_HWND_LIST.get_count(): %d" , dsp_preset_switcher::PARENT_HWND_LIST.get_count() );
	for( t_size i = 0 , imax = dsp_preset_switcher::PARENT_HWND_LIST.get_count(); i < imax ; ++i )
	{
		uPostMessage( dsp_preset_switcher::PARENT_HWND_LIST[i] , WM_USER_DSP_CORE_CHANGE , 0 , 0 );  // no point in blocking
	}
	return;
}
Beispiel #3
0
bool menu_extension::on_menuchar(unsigned short chr)
{
	{
		UINT id;
		if (SendMessage(wnd_menu,TB_MAPACCELERATOR,chr,(LPARAM)&id))
		{
			uPostMessage(get_wnd(),MSG_CREATE_MENU,id,TRUE);
			return true;
		}
	}
	return false;
}
Beispiel #4
0
bool menu_extension::on_hooked_message(message_hook_manager::t_message_hook_type p_type, int code, WPARAM wp, LPARAM lp)
{
	static POINT last_pt;

	if (code == MSGF_MENU)
	{
		switch(((MSG*)lp)->message)
		{

		case WM_LBUTTONDOWN:
		case WM_RBUTTONDOWN:
			{
				SendMessage(wnd_menu, TB_SETHOTITEM, -1, 0);
				if (((MSG*)lp)->message == WM_LBUTTONDOWN)
				{
					POINT pt; RECT toolbar;
					GetClientRect(get_wnd(), &toolbar);
					pt.y = GET_Y_LPARAM(((MSG*)lp)->lParam);
					pt.x = GET_X_LPARAM(((MSG*)lp)->lParam);


					if (ScreenToClient(wnd_menu, &pt) && PtInRect(&toolbar, pt))
					{
						t_size idx = SendMessage(wnd_menu, TB_HITTEST, 0, (long)&pt);

						if (idx >= 0 && idx < m_buttons.get_count())
							redrop = false;
					}
				}
			}
			break;
		case WM_KEYDOWN:
			{
				switch ( ((MSG*)lp)->wParam )
				{
				case VK_LEFT:
					if (!sub_menu_ref_count) 
					{
						destroy_menu();
						if (active_item==1) active_item = m_buttons.get_count(); else active_item--;
						uPostMessage(get_wnd(), MSG_CREATE_MENU, active_item, 0);
					}

					break;
				case VK_RIGHT:
					if (!is_submenu) 
					{
						destroy_menu();
						if (active_item==m_buttons.get_count()) active_item = 1; else active_item++;
						uPostMessage(get_wnd(), MSG_CREATE_MENU, active_item, 0);
					}
					break;
				case VK_ESCAPE:
					if (!sub_menu_ref_count) 
					{
						SetFocus(wnd_menu);
						SendMessage(wnd_menu, TB_SETHOTITEM, active_item-1, 0);
						destroy_menu();
					}
					break;
				}
			}
			break;

		case WM_MOUSEMOVE:
			{
				POINT px;
				px.y = GET_Y_LPARAM(((MSG*)lp)->lParam);
				px.x = GET_X_LPARAM(((MSG*)lp)->lParam);
				if (px.x != last_pt.x || px.y != last_pt.y)
				{
					HWND wnd_hit = WindowFromPoint(px);
					if (wnd_hit == wnd_menu)
					{
						POINT pt = px;
						int hot_item = SendMessage(wnd_menu, TB_GETHOTITEM, 0, 0);
						if (ScreenToClient(wnd_menu, &pt))
						{

							t_size idx = SendMessage(wnd_menu, TB_HITTEST, 0, (long)&pt);

							if (idx >= 0 && idx < m_buttons.get_count() && (active_item-1) != idx)
							{
								destroy_menu();
								active_item = idx+1; 
								uPostMessage(get_wnd(), MSG_CREATE_MENU, active_item, 0);
							} 
						}
					}
				}
				last_pt = px;
			}
			break;

		}
	}
	return false;
}
Beispiel #5
0
	inline void show_menu_acc() const
	{
		uPostMessage(get_wnd(), MSG_SHOW_MENUACC, 0, 0);
	}
Beispiel #6
0
	inline void update_menu_acc() const
	{
		uPostMessage(get_wnd(), MSG_HIDE_MENUACC, 0, 0);
	}