本文整理汇总了C++中nuiEvent类的典型用法代码示例。如果您正苦于以下问题:C++ nuiEvent类的具体用法?C++ nuiEvent怎么用?C++ nuiEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了nuiEvent类的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: targets
bool nuiEventSource::SendEvent(const nuiEvent& rEvent)
{
if (IsEnabled() && !mpTargets.empty())
{
rEvent.SetSource(this);
std::vector<nuiEventTargetBase*> targets(mpTargets);
std::vector<nuiEventTargetBase*>::const_iterator it = targets.begin();
std::vector<nuiEventTargetBase*>::const_iterator end = targets.end();
mEnumerating++;
bool handled = false;
while (it != end && !handled)
{
nuiEventTargetBase* pETB = *it;
if (mGraveYard.find(pETB) == mGraveYard.end())
{
pETB->OnEvent(rEvent);
handled = rEvent.IsCanceled();
}
++it;
}
mEnumerating--;
mGraveYard.clear();
return handled;
}
return false;
}
示例3: CallEvent
bool nuiEventTargetBase::CallEvent(void* pTarget, nuiDelegateMemento pFunc, const nuiEvent& rEvent)
{
Delegate del;
del.SetMemento(pFunc);
del(rEvent);
return rEvent.IsCanceled();
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例7: OnSourceTextChanged
void ProjectGenerator::OnSourceTextChanged(const nuiEvent& rEvent)
{
mpTimer->Stop();
mpTimer->Start(false);
rEvent.Cancel();
}
示例8: 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();
}
示例9: 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();
}
示例10: OnTargetSelected
void ProjectGenerator::OnTargetSelected(const nuiEvent& rEvent)
{
nuiDialogSelectDirectory* pDialog = (nuiDialogSelectDirectory*)rEvent.mpUser;
mProjectTargetPath = pDialog->GetSelectedDirectory();
mpProjectTarget->SetText(mProjectTargetPath);
nglPath path(mProjectTargetPath);
OnTargetTextChanged(rEvent);
if (!rEvent.IsCanceled())
{
rEvent.Cancel();
return;
}
GetPreferences().SetString(PREFERENCES_PROJECTGENERATOR, _T("nuiTargetPath"), path.GetParent().GetPathName());
}
示例11: OnTimerTick
void TimeLabel::OnTimerTick(const nuiEvent& rEvent)
{
nglString text(GetPosition());
text += (_T(" / "));
text += GetLength();
SetText(text);
rEvent.Cancel();
}
示例12: 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();
}
示例13: SwatchSelected
void nuiColorSelector::SwatchSelected(const nuiEvent& rEvent)
{
nuiPane* pPane = (nuiPane*) rEvent.mpUser;
SetCurrentColor(pPane->GetFillColor());
// send event
SwatchColorChanged();
rEvent.Cancel();
}
示例14: 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();
}
示例15: 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();
}