can i catch wxEVT_LEFT_UP event in wxTreeCtrl?

Questions about wxWidgets running on MS.NET, mono or Portable.NET ? Ask it here !
nicecapj
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Aug 20, 2009 2:30 am
Location: korea
Contact:

can i catch wxEVT_LEFT_UP event in wxTreeCtrl?

Postby nicecapj » Thu Aug 20, 2009 2:48 am

EVT_TREE_SEL_CHANGING(ID_TREE,MainFrame::OnTreeSelChanging)
EVT_TREE_SEL_CHANGED(ID_TREE, MainFrame::OnTreeSelChanged)

void MainFrame::CreateControls()
{
wxBoxSizer* pPanelSizer = new wxBoxSizer(wxVERTICAL);

//add to sizer
wxTreeCtrl* pTree = new wxTreeCtrl(panel3, ID_TREE, wxPoint(0,0), wxSize(300,80));
pPanelSizer->Add(pTree, 0,wxEXPAND | wxALL, 5);

pTree->DeleteAllItems();
wxTreeItemId root = pTree->AddRoot("root", 0, 0, NULL);
wxTreeItemId childNode = pTree->AppendItem(root, "child", 0, 0, NULL);
wxTreeItemId childNode2 = pTree->AppendItem(root, "child2", 0, 0, NULL);
wxTreeItemId childNode3 = pTree->AppendItem(childNode2, "child3", 0, 0, NULL);


//connect for catch mouseEvent
pTree->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MainFrame::OnTreeMouseDown),0, this);
pTree->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(MainFrame::OnTreeMouseUp),0, this);
}

void MainFrame::OnTreeSelChanging(wxTreeEvent& event)
{
wxLogDebug("Changing");
}

void MainFrame::OnTreeSelChanged(wxTreeEvent& event)
{
wxLogDebug("Changed");
}

MainFrame::OnTreeMouseDown(wxMouseEvent& event)
{
wxLogDebug("MouseDown");
}

MainFrame::OnTreeMouseUp(wxMouseEvent& event)
{
wxLogDebug("MouseUp");
}

------------------------------------------------------------------------------------------------
I want to catch wxEVT_LEFT_UP because i need to show node`s info when i catch wxEVT_LEFT_DOWN and initialze info when i catch wxEVT_LEFT_UP.

<test result>
printed MouseDown -> Changing -> Changed .
i can`t catch MouseUp event.

ps : I am begginer of english writting...

Return to “wx.NET”

Who is online

Users browsing this forum: No registered users and 4 guests