Ejemplo n.º 1
0
void OpenResourceDialog::OpenSelection(const OpenResourceDialogItemData& selection, IManager* manager)
{
	if ( manager && manager->OpenFile(selection.m_file, wxEmptyString, selection.m_line) ) {
		IEditor *editor = manager->GetActiveEditor();
		if ( editor && selection.m_name.IsEmpty() == false) {
			editor->FindAndSelect(selection.m_pattern, selection.m_name, 0, manager->GetNavigationMgr());
		}
	}
}
Ejemplo n.º 2
0
void PHPOutlineTree::ItemSelected(const wxTreeItemId& item, bool focusEditor)
{
    QItemData* itemData = dynamic_cast<QItemData*>(GetItemData(item));
    CHECK_PTR_RET(itemData);

    IEditor* editor = m_manager->GetActiveEditor();
    CHECK_PTR_RET(editor);

    // Define the pattern to search

    editor->FindAndSelect(itemData->m_entry->GetShortName(), itemData->m_entry->GetShortName(),
                          editor->PosFromLine(itemData->m_entry->GetLine()), NavMgr::Get());
    // set the focus to the editor
    if(focusEditor) { CallAfter(&PHPOutlineTree::SetEditorActive, editor); }
}
Ejemplo n.º 3
0
void PhpPlugin::OnOpenResource(wxCommandEvent& e)
{
    if(PHPWorkspace::Get()->IsOpen()) {
        OpenResourceDlg dlg(FRAME, m_mgr);
        if(dlg.ShowModal() == wxID_OK) {
            ResourceItem* itemData = dlg.GetSelectedItem();
            if(itemData) {
                if(m_mgr->OpenFile(itemData->filename.GetFullPath())) {
                    IEditor* editor = m_mgr->GetActiveEditor();
                    if(editor && itemData->line != wxNOT_FOUND) {
                        editor->FindAndSelect(
                            itemData->displayName, itemData->displayName, editor->PosFromLine(itemData->line), NULL);
                    }
                }
            }
        }
    } else {
        e.Skip();
    }
}