Example #1
0
void wxCheckedListCtrl::OnActivateEvent(wxListEvent& event)
{
    long item = event.GetItem().GetId();
    if (item == wxNOT_FOUND || !IsEnabled(item))
    {
        // skip this item
        event.Skip();
        return;
    }

    wxListEvent ev(wxEVT_NULL, GetId());
    ev.m_itemIndex = item;

    // send the check event
    if (IsChecked(item))
    {
        ev.SetEventType(wxEVT_COMMAND_LIST_ITEM_UNCHECKED);
        Check(item, FALSE);
        AddPendingEvent(ev);
    } else {
        ev.SetEventType(wxEVT_COMMAND_LIST_ITEM_CHECKED);
        Check(item, TRUE);
        AddPendingEvent(ev);
    }
    event.Skip();
}
Example #2
0
void InterpreterDisAsmFrame::InstrKey(wxListEvent& event)
{
	long i = m_list->GetFirstSelected();
	if (i < 0 || !cpu)
	{
		event.Skip();
		return;
	}

	const u32 start_pc = m_pc - m_item_count * 4;
	const u32 pc = start_pc + i * 4;

	switch (event.GetKeyCode())
	{
	case 'E':
	{
		InstructionEditorDialog dlg(this, pc, cpu, m_disasm.get());
		DoUpdate();
		return;
	}
	case 'R':
	{
		RegisterEditorDialog dlg(this, pc, cpu, m_disasm.get());
		DoUpdate();
		return;
	}
	}

	event.Skip();
}
Example #3
0
void InterpreterDisAsmFrame::InstrKey(wxListEvent& event)
{
	long i = m_list->GetFirstSelected();
	if(i < 0 || !CPU)
	{
		event.Skip();
		return;
	}

	const u64 start_pc = PC - m_item_count*4;
	const u64 pc = start_pc + i*4;

	switch(event.GetKeyCode())
	{
	case 'E':
		InstructionEditorDialog(this, pc, CPU, decoder, disasm);
		DoUpdate();
		return;
	case 'R':
		RegisterEditorDialog(this, pc, CPU, decoder, disasm);
		DoUpdate();
		return;
	}

	event.Skip();
}
Example #4
0
void InterpreterDisAsmFrame::InstrKey(wxListEvent& event)
{
	long i = m_list->GetFirstSelected();
	if(i < 0 || !CPU)
	{
		event.Skip();
		return;
	}

	const u64 start_pc = PC - m_item_count*4;
	const u64 pc = start_pc + i*4;

	switch(event.GetKeyCode())
	{
	case 'E':
		// TODO:: Syphurith: It is said the InstructionEditorDialog would be immediately destroyed.
		InstructionEditorDialog(this, pc, CPU, decoder.get(), disasm);
		DoUpdate();
		return;
	case 'R':
		// TODO:: Syphurith: Eh Similiar for this one.
		RegisterEditorDialog(this, pc, CPU, decoder.get(), disasm);
		DoUpdate();
		return;
	}

	event.Skip();
}
Example #5
0
void ItemEditorFrame::OnItemListSelected( wxListEvent& event )
{
	selectItemIndex = event.GetIndex();

	if ( selectItemIndex < 0 )
		return;

	unsigned itemID = m_ItemListCtrl->GetItemData( selectItemIndex );
	TItemBase* item =  TItemManager::getInstance().getItem( itemID );

	if ( item )
	{
		m_EditPanel->Enable();
		item->getDataInfo( mItemInfo );


		GuiIO::wxOutputEval eval;
		processGUIStream( eval );

		if ( item->isEquipment() )
		{
			CFObject* obj[2];
			TEquipment* equip = static_cast< TEquipment* >( item );
			if ( equip ->createModel( obj ) )
			{
				changeEquipModel(  equip , obj[0] );
			}
			//getGame()->changeModel( selectItemID  , m_ModelObj );
			//m_objCtrl->setSelectObj( m_ModelObj );
		}
		m_ModifyButton->Enable( false );
	}

	event.Skip();
}
Example #6
0
void CompilerMainPage::OnLinkerOptionDeSelected(wxListEvent& event)
{
#ifndef __WXMAC__
    m_selectedLnkOption = wxNOT_FOUND;
#endif
    event.Skip();
}
Example #7
0
void CompilerMainPage::OnFileTypeDeSelected(wxListEvent& event)
{
#ifndef __WXMAC__
    m_selectedFileType = wxNOT_FOUND;
#endif
    event.Skip();
}
Example #8
0
void wxGxObjectDialog::OnItemSelected(wxListEvent& event)
{
	event.Skip();
    //if(m_bIsSaveDlg)
    //    return;

    wxGxDialogContentView::LPITEMDATA pItemData = (wxGxDialogContentView::LPITEMDATA)event.GetData();
	if(pItemData == NULL)
		return;

	wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(pItemData->nObjectID);
    bool bIsDataset = pGxObject->IsKindOf(wxCLASSINFO(wxGxDataset)) || m_FilterArray[m_WildcardCombo->GetCurrentSelection()]->CanChooseObject(pGxObject);
    bool bIsObjContainer = pGxObject->IsKindOf(wxCLASSINFO(wxGxObjectContainer));
    if(!bIsDataset && bIsObjContainer)
    {
        return;
    }

    wxString sTempName;
	long item = wxNOT_FOUND;
	while(1)
    {
        item = m_pwxGxContentView->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        if ( item == wxNOT_FOUND )
            break;
		if(sTempName.IsEmpty())
			sTempName += m_pwxGxContentView->GetItemText(item);
		else
			sTempName += wxT("; ") + m_pwxGxContentView->GetItemText(item);
    }
	if(!sTempName.IsEmpty())
        m_sName = sTempName;
	TransferDataToWindow();
}
void OccurrencesHighlighting::OnListKeyDown(wxListEvent &event)
{
    switch ( event.GetKeyCode() )
    {
        case WXK_DELETE:
            RemoveSelected();
            break;

        case WXK_INSERT:
//            if ( GetWindowStyle() & wxLC_REPORT )
//            {
//                if ( GetWindowStyle() & wxLC_VIRTUAL )
//                {
//                    SetItemCount(GetItemCount() + 1);
//                }
//                else // !virtual
//                {
//                    InsertItemInReportView(event.GetIndex());
//                }
//            }
            //else: fall through

        default:

            event.Skip();
    }
}
Example #10
0
void wxListbook::OnListSelected(wxListEvent& eventList)
{
    if ( eventList.GetEventObject() != m_bookctrl )
    {
        eventList.Skip();
        return;
    }

    const int selNew = eventList.GetIndex();

    if ( selNew == m_selection )
    {
        // this event can only come from our own Select(m_selection) below
        // which we call when the page change is vetoed, so we should simply
        // ignore it
        return;
    }

    SetSelection(selNew);

    // change wasn't allowed, return to previous state
    if (m_selection != selNew)
    {
        GetListView()->Select(m_selection);
        GetListView()->Focus(m_selection);
    }
}
Example #11
0
// ----------------------------------------------------------------------------
// ArchiveEntryList::onListItemActivated
//
// Called when a list item is 'activated' (double-click or enter)
// ----------------------------------------------------------------------------
void ArchiveEntryList::onListItemActivated(wxListEvent& e)
{
	// Get item entry
	ArchiveEntry* entry = getEntry(e.GetIndex());

	// Do nothing if NULL (shouldn't be)
	if (!entry)
		return;

	// If it's a folder, open it
	if (entry->getType() == EntryType::folderType())
	{
		// Get directory to open
		ArchiveTreeNode* dir = nullptr;
		if (entry == entry_dir_back)
			dir = (ArchiveTreeNode*)current_dir->getParent();	// 'Back directory' entry, open current dir's parent
		else
			dir = archive->getDir(entry->getName(), current_dir);

		// Check it exists (really should)
		if (!dir)
		{
			LOG_MESSAGE(1, "Error: Trying to open nonexistant directory");
			return;
		}

		// Set current dir
		setDir(dir);
	}
	else
		e.Skip();
}
void wxdlg3dViewer::OnListPolysSelected( wxListEvent& event )
{
////@begin wxEVT_COMMAND_LIST_ITEM_SELECTED event handler for ID_LISTPOLYS in wxdlg3dViewer.
    // Before editing this code, remove the block markers.
    event.Skip();
////@end wxEVT_COMMAND_LIST_ITEM_SELECTED event handler for ID_LISTPOLYS in wxdlg3dViewer. 
}
Example #13
0
/**
 * \brief Event sent when the user starts to resize a column.
 * \param event The event.
 */
void bf::item_field_edit::on_column_begin_drag( wxListEvent& event )
{
  if ( event.GetColumn() + 1 == GetColumnCount() )
    event.Veto();
  else
    event.Skip();
} // item_field_edit::on_column_begin_drag()
Example #14
0
void DataModelListCtrl::OnBeginLabelEdit(wxListEvent& event)
{
    if (CanEditLabel())
        event.Skip(); // does nothing :(
    else
        EndEditLabel(true);
}
Example #15
0
void StreamTable::onActivate(wxListEvent& event) {
    // find out what we have got in our second column:
    long index = event.GetIndex();
    const wxString& loc = getLocation(index);
    if (loc.IsEmpty()) {
        std::cerr << "Location is invalid (empty)" << std::endl;
        return;
    }

    try {
        TrackInfo* onDaHeap = new TrackInfo();
        onDaHeap->setLocation(loc);
        // We set a void* here. It's a pointer to the `onDaHeap' TrackInfo object.
        // Later on (see the `TrackStatusHandler::onStreamActivated' function), we
        // can cast it back to a TrackInfo* and work with it. That function must
        // also delete that very same pointer, or else we're f****d.
        event.SetClientObject(onDaHeap);

        // make sure this event is handled by event handlers up in the chain.
        event.Skip();
    } catch (AudioException& ex) {
        wxString msg;
        msg << wxT("Unable to open the URL `") << loc << wxT("'.\n\n");
        msg << wxT("GStreamer error description:\n") << ex.getAsWxString();
        wxMessageDialog dlg(this, msg, wxT("Error"), wxICON_ERROR | wxOK);
        dlg.ShowModal();
    }
}
Example #16
0
void CGameListCtrl::OnColumnClick(wxListEvent& event)
{
	if(event.GetColumn() != COLUMN_BANNER)
	{
		int current_column = event.GetColumn();
		if (sorted)
		{
			if (last_column == current_column)
			{
				last_sort = -last_sort;
			}
			else
			{
				SConfig::GetInstance().m_ListSort2 = last_sort;
				last_column = current_column;
				last_sort = current_column;
			}
			SConfig::GetInstance().m_ListSort = last_sort;
		}
		else
		{
			last_sort = current_column;
			last_column = current_column;
		}
		caller = this;
		SortItems(wxListCompare, last_sort);
	}

	SetBackgroundColor();

	event.Skip();
}
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnListItemDeselected( wxListEvent& event )
{
    if( !m_skipCopyFromPanel )
    {
        if( !copyPanelToSelectedField() )
            event.Skip();   // do not go to the next row
    }
}
Example #18
0
void CMuleListCtrl::OnItemDeleted(wxListEvent& evt)
{	
	if (evt.GetIndex() <= m_tts_item) {
		m_tts_item--;
	}

	evt.Skip();
}
Example #19
0
void IRCChannelPage::onUserActivated(wxListEvent &e)
{
	e.Skip();

	int32 index = e.GetIndex();
	if(index != -1)
		getIRCWindow()->openChat(static_cast<uint32>(m_usersCtrl->GetItemData(index)));		
}
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnListItemDeselected( wxListEvent& event )
{
    if( !m_skipCopyFromPanel )
    {
        if( !copyPanelToSelectedField() )
            event.Skip();   // do not go to the next row
    }
}
Example #21
0
void ItemEditorFrame::OnPMListSelected( wxListEvent& event )
{
	selectPMIndex = event.GetIndex();

	m_PMModifyButton->Enable();
	m_PMRemoveButton->Enable();

	event.Skip();
}
Example #22
0
void ItemEditorFrame::OnPMListDeselected( wxListEvent& event )
{
	selectPMIndex = -1;

	m_PMModifyButton->Enable( false );
	m_PMRemoveButton->Enable( false );

	event.Skip();
}
Example #23
0
void CSourcesListBox::TranslateKeys( wxListEvent& event )
{
	if ( event.GetKeyCode() == WXK_DELETE || event.GetKeyCode() == WXK_BACK )
		DelSel();
	else if ( event.GetKeyCode() == WXK_F2 )
		RenameSel();
	else
		event.Skip();
}
void CustomVirtListCtrl<T,L>::OnEndResizeCol(wxListEvent& event)
{
	int column = event.GetColumn();
	int new_size = GetColumnWidth( column );
	sett().SetColumnWidth( m_name, column, new_size );
	sett().SaveSettings();

	//let the event go further
	event.Skip();
}
Example #25
0
void DbSettingDialog::OnItemKeyDown(wxListEvent& event)
{
    if(event.GetKeyCode() == WXK_DELETE || event.GetKeyCode() == WXK_NUMPAD_DELETE) {
        m_listCtrlRecentFiles->DeleteItem(event.GetItem());
        DoSaveSqliteHistory();

    } else {
        event.Skip();
    }
}
void OpenResourceDialog::OnItemSelected(wxListEvent& event)
{
	event.Skip();
	if(event.m_itemIndex != wxNOT_FOUND) {
		// display the full name at the bottom static text control
		OpenResourceDialogItemData *data = (OpenResourceDialogItemData *) m_listOptions->GetItemData(event.m_itemIndex );
		m_selection = *data;
		m_fullText->SetLabel(data->m_file);
	}
}
void CBOINCBaseView::OnListDeselected(wxListEvent& event) {
    wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function Begin"));

    if (!m_bIgnoreUIEvents) {
        m_bForceUpdateSelection = true;
        UpdateSelection();
        event.Skip();
    }

    wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function End"));
}
Example #28
0
void ItemEditorFrame::OnItemListRightClick( wxListEvent& event )
{
	if ( selectItemIndex < 0 )
		return;

	wxMenu* menu = new wxMenu;
	menu->Append( COM_CHANGE_ITEM_ID , wxT("Change ID") );
	menu->Append( COM_DELETE_ITEM    , wxT("Delete Item") );
	m_ItemListCtrl->PopupMenu( menu , event.GetPoint() );
	event.Skip();
}
Example #29
0
// ----------------------------------------------------------------------------
// ArchiveEntryList::onColumnResize
//
// Called when a column is resized
// ----------------------------------------------------------------------------
void ArchiveEntryList::onColumnResize(wxListEvent& e)
{
	// Save column widths
	elist_colname_width = GetColumnWidth(col_name);
	if (elist_colsize_show)
		elist_colsize_width = GetColumnWidth(col_size);
	if (elist_coltype_show)
		elist_coltype_width = GetColumnWidth(col_type);
	if (elist_colindex_show)
		elist_colindex_width = GetColumnWidth(col_index);
	e.Skip();
}
// Work around a bug (feature?) in virtual list control 
//   which does not send deselection events
void CBOINCBaseView::OnCacheHint(wxListEvent& event) {
    static int oldSelectionCount = 0;
    int newSelectionCount = m_pListPane->GetSelectedItemCount();

    if (newSelectionCount < oldSelectionCount) {
        wxListEvent leDeselectedEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED, m_windowId);
        leDeselectedEvent.SetEventObject(this);
        OnListDeselected(leDeselectedEvent);
    }
    oldSelectionCount = newSelectionCount;
    event.Skip();
}