本文整理汇总了C++中wxTreeEvent::Allow方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent::Allow方法的具体用法?C++ wxTreeEvent::Allow怎么用?C++ wxTreeEvent::Allow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTreeEvent
的用法示例。
在下文中一共展示了wxTreeEvent::Allow方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTreeItemSelected
void WorkspaceBrowserF::OnTreeItemSelected(wxTreeEvent& event)
{
if (Manager::IsAppShuttingDown())
return;
if (m_pBrowserBuilder)
{
if (!m_pBrowserBuilder->SelectNode(event.GetItem()))
return;
}
event.Allow();
EditorManager* edMan = Manager::Get()->GetEditorManager();
if (!edMan)
return;
cbEditor* ed = edMan->GetBuiltinActiveEditor();
if (!ed)
return;
cbStyledTextCtrl* control = ed->GetControl();
int currentLine = control->GetCurrentLine() + 1;
wxString activeFilename = ed->GetFilename();
if (activeFilename.IsEmpty())
return;
MarkSymbol(UnixFilename(activeFilename), currentLine);
}
示例2: OnSpinTreeDragBegin
void wxSpinTreeCtrl::OnSpinTreeDragBegin(wxTreeEvent &event)
{
spin::ReferencedNode *spinNode = this->GetNode(event.GetItem());
if (spinNode)
{
draggedItem = event.GetItem();
event.Allow();
}
}
示例3: On_Drag_Begin
//---------------------------------------------------------
void CWKSP_Map_Control::On_Drag_Begin(wxTreeEvent &event)
{
CWKSP_Base_Item *pItem = (CWKSP_Base_Item *)GetItemData(event.GetItem());
if( pItem
&& (pItem->Get_Type() == WKSP_ITEM_Map_Layer
|| pItem->Get_Type() == WKSP_ITEM_Map_Graticule
|| pItem->Get_Type() == WKSP_ITEM_Map_BaseMap) )
{
m_draggedItem = event.GetItem();
event.Allow();
}
}
示例4: TreeOnBeginDrag
void DecisionLogicFrame::TreeOnBeginDrag(wxTreeEvent& event)
{
// need to explicitly allow drag
if ( ItemIsDraggable(event.GetItem()) )
{
m_draggedItem = event.GetItem();
wxPoint clientpt = event.GetPoint();
wxPoint screenpt = ClientToScreen(clientpt);
m_draiggingName = m_tree->GetItemText(event.GetItem());
event.Allow();
}
}
示例5: OnTreeItemStartDrag
void CTimeBarFrame::OnTreeItemStartDrag(wxTreeEvent& event)
{
m_pBeginDragData = static_cast<CTimeBarFrameData*>(m_pItemTreeCtrl->GetItemData(event.GetItem()));
BEATS_ASSERT(m_pBeginDragData != NULL)
if (m_pBeginDragData->GetId() != m_pItemTreeCtrl->GetRootItem())
{
m_pItemTreeCtrl->SelectItem(event.GetItem());
if (m_bEnableDrag)
{
wxCommandEvent dragEvent(TIMTBAR_DRAGITEMBEGIN_EVENT, GetId());
dragEvent.SetEventObject(this);
ProcessWindowEvent(dragEvent);
event.Allow();
}
}
}
示例6: OnBeginDrag
///////////////////////////////////////////////////////////////////////////////
// Called when the user begins to drag an item in the tree control. Determines
// if the item is allowed to be dragged, and kicks off the drag-and-drop event
// if it is allowed.
//
void HierarchyOutliner::OnBeginDrag( wxTreeEvent& args )
{
// You can only drag something if...
// 1. The drag event contains a valid item to originate the drag
// 2. The item that the drag originates on is selected
// 3. There is something in the scene's selected item list (which had better be the
// case if item 2 above was true.
// 4. You cannot drag the root item
if ( ( args.GetItem().IsOk() )&&
( m_TreeCtrl->IsSelected( args.GetItem() ) ) &&
( m_CurrentScene->GetSelection().GetItems().Size() > 0 ) &&
( args.GetItem() != m_TreeCtrl->GetRootItem() ) )
{
args.Allow();
}
// else: automatically veto'd (you have to specifically allow a drag operation)
}
示例7: OnBeginDrag
void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
{
// need to explicitly allow drag
if ( event.GetItem() != GetRootItem() )
{
m_draggedItem = event.GetItem();
wxLogMessage(wxT("OnBeginDrag: started dragging %s"),
GetItemText(m_draggedItem).c_str());
event.Allow();
}
else
{
wxLogMessage(wxT("OnBeginDrag: this item can't be dragged."));
}
}
示例8: onTreeBeginDrag
void BookmarkView::onTreeBeginDrag( wxTreeEvent& event ) {
TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(event.GetItem()));
dragItem = nullptr;
dragItemId = nullptr;
SetCursor(wxCURSOR_CROSS);
if (!tvi) {
event.Veto();
return;
}
bool bAllow = false;
std::wstring dragItemName;
if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
bAllow = true;
dragItemName = BookmarkMgr::getActiveDisplayName(tvi->demod);
} else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT || tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
bAllow = true;
dragItemName = BookmarkMgr::getBookmarkEntryDisplayName(tvi->bookmarkEnt);
}
if (bAllow) {
wxColour bgColor(ThemeMgr::mgr.currentTheme->generalBackground);
wxColour textColor(ThemeMgr::mgr.currentTheme->text);
m_treeView->SetBackgroundColour(textColor);
m_treeView->SetForegroundColour(bgColor);
// m_treeView->SetToolTip("Dragging " + dragItemName);
dragItem = tvi;
dragItemId = event.GetItem();
visualDragItem = new BookmarkViewVisualDragItem(dragItemName);
event.Allow();
} else {
event.Veto();
}
}
示例9: OnTreeBeginDrag
void BundlePane::OnTreeBeginDrag(wxTreeEvent& event) {
wxTreeItemId id = event.GetItem();
if (!id.IsOk()) {
wxLogDebug(wxT("Starting Drag: invalid item"));
return;
}
const BundleItemData* data = (BundleItemData*)m_bundleTree->GetItemData( id );
if (!data || data->m_type == BUNDLE_BUNDLE) {
wxLogDebug(wxT("Starting Drag: bundle or root menu"));
return; // bundles and menu roots cannot be dragged
}
m_draggedItem = id;
wxLogDebug(wxT("Starting Drag of item: %s"), m_bundleTree->GetItemText(id).c_str());
// Need to explicitly allow drag
event.Allow();
}
示例10: OnBeginDrag
void SkillObjectTree::OnBeginDrag(wxTreeEvent& event)
{
// need to explicitly allow drag
if ( event.GetItem() != GetRootItem() )
{
m_draggedItem = event.GetItem();
wxPoint clientpt = event.GetPoint();
wxPoint screenpt = ClientToScreen(clientpt);
//wxLogMessage(wxT("OnBeginDrag: started dragging %s at screen coords (%i,%i)"),
// GetItemText(m_draggedItem).c_str(),
// screenpt.x, screenpt.y);
event.Allow();
}
else
{
//wxLogMessage(wxT("OnBeginDrag: this item can't be dragged."));
}
}
示例11: OnBeginDrag
void RegTreeCtrl::OnBeginDrag(wxTreeEvent& event)
{
m_copyOnDrop = event.GetEventType() == wxEVT_TREE_BEGIN_DRAG;
TreeNode *pNode = GetNode(event);
if ( pNode->IsRoot() || pNode->Parent()->IsRoot() )
{
wxLogStatus(wxT("This registry key can't be %s."),
m_copyOnDrop ? wxT("copied") : wxT("moved"));
}
else
{
wxLogStatus(wxT("%s item %s..."),
m_copyOnDrop ? wxT("Copying") : wxT("Moving"),
pNode->FullName());
m_draggedItem = pNode;
event.Allow();
}
}
示例12: BeginDrag
void E_Scene_Groupesurfaces_Groupe::BeginDrag(wxTreeEvent& treeEvent,wxTreeCtrl* tree)
{
treeEvent.Allow();
}
示例13:
void wxGD::TreeView::OnBeginDrag( wxTreeEvent &event )
{
event.Allow();
}