LTBOOL CFolderWeaponControls::OnRButtonUp(int x, int y) { // Get the control that the click was on int nControlIndex=0; if (GetControlUnderPoint(x, y, &nControlIndex)) { CLTGUICtrl* pCtrl = GetControl(nControlIndex); if (pCtrl && pCtrl->GetParam1()) { CLTGUIColumnTextCtrl *pColumn=(CLTGUIColumnTextCtrl *)pCtrl; int nAct = pCtrl->GetParam1()-1; m_nActions[nAct] = GetPreviousCommand(m_nActions[nAct]); int nWeaponId = g_pWeaponMgr->GetWeaponId(m_nActions[nAct]); WEAPON *pWeapon = g_pWeaponMgr->GetWeapon(nWeaponId); if (pWeapon) pColumn->SetString(1,pWeapon->nNameId); else pColumn->SetString(1,IDS_CONTROL_UNASSIGNED); UpdateSelection(); return LTTRUE; } } return CBaseFolder::OnRButtonUp(x, y); }
void SelectionHandler::UpdateSelection(const COORD& coordCurrent, CharInfo screenBuffer []) { if ((m_selectionState != selstateStartedSelecting) && (m_selectionState != selstateSelecting)) { return; } if ((coordCurrent.X == m_coordCurrent.X) && (coordCurrent.Y == m_coordCurrent.Y)) return; // TRACE(L"Update selection current: %ix%i\n", coordCurrent.X, coordCurrent.Y); m_coordCurrent = coordCurrent; SMALL_RECT& srWindow = m_consoleInfo->csbi.srWindow; int nDeltaX = m_coordCurrent.X - srWindow.Left; int nDeltaY = m_coordCurrent.Y - srWindow.Top; if (nDeltaX < 0) nDeltaX = 0; if (nDeltaY < 0) nDeltaY = 0; if (screenBuffer[nDeltaY * m_consoleParams->dwColumns + nDeltaX].charInfo.Attributes & COMMON_LVB_LEADING_BYTE) { ++m_coordCurrent.X; } UpdateSelection(); }
void HierarchyTreeController::DeleteNodes(const HierarchyTreeNode::HIERARCHYTREENODESLIST& nodes, bool deleteNodeFromMemory, bool deleteNodeFromScene, bool deleteNodeFromDisk) { if (!nodes.size()) return; // Deletion of nodes might change the active platform or screen. this->activePlatformAfterDeleteNodes = this->activePlatform; this->activeScreenAfterDeleteNodes = this->activeScreen; DeleteNodesInternal(nodes); UpdateSelection(this->activePlatformAfterDeleteNodes, this->activeScreenAfterDeleteNodes); emit SelectedControlNodesChanged(activeControlNodes); if (deleteNodeFromScene) { RegisterNodesDeletedFromScene(nodes); } if (deleteNodeFromDisk) { DeleteNodesFiles(nodes); } hierarchyTree.DeleteNodes(nodes, deleteNodeFromMemory, deleteNodeFromScene); EmitHierarchyTreeUpdated(); }
void PSelectionInteraction::HandleGlobalInteraction (int inIndex, PlotDataBase *inXData, PlotDataBase *inYData, bool inHit, long inNearestPointIndex, DataDrawerBase *inDataDrawer, PlotDataSelection *inPlotDataSelection) { if (inPlotDataSelection->size ()>0) { for (int theI=0;theI<inPlotDataSelection->size ();theI++) { UpdateSelection (inIndex, theI, inXData, inYData, inHit, inPlotDataSelection); } } }
void CViewMessagesGrid::OnMessagesCopyAll( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewMessagesGrid::OnMessagesCopyAll - Function Begin")); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); #ifdef wxUSE_CLIPBOARD wxInt32 iIndex = -1; wxInt32 iRowCount = 0; pFrame->UpdateStatusText(_("Copying all messages to the clipboard...")); OpenClipboard(); iRowCount = m_pGridPane->GetRows(); for (iIndex = 0; iIndex < iRowCount; iIndex++) { CopyToClipboard(iIndex); } CloseClipboard(); pFrame->UpdateStatusText(wxT("")); #endif UpdateSelection(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewMessagesGrid::OnMessagesCopyAll - Function End")); }
void CViewMessagesGrid::OnMessagesCopySelected( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewMessagesGrid::OnMessagesCopySelected - Function Begin")); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); #ifdef wxUSE_CLIPBOARD pFrame->UpdateStatusText(_("Copying selected messages to Clipboard...")); OpenClipboard(); wxArrayInt arrSelRows = m_pGridPane->GetSelectedRows2(); for (unsigned int i=0; i< arrSelRows.GetCount();i++) { CopyToClipboard(arrSelRows[i]); } CloseClipboard(); pFrame->UpdateStatusText(wxT("")); #endif UpdateSelection(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewMessagesGrid::OnMessagesCopySelected - Function End")); }
LLEModulesManagerFrame::LLEModulesManagerFrame(wxWindow* parent) : wxDialog(parent, wxID_ANY, "LLEModulesManagerFrame", wxDefaultPosition, wxSize(480, 640)) { wxBoxSizer *s_panel = new wxBoxSizer(wxVERTICAL); wxBoxSizer *s_p_panel = new wxBoxSizer(wxVERTICAL); wxPanel *p_main = new wxPanel(this); m_check_list = new wxCheckListBox(p_main, wxID_ANY); // select / unselect wxStaticBoxSizer* s_selection = new wxStaticBoxSizer(wxHORIZONTAL, p_main); wxButton* b_select = new wxButton(p_main, wxID_ANY, "Select All", wxDefaultPosition, wxSize(80, -1)); wxButton* b_unselect = new wxButton(p_main, wxID_ANY, "Unselect All", wxDefaultPosition, wxSize(80, -1)); s_selection->Add(b_select); s_selection->Add(b_unselect); s_p_panel->Add(s_selection); s_p_panel->Add(m_check_list, 1, wxEXPAND | wxALL, 5); p_main->SetSizerAndFit(s_p_panel); s_panel->Add(p_main, 1, wxEXPAND | wxALL, 5); SetSizerAndFit(s_panel); Refresh(); SetSize(350, 500); b_select->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { OnSelectAll(event, true); event.Skip(); }); b_unselect->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { OnSelectAll(event, false); event.Skip(); }); Bind(wxEVT_CHECKLISTBOX, [this](wxCommandEvent& event) { UpdateSelection(event.GetInt()); event.Skip(); }); Bind(wxEVT_SIZE, [p_main, this](wxSizeEvent& event) { p_main->SetSize(GetClientSize()); m_check_list->SetSize(p_main->GetClientSize() - wxSize(10, 50)); event.Skip(); }); }
void CViewTransfers::OnTransfersRetryNow( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewTransfers::OnTransfersRetryNow - Function Begin")); CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); int row; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); pFrame->UpdateStatusText(_("Retrying transfer now...")); row = -1; while (1) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; pDoc->TransferRetryNow(m_iSortedIndexes[row]); } pFrame->UpdateStatusText(wxT("")); UpdateSelection(); pFrame->ResetReminderTimers(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewTransfers::OnTransfersRetryNow - Function End")); }
bool wxNotebook::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result) { wxBookCtrlEvent event(wxEVT_NULL, m_windowId); NMHDR* hdr = (NMHDR *)lParam; switch ( hdr->code ) { case TCN_SELCHANGE: event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED); break; case TCN_SELCHANGING: event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING); break; default: return wxControl::MSWOnNotify(idCtrl, lParam, result); } event.SetSelection(TabCtrl_GetCurSel(GetHwnd())); event.SetOldSelection(m_selection); event.SetEventObject(this); event.SetInt(idCtrl); // Change the selection before generating the event as its handler should // already see the new page selected. if ( hdr->code == TCN_SELCHANGE ) UpdateSelection(event.GetSelection()); bool processed = HandleWindowEvent(event); *result = !event.IsAllowed(); return processed; }
void HierarchyTreeController::SelectControl(HierarchyTreeControlNode* control) { if (activeControlNodes.find(control) != activeControlNodes.end()) return; //add selection activeControlNodes.insert(control); UIControl* uiControl = control->GetUIObject(); if (uiControl) { uiControl->SetDebugDraw(true); uiControl->SetDebugDrawColor(Color(1.f, 0, 0, 1.f)); //YZ draw parent rect UIControl* parentUiControl = uiControl->GetParent(); if (parentUiControl) { parentUiControl->SetDebugDrawColor(Color(0.55f, 0.55f, 0.55f, 1.f)); parentUiControl->SetDebugDraw(true); } } emit AddSelectedControl(control); emit SelectedControlNodesChanged(activeControlNodes); UpdateSelection(control); }
void CViewProjects::OnProjectNoNewWork( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectNoNewWork - Function Begin")); CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); int row; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); wxASSERT(m_pListPane); row = -1; while (1) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; PROJECT* project = pDoc->project(m_iSortedIndexes[row]); if (project) { if (project->dont_request_more_work) { pDoc->ProjectAllowMoreWork(m_iSortedIndexes[row]); } else { pDoc->ProjectNoMoreWork(m_iSortedIndexes[row]); } } } m_bForceUpdateSelection = true; UpdateSelection(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectNoNewWork - Function End")); }
void CViewProjects::OnProjectUpdate( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectUpdate - Function Begin")); CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); int row; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); wxASSERT(m_pListPane); row = -1; while (1) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; pDoc->ProjectUpdate(m_iSortedIndexes[row]); } m_bForceUpdateSelection = true; UpdateSelection(); pFrame->ResetReminderTimers(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectUpdate - Function End")); }
void CViewWork::OnWorkShowVMConsole( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkShowVMConsole - Function Begin")); CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); RESULT* result; int row; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); wxASSERT(m_pListPane); row = -1; while (1) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; result = pDoc->result(m_iSortedIndexes[row]); if (result) { pDoc->WorkShowVMConsole(result); } } UpdateSelection(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkShowVMConsole - Function End")); }
static menuSound_t PingSelected(void) { serverslot_t *slot; netadr_t address; char *hostname; if (!m_servers.list.numItems) return QMS_BEEP; if (m_servers.list.curvalue < 0) return QMS_BEEP; slot = m_servers.list.items[m_servers.list.curvalue]; address = slot->address; hostname = slot->hostname; FreeSlot(slot); slot = UI_FormatColumns(SLOT_EXTRASIZE, hostname, "???", "???", "?/?", "???", NULL); slot->status = SLOT_PENDING; slot->address = address; slot->hostname = hostname; slot->color = U32_WHITE; slot->numRules = 0; slot->numPlayers = 0; slot->timestamp = com_eventTime; m_servers.list.items[m_servers.list.curvalue] = slot; UpdateStatus(); UpdateSelection(); CL_SendStatusRequest(&slot->address); return QMS_SILENT; }
void CViewTasks::OnInit(wxCommandEvent& WXUNUSED(event)) { CBSLClient* pState = wxGetApp().GetState(); CViewTaskItem* pItem = NULL; CBSLTaskInstance bslTaskInstance; std::vector<BSLTASKINSTANCE> oTaskInstances; // Add any projects we know about pState->EnumerateTaskInstances(m_hHost, oTaskInstances, false); for (std::vector<BSLTASKINSTANCE>::iterator iter = oTaskInstances.begin(); iter != oTaskInstances.end(); iter++) { pState->GetTaskInstance(*iter, &bslTaskInstance); pItem = new CViewTaskItem(); m_oTaskItems.push_back(pItem); pItem->hTaskInstance = bslTaskInstance.GetTaskInstanceHandle(); pItem->uiIndex = (wxUint32)m_oTaskItems.size() - 1; pState->SetTaskInstanceEventData(bslTaskInstance.GetTaskInstanceHandle(), (wxUIntPtr)pItem); // Update the content of the list item UpdateTaskInstance(*pItem, bslTaskInstance); } m_pListPane->SetItemCount(m_oTaskItems.size()); // Register for task instance events pState->RegisterEventHandler(this, wxEVT_BSLTASKINSTANCE_BULKADD, m_hHost, NULL); pState->RegisterEventHandler(this, wxEVT_BSLTASKINSTANCE_BULKUPDATE, m_hHost, NULL); pState->RegisterEventHandler(this, wxEVT_BSLTASKINSTANCE_DELETE, m_hHost, NULL); // Update Everything UpdateSelection(); }
boolean StringBrowser::LeftButtonDown (Event& e) { boolean status = false; if (DoubleClicked(e)) { subject->SetValue(done[0]); status = true; } else if (uniqueSel) { if (Selections() == 0) { Select(Locate(e.x, e.y)); } else { Unselect(Selection()); if (!e.shift) { Select(Locate(e.x, e.y)); } } } else { lastdot = lastmark = Locate(e.x, e.y); if (Selected(lastdot) && e.shift) { Unselect(lastdot); do { ScrollToView(e.x, e.y); UpdateSelection(lastdot, Locate(e.x, e.y), Plain); Poll(e); } while (e.leftmouse); } else { if (!e.shift) { UnselectAll(); } Select(lastdot); do { ScrollToView(e.x, e.y); UpdateSelection(lastdot, Locate(e.x, e.y), highlight); Poll(e); } while (e.leftmouse); } } Note(e); if (singleClick) { subject->SetValue(done[0]); status = true; } return status; }
CViewResources::CViewResources(wxNotebook* pNotebook) : CBOINCBaseView(pNotebook) { m_BOINCwasEmpty=false; wxGridSizer* itemGridSizer = new wxGridSizer(2, 0, 3); wxASSERT(itemGridSizer); // create pie chart ctrl for total disk usage m_pieCtrlTotal = new wxPieCtrl(this, ID_PIECTRL_RESOURCEUTILIZATIONVIEWTOTAL, wxDefaultPosition, wxSize(-1,-1)); wxASSERT(m_pieCtrlTotal); // setup the legend m_pieCtrlTotal->SetTransparent(true); m_pieCtrlTotal->SetHorLegendBorder(10); m_pieCtrlTotal->SetLabelFont(*wxSWISS_FONT); m_pieCtrlTotal->SetLabelColour(wxColour(0,0,0)); m_pieCtrlTotal->SetLabel(_("Total disk usage")); // initialize pie control m_pieCtrlTotal->m_Series.Clear(); wxPiePart CtrlTotalPart; CtrlTotalPart.SetLabel(wxEmptyString); CtrlTotalPart.SetValue(1); CtrlTotalPart.SetColour(wxColour(255,255,255)); m_pieCtrlTotal->m_Series.Add(CtrlTotalPart); m_pieCtrlTotal->Refresh(); // create pie chart ctrl for BOINC disk usage m_pieCtrlBOINC = new wxPieCtrl(this, ID_PIECTRL_RESOURCEUTILIZATIONVIEW, wxDefaultPosition, wxSize(-1,-1)); wxASSERT(m_pieCtrlBOINC); //setup the legend m_pieCtrlBOINC->SetTransparent(true); m_pieCtrlBOINC->SetHorLegendBorder(10); m_pieCtrlBOINC->SetLabelFont(*wxSWISS_FONT); m_pieCtrlBOINC->SetLabelColour(wxColour(0,0,0)); m_pieCtrlBOINC->SetLabel(_("Disk usage by BOINC projects")); // initialize pie control m_pieCtrlBOINC->m_Series.Clear(); wxPiePart CtrlBOINCPart; CtrlBOINCPart.SetLabel(wxEmptyString); CtrlBOINCPart.SetValue(1); CtrlBOINCPart.SetColour(wxColour(255,255,255)); m_pieCtrlBOINC->m_Series.Add(CtrlBOINCPart); m_pieCtrlBOINC->Refresh(); //init the flexGrid itemGridSizer->Add(m_pieCtrlTotal, 1, wxGROW|wxALL,1); itemGridSizer->Add(m_pieCtrlBOINC, 1, wxGROW|wxALL,1); SetSizer(itemGridSizer); Layout(); UpdateSelection(); }
bool emFileManModel::Cycle() { if (IsSignaled(FileUpdateSignalModel->Sig)) { UpdateSelection(); UpdateCommands(); } return false; }
//------------------------------------------------------------------------------ // mousePressEvent - Handle mouse press events. //------------------------------------------------------------------------------ void Card::mousePressEvent(QGraphicsSceneMouseEvent*) { if ( isEnabled() && (flags() & QGraphicsItem::ItemIsSelectable)) { setSelected(!isSelected()); UpdateSelection(); } }
void LLEModulesManagerFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event), bool is_checked) { for (uint i = 0; i < m_check_list->GetCount(); i++) { m_check_list->Check(i, is_checked); UpdateSelection(i); } }
static void Size(menuFrameWork_t *self) { if (uis.width >= 640) SizeFull(); else SizeCompact(); UpdateSelection(); }
BOOL CXTPColorHex::SetSelectedColor(int iIndex, BOOL bNotify /*=TRUE*/) { if (iIndex != -1) { return UpdateSelection(GetColorCell(iIndex), bNotify); } return FALSE; }
LTBOOL CFolderWeaponControls::OnMouseMove(int x, int y) { if (CBaseFolder::OnMouseMove(x,y)) { UpdateSelection(); return LTTRUE; } return LTFALSE; }
void CXTPColorHex::OnMouseMove(UINT nFlags, CPoint point) { if (GetCapture() == this) { UpdateSelection(point); } CStatic::OnMouseMove(nFlags, point); }
void FltDlg::Show() { if (shown) return; FormWindow::Show(); UpdateSelection(); UpdateObjective(); }
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID, int iTaskWindowFlags, wxWindowID iListWindowID, int iListWindowFlags) : wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { m_bProcessingTaskRenderEvent = false; m_bProcessingListRenderEvent = false; m_bForceUpdateSelection = true; m_bIgnoreUIEvents = false; m_iPreviousSelectionCount = 0; m_lPreviousFirstSelection = -1; // // Setup View // m_pTaskPane = NULL; m_pListPane = NULL; SetName(GetViewName()); SetAutoLayout(TRUE); wxFlexGridSizer* itemFlexGridSizer = new wxFlexGridSizer(2, 0, 0); wxASSERT(itemFlexGridSizer); itemFlexGridSizer->AddGrowableRow(0); itemFlexGridSizer->AddGrowableCol(1); m_pTaskPane = new CBOINCTaskCtrl(this, iTaskWindowID, iTaskWindowFlags); wxASSERT(m_pTaskPane); m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags); wxASSERT(m_pListPane); itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1); itemFlexGridSizer->Add(m_pListPane, 1, wxGROW|wxALL, 1); SetSizer(itemFlexGridSizer); UpdateSelection(); #if USE_NATIVE_LISTCONTROL m_pListPane->PushEventHandler(new MyEvtHandler(m_pListPane)); #else m_pListPane->SaveEventHandler((m_pListPane->GetMainWin())->GetEventHandler()); (m_pListPane->GetMainWin())->PushEventHandler(new MyEvtHandler(m_pListPane)); #endif m_iProgressColumn = -1; m_iSortColumn = -1; m_bReverseSort = false; m_SortArrows = new wxImageList(16, 16, true); m_SortArrows->Add( wxIcon( sortascending_xpm ) ); m_SortArrows->Add( wxIcon( sortdescending_xpm ) ); m_pListPane->SetImageList(m_SortArrows, wxIMAGE_LIST_SMALL); }
void CViewProjects::OnProjectDetach( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectDetach - Function Begin")); wxInt32 iAnswer = 0; wxString strMessage = wxEmptyString; CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); CProject* pProject = NULL; int row; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); wxASSERT(m_pListPane); if (!pDoc->IsUserAuthorized()) return; pFrame->UpdateStatusText(_("Removing project...")); row = -1; while (1) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; if (GetProjectCacheAtIndex(pProject, m_iSortedIndexes[row])) { return; } strMessage.Printf( _("Are you sure you want to remove project '%s'?"), pProject->m_strProjectName.c_str() ); iAnswer = wxGetApp().SafeMessageBox( strMessage, _("Remove Project"), wxYES_NO | wxICON_QUESTION, this ); if (wxYES == iAnswer) { pDoc->ProjectDetach(m_iSortedIndexes[row]); } } pFrame->UpdateStatusText(wxT("")); m_bForceUpdateSelection = true; UpdateSelection(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectDetach - Function End")); }
void SelectionHandler::SelectAll(void) { m_coordInitial.X = 0; m_coordInitial.Y = 0; m_coordCurrent.X = m_consoleInfo->csbi.dwSize.X - 1; m_coordCurrent.Y = m_consoleInfo->csbi.dwSize.Y - 1; m_selectionState = selstateSelected; UpdateSelection(); }
// Handles a key press. Returns FALSE if the key was not processed through this method. // Left, Up, Down, Right, and Enter are automatically passed through OnUp(), OnDown(), etc. LTBOOL CFolderWeaponControls::HandleKeyDown(int key, int rep) { if (CBaseFolder::HandleKeyDown(key,rep)) { UpdateSelection(); return LTTRUE; } return LTFALSE; }
void CViewTransfers::OnTransfersAbort( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewTransfers::OnTransfersAbort - Function Begin")); wxInt32 iAnswer = 0; wxString strMessage = wxEmptyString; CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); CTransfer* pTransfer = NULL; int row; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); wxASSERT(m_pListPane); if (!pDoc->IsUserAuthorized()) return; pFrame->UpdateStatusText(_("Aborting transfer...")); row = -1; while (1) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; if (GetTransferCacheAtIndex(pTransfer, m_iSortedIndexes[row])) { return; } strMessage.Printf( _("Are you sure you want to abort this file transfer '%s'?\nNOTE: Aborting a transfer will invalidate a task and you\nwill not receive credit for it."), pTransfer->m_strFileName.c_str() ); iAnswer = wxGetApp().SafeMessageBox( strMessage, _("Abort File Transfer"), wxYES_NO | wxICON_QUESTION, this ); if (wxYES == iAnswer) { pDoc->TransferAbort(m_iSortedIndexes[row]); } } pFrame->UpdateStatusText(wxT("")); UpdateSelection(); pFrame->FireRefreshView(); wxLogTrace(wxT("Function Start/End"), wxT("CViewTransfers::OnTransfersAbort - Function End")); }