当前位置: 首页>>代码示例>>C++>>正文


C++ nuiEvent::Cancel方法代码示例

本文整理汇总了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();
}
开发者ID:YetToCome,项目名称:nui3,代码行数:33,代码来源:nuiMatrixView.cpp

示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:27,代码来源:ThreadInspectorTest.cpp

示例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();
}
开发者ID:changbiao,项目名称:nui3,代码行数:27,代码来源:MainWindow.cpp

示例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();
}
开发者ID:changbiao,项目名称:nui3,代码行数:27,代码来源:MainWindow.cpp

示例5: OnSourceTextChanged

void ProjectGenerator::OnSourceTextChanged(const nuiEvent& rEvent)
{
  mpTimer->Stop();
  mpTimer->Start(false);
    
  rEvent.Cancel();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:7,代码来源:ProjectGenerator.cpp

示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:8,代码来源:MainWindow.cpp

示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:8,代码来源:ProjectGenerator.cpp

示例8: OnTimerTick

void TimeLabel::OnTimerTick(const nuiEvent& rEvent)
{
  nglString text(GetPosition());
  text += (_T(" / "));
  text += GetLength();
  
  SetText(text);
  rEvent.Cancel();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:9,代码来源:TimeLabel.cpp

示例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();
}
开发者ID:YetToCome,项目名称:nui3,代码行数:9,代码来源:FrameEditor.cpp

示例10: SwatchSelected

void nuiColorSelector::SwatchSelected(const nuiEvent& rEvent)
{
  nuiPane* pPane = (nuiPane*) rEvent.mpUser;
  SetCurrentColor(pPane->GetFillColor());
  
  // send event
  SwatchColorChanged(); 
  rEvent.Cancel();
}
开发者ID:YetToCome,项目名称:nui3,代码行数:9,代码来源:nuiColorSelector.cpp

示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:10,代码来源:MainWindow.cpp

示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:11,代码来源:MainWindow.cpp

示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:15,代码来源:MainWindow.cpp

示例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();
}
开发者ID:YetToCome,项目名称:nui3,代码行数:14,代码来源:nuiColorSelector.cpp

示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:15,代码来源:MainWindow.cpp


注:本文中的nuiEvent::Cancel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。