void clGotoAnythingManager::OnActionSelected(clGotoEvent& e)
{
    e.Skip();
    // Trigger the action
    const clGotoEntry& entry = e.GetEntry();
    if(entry.GetResourceID() != wxID_ANY) {
        wxCommandEvent evtAction(wxEVT_MENU, entry.GetResourceID());
        if(entry.IsCheckable()) {
            evtAction.SetInt(entry.IsChecked() ? 0 : 1); // Set the opposite value
        }
        EventNotifier::Get()->TopFrame()->GetEventHandler()->AddPendingEvent(evtAction);
    }
}
Beispiel #2
0
void SmartCompletion::OnGotoAnythingSelectionMade(clGotoEvent& event)
{
    event.Skip();
    if(!m_config.IsEnabled()) return;

    // Collect info about this match
    WeightTable_t& T = *m_pGTAWeight;

    const wxString& key = event.GetEntry().GetDesc();
    if(T.count(key) == 0) {
        T[key] = 1;
    } else {
        T[key]++;
    }
    m_config.GetUsageDb().StoreGTAUsage(key, T[key]);
}