本文整理汇总了C++中UIManager::Button1Down方法的典型用法代码示例。如果您正苦于以下问题:C++ UIManager::Button1Down方法的具体用法?C++ UIManager::Button1Down怎么用?C++ UIManager::Button1Down使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIManager
的用法示例。
在下文中一共展示了UIManager::Button1Down方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MouseDown
// ---------------------------------------------------------------------
//! Called when user presses a mouse button.
// ---------------------------------------------------------------------
void BeSkinView::MouseDown(
BPoint where //!< location of the cursor
)
{
uint32 buttons = 0;
BMessage* message = Window()->CurrentMessage();
if (NULL != message)
{
int32 value = 0;
if (B_OK == message->FindInt32("buttons", &value))
{
buttons = value;
}
}
if (0 == (buttons & (B_PRIMARY_MOUSE_BUTTON | B_SECONDARY_MOUSE_BUTTON)))
{
return;
}
BWindow* window = Window();
if (!window->IsActive())
{
window->Activate();
}
// deactivate tool tip
BMessage deactivateMessage(BeToolTipWindow::MSG_DEACTIVATE);
toolTipMessenger->SendMessage(&deactivateMessage, static_cast<BHandler*>(NULL), 1000000);
UIManager* uiManager = getUIManager();
ASSERT(NULL != uiManager);
if (NULL != uiManager)
{
if (buttons & B_PRIMARY_MOUSE_BUTTON)
{
uiManager->Button1Down();
lastPressedMouseButton = 1;
}
else if (buttons & B_SECONDARY_MOUSE_BUTTON)
{
uiManager->Button2Down();
lastPressedMouseButton = 2;
}
}
}
示例2: getUIManager
// ---------------------------------------------------------------------
LRESULT WinSkinWindow::onLButtonDown(
HWND hWnd, //!< ウィンドウハンドル
UINT uMsg, //!< WM_LBUTTONDOWN
WPARAM wParam, //!< 様々な仮想キーが押されているかどうのフラグ
LPARAM lParam //!< 下位ワードがマウスカーソルの X 座標、上位ワードが Y 座標
)
{
base::wndProc(hWnd, uMsg, wParam, lParam);
mousePosition.x = GET_X_LPARAM(lParam);
mousePosition.y = GET_Y_LPARAM(lParam);
mousePositionAvailable = true;
UIManager* uiManager = getUIManager();
ASSERT(NULL != uiManager);
if (NULL != uiManager)
{
uiManager->Button1Down();
}
return 0;
}