本文整理汇总了C++中HeeksObj::CopyFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ HeeksObj::CopyFrom方法的具体用法?C++ HeeksObj::CopyFrom怎么用?C++ HeeksObj::CopyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeeksObj
的用法示例。
在下文中一共展示了HeeksObj::CopyFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouse
void CTreeCanvas::OnMouse( wxMouseEvent& event )
{
if(wxGetApp().m_property_grid_validation)return;
if(event.Entering()){
SetFocus(); // so middle wheel works
}
if(event.LeftDown())
{
const CTreeButton* button = HitTest(event.GetPosition());
if(button)
{
switch(button->type)
{
case ButtonTypePlus:
case ButtonTypeMinus:
SetExpanded(button->obj, button->type == 0);
SetVirtualSize(GetRenderSize());
this->Refresh();
break;
case ButtonTypeLabelBefore:
case ButtonTypeLabel:
default:
OnLabelLeftDown(button->obj, event);
clicked_object = button->obj;
break;
}
}
else
{
wxGetApp().m_marked_list->Clear(true);
}
m_button_down_point = event.GetPosition();
}
if(event.LeftUp())
{
if(m_dragging)
{
m_dragging = false;
// find the object to drop on to
const CTreeButton* button = HitTest(event.GetPosition());
if(button == NULL || !wxGetApp().m_marked_list->ObjectMarked(button->obj)) // can only drop on to an item other than one of the items being dragged
{
// test drop possible
bool drag_possible = true;
HeeksObj* add_to = &wxGetApp();
if(button && button->paste_into)add_to = button->paste_into;
for(std::list<HeeksObj*>::iterator It = m_dragged_list.begin(); It != m_dragged_list.end(); It++)
{
HeeksObj* object = *It;
if(!add_to->CanAdd(object) || !object->CanAddTo(add_to))
{
drag_possible = false;
break;
}
}
if(drag_possible)
{
wxGetApp().CreateUndoPoint();
// cut the objects
wxGetApp().Remove(m_dragged_list);
// paste the objects
for(std::list<HeeksObj*>::iterator It = m_dragged_list.begin(); It != m_dragged_list.end(); It++)
{
HeeksObj* object = *It;
{
if(object->OneOfAKind())
{
bool one_found = false;
for(HeeksObj* child = add_to->GetFirstChild(); child; child = add_to->GetNextChild())
{
if(child->GetType() == object->GetType())
{
child->CopyFrom(object);
one_found = true;
break;
}
}
if(!one_found)
{
add_to->Add(object, button ? button->paste_before : NULL);
}
}
else
{
add_to->Add(object, button ? button->paste_before : NULL);
}
}
//.........这里部分代码省略.........