Click here to Skip to main content
15,911,896 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Embedded Data Pin
CPallini9-Sep-08 21:06
mveCPallini9-Sep-08 21:06 
GeneralRe: Embedded Data Pin
Hamid_RT10-Sep-08 0:44
Hamid_RT10-Sep-08 0:44 
GeneralRe: Embedded Data Pin
CPallini10-Sep-08 0:59
mveCPallini10-Sep-08 0:59 
GeneralRe: Embedded Data Pin
Hamid_RT10-Sep-08 9:33
Hamid_RT10-Sep-08 9:33 
AnswerRe: Embedded Data Pin
claman9-Sep-08 6:35
claman9-Sep-08 6:35 
GeneralRe: Embedded Data Pin
thebeekeeper9-Sep-08 7:03
thebeekeeper9-Sep-08 7:03 
AnswerRe: Embedded Data Pin
Bram van Kampen9-Sep-08 8:33
Bram van Kampen9-Sep-08 8:33 
QuestionHow to Change Focus on Tree View with Mouse Click Pin
Stuck At Zero9-Sep-08 3:35
Stuck At Zero9-Sep-08 3:35 
The problem is I have 8 root nodes. By default the program is focused on the 1st root node. Whenever I click on any other root node (or their descendants), the program is still indexing the 1st root node.

The reason seems to be how one can highlight a node via the keyboard arrow keys. If I use the keyboard to highlight a different node, then the focus is changed. Mouse clicks seem to do absolutely nothing with changing the focus to a different node.

I am wondering how I can force my app to change whatever node it is currently focused on to the one the user specifies by left-clicking with their mouse. The "mouse click" focus is currently non-existent, and the keyboard focus is what is driving things which is what I do not want.

BOOL CViewFilter::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
	CDialog::OnNotify(wParam, lParam, pResult);
	// TODO: Add your specialized code here and/or call the base class
	if (wParam == IDC_TREE1)
	{
		NMHDR *pHdr = (NMHDR *)lParam;

		if (pHdr->code == NM_CLICK)
		{
			HTREEITEM hItem = m_filterTreeCtrl.GetSelectedItem();  // Keyboard Highlighted Selection... Not Mouse Clicked Node

			if ((hItem != 0) && (m_filterTreeCtrl.GetCheck(hItem) == 0))
			{
				// Deselect All Subsequent Children Nodes
				//SetDecendentNodesOff(hItem);
				SetDecendentNodesOn(hItem);  // Backwards due to focused node not changing state immediately after click
			}
			else if ((hItem != 0) && (m_filterTreeCtrl.GetCheck(hItem) == 1))
			{
				// Select All Subsequent Children Nodes
				//SetDecendentNodesOn(hItem);
				SetDecendentNodesOff(hItem);// Backwards due to focused node not changing state immediately after click
			}
		}
	}

	return CDialog::OnNotify(wParam, lParam, pResult);
}

AnswerRe: How to Change Focus on Tree View with Mouse Click Pin
Mark Salsbery9-Sep-08 5:23
Mark Salsbery9-Sep-08 5:23 
GeneralRe: How to Change Focus on Tree View with Mouse Click Pin
Stuck At Zero9-Sep-08 6:13
Stuck At Zero9-Sep-08 6:13 
GeneralRe: How to Change Focus on Tree View with Mouse Click Pin
Mark Salsbery9-Sep-08 6:29
Mark Salsbery9-Sep-08 6:29 
GeneralRe: How to Change Focus on Tree View with Mouse Click Pin
Stuck At Zero9-Sep-08 6:36
Stuck At Zero9-Sep-08 6:36 
QuestionInstalling drivers and Inno Setup Pin
AnithaSubramani9-Sep-08 2:47
AnithaSubramani9-Sep-08 2:47 
QuestionRe: Installing drivers and Inno Setup Pin
sashoalm9-Sep-08 5:08
sashoalm9-Sep-08 5:08 
AnswerRe: Installing drivers and Inno Setup [modified] Pin
AnithaSubramani9-Sep-08 18:56
AnithaSubramani9-Sep-08 18:56 
GeneralRe: Installing drivers and Inno Setup Pin
sashoalm9-Sep-08 23:40
sashoalm9-Sep-08 23:40 
QuestionLeft Click on CHeaderCtrl for a ListCtrl Pin
PrincessLily9-Sep-08 2:31
PrincessLily9-Sep-08 2:31 
AnswerRe: Left Click on CHeaderCtrl for a ListCtrl Pin
Michael Dunn9-Sep-08 14:21
sitebuilderMichael Dunn9-Sep-08 14:21 
GeneralRe: Left Click on CHeaderCtrl for a ListCtrl Pin
PrincessLily9-Sep-08 20:58
PrincessLily9-Sep-08 20:58 
QuestionArray Variable initialization Pin
T.RATHA KRISHNAN9-Sep-08 2:29
T.RATHA KRISHNAN9-Sep-08 2:29 
AnswerRe: Array Variable initialization Pin
toxcct9-Sep-08 2:32
toxcct9-Sep-08 2:32 
GeneralRe: Array Variable initialization Pin
T.RATHA KRISHNAN9-Sep-08 2:39
T.RATHA KRISHNAN9-Sep-08 2:39 
GeneralRe: Array Variable initialization Pin
toxcct9-Sep-08 2:42
toxcct9-Sep-08 2:42 
GeneralRe: Array Variable initialization Pin
T.RATHA KRISHNAN9-Sep-08 2:51
T.RATHA KRISHNAN9-Sep-08 2:51 
GeneralRe: Array Variable initialization Pin
toxcct9-Sep-08 2:59
toxcct9-Sep-08 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.