本文整理汇总了C++中wxTreeEvent::GetOldItem方法的典型用法代码示例。如果您正苦于以下问题:C++ wxTreeEvent::GetOldItem方法的具体用法?C++ wxTreeEvent::GetOldItem怎么用?C++ wxTreeEvent::GetOldItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxTreeEvent
的用法示例。
在下文中一共展示了wxTreeEvent::GetOldItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSelChanged
void IceNoteFrame::OnSelChanged(wxTreeEvent& event)
{
wxTreeItemId i = event.GetItem();
NoteTreeItemData *item = (NoteTreeItemData*)noteTree->GetItemData(i);
if (m_currentNoteItemId == item->getItemId()) /* if not changed */
return;
/* STEP1: Save the past one */
if (m_currentNoteItemId > 0) /* if the prev is a note */
{
saveAbstract(m_currentNoteItemId);
m_fileHandler->saveNote(m_currentNoteItemId, *m_richTextCtrl);
/* update the title! */
noteTree->SetItemText(event.GetOldItem(), m_fileHandler->getItemTitle(m_currentNoteItemId));
}
/* if it is a note, save the past one and load the new one */
if (item->getItemType() == NIT_NOTE)
{
/* STEP2: Set and load the new one */
m_currentNoteItemId = item->getItemId();
m_fileHandler->openNote(m_currentNoteItemId, *m_richTextCtrl);
}
else
m_currentNoteItemId = 0; /* it's a notebook! */
SplitterWindow1->Enable(m_currentNoteItemId != 0);
loadAndShowAbstract(m_currentNoteItemId);
m_richTextCtrl->SetFocus();
}
示例2: OnSelectionChanged
void CLocalTreeView::OnSelectionChanged(wxTreeEvent& event)
{
if (m_setSelection)
{
event.Skip();
return;
}
wxTreeItemId item = event.GetItem();
if (!item)
return;
wxString dir = GetDirFromItem(item);
wxString error;
if (!m_pState->SetLocalDir(dir, &error))
{
if (error != _T(""))
wxMessageBox(error, _("Failed to change directory"), wxICON_INFORMATION);
else
wxBell();
m_setSelection = true;
SelectItem(event.GetOldItem());
m_setSelection = false;
}
}
示例3: UponTreeSelectionChange
void DatabaseView::UponTreeSelectionChange(wxTreeEvent& event)
{
wxTreeCtrl& tree_ctrl = tree();
MultiDimGrid& grid_ctrl = grid();
// save the current selection
wxTreeItemId const old_item = event.GetOldItem();
if(old_item.IsOk())
{
database_tree_item_data* old_item_data =
dynamic_cast<database_tree_item_data*>
(tree_ctrl.GetItemData(old_item)
);
if(old_item_data)
{
old_item_data->set_axes_selected(grid_ctrl.GetGridAxisSelection());
}
}
database_tree_item_data* item_data =
dynamic_cast<database_tree_item_data*>
(tree_ctrl.GetItemData(event.GetItem())
);
if(!item_data)
{
return;
}
table_adapter().SetTDBValue
(&document().GetTDBValue(item_data->db_name().Idx)
);
bool is_topic = tree_ctrl.GetChildrenCount(event.GetItem());
set_grid_label_text(item_data->db_name().LongName);
wxSizer* sizer = grid_ctrl.GetContainingSizer();
LMI_ASSERT(sizer);
sizer->Show(&grid_ctrl, !is_topic);
sizer->Layout();
// restore axis selection if any
grid_ctrl.SetGridAxisSelection(item_data->get_axes_selected());
grid_ctrl.RefreshTableFull();
}
示例4: defined
void P3DPlantModelTreeCtrl::OnSelectionChanged
(wxTreeEvent &event)
{
P3DBranchModel *BranchModel;
#if defined(__WXMSW__)
{
SetItemBold(event.GetOldItem(),false);
SetItemBold(event.GetItem(),true);
}
#endif
if (!event.GetItem().IsOk())
{
return;
}
BranchModel = ((P3DPlantModelTreeCtrlItemData*)(GetItemData(event.GetItem())))->GetBranchModel();
BranchPanel->SwitchToBranch(BranchModel);
}
示例5: OnChangeSettingPanel
/**
* ツリーコントロールでのウィンドウ描画切り替え
*/
void SettingDialog::OnChangeSettingPanel(wxTreeEvent& event) {
// 選択されたTreeItemIdのインスタンス
const wxTreeItemId pushedTree = event.GetItem();
// 板名をwxStringで取得する
const wxString itemStr(settingTreeCtrl->GetItemText(pushedTree));
// 取得不可なものであればリターン
if (itemStr == wxEmptyString) return;
if (settingPanel) {
// settingPanel内の情報を保存する
const wxTreeItemId oldPushedTree = event.GetOldItem();
const wxString oldItemStr(settingTreeCtrl->GetItemText(oldPushedTree));
if (oldItemStr != wxEmptyString) {
SaveConfig(oldItemStr);
}
// settingPanelのインスタンスが存在するならばDestroy
// 子ウィンドウを殺す
settingPanel->DestroyChildren();
}
if (itemStr == wxT("通信")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new NetworkSettingPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("パス")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new PathSettingPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("動作")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new BehaviorPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("操作")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new OperationPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("タブ操作")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new TabControlSettingPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("書き込み")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new KakikomiPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("Doe")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new DoePanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("その他1")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new OtherSettingPanelOne(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("User")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new UserSettingPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("色・フォント")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new ColorFontSettingPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("タブ色")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(new TabColorSettingPanel(settingPanel));
settingPanel->SetSizer(vbox);
} else if (itemStr == wxT("ヒント")) {
wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
vbox->Add(wxXmlResource::Get()->LoadPanel(settingPanel, wxT("hint_panel")));
settingPanel->SetSizer(vbox);
}
settingPanel->GetSizer()->Fit(settingPanel);
// ウィンドウのタイトルを変える
this->SetTitle(wxT("設定 - ") + itemStr);
}