本文整理汇总了C++中UpdateSelection函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateSelection函数的具体用法?C++ UpdateSelection怎么用?C++ UpdateSelection使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateSelection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetControl
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);
}
示例2: UpdateSelection
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();
}
示例3: UpdateSelection
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);
}
}
}
示例4: WXUNUSED
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"));
}
示例5: wxDialog
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(); });
}
示例6: WXUNUSED
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"));
}
示例7: event
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;
}
示例8: WXUNUSED
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"));
}
示例9: WXUNUSED
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"));
}
示例10: PingSelected
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;
}
示例11: WXUNUSED
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();
}
示例12: if
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;
}
示例13: CBOINCBaseView
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();
}
示例14: UpdateSelection
bool emFileManModel::Cycle()
{
if (IsSignaled(FileUpdateSignalModel->Sig)) {
UpdateSelection();
UpdateCommands();
}
return false;
}
示例15: setSelected
//------------------------------------------------------------------------------
// mousePressEvent - Handle mouse press events.
//------------------------------------------------------------------------------
void Card::mousePressEvent(QGraphicsSceneMouseEvent*)
{
if ( isEnabled() && (flags() & QGraphicsItem::ItemIsSelectable))
{
setSelected(!isSelected());
UpdateSelection();
}
}