void CHOpenGLView::OnRButtonUp(UINT /* nFlags */, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
Exemplo n.º 2
0
void CbaltoshopView::OnRButtonUp(UINT nFlags, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
void CMy150716MapToolmfcView::OnRButtonUp(UINT /* nFlags */, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
Exemplo n.º 4
0
INT_PTR Dialog::DialogProcDefault(HWND hwnd, UINT uMsg,
                                  WPARAM wParam, LPARAM lParam) {
  switch (uMsg) {
    case WM_CLOSE: {
      return OnClose();
    }
    case WM_COMMAND: {
      switch (LOWORD(wParam)) {
        case IDOK:
          OnOK();
          return TRUE;
        case IDCANCEL:
          OnCancel();
          return TRUE;
        default:
          return OnCommand(wParam, lParam);
      }
      break;
    }
    case WM_CONTEXTMENU: {
      POINT pt = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
      OnContextMenu(reinterpret_cast<HWND>(wParam), pt);
      break;
    }
    case WM_DESTROY: {
      OnDestroy();
      break;
    }
    case WM_INITDIALOG: {
#ifdef TAIGA_WIN_DIALOG_REMEMBER_LAST_POSITION_AND_SIZE
      if (pos_last_.x && pos_last_.y)
        SetPosition(nullptr, pos_last_.x, pos_last_.y, 0, 0, SWP_NOSIZE);
      if (size_last_.cx && size_last_.cy)
        SetPosition(nullptr, 0, 0, size_last_.cx, size_last_.cy, SWP_NOMOVE);
#endif
      return OnInitDialog();
    }
    case WM_DROPFILES: {
      OnDropFiles(reinterpret_cast<HDROP>(wParam));
      break;
    }
    case WM_ENTERSIZEMOVE:
    case WM_EXITSIZEMOVE: {
      SIZE size = {0};
      OnSize(uMsg, 0, size);
      break;
    }
    case WM_GETMINMAXINFO: {
      LPMINMAXINFO mmi = reinterpret_cast<LPMINMAXINFO>(lParam);
      SetMinMaxInfo(mmi);
      OnGetMinMaxInfo(mmi);
      break;
    }
    case WM_LBUTTONDOWN:
    case WM_MBUTTONDOWN:
    case WM_RBUTTONDOWN:
    case WM_LBUTTONUP:
    case WM_MBUTTONUP:
    case WM_RBUTTONUP:
    case WM_MOUSEACTIVATE:
    case WM_MOUSEHOVER:
    case WM_MOUSEHWHEEL:
    case WM_MOUSELEAVE:
    case WM_MOUSEMOVE:
    case WM_MOUSEWHEEL: {
      LRESULT result = OnMouseEvent(uMsg, wParam, lParam);
      if (result != -1) {
        ::SetWindowLongPtrW(hwnd, DWL_MSGRESULT, result);
        return TRUE;
      }
      break;
    }
    case WM_MOVE: {
      POINTS pts = MAKEPOINTS(lParam);
      OnMove(&pts);
      break;
    }
    case WM_NOTIFY: {
      LRESULT result = OnNotify(wParam, reinterpret_cast<LPNMHDR>(lParam));
      if (result) {
        ::SetWindowLongPtr(hwnd, DWL_MSGRESULT, result);
        return TRUE;
      }
      break;
    }
    case WM_PAINT: {
      if (::GetUpdateRect(hwnd, nullptr, FALSE)) {
        PAINTSTRUCT ps;
        HDC hdc = ::BeginPaint(hwnd, &ps);
        OnPaint(hdc, &ps);
        ::EndPaint(hwnd, &ps);
      } else {
        HDC hdc = ::GetDC(hwnd);
        OnPaint(hdc, nullptr);
        ::ReleaseDC(hwnd, hdc);
      }
      break;
    }
    case WM_SIZE: {
      SIZE size = {LOWORD(lParam), HIWORD(lParam)};
      OnSize(uMsg, static_cast<UINT>(wParam), size);
      break;
    }
    case WM_TIMER: {
      OnTimer(static_cast<UINT_PTR>(wParam));
      break;
    }
    case WM_WINDOWPOSCHANGING: {
      LPWINDOWPOS window_pos = reinterpret_cast<LPWINDOWPOS>(lParam);
      SnapToEdges(window_pos);
      OnWindowPosChanging(window_pos);
      break;
    }
    default: {
      if (uMsg == WM_TASKBARCREATED ||
          uMsg == WM_TASKBARBUTTONCREATED ||
          uMsg == WM_TASKBARCALLBACK) {
        OnTaskbarCallback(uMsg, lParam);
        return FALSE;
      }
      break;
    }
  }

  return FALSE;
}
void CBlendingAnimationsView::OnRButtonUp(UINT /* nFlags */, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
	void CRecognitionTextView::OnRButtonUp(UINT /* nFlags */, CPoint point)
	{
		ClientToScreen(&point);
		OnContextMenu(this, point);
	}
Exemplo n.º 7
0
void CCommTestView::OnRButtonUp(UINT nFlags, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
Exemplo n.º 8
0
void TableView::handleEvent(System::Event* evt)
{
	ASSERT(0);
#if 0
	sysstring type = evt->get_type();

	if (evt->get_eventPhase() != System::CAPTURING_PHASE)
	{
		if (type == OLESTR("command"))
		{
			CommandInvokeEvent* cmdEvt = dynamic_cast<CommandInvokeEvent*>(evt);

			int ncolumn = cmdEvt->get_Command() - 100;
			Visual* column = m_list->m_treeHeader->m_columns[ncolumn];
			column->put_Visibility(column->get_Visibility()==Collapsed? Visible: Collapsed);
		}
		else if (type == OLESTR("contextmenu"))
		{
			evt->stopPropagation();
			MouseEvent* mouseEvt = dynamic_cast<MouseEvent*>(evt);

			OnContextMenu(mouseEvt);
		}
		else if (type == OLESTR("ItemStateChanging"))
		{
			evt->stopPropagation();

			int index = *dynamic_cast<IntObject*>(dynamic_cast<TreeItem*>(evt->get_target())->m_itemData);

			Record pRecord = m_table[index];

			CViewGroup* pMessage = new MailMessage;

			Field Subject = pRecord.get_Fields()[1];
			Field Headers = pRecord.get_Fields()[3];
			Field Content = pRecord.get_Fields()[4];

			ScrollViewer* pScroller = new ScrollViewer;
			{
				TextEdit* textView = new TextEdit;
				textView->put_textDocument(new TextDocument());
				textView->SetText(
					ConvertA2S((char*)Headers.GetData(), Headers.GetSize()) +
					OLESTR("\n") +
					ConvertA2S((char*)Content.GetData(), Content.GetSize()));

				pScroller->put_Content(textView);
			}
			pScroller->SetOwnerWindow(get_OwnerWindow());	// TODO remove

			pMessage->m_views.Add(pScroller);

			m_xmlDocumentWorkspace.Create(m_Canvas, pMessage);

			for (int i = 0; i < pMessage->m_sheets.GetSize(); i++)
			{
				CViewSheet* pViewSheet = pMessage->m_sheets[i];

				sysstring str;
				try
				{
					str = ConvertA2S((char*)Subject.GetData(), Subject.GetSize());
				}
				catch(int)
				{
					str = OLESTR("(Error)");
				}

				pViewSheet->m_tabElement->set_TextContent(str);
			}
		}
	}
#endif
}
Exemplo n.º 9
0
void OUMapMakerEXView::OnRButtonUp(UINT nFlags, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
Exemplo n.º 10
0
void CUIDesignerView::OnRButtonUp(UINT nFlags, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
void CMy601DemoClientView::OnRButtonUp(UINT /* nFlags */, CPoint point)
{
	ClientToScreen(&point);
	OnContextMenu(this, point);
}
Exemplo n.º 12
0
bool CGUIBaseContainer::OnAction(const CAction &action)
{
  if (action.GetID() >= KEY_ASCII)
  {
    OnJumpLetter((char)(action.GetID() & 0xff));
    return true;
  }
  // stop the timer on any other action
  m_matchTimer.Stop();

  switch (action.GetID())
  {
  case ACTION_MOVE_LEFT:
  case ACTION_MOVE_RIGHT:
  case ACTION_MOVE_DOWN:
  case ACTION_MOVE_UP:
  case ACTION_NAV_BACK:
  case ACTION_PREVIOUS_MENU:
    {
      if (!HasFocus()) return false;

      if (action.GetHoldTime() > HOLD_TIME_START &&
        ((m_orientation == VERTICAL && (action.GetID() == ACTION_MOVE_UP || action.GetID() == ACTION_MOVE_DOWN)) ||
         (m_orientation == HORIZONTAL && (action.GetID() == ACTION_MOVE_LEFT || action.GetID() == ACTION_MOVE_RIGHT))))
      { // action is held down - repeat a number of times
        float speed = std::min(1.0f, (float)(action.GetHoldTime() - HOLD_TIME_START) / (HOLD_TIME_END - HOLD_TIME_START));
        unsigned int frameDuration = std::min(CTimeUtils::GetFrameTime() - m_lastHoldTime, 50u); // max 20fps

        // maximal scroll rate is at least 30 items per second, and at most (item_rows/7) items per second
        //  i.e. timed to take 7 seconds to traverse the list at full speed.
        // minimal scroll rate is at least 10 items per second
        float maxSpeed = std::max(frameDuration * 0.001f * 30, frameDuration * 0.001f * GetRows() / 7);
        float minSpeed = frameDuration * 0.001f * 10;
        m_scrollItemsPerFrame += std::max(minSpeed, speed*maxSpeed); // accelerate to max speed
        m_lastHoldTime = CTimeUtils::GetFrameTime();

        if(m_scrollItemsPerFrame < 1.0f)//not enough hold time accumulated for one step
          return true;

        while (m_scrollItemsPerFrame >= 1)
        {
          if (action.GetID() == ACTION_MOVE_LEFT || action.GetID() == ACTION_MOVE_UP)
            MoveUp(false);
          else
            MoveDown(false);
          m_scrollItemsPerFrame--;
        }
        return true;
      }
      else
      {
        //if HOLD_TIME_START is reached we need
        //a sane initial value for calculating m_scrollItemsPerPage
        m_lastHoldTime = CTimeUtils::GetFrameTime();
        m_scrollItemsPerFrame = 0.0f;
        return CGUIControl::OnAction(action);
      }
    }
  case ACTION_CONTEXT_MENU:
    if (OnContextMenu())
      return true;
    break;
  case ACTION_SHOW_INFO:
    if (m_listProvider)
    {
      int selected = GetSelectedItem();
      if (selected >= 0 && selected < static_cast<int>(m_items.size()))
      {
        m_listProvider->OnInfo(m_items[selected]);
        return true;
      }
    }
    else if (OnInfo())
      return true;
    else if (action.GetID())
      return OnClick(action.GetID());
    else
      return false;

  case ACTION_FIRST_PAGE:
    SelectItem(0);
    return true;

  case ACTION_LAST_PAGE:
    if (m_items.size())
      SelectItem(m_items.size() - 1);
    return true;

  case ACTION_NEXT_LETTER:
    OnNextLetter();
    return true;
  case ACTION_PREV_LETTER:
    OnPrevLetter();
    return true;
  case ACTION_JUMP_SMS2:
  case ACTION_JUMP_SMS3:
  case ACTION_JUMP_SMS4:
  case ACTION_JUMP_SMS5:
  case ACTION_JUMP_SMS6:
  case ACTION_JUMP_SMS7:
  case ACTION_JUMP_SMS8:
  case ACTION_JUMP_SMS9:
    OnJumpSMS(action.GetID() - ACTION_JUMP_SMS2 + 2);
    return true;

  default:
    break;
  }
  return action.GetID() && OnClick(action.GetID());
}