Пример #1
0
void CQListCtrl::OnTimer(UINT_PTR nIDEvent) 
{
	if(nIDEvent == TIMER_SHOW_PROPERTIES)
	{
		if( theApp.m_bShowingQuickPaste )
			ShowFullDescription(true);
		KillTimer(TIMER_SHOW_PROPERTIES);
	}
	
	CListCtrl::OnTimer(nIDEvent);
}
Пример #2
0
void CQListCtrl::OnTimer(UINT_PTR nIDEvent) 
{
	//http://support.microsoft.com/kb/200054
	//OnTimer() Is Not Called Repeatedly for a List Control
	bool callBase = true;

	switch(nIDEvent)
	{
		case TIMER_SHOW_PROPERTIES:
			{
				if( theApp.m_bShowingQuickPaste )
					ShowFullDescription(true);
				KillTimer(TIMER_SHOW_PROPERTIES);

				callBase = false;
			}
			break;

		case TIMER_HIDE_SCROL:
			{
				CPoint cursorPos;
				GetCursorPos(&cursorPos);

				CRect crWindow;
				this->GetWindowRect(&crWindow);

				

				//check and see if they moved out of the scroll area
				//If they did tell our parent so
				if(MouseInScrollBarArea(crWindow, cursorPos) == false)
				{
					StopHideScrollBarTimer();
				}

				callBase = false;
			}
			break;

		case TIMER_SHOW_SCROLL:
			{
				CPoint cursorPos;
				GetCursorPos(&cursorPos);

				CRect crWindow;
				this->GetWindowRect(&crWindow);

				//Adjust for the v-scroll bar being off of the screen
				crWindow.right -= theApp.m_metrics.ScaleX(GetSystemMetrics(SM_CXVSCROLL));
				crWindow.bottom -= theApp.m_metrics.ScaleX(::GetSystemMetrics(SM_CXHSCROLL));

				//Check and see if we are still in the cursor area
				if(MouseInScrollBarArea(crWindow, cursorPos))
				{
					m_timerToHideScrollAreaSet = true;
					GetParent()->SendMessage(NM_SHOW_HIDE_SCROLLBARS, 1, 0);

					//Start looking to hide the scroll bars
					SetTimer(TIMER_HIDE_SCROL, 1000, NULL);
				}

				KillTimer(TIMER_SHOW_SCROLL);

				callBase = false;
			}
			break;
	}
	
	if(callBase)
	{
		CListCtrl::OnTimer(nIDEvent);
	}
}
Пример #3
0
BOOL CQListCtrl::HandleKeyDown(WPARAM wParam, LPARAM lParam)
{
	if(m_pToolTip)
	{
		MSG Msg;
		Msg.lParam = lParam;
		Msg.wParam = wParam;
		Msg.message = WM_KEYDOWN;
		if(m_pToolTip->OnMsg(&Msg))
			return TRUE;
	}

	WPARAM vk = wParam;
				
	// if a number key was pressed
	if('0' <= vk && vk <= '9')
	{
		// if <Ctrl> is required but is absent, then break
		if(g_Opt.m_bUseCtrlNumAccel && !(GetKeyState(VK_CONTROL) & 0x8000))
			return FALSE;
		
		int index = (int)vk - '0';
		// '0' is actually 10 in the ditto window
		if(index == 0)
			index = 10;
		// translate num 1-10 into the actual index (based upon m_bStartTop)
		index = GetFirstTenIndex(index);
		GetParent()->SendMessage(NM_SELECT_INDEX, index, 0);
		return TRUE;
	}

	if(VK_NUMPAD0 <= vk && vk <= VK_NUMPAD9)
	{
		// if <Ctrl> is required but is absent, then break
		if( g_Opt.m_bUseCtrlNumAccel && !(GetKeyState(VK_CONTROL) & 0x8000) )
			return FALSE;
		
		int index = (int)vk - VK_NUMPAD0;
		// '0' is actually 10 in the ditto window
		if(index == 0)
			index = 10;
		
		// translate num 1-10 into the actual index (based upon m_bStartTop)
		index = GetFirstTenIndex(index);
		GetParent()->SendMessage(NM_SELECT_INDEX, index, 0);
		return TRUE;
	}
	
	switch( vk )
	{
	case 'X': // Ctrl-X = Cut (prepare for moving the items into a Group)
		if(GetKeyState(VK_CONTROL) & 0x8000)
		{
			LoadCopyOrCutToClipboard();		
			
			theApp.IC_Cut(); // uses selection
			return TRUE;
		}
		break;
		
	case 'C': // Ctrl-C = Copy (prepare for copying the items into a Group)
		if(GetKeyState(VK_CONTROL) & 0x8000)
		{
			LoadCopyOrCutToClipboard();
			
			theApp.IC_Copy(); // uses selection
			return TRUE;
		}
		break;
		
	case 'V': // Ctrl-V = Paste (actually performs the copy or move of items into the current Group)
		if(GetKeyState(VK_CONTROL) & 0x8000)
		{
			theApp.IC_Paste();
			return TRUE;
		}
		break;
		
	case 'A': // Ctrl-A = Select All
		if(GetKeyState(VK_CONTROL) & 0x8000)
		{
			int nCount = GetItemCount();
			for(int i = 0; i < nCount; i++)
			{
				SetSelection(i);
			}
			return TRUE;
		}
		break;
		
	case VK_F3:
		{
			ShowFullDescription();
			return TRUE;
		}
	case VK_BACK:
		theApp.EnterGroupID( theApp.m_GroupParentID );
		return TRUE;
	case VK_SPACE:
		if(GetKeyState(VK_CONTROL) & 0x8000)
		{
			theApp.ShowPersistent( !g_Opt.m_bShowPersistent );
			return TRUE;
		}
		break;
	} // end switch(vk)
	
	return FALSE;
}