本文整理汇总了C++中nuiEvent类的典型用法代码示例。如果您正苦于以下问题:C++ nuiEvent类的具体用法?C++ nuiEvent怎么用?C++ nuiEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了nuiEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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;
}
开发者ID:hamedmohammadi,项目名称:nui3,代码行数:29,代码来源:nuiEvent.cpp
示例3: CallEvent
bool nuiEventTargetBase::CallEvent(void* pTarget, nuiDelegateMemento pFunc, const nuiEvent& rEvent)
{
Delegate del;
del.SetMemento(pFunc);
del(rEvent);
return rEvent.IsCanceled();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:7,代码来源:nuiEvent.cpp
示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:27,代码来源:ThreadInspectorTest.cpp
示例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();
}
开发者ID:changbiao,项目名称:nui3,代码行数:27,代码来源:MainWindow.cpp
示例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();
}
开发者ID:changbiao,项目名称:nui3,代码行数:27,代码来源:MainWindow.cpp
示例7: OnSourceTextChanged
void ProjectGenerator::OnSourceTextChanged(const nuiEvent& rEvent)
{
mpTimer->Stop();
mpTimer->Start(false);
rEvent.Cancel();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:7,代码来源:ProjectGenerator.cpp
示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:8,代码来源:MainWindow.cpp
示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:8,代码来源:ProjectGenerator.cpp
示例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());
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:17,代码来源:ProjectGenerator.cpp
示例11: OnTimerTick
void TimeLabel::OnTimerTick(const nuiEvent& rEvent)
{
nglString text(GetPosition());
text += (_T(" / "));
text += GetLength();
SetText(text);
rEvent.Cancel();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:9,代码来源:TimeLabel.cpp
示例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();
}
开发者ID:YetToCome,项目名称:nui3,代码行数:9,代码来源:FrameEditor.cpp
示例13: 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
示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:10,代码来源:MainWindow.cpp
示例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();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:11,代码来源:MainWindow.cpp
示例16: 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
示例17: 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();
bool handled = false;
while (it != end && !handled)
{
((*it)->OnEvent(rEvent));
handled = rEvent.IsCanceled();
++it;
}
return handled;
}
return false;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:22,代码来源:nuiEvent.cpp
示例18: 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
示例19: RemoveLLThread
void ThreadInspectorTest::RemoveLLThread(const nuiEvent& rEvent)
{
nuiWidget* pWidget = mpLLList->GetSelected();
if (!pWidget)
{
rEvent.Cancel();
return;
}
// retrieve thread associated to the selected widget from the list
std::map<nuiWidget*, TITLLthread*>::iterator it = mLLThreads.find(pWidget);
NGL_ASSERT(it != mLLThreads.end());
// request stop to the thread
TITLLthread* pThread = it->second;
pThread->Stop();
// clean
delete pThread;
mpLLList->DelChild(pWidget);
mLLThreads.erase(it);
rEvent.Cancel();
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:24,代码来源:ThreadInspectorTest.cpp
示例20: 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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论