本文整理汇总了C++中OnClick函数的典型用法代码示例。如果您正苦于以下问题:C++ OnClick函数的具体用法?C++ OnClick怎么用?C++ OnClick使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnClick函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClick
int ListBox::OnKeyDown(int vk, int flags)
{
if (selcount == 1 && list_index >= 0 && list_index < items.size()) {
ListBoxItem* item = items[list_index];
if (vk == VK_DOWN) {
if (list_index < items.size() - 1) {
item->selected = false;
list_index++;
item = items[list_index];
item->selected = true;
OnClick();
return ActiveWindow::OnKeyDown(vk, flags);
}
}
else if (vk == VK_UP) {
if (list_index > 0) {
item->selected = false;
list_index--;
item = items[list_index];
item->selected = true;
OnClick();
return ActiveWindow::OnKeyDown(vk, flags);
}
}
}
return ScrollWindow::OnKeyDown(vk, flags);
}
示例2: SNew
TSharedRef<SWidget> UJavascriptListView::RebuildWidget()
{
MyListView = SNew(SListView< UObject* >)
.SelectionMode(SelectionMode)
.ListItemsSource(&Items)
.ItemHeight(ItemHeight)
.OnGenerateRow(BIND_UOBJECT_DELEGATE(SListView< UObject* >::FOnGenerateRow, HandleOnGenerateRow))
.OnSelectionChanged_Lambda([this](UObject* Object, ESelectInfo::Type SelectInfo){
OnSelectionChanged(Object, SelectInfo);
})
.OnMouseButtonClick_Lambda([this](UObject* Object){
OnClick(Object);
})
.OnMouseButtonDoubleClick_Lambda([this](UObject* Object){
OnDoubleClick(Object);
})
//.OnContextMenuOpening(this, &SSocketManager::OnContextMenuOpening)
//.OnItemScrolledIntoView(this, &SSocketManager::OnItemScrolledIntoView)
// .HeaderRow
// (
// SNew(SHeaderRow)
// .Visibility(EVisibility::Collapsed)
// + SHeaderRow::Column(TEXT("Socket"))
// );
;
return BuildDesignTimeWidget(MyListView.ToSharedRef());
}
示例3: OnClick
void YAddingSong::Notify(TNotifyUI& msg)
{
if (msg.sType.Compare(kClick)==0)
OnClick(msg);
else if(msg.sType.Compare(kWindowInit)==0)
OnInit(msg);
}
示例4: ReleaseCapture
void CXTPPopupControl::OnLButtonUp(UINT /*nFlags*/, CPoint point)
{
//if there is pressed control
if (m_pPressed)
{
//store popup pointer
CXTPPopupItem* pPressed = m_pPressed;
m_pPressed = NULL;
//free mouse event
ReleaseCapture();
RedrawControl();
//if selected pointer equal pressed pointer - it is clik on item
if (pPressed == m_pSelected)
{
//redraw all valid items
OnClick(pPressed);
}
else
{
OnMouseMove(0, point);
}
}
}
示例5: OnClick
void PropertyWin::Notify(TNotifyUI& msg)
{
if (msg.sType.Compare(kClick)==0)
{
OnClick(msg);
}
}
示例6: switch
bool CGUIDialogVisualisationSettings::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
unsigned int iControl = message.GetSenderId();
if (iControl >= CONTROL_START && iControl < CONTROL_PAGE)
OnClick(iControl);
return true;
}
break;
case GUI_MSG_WINDOW_DEINIT:
case GUI_MSG_VISUALISATION_UNLOADING:
{
FreeControls();
m_pVisualisation = NULL;
m_pSettings = NULL;
}
break;
case GUI_MSG_VISUALISATION_LOADED:
{
SetVisualisation((CVisualisation *)message.GetLPVOID());
SetupPage();
SET_CONTROL_FOCUS(CONTROL_START, 0);
}
}
return CGUIDialog::OnMessage(message);
}
示例7: QWidget
Palindroma::Palindroma(QWidget *parent) :
QWidget(parent),
ui(new Ui::Palindroma)
{
ui->setupUi(this);
connect( ui->pushButton , SIGNAL(clicked()) , this , SLOT(OnClick())) ;
}
示例8: Vector2f
void ButtonComponent::CheckMouseCollision()
{
m_wasPressed = false;
Vector2f diff = g_input->GetMousePosition() - m_object->GetGlobalPos();
float alpha = -m_object->GetGlobalRotation() * (float)PI / 180.f;
Vector2f rotatedDiff = Vector2f(diff.x * cos(alpha) - diff.y * sin(alpha), diff.x * sin(alpha) + diff.y * cos(alpha));
if (rotatedDiff.x >= 0 &&
rotatedDiff.y >= 0 &&
rotatedDiff.x <= m_size.x &&
rotatedDiff.y <= m_size.y)
{
OnFocus();
if (g_input->WasPressedThisTurn(MOUSE_LEFT))
{
OnClick();
}
}
else
{
OnUnfocus();
}
}
示例9: switch
/** ***********************************************************************
**
** OnInputAction
**
************************************************************************ */
BOOL OpNumberEdit::OnInputAction(OpInputAction* action)
{
#if defined OP_KEY_UP_ENABLED && defined OP_KEY_DOWN_ENABLED
switch (action->GetAction())
{
case OpInputAction::ACTION_LOWLEVEL_PREFILTER_ACTION:
{
switch (action->GetChildAction()->GetAction())
{
case OpInputAction::ACTION_LOWLEVEL_KEY_PRESSED:
{
OpKey::Code key = action->GetChildAction()->GetActionKeyCode();
switch (key)
{
case OP_KEY_UP:
case OP_KEY_DOWN:
// Simulate click on the up or down button
OnClick(m_spinner, key == OP_KEY_DOWN ? 1 : 0);
return TRUE;
}
}
}
return FALSE;
}
}
#endif // defined OP_KEY_UP_ENABLED && defined OP_KEY_DOWN_ENABLED
return FALSE;
}
示例10: GetSelectedItem
bool CGUIDialogFavourites::OnMessage(CGUIMessage &message)
{
if (message.GetMessage() == GUI_MSG_CLICKED)
{
if (message.GetSenderId() == FAVOURITES_LIST)
{
int item = GetSelectedItem();
int action = message.GetParam1();
if (action == ACTION_SELECT_ITEM || action == ACTION_MOUSE_LEFT_CLICK)
OnClick(item);
else if (action == ACTION_MOVE_ITEM_UP)
OnMoveItem(item, -1);
else if (action == ACTION_MOVE_ITEM_DOWN)
OnMoveItem(item, 1);
else if (action == ACTION_CONTEXT_MENU || action == ACTION_MOUSE_RIGHT_CLICK)
OnPopupMenu(item);
else if (action == ACTION_DELETE_ITEM)
OnDelete(item);
else
return false;
return true;
}
}
else if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT)
{
CGUIDialog::OnMessage(message);
// clear our favourites
CGUIMessage message(GUI_MSG_LABEL_RESET, GetID(), FAVOURITES_LIST);
OnMessage(message);
m_favourites->Clear();
return true;
}
return CGUIDialog::OnMessage(message);
}
示例11: OnClick
bool CDialogRecordPref::OnAction(int actionId)
{
if (actionId == ADDON_ACTION_CLOSE_DIALOG || actionId == ADDON_ACTION_PREVIOUS_MENU || actionId == 92/*back*/)
return OnClick(BUTTON_CANCEL);
else
return false;
}
示例12: OnClick
void Gui::OnAi(void)
{
ui->buttonBox->setEnabled(false);
if(model->solver.isSolved() == false)
this->OnSolve();
if(model->solver.isSolved() == false)
return;
QElapsedTimer timer;
timer.start();
for( long y = 0 ; y < model->rowCount() ; y++)
{
for( long x = 0 ; x < model->columnCount() ; x++)
{
if(model->solver.get(x, y))
{
OnClick(model->index(y, x));
qApp->processEvents();
//yieldCurrentThread();
//msleep(10);
}
}
}
double elapsed = static_cast<long>(timer.elapsed()) / 1000.0;
statusBar()->showMessage(QString("Autoplay in %1 ms").arg(elapsed));
ui->buttonBox->setEnabled(true);
}
示例13: OnClick
void __stdcall ExOptions::m_OnEnter(StormMsg * Msg) // 28.12 -> resolved
{
OnClick(Msg);
Msg->_2 = 1;
Msg->_3 = 0;
D2Funcs.STORM_ResetMsgQuene(Msg);
}
示例14: if
bool Button::HandleEvents(const SDL_Event &Event)
{
if(Event.type==SDL_EventType::SDL_MOUSEMOTION)
{
if(PointInside(Event.motion.x, Event.motion.y))
{
Selected=true;
}
else
{
Selected=false;
}
}
else if(Event.type==SDL_EventType::SDL_MOUSEBUTTONDOWN)
{
if(Event.button.button==SDL_BUTTON_LEFT)
{
if(PointInside(Event.button.x, Event.button.y))
{
OnClick();
}
}
}
return true;
}
示例15: switch
// We have to dispatch our own notify messages because the multiple inheritance of CCSHDialog prevents
// the message map from compiling properly for ON_NOTIFY messages.
BOOL CFailingRulesDialog::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult )
{
LPNMHDR pHdr=(LPNMHDR)lParam;
bool bHandled=false;
switch(pHdr->idFrom){
case IDC_LIST1:
switch (pHdr->code) {
case LVN_ITEMCHANGED:
bHandled=OnItemChanged(wParam, (LPNMLISTVIEW)lParam, pResult);
break;
case NM_CLICK:
bHandled=OnClick(wParam, (LPNMLISTVIEW)lParam, pResult);
break;
case NM_RCLICK:
bHandled=OnRClick(wParam, (LPNMITEMACTIVATE)lParam, pResult);
break;
default:
break;
}
break;
case IDC_LIST2:
switch (pHdr->code) {
case LVN_ITEMCHANGED:
bHandled=OnSolutionItemChanged(wParam,(LPNMLISTVIEW)lParam, pResult);
break;
default:
break;
}
break;
}
return bHandled || CeCosDialog::OnNotify(wParam,lParam,pResult);
}