コード例 #1
0
LRESULT CMainFrame::OnTVSelChanged(int, LPNMHDR pnmh, BOOL&)
{
	// 如何解析参数
	LPNMTREEVIEW pnmtv = reinterpret_cast<LPNMTREEVIEW>(pnmh);
	CTreeViewCtrlEx tree = pnmh->hwndFrom;
	if (tree.IsWindow())
	{
		CTreeItem item = tree.GetSelectedItem();
		std::string path;
		for (; !item.IsNull() && !item.GetParent().IsNull(); item = item.GetParent())
		{
			std::string name(256, 0);
			item.GetText((LPTSTR)name.c_str(), 256);
			std::string temp = name.c_str();
			if (!path.empty())
			{
				path = temp + "/" + path;
			}
			else
			{
				path = temp;
			}
		}
		//
		if (_canvas)
		{
			path = Buddha::FileSystem::getInstancePtr()->getDataDirectory() + path;
			_canvas->changeModelFile(standardFilePath(path));
		}
	}

	return 0L;
}
コード例 #2
0
LRESULT CMainWindow::OnTVSelChanged(int, LPNMHDR pnmh, BOOL&)
{
  // 如何解析参数
  LPNMTREEVIEW pnmtv = reinterpret_cast<LPNMTREEVIEW>(pnmh);
  CTreeViewCtrlEx tree = pnmh->hwndFrom;
  if (tree.IsWindow())
    {
      CTreeItem item = tree.GetSelectedItem();
      std::string path;
      for (; !item.IsNull(); item = item.GetParent())
	{
	  std::string name(256, 0);
	  item.GetText((LPTSTR)name.c_str(), 256);
	  std::string temp = name.c_str();
	  if (!path.empty())
	    {
	      path = temp + "/" + path;
	    }
	  else
	    {
	      path = temp;
	    }
	}
      //
      m_wndStatusBar.SetPaneText(ID_DEFAULT_PANE, TEXT(path.c_str()));
      //
      mViewWindow.changeModelFile(path);
    }

  return 0L;
}