void ProcessesDialog::OnProcessActivated(wxListEvent& event) { if (static_cast<unsigned int>(event.GetIndex()) < m_processes.size()) { long index = m_processList->GetItemData(event.GetIndex()); m_processId = m_processes[index].id; EndModal(wxID_OK); } }
void ProcessesDialog::OnProcessSelected(wxListEvent& event) { if (static_cast<unsigned int>(event.GetIndex()) < m_processes.size()) { long index = m_processList->GetItemData(event.GetIndex()); m_processId = m_processes[index].id; } UpdateAttachStatus(); }
void KeyConfigPrefs::OnKeyDown(wxListEvent &event) { int keycode = event.GetKeyCode(); int selected = mList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); int cnt = mList->GetItemCount(); wxListItem item; bool found = false; item.SetColumn(CommandColumn); item.SetMask(wxLIST_MASK_TEXT); for (int i = selected + 1; i < cnt; i++) { item.SetId(i); mList->GetItem(item); if (item.m_text.Left(1).IsSameAs(keycode, false)) { mList->SetItemState(event.GetIndex(), 0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED); mList->SetItemState(i, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED); mList->EnsureVisible(i); found = true; break; } } if (!found) { for (int i = 0; i < selected; i++) { item.SetId(i); mList->GetItem(item); if (item.m_text.Left(1).IsSameAs(keycode, false)) { mList->SetItemState(event.GetIndex(), 0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED); mList->SetItemState(i, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED); mList->EnsureVisible(i); break; } } } }
void StudioFrame::OnSfxEndLabelEdit(wxListEvent& event) { if (timer == NULL) { timer = new StudioTimer(this); } wxString str = sfxList->GetItemText(event.GetIndex()); timer->labelIndex = event.GetIndex(); timer->sfxList = sfxList; timer->trackName = str.ToStdString(); timer->StartOnce(10); }
void BattleListTab::OnSelect( wxListEvent& event ) { wxLogDebugFunc( _T( "" ) ); if ( event.GetIndex() == -1 ) { SelectBattle( 0 ); } else { IBattle* b = ( m_battle_list->GetDataFromIndex( event.GetIndex() ) ) ; SelectBattle( b );// } }
void SettingsDialog::OnColourlistctrlListItemSelected(wxListEvent& event) { // Get Colour from Setting based off of Selected Index wxColour col = Themes[cmbbx_theme->GetSelection()]->Colours[event.GetIndex()]->TowxColour(); //Set the Global Variable of Selection selColor = event.GetIndex(); // Set the Colour Picker to this Colour m_colourPicker330->SetColour(col); }
bool CLocalListView::OnBeginRename(const wxListEvent& event) { if (!m_pState->GetLocalDir().IsWriteable()) return false; if (event.GetIndex() == 0 && m_hasParent) return false; const CLocalFileData * const data = GetData(event.GetIndex()); if (!data || data->flags == fill) return false; return true; }
void BuildMessagesPnl::OnmessagesListItemActivated(wxListEvent& event) { //Painful wxListItem row_info; row_info.m_itemId = event.GetIndex(); row_info.m_col = 1; row_info.m_mask = wxLIST_MASK_TEXT; messagesList->GetItem( row_info ); size_t line = row_info.m_text.empty() ? gd::String::npos : gd::String(row_info.m_text).To<int>(); gd::String file = messagesList->GetItemText(event.GetIndex()); if ( projectManager && wxFileExists(file) ) projectManager->EditSourceFile(gameAssociatedWithErrors, file, line); }
/////////////////////////////////////////////////////////////////////////////// // Callback for when an item is selected. Fires a selection changing event to // interested listeners, and reverts the change if listeners decide to veto the // event. // void ListView::OnItemSelected( wxListEvent& args ) { m_SelectionDirty = true; ListSelectionChangeArgs changing( this, true, args.GetIndex(), args.GetData() ); m_SelectionChanging.Raise( changing ); if ( changing.m_Veto ) { Disconnect( GetId(), wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ListView::OnItemDeselected ), NULL, this ); Select( args.GetIndex(), false ); Connect( GetId(), wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ListView::OnItemDeselected ), NULL, this ); } args.Skip(); }
void cssVFSFileDlg :: OnDirViewActivated( wxListEvent & event ) { long curItem = event.GetIndex(); long data = fileView->GetItemData( curItem ); switch( data ) { case FILE: EndModal( TRUE ); break; case FOLDER: OpenTreeItemChild( fileView->GetItemText( event.GetIndex() ) ); break; } }
void CContactListCtrl::OnRightClick(wxListEvent& e) { wxMenu menu; if (GetSelectedItemCount() == 1) { // Single selection CContact& rContact = m_liEntries[e.GetIndex()]; const TPhoneList& rPhones = rContact.getConstPhones(); if (rPhones.size()) { wxMenu *submenu = new wxMenu(); TPhoneList::const_iterator it = rPhones.begin(); for (int i = 0; it != rPhones.end() && (i < MAX_PHONES); ++it, ++i) { submenu->Append(ID_CTX_MAKE_CALL + i, wxString::Format(wxT("%s (%s)"), it->getNumber(), CPhone::getNumberTypeName(it->getType()))); } if (rPhones.size() > MAX_PHONES) { submenu->Append(ID_CTX_SELECT_CALL, _("More...")); } menu.Append(ID_CTX_SELECT_CALL, _("Call...")); menu.AppendSubMenu(submenu, _("Quick Call")); menu.AppendSeparator(); } menu.Append(CMD_ADD_ADDRESS, _("Add...")); menu.Append(CMD_EDIT_ADDRESS, _("Edit...")); menu.AppendSeparator(); menu.Append(CMD_DEL_ADDRESS, _("Delete")); } else { // Multiple selection menu.Append(CMD_ADD_ADDRESS, _("Add...")); menu.AppendSeparator(); menu.Append(CMD_DEL_ADDRESS, _("Delete")); } PopupMenu(&menu); }
/// An item in the chains list has been selected. void EditChainsDialog::OnChainSelected(wxListEvent & event) { if (!ChangeOK()) { event.Veto(); return; } int item = event.GetIndex(); mActiveChain = mChains->GetItemText(item); mBatchCommands.ReadChain(mActiveChain); if (mBatchCommands.IsFixed(mActiveChain)) { mRemove->Disable(); mRename->Disable(); mDefaults->Enable(); } else { mRemove->Enable(); mRename->Enable(); mDefaults->Disable(); } PopulateList(); }
void InitialPositionBrowserDlg::OninitialPositionsListItemDeselect(wxListEvent& event) { if ( notUserSelection || event.GetIndex() < 0 ) return; gd::InitialInstance * instance = static_cast<gd::InitialInstance*>(wxUIntToPtr(initialPositionsList->GetItemData(event.GetIndex()))); layoutCanvas.UnselectInstance(instance); }
void frmMain::OnPropSelChanged(wxListEvent& event) { if (properties->GetSelectedItemCount() == 1) { wxTreeItemId item=browser->GetSelection(); if (item) { pgObject *data=browser->GetObject(item); if (data && data->IsCollection()) { currentObject=((pgCollection*)data)->FindChild(browser, event.GetIndex()); if (currentObject) { setDisplay(currentObject); sqlPane->SetReadOnly(false); sqlPane->SetText(currentObject->GetSql(browser)); sqlPane->SetReadOnly(true); } } } } editMenu->Enable(MNU_COPY, properties->GetSelectedItemCount() > 0); if(properties->GetSelectedItemCount() > 0) { manager.GetPane(wxT("listViews")).SetFlag(wxAuiPaneInfo::optionActive, true); } }
void dlgSearchObject::OnSelSearchResult(wxListEvent &ev) { long row_number = ev.GetIndex(); if(lcResults->GetItemTextColour(row_number) == wxColour(128, 128, 128)) { /* Result type is not enabled in settings, so we don't search for it in the tree */ return; } //Taken from: http://wiki.wxwidgets.org/WxListCtrl#Get_the_String_Contents_of_a_.22cell.22_in_a_LC_REPORT_wxListCtrl wxListItem row_info; wxString path; // Set what row it is (m_itemId is a member of the regular wxListCtrl class) row_info.m_itemId = row_number; // Set what column of that row we want to query for information. row_info.m_col = 2; // Set text mask row_info.m_mask = wxLIST_MASK_TEXT; // Get the info and store it in row_info variable. lcResults->GetItem(row_info); // Extract the text out that cell path = row_info.m_text; if(!parent->SetCurrentNode(parent->GetBrowser()->GetRootItem(), path)) { wxMessageBox(_("The specified object couldn't be found in the tree.")); } }
void Panels::MemoryCardListPanel_Simple::OnOpenItemContextMenu(wxListEvent& evt) { int idx = evt.GetIndex(); wxMenu* junk = new wxMenu(); if( idx != wxNOT_FOUND ) { const McdSlotItem& card( GetCardForViewIndex(idx) ); if (card.IsPresent){ junk->Append( McdMenuId_AssignUnassign, card.Slot>=0?_("Eject card"):_("Insert card ...") ); junk->Append( McdMenuId_Duplicate, _("Duplicate card ...") ); junk->Append( McdMenuId_Rename, _("Rename card ...") ); junk->Append( McdMenuId_Create, _("Delete card") ); if (card.IsFormatted && !card.IsPSX) { junk->Append( McdMenuId_Convert, _("Convert card") ); } } else junk->Append( McdMenuId_Create, _("Create a new card ...") ); } else junk->Append( McdMenuId_Create, _("Create a new card ...") ); junk->AppendSeparator(); junk->Append( McdMenuId_RefreshList, _("Refresh List") ); PopupMenu( junk ); m_listview->RefreshItem( idx ); UpdateUI(); }
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); } }
void frmMain::OnPropSelChanged(wxListEvent &event) { if (properties->GetSelectedItemCount() == 1) { wxTreeItemId item = browser->GetSelection(); if (item) { pgObject *data = browser->GetObject(item); if (data && data->IsCollection()) { currentObject = ((pgCollection *)data)->FindChild(browser, event.GetIndex()); if (currentObject) { setDisplay(currentObject); sqlPane->SetReadOnly(false); sqlPane->SetText(currentObject->GetSql(browser)); sqlPane->SetReadOnly(true); } } } } editMenu->Enable(MNU_COPY, properties->GetSelectedItemCount() > 0); // The generic list view control on the Mac doesn't fire focus events // as it should, so we set currentControl here instead of relying on // the ChildFocusEvent. The native list view does fire the events, but // does weird things with multi-select items so we currently disable // it (see the creation of the listviews in frmMain.cpp). #ifdef __WXMAC__ currentControl = properties; #endif }
void KeyConfigPrefs::OnItemSelected(wxListEvent &event) { mCommandSelected = event.GetIndex(); if (mCommandSelected < 0 || mCommandSelected >= (int)mNames.GetCount()) { mCurrentComboText->SetLabel(wxT("")); return; } wxListItem item; item.m_col = KeyComboColumn; item.m_mask = wxLIST_MASK_TEXT; item.SetId( mCommandSelected ); mList->GetItem(item); mCurrentComboText->Clear(); mCurrentComboText->AppendText(item.m_text); // JKC: July-2004 // Under Windows 98 setting the focus to the combo box whilst // we are still processing an OnItemSelected event can lead // to a crash (try clicking on an item in the list and dragging it). // It's OK under WinXP. TODO: Is there a #define that only excludes // WIN_98 that we could use here instead?? #ifndef __WXMSW__ // LLL: Removed since the focus would jump away from the listctrl when // using the keyboard to move up and down the list. Every time // the up/down arrows are pressed, the focus jumps aways and you have // to tab back to the listctrl. //mCurrentComboText->SetFocus(); #else //JKC Something like the following might do what we want under Win98? //mCurrentComboText->GetEventHandler()->AddPendingEvent( wxFocusEvent(wxEVT_SET_FOCUS)); #endif }
void VHDDExplorer::OnListDrag(wxListEvent& event) { m_drop_target->SetSrcIndx(event.GetIndex()); wxDataObjectSimple obj(wxDF_PRIVATE); wxDropSource drag(obj, m_list); drag.DoDragDrop(wxDrag_AllowMove); }
/***************************************************** ** ** ToolbarPanel --- OnLeftSelected ** ******************************************************/ void ToolbarPanel::OnLeftSelected( wxListEvent& event ) { right_sel = event.GetIndex(); if ( ! button_left->IsEnabled() ) button_left->Enable( true ); if ( ! button_up->IsEnabled() ) button_up->Enable( right_sel > 0 ); if ( ! button_down->IsEnabled() ) button_down->Enable( right_sel < list2->GetItemCount() - 1 ); }
void CMuleListCtrl::OnItemSelected(wxListEvent& evt) { if (IsSorting()) { // Selection/Deselection that happened while sorting. evt.Veto(); } else { // We reset the current TTS session if the user manually changes the selection if (m_tts_item != evt.GetIndex()) { ResetTTS(); // The item is changed so that the next TTS starts from the selected item. m_tts_item = evt.GetIndex(); } evt.Skip(); } }
/** * Edit property of an extension */ void DebuggerGUI::OnExtensionListItemActivated(wxListEvent& event) { wxListCtrl * list = dynamic_cast<wxListCtrl*>(event.GetEventObject()); if ( !list ) { cout << "Received an event for a bad Extension wxListCtrl in debugger." << endl; return; } boost::shared_ptr<gd::PlatformExtension> gdExtension = CppPlatform::Get().GetExtension(string(list->GetName().mb_str())); boost::shared_ptr<ExtensionBase> extension = boost::dynamic_pointer_cast<ExtensionBase>(gdExtension); if ( extension == boost::shared_ptr<ExtensionBase>() ) { cout << "Unknown extension in debugger ( " << list->GetName() << " )" << endl; return; } int propNb = event.GetIndex(); string uselessName, oldValue; extension->GetPropertyForDebugger(scene, propNb, uselessName, oldValue); string newValue = string(wxGetTextFromUser(_("Enter the new value"), _("Editing a value"), oldValue).mb_str()); if ( !extension->ChangeProperty(scene, propNb, newValue) ) { gd::LogWarning(_("Unable to modify the value.\nThe value entered is either incorrect or the property is read-only.")); } }
/** @brief OnActivateItem * * @todo: document this function */ void ChannelListctrl::OnActivateItem(wxListEvent& event) { int index = event.GetIndex(); if ( index == -1 ) return; wxString chan_name = m_data[ m_visible_idxs[index] ].name; ui().JoinChannel( chan_name, _T("") ); }
void ABoxDlg::onStubSelected( wxListEvent& event ) { m_SelectedStub = event.GetIndex(); m_Open->Enable(true); m_Modify->Enable(!m_ReadOnly); m_Delete->Enable(!m_ReadOnly); showStub(); }
// ---------------------------------------------------------------------------- // 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 DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnListItemSelected( wxListEvent& event ) { // remember the selected row, statically s_SelectedRow = event.GetIndex(); copySelectedFieldToPanel(); }
void StyleDialog::OnItemRightClick ( wxListEvent& event ) { int index = indexForContextMenu = event.GetIndex(); wxString match, suggestion; match = getTextByColumn ( table, index, 2 ); suggestion = getTextByColumn ( table, index, 4 ); wxMenu contextMenu; contextMenu.Append ( ID_MENU_IGNORE_ONCE, _ ( "Ignore once" ) ); contextMenu.Append ( ID_MENU_IGNORE_ALL, _ ( "Ignore all" ) ); contextMenu.AppendSeparator(); contextMenu.Append ( ID_MENU_CHANGE_ONCE, _ ( "Change once" ) ); contextMenu.Append ( ID_MENU_CHANGE_ALL, _ ( "Change all" ) ); contextMenu.AppendSeparator(); contextMenu.Append ( ID_MENU_NEW_SUGGESTION, _ ( "New suggestion..." ) ); wxString menuString; menuString.Printf ( _T ( "Change '%s' to '%s' throughout" ), match.c_str(), suggestion.c_str() ); contextMenu.Append ( ID_MENU_APPLY_SUGGESTION_ALL, menuString ); bool ignore = ( getTextByColumn ( table, index, 6 ) == _ ( "Ignore" ) ); contextMenu.Enable ( ( ignore ) ? ID_MENU_IGNORE_ONCE : ID_MENU_CHANGE_ONCE, false ); PopupMenu ( &contextMenu, wxPoint ( -1, -1 ) ); }
void BattleRoomTab::OnOptionActivate(wxListEvent& event) { if (!m_battle) return; if (!m_battle->IsFounderMe()) return; long index = event.GetIndex(); if (index == 0) return; wxString tag; for (OptionListMap::const_iterator itor = m_opt_list_map.begin(); itor != m_opt_list_map.end(); ++itor) { if (itor->second == index) { tag = itor->first; break; } } LSL::OptionsWrapper& optWrap = m_battle->CustomBattleOptions(); LSL::Enum::GameOption optFlag = (LSL::Enum::GameOption)FromwxString(tag.BeforeFirst('_')); const std::string key = STD_STRING(tag.AfterFirst('_')); LSL::Enum::OptionType type = optWrap.GetSingleOptionType(key); if (!optWrap.keyExists(key, optFlag, false, type)) return; SingleOptionDialog dlg(*m_battle, tag); dlg.ShowModal(); }
void SessionAdmin::OnListctrlSelected( wxListEvent& event ) { MySession *s = wxDynamicCast((void *)m_SessionListCtrl->GetItemData(event.GetIndex()), MySession); bool running = ((NULL != s) && (s->eGetSessionStatus() == MySession::Running)); SessionToolsEnable(true, running); }