本文整理汇总了C++中wxTreeEvent::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent::GetId方法的具体用法?C++ wxTreeEvent::GetId怎么用?C++ wxTreeEvent::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTreeEvent
的用法示例。
在下文中一共展示了wxTreeEvent::GetId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDragStart
void UserRulesEditorFrame::OnDragStart(wxTreeEvent& event) {
if (event.GetId() == LIST_Modlist) {
dragData = new wxTextDataObject(InstalledModsList->GetItemText(event.GetItem()));
dragSource = new wxDropSource(InstalledModsList);
} else if (event.GetId() == LIST_Masterlist) {
dragData = new wxTextDataObject(MasterlistModsList->GetItemText(event.GetItem()));
dragSource = new wxDropSource(MasterlistModsList);
}
dragSource->SetData(*dragData);
dragResult = dragSource->DoDragDrop();
}
示例2: OnList
void ModelControl::OnList(wxTreeEvent &event)
{
if (!init || !model)
return;
int id = event.GetId();
if (id == ID_MODEL_GEOSETS)
{
wxTreeItemId curItem = clbGeosets->GetSelection();
GeosetTreeItemData * data = (GeosetTreeItemData *)clbGeosets->GetItemData(curItem);
if(data)
{
size_t geosetIndex = data->geosetId;
model->showGeosets[geosetIndex] = !model->showGeosets[geosetIndex];
clbGeosets->SetItemBackgroundColour(curItem,
(model->showGeosets[geosetIndex])?*wxGREEN:*wxWHITE);
}
else
std::cout << "data is null !!!" << std::endl;
clbGeosets->Layout();
clbGeosets->Fit();
Layout();
Fit();
}
}
示例3: OnTreeEvent
void ProjectWindow::OnTreeEvent( wxTreeEvent& evt )
{
if (evt.GetId() == ASSET_LIST)
{
AssetTreeItemData* data = dynamic_cast<AssetTreeItemData*>(mAssetsTab->assetList->GetItemData(evt.GetItem()));
if (data)
{
mAssetsInspector->Inspect(data->objPtr);
return;
}
}
}
示例4: OnTreeMenu
void ProjectWindow::OnTreeMenu( wxTreeEvent& evt )
{
mSelectedModule = NULL;
if (evt.GetId() == ASSET_LIST)
{
ModuleTreeItemData* module_data = dynamic_cast<ModuleTreeItemData*>(mAssetsTab->assetList->GetItemData(evt.GetItem()));
if (module_data)
{
ModuleInfo mod = module_data->obj;
mSelectedModule = Torque::ModuleDatabaseLink->findLoadedModule(mod.moduleID);
if (mSelectedModule != NULL)
mFrame->PopupMenu(mProjectPanel->moduleMenu, wxDefaultPosition);
return;
}
}
}
示例5: OnTreeDrag
void ProjectWindow::OnTreeDrag(wxTreeEvent& evt)
{
if (evt.GetId() == ASSET_LIST)
{
AssetTreeItemData* data = dynamic_cast<AssetTreeItemData*>(mAssetsTab->assetList->GetItemData(evt.GetItem()));
if (data)
{
const AssetDefinition* asset = data->objPtr;
wxString command("Asset->");
command.Append(asset->mAssetType);
command.Append("->");
command.Append(asset->mAssetId);
wxTextDataObject dragData(command);
wxDropSource dragSource(mProjectPanel);
dragSource.SetData(dragData);
wxDragResult result = dragSource.DoDragDrop(TRUE);
return;
}
}
}
示例6: OnEndLabelEdit
void PWSTreeCtrl::OnEndLabelEdit( wxTreeEvent& evt )
{
switch (evt.GetId()) {
case ID_TREECTRL:
{
if (evt.GetLabel().Find(wxT('.')) == wxNOT_FOUND) {
// Not safe to modify the tree ctrl in any way. Wait for the stack to unwind.
wxTreeEvent newEvt(evt);
newEvt.SetId(ID_TREECTRL_1);
AddPendingEvent(newEvt);
}
else {
evt.Veto();
wxMessageBox(_("Dots are not allowed in group names"), _("Invalid Character"), wxOK|wxICON_ERROR);
}
break;
}
case ID_TREECTRL_1:
{
wxTreeItemId groupItem = evt.GetItem();
if (groupItem.IsOk()) {
PWTreeItemData* data = dynamic_cast<PWTreeItemData *>(GetItemData(groupItem));
if (data && data->BeingAdded()) {
// A new group being added
FinishAddingGroup(evt, groupItem);
}
else if (data && data->BeingEdited()) {
// An existing group being renamed
FinishRenamingGroup(evt, groupItem, data->GetOldPath());
}
}
break;
}
default:
wxFAIL_MSG(wxString::Format(wxT("End Label Edit handler received an unexpected identifier: %d"), evt.GetId()));
break;
}
}