本文整理汇总了C++中nuiEvent::Cancel方法的典型用法代码示例。如果您正苦于以下问题:C++ nuiEvent::Cancel方法的具体用法?C++ nuiEvent::Cancel怎么用?C++ nuiEvent::Cancel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nuiEvent
的用法示例。
在下文中一共展示了nuiEvent::Cancel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Renamed
void nuiMatrixView::Renamed(const nuiEvent& rEvent)
{
NGL_ASSERT(rEvent.mpUser);
nuiLabelRenamer* renamer = (nuiLabelRenamer*)rEvent.mpUser;
nglString contents = renamer->GetText();
contents.Trim();
if (contents.IsEmpty())
{
rEvent.Cancel();
return;
}
double value = contents.GetCDouble();
// report the new value to all selected items
if (mSelectedItems.size() != 0)
{
std::map<nuiMatrixViewItem*, bool>::iterator it;
for (it = mSelectedItems.begin(); it != mSelectedItems.end(); ++it)
{
nuiMatrixViewItem* item = it->first;
item->SetValue(value);
}
}
// report the new value to the single targeted item
else
mClickedItem->SetValue(value);
ValueChanged();
rEvent.Cancel();
}
示例2: CreateLLThread
void ThreadInspectorTest::CreateLLThread(const nuiEvent& rEvent)
{
// create thread
nglString name;
name.Format(_T("LLtest%d"), mThreadCount);
mThreadCount++;
TITLLthread* pThread = new TITLLthread(name);
// create UI control in the list
nuiHBox* pBox = new nuiHBox(0);
mpLLList->AddChild(pBox);
pBox->SetBorder(0, 3);
// store the relation widget box -> thread
mLLThreads[pBox] = pThread;
pThread->Start();
nglString label;
label.Format(_T("LLthread '%ls' [0x%x]"), pThread->GetName().GetChars(), pThread->GetID());
nuiLabel* pLabel = new nuiLabel(label);
pBox->AddCell(pLabel);
pBox->AddCell(pThread->InitGUI());
rEvent.Cancel();
}
示例3: OnButtonPressed
void MainWindow::OnButtonPressed(const nuiEvent& rEvent)
{
NGL_OUT("MainWindow::OnButtonPressed");
int64 tag = (int64)rEvent.mpUser;
nglString msg;
switch (tag)
{
case TAG_BUTTON1:
msg = _T("a simple button\nwith a 'nuiCenter' position");
break;
case TAG_BUTTON2:
msg = _T("the same simple button\nbut with a 'nuiFill' position");
break;
case TAG_BUTTON3:
msg = _T("a simple button\nwith an image inside");
break;
case TAG_BUTTON4:
msg = _T("a rollover button\nusing three decorations");
break;
}
mpLabel->SetText(msg);
rEvent.Cancel();
}
示例4: OnTogglePressed
void MainWindow::OnTogglePressed(const nuiEvent& rEvent)
{
NGL_OUT("MainWindow::OnTogglePressed");
int64 tag = (int64)rEvent.mpUser;
nglString msg;
switch (tag)
{
case TAG_TOGGLEBUTTON1:
msg = _T("a simple togglebutton, pressed");
break;
case TAG_TOGGLEBUTTON2:
msg = _T("a simple togglebutton, released");
break;
case TAG_TOGGLEBUTTON3:
msg = _T("a checkbox, pressed");
break;
case TAG_TOGGLEBUTTON4:
msg = _T("a checkbox, released");
break;
}
mpLabel->SetText(msg);
rEvent.Cancel();
}
示例5: OnSourceTextChanged
void ProjectGenerator::OnSourceTextChanged(const nuiEvent& rEvent)
{
mpTimer->Stop();
mpTimer->Start(false);
rEvent.Cancel();
}
示例6: OnMenuCommand
void MainWindow::OnMenuCommand(const nuiEvent& rEvent)
{
uint64 ID = (uint64)rEvent.mpUser;
nglString msg;
msg.Format(_T("event item New%d"), ID);
MyCommand(msg);
rEvent.Cancel();
}
示例7: OnBrowseTarget
void ProjectGenerator::OnBrowseTarget(const nuiEvent& rEvent)
{
nglPath path = nglPath(mProjectTargetPath).GetParent();
nuiDialogSelectDirectory* pDialog = new nuiDialogSelectDirectory(GetMainWindow(), _T("ENTER THE NEW PROJECT TARGET"), path, nglPath(_T("/")));
mEventSink.Connect(pDialog->DirectorySelected, &ProjectGenerator::OnTargetSelected, (void*)pDialog);
rEvent.Cancel();
}
示例8: OnTimerTick
void TimeLabel::OnTimerTick(const nuiEvent& rEvent)
{
nglString text(GetPosition());
text += (_T(" / "));
text += GetLength();
SetText(text);
rEvent.Cancel();
}
示例9: OnFrameMouseMoved
void FrameEditor::OnFrameMouseMoved(const nuiEvent& rEvent)
{
nuiMouseMovedEvent* pEvent = (nuiMouseMovedEvent*)&rEvent;
// set the information nuiAttribute. It will automatically update the gui
nuiPoint point(pEvent->mX, pEvent->mY);
GetMainWindow()->mAttributeMouseCoord.Set(point);
rEvent.Cancel();
}
示例10: SwatchSelected
void nuiColorSelector::SwatchSelected(const nuiEvent& rEvent)
{
nuiPane* pPane = (nuiPane*) rEvent.mpUser;
SetCurrentColor(pPane->GetFillColor());
// send event
SwatchColorChanged();
rEvent.Cancel();
}
示例11: OnRadioPressed
void MainWindow::OnRadioPressed(const nuiEvent& rEvent)
{
int64 index = (int64)rEvent.mpUser;
nglString msg;
msg.Format(_T("radio button #%d"), index);
mpLabel->SetText(msg);
rEvent.Cancel();
}
示例12: OnItemActivated
void MainWindow::OnItemActivated(const nuiEvent& rEvent)
{
uint32 token;
nuiGetTokenValue<uint32>(mpList->GetSelectedToken(), token);
nglString message;
message.Format(_T("activated item num %d"), token);
mpOutput->SetText(message);
rEvent.Cancel();
}
示例13: OnScrollbarMoved
//
// just a trick to make the two scrollbars move together
//
void MainWindow::OnScrollbarMoved(const nuiEvent& rEvent)
{
// get the scrollbar given as the event's user parameter
nuiScrollView* pView = (nuiScrollView*)rEvent.mpUser;
// guess who is the other scrollbar
nuiScrollView* pOtherView = (pView == mpViews[0])? mpViews[1] : mpViews[0];
// ask the other one to take the position that the first one is giving
pOtherView->GetScrollBar(nuiVertical)->GetRange().SetValue(pView->GetScrollBar(nuiVertical)->GetRange().GetValue());
rEvent.Cancel();
}
示例14: RGBSliderChanged
void nuiColorSelector::RGBSliderChanged(const nuiEvent& rEvent)
{
nuiSize red = (float)mpRedSlider->GetRange().GetValue();
nuiSize green = (float)mpGreenSlider->GetRange().GetValue();
nuiSize blue = (float)mpBlueSlider->GetRange().GetValue();
nuiSize alpha = (float)mpRGBAlphaSlider->GetRange().GetValue();
SetCurrentColor(nuiColor(red, green, blue, alpha));
// send event
RGBColorChanged();
rEvent.Cancel();
}
示例15: OnAddItem
void MainWindow::OnAddItem(const nuiEvent& rEvent)
{
uint32 ID = mUniqueID;
mUniqueID++;
nglString name;
name.Format(_T("New%d"), ID);
nuiMainMenuItem* pNew = new nuiMainMenuItem(name);
mpCurrentTestMenu->AddChild(pNew);
mEventSink.Connect(pNew->Activated, &MainWindow::OnMenuCommand, (void*)ID);
mpLastItem = pNew;
rEvent.Cancel();
}