tScanningDialogWidget::tScanningDialogWidget( QWidget* pParent )
    : tDialogWidget( QString(), QString(), pParent )
    , m_pSpinner( 0 )
    , m_pLabel( 0 )
    , m_Status( tFusionClient::eBluetoothPairingStatus_NotConnectedOrDisconnect )
    , m_Discovering( false )
{
    m_pSpinner = new tWaitingSpinner( this );
    m_pSpinner->start();
    m_pSpinner->hide();
    m_pSpinner->setInnerRadius( contentsRect().height()/2 );
    m_pSpinner->setLineLength( contentsRect().height()/2 );
    m_pSpinner->setColor( palette().color( QPalette::Disabled, QPalette::Text ) );

    // Create a horizontal layout to hold the image label on the left and text labels on the right
    QHBoxLayout* pLayout = new QHBoxLayout;
    pLayout->setContentsMargins( 0, 0, 0, 0 );
    pLayout->setSpacing ( 10 );
    pLayout->addWidget( m_pSpinner );
    pLayout->setAlignment( Qt::AlignLeft );

    m_pLabel = new QLabel( this );
    pLayout->addWidget( m_pLabel );

    setLayout( pLayout );

    Connect( this, SIGNAL( Triggered() ), this, SLOT( OnClicked() ) );

    updateSpinner();
}
Beispiel #2
0
BOOL UILabel::OnLButtonUp(UINT flag, const UIPoint &point) {
	if (mb_clicked && m_config.is_hyperlink) {
		OnClicked();
		mb_clicked = false;
	}
	MouseLButtonUp.RaiseEvent(this);
	return TRUE;
}
Beispiel #3
0
BOOL	UIButton::OnLButtonUp(UINT flag,const UIPoint &point)
{
	SetButtonStatus(kUIButtonStatusHover);
	if (self_clicked_)
	{
		OnClicked();
		self_clicked_ = FALSE;
	}
	return TRUE;
}
Beispiel #4
0
void
BaseButtonWindow::Click()
{
  if (OnClicked())
    return;

  unsigned id = GetID();
  if (id != 0)
    ::SendMessage(::GetParent(hWnd), WM_COMMAND, id, 0);
}
Beispiel #5
0
void GUITexture::OnMouseClick(Vector2f mousePos)
{
    if (IsButton && GetBounds().IsPointInside(mousePos))
    {
        isBeingClicked = true;
        CurrentTimeLerpSpeed = TimeLerpSpeed;
        if (OnClicked != 0)
        {
            OnClicked(this, mousePos, OnClicked_pData);
        }
    }
}
Beispiel #6
0
 void Dialog::mousePressEvent(QMouseEvent* e)
 {
     if(e->button()==Qt::LeftButton)
     {
        this->isDrag=true;
     }
     QString *color;
     QString *title;
     switch (this->objectType) {
     case 1:
         color=new QString("border:2px groove gray;border-radius:10px;padding:2px 4px;background-color: rgb(255, 74, 19)");
         title=new QString("开始");
         break;
     case 2:
          color=new QString("border:2px groove gray;border-radius:10px;padding:2px 4px;background-color: rgb(255, 74, 19)");
          title=new QString("结束");
          break;
     case 3:
          color=new QString("background-color: rgb(33, 224, 255)");
          title=new QString("自动");
          break;
     case 4:
          color=new QString("background-color: rgb(84, 255, 160) ");
          title=new QString("人工");
          break;
     case 5:
          color=new QString("background-color:rgb(255, 241, 42)");
          title=new QString("条件");
          break;
     default:
         QMessageBox::information(this, tr("Information"), "请选择节点类型");
         return ;
     }

        QPushButton *btn=new QPushButton(this);
        title->append(QString(":%1").arg(this->lst->count(),this->objectType));
        btn->setText(*title);
        btn->setGeometry(QRect(e->x()-50, e->y()-10, 100, 20));

         btn->setStyleSheet(*color);
        btn->show();
        btn->setObjectName(QString("btn%1").arg(this->lst->count()));
        connect(btn, SIGNAL(clicked()), this, SLOT(OnClicked()));
        connect(btn,SIGNAL(pressed()),this,SLOT(OnPress()));
        connect(btn,SIGNAL(released()),this,SLOT(OnRelease()));
        TaskNode *node=new TaskNode(btn,this->objectType);
        node->params=NULL;
        node->postTask=NULL;
        node->prevTask=NULL;
        node->majorTask=NULL;
        this->lst->append(node);
        //this->ui->txtLog->setText(QString(":%1").arg(this->lst->count()));
 }
void Button::Update(int delta)
{
    isMouseOver = false;
    isMouseDown = false;

    if (pOutEase->GetIsStarted() && !pOutEase->GetIsFinished())
    {
        pOutEase->Update(delta);
        animationOffset = (int)pOutEase->GetCurrentValue();
    }
    else if (pOutEase->GetIsFinished())
    {
        SetIsHidden(true);
    }
    else if (pInEase->GetIsStarted() && !pInEase->GetIsFinished())
    {
        pInEase->Update(delta);
        animationOffset = (int)pInEase->GetCurrentValue();
    }
    else
    {
        if (GetUnlockedLockCount() > 0 && !pUnlockingAnimation->IsFinished())
        {
            pUnlockingAnimation->Update(delta);

            AnimationSound * pSoundToPlay = pUnlockingAnimation->GetSoundToPlay();

            if (pSoundToPlay != NULL)
            {
                pSoundToPlay->Play(gSoundEffectsVolume);
            }
        }
        else if (!GetIsDisabled())
        {
            RectangleWH positionRect = RectangleWH(GetXPosition(), GetYPosition(), pTextFont->GetWidth(GetText()), TextHeight);
            bool isPressed = MouseHelper::PressedAndHeldAnywhere() || MouseHelper::DoublePressedAndHeldAnywhere();

            if (MouseHelper::ClickedOnRect(positionRect))
            {
                OnClicked();
            }

            if (MouseHelper::MouseDownOnRect(positionRect) && !isPressed)
            {
                isMouseDown = true;
            }
            else if (MouseHelper::MouseOverRect(positionRect) && !isPressed)
            {
                isMouseOver = true;
            }
        }
    }
}
Beispiel #8
0
bool
CheckBoxControl::OnKeyDown(unsigned key_code)
{
  switch (key_code) {
  case KEY_RETURN:
  case KEY_SPACE:
    SetState(!GetState());
    OnClicked();
    return true;
  }

  return PaintWindow::OnKeyDown(key_code);
}
Beispiel #9
0
bool HKWidgetListbox::InputEvent(HKInputManager &manager, const HKInputManager::EventInfo &ev)
{
	// try and handle the input event in some standard ways...
	switch(ev.ev)
	{
		case HKInputManager::IE_Down:
		{
			// immediately stop the thing from scrolling
			velocity = 0.f;
			scrollOffset = MFFloor(scrollOffset);

			// if the down stroke is outside the listbox, we have triggered a non-click
			MFRect rect = { 0.f, 0.f, size.x, size.y };
			if(!MFTypes_PointInRect(ev.down.x, ev.down.y, &rect))
			{
				HKWidgetSelectEvent sel(this, -1);
				OnClicked(*this, sel);
			}
			break;
		}
		case HKInputManager::IE_Up:
		{
			if(bDragging)
			{
				bDragging = false;
				GetUI().SetFocus(ev.pSource, pOldFocus);
			}
			break;
		}
		case HKInputManager::IE_Drag:
		{
			// scroll the contents
			float delta = orientation == Horizontal ? ev.drag.deltaX : ev.drag.deltaY;
			scrollOffset += delta;

			const float smooth = 0.5f;
			velocity = velocity*smooth + (delta / MFSystem_GetTimeDelta())*(1.f-smooth);

			if(!bDragging)
			{
				bDragging = true;
				pOldFocus = GetUI().SetFocus(ev.pSource, this);
			}
			break;
		}
		default:
			break;
	}

	return HKWidget::InputEvent(manager, ev);
}
Beispiel #10
0
void TrophyButton::TouchesMovedImpl(Touch &_touches)
{
	if (m_touchID != -1 && m_touchID != _touches.ID)
		return;
		
	if (_touches.X > bounds.left && 
		_touches.X < bounds.right + bounds.left &&
		_touches.Y > bounds.top &&
		_touches.Y < bounds.bottom + bounds.top)
	{
		m_touchID = _touches.ID;
		OnClicked(trophyName);
	}
}
Beispiel #11
0
bool
CheckBoxControl::OnKeyDown(unsigned key_code)
{
  switch (key_code) {
#ifdef GNAV
  // JMW added this to make data entry easier
  case KEY_APP4:
#endif
  case KEY_RETURN:
    SetState(!GetState());
    return OnClicked();
  }

  return CheckBox::OnKeyDown(key_code);
}
LRESULT	CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    m_PAddrStart.Attach(GetDlgItem(IDC_PADDR_START));
    m_PAddrStart.SetDisplayType(CEditNumber::DisplayHex);
    m_SearchLen.Attach(GetDlgItem(IDC_ADDR_END));
    m_SearchLen.SetDisplayType(CEditNumber::DisplayHex);
    m_SearchValue.Attach(GetDlgItem(IDC_SEARCH_VALUE));
    m_SearchValue.SetDisplayType(CEditNumber::DisplayDec);
    m_SearchValue.SetValue(0);
    m_MaxSearch.Attach(GetDlgItem(IDC_MAX_SEARCH));
    m_MaxSearch.SetDisplayType(CEditNumber::DisplayDec);
    m_MaxSearch.SetValue(50000);
    m_UnknownSize.Attach(GetDlgItem(IDC_UNKNOWN_ALIGN));
    AddAlignmentOptions(m_UnknownSize);
    m_ValueSize.Attach(GetDlgItem(IDC_VALUE_ALIGN));
    AddAlignmentOptions(m_ValueSize);
    m_SearchResults.Attach(GetDlgItem(IDC_LST_RESULTS));
    m_SearchResults.AddColumn("ID", 0);
    m_SearchResults.AddColumn("PAddr", 1);
    m_SearchResults.AddColumn("Value", 2);
    m_SearchResults.SetColumnWidth(0, 50);
    m_SearchResults.SetColumnWidth(1, 75);
    m_SearchResults.SetColumnWidth(2, 75);
    m_SearchResults.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
    m_UnknownOptions.Attach(GetDlgItem(IDC_CMB_UNKNOWN));
    m_HaveResults = false;
    FixUnknownOptions(true);

    SendMessage(GetDlgItem(IDC_RADIO_VALUE), BM_SETCHECK, BST_CHECKED, 0);

    BOOL bHandled;
    OnClicked(0, IDC_BTN_RDRAM, NULL, bHandled);
    OnClicked(0, IDC_RADIO_VALUE, NULL, bHandled);
    WindowCreated();
    return TRUE;
}
Beispiel #13
0
bool
ButtonWindow::OnKeyDown(unsigned key_code)
{
  switch (key_code) {
  case KEY_RETURN:
  case KEY_SPACE:
    SetDown(false);

    if (!OnClicked() && id != 0 && parent != nullptr)
      parent->OnCommand(id, 0);
    return true;

  default:
    return PaintWindow::OnKeyDown(key_code);
  }
}
Beispiel #14
0
bool
CheckBoxControl::OnMouseUp(PixelPoint p)
{
  if (!dragging)
    return true;

  dragging = false;
  ReleaseCapture();

  if (!pressed)
    return true;

  SetPressed(false);
  SetState(!GetState());
  OnClicked();
  return true;
}
Beispiel #15
0
void ShopItem::TouchesMovedImpl(Touch &_touches)
{
	if (disableInput) return;
	
	plusButton->TouchesMoved(_touches);
	
	if (m_touchID != -1 && m_touchID != _touches.ID)
		return;
			
	if (_touches.X > bounds.left && 
		_touches.X < bounds.right + bounds.left &&
		_touches.Y > bounds.top &&
		_touches.Y < bounds.bottom + bounds.top)
	{
		m_touchID = _touches.ID;
			
		OnClicked(this);
	}
}
Beispiel #16
0
bool
ButtonWindow::OnMouseUp(PixelScalar x, PixelScalar y)
{
  if (!dragging)
    return true;

  dragging = false;
  ReleaseCapture();

  if (!down)
    return true;

  SetDown(false);

  if (!OnClicked() && id != 0 && parent != nullptr)
    parent->OnCommand(id, 0);

  return true;
}
Beispiel #17
0
void HKWidgetListbox::OnItemClick(HKWidget &widget, const HKWidgetEventInfo &ev)
{
	HKWidgetSelectEvent sel(ev.pSender, GetChildIndex(&widget));
	OnClicked(*this, sel);
}
Beispiel #18
0
	SelectionButton::SelectionButton(QWidget *parent, const char *name , QString id ): QPushButton(name, parent),  id_(id)
	{
		connect(this, SIGNAL(clicked()), this, SLOT(OnClicked()) );
	}
Beispiel #19
0
void
Button::Click()
{
  SetDown(false);
  OnClicked();
}
void STranslationWidgetPicker::OnCheckStateChanged(const ECheckBoxState NewCheckedState)
{
	OnClicked();
}
/**
 * Called by Slate when this tool bar check box button is toggled
 */
void SToolBarButtonBlock::OnCheckStateChanged( const ECheckBoxState NewCheckedState )
{
	OnClicked();
}