Beispiel #1
0
	bool COptionUI::Activate()
	{
		if( !CButtonUI::Activate() ) return false;
		if( !m_sGroupName.IsEmpty() ) Selected(true);
		else Selected(!m_bSelected);

		return true;
	}
Beispiel #2
0
//=============================================================================
//	eList::Insert
//-----------------------------------------------------------------------------
void eList::Insert(const char* item)
{
	if(size == MAX_ITEMS)
		return;
	char* s = new char[strlen(item) + 1];
	strcpy(s, item);
	items[size] = s;
	++size;
	items[size] = NULL;
	changed = true;
	if(Selected() < 0)
		Selected(0);
}
//=============================================================================
//	eList::OnKey
//-----------------------------------------------------------------------------
bool eList::OnKey(char key, dword flags)
{
	switch(key)
	{
	case 'l': Selected(selected - page_size);	return true;
	case 'r': Selected(selected + page_size);	return true;
	case 'u': Selected(selected - 1);			return true;
	case 'd': Selected(selected + 1);			return true;
	case 'f':
	case 'e':
	case ' ': Notify(N_SELECTED);				return true;
	}
	return false;
}
Beispiel #4
0
void ESoundSource::Render(int priority, bool strictB2F)
{
    if((1==priority)&&(false==strictB2F)){
	 	RCache.set_xform_world	(Fidentity);
	 	Device.SetShader		(Device.m_WireShader);
        u32 clr0				= Locked()?SOUND_LOCK_COLOR:(Selected()?SOUND_SEL0_COLOR:SOUND_NORM_COLOR);
        u32 clr1				= Locked()?SOUND_LOCK_COLOR:(Selected()?SOUND_SEL1_COLOR:SOUND_NORM_COLOR);
        if (Selected()){ 
        	DU.DrawLineSphere	(m_Params.position, m_Params.max_distance, clr1, true);
        	DU.DrawLineSphere	(m_Params.position, m_Params.min_distance, clr0, false);
        }else{
			DU.DrawSound		(m_Params.position,VIS_RADIUS, clr1);
        }
    }
}
Beispiel #5
0
void MAS::RadioButton::MsgRadio(int g) {
   if (g == group && !HasFocus() && Selected()) {
      Toggle();
   }
   
   Widget::MsgRadio(g);
}
Beispiel #6
0
LRESULT CSysOptionUI::CommandHandler( int code )
{
	if(GetManager() && code == BN_CLICKED){
		Selected();
	}
	return 0;
}
Beispiel #7
0
EventStates
HTMLOptionElement::IntrinsicState() const
{
  EventStates state = nsGenericHTMLElement::IntrinsicState();
  if (Selected()) {
    state |= NS_EVENT_STATE_CHECKED;
  }
  if (DefaultSelected()) {
    state |= NS_EVENT_STATE_DEFAULT;
  }

  // An <option> is disabled if it has @disabled set or if it's <optgroup> has
  // @disabled set.
  if (HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
    state |= NS_EVENT_STATE_DISABLED;
    state &= ~NS_EVENT_STATE_ENABLED;
  } else {
    nsIContent* parent = GetParent();
    if (parent && parent->IsHTMLElement(nsGkAtoms::optgroup) &&
        parent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
      state |= NS_EVENT_STATE_DISABLED;
      state &= ~NS_EVENT_STATE_ENABLED;
    } else {
      state &= ~NS_EVENT_STATE_DISABLED;
      state |= NS_EVENT_STATE_ENABLED;
    }
  }

  return state;
}
Beispiel #8
0
	void COptionUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
	{
		if( _tcsicmp(pstrName, _T("group")) == 0 ) SetGroup(pstrValue);
		else if( _tcsicmp(pstrName, _T("selected")) == 0 ) Selected(_tcsicmp(pstrValue, _T("true")) == 0);
		else if( _tcsicmp(pstrName, _T("selectedimage")) == 0 ) SetSelectedImage(pstrValue);
		else if( _tcsicmp(pstrName, _T("selectedhotimage")) == 0 ) SetSelectedHotImage(pstrValue);
		else if( _tcsicmp(pstrName, _T("selectedpushedimage")) == 0 ) SetSelectedPushedImage(pstrValue);
		else if( _tcsicmp(pstrName, _T("selectedforeimage")) == 0 ) SetSelectedForedImage(pstrValue);
		else if( _tcsicmp(pstrName, _T("selectedstateimage")) == 0 ) SetSelectedStateImage(pstrValue);
		else if( _tcsicmp(pstrName, _T("selectedstatecount")) == 0 ) SetSelectedStateCount(_ttoi(pstrValue));
		else if( _tcsicmp(pstrName, _T("selectedbkcolor")) == 0 ) {
			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
			LPTSTR pstr = NULL;
			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
			SetSelectedBkColor(clrColor);
		}
		else if( _tcsicmp(pstrName, _T("selectedtextcolor")) == 0 ) {
			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
			LPTSTR pstr = NULL;
			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
			SetSelectedTextColor(clrColor);
		}
		else if( _tcsicmp(pstrName, _T("selectedfont")) == 0 ) SetSelectedFont(_ttoi(pstrValue));
		else CButtonUI::SetAttribute(pstrName, pstrValue);
	}
Beispiel #9
0
NS_IMETHODIMP
HTMLOptionElement::GetSelected(bool* aValue)
{
  NS_ENSURE_ARG_POINTER(aValue);
  *aValue = Selected();
  return NS_OK;
}
Beispiel #10
0
void CCurve::DrawHandles(HDC hDC, BOOL bWantHandles)
{
	if ( !bWantHandles || !Selected() )
		return;

	if (!CanEditPoint(iCurrent))
		iCurrent = ClosestToIndex(iCurrent);

	HBRUSH oldBrush = Brush.SetInto(hDC);
	
	// draw a small boxes to show the  points
	for (int i = 1;i < (NumPoints-1); i++)
	{
		int iSize = (i == iCurrent ? HandlesDim/2 : HandlesDim/4);
		CPoint origin;
		CPoint corner;
		origin = Points[i];
		corner = Points[i];
		corner.x += iSize;
		corner.y += iSize;
		origin.x -= iSize;
		origin.y -= iSize;
		Rectangle(hDC, origin.x, origin.y, corner.x, corner.y);
	}
 
	SelectObject(hDC, oldBrush);
}
Beispiel #11
0
void StringBrowser::Select (int index) {
    if (index < strcount && !Selected(index)) {
        BufInsert(String(index), selcount, selbuf, selbufsize, selcount);
        display->Draw(output, canvas);
        display->Style(index, 0, index+1, -1, highlight);
    }
}
Beispiel #12
0
void MAS::HyperText::Draw(Bitmap &canvas) {
    // get the button state
    int state = Disabled() ? 2 : ((Selected() || (Flags() & D_PRESSED)) ? 1 : (HasFocus() ? 3 : 0));

    // get the button colors and font
    Color fg = GetFontColor(state);
    Color bg = GetShadowColor(state);
    Font f = GetFont(state);
    Color textMode = GetTextMode();

    canvas.Clear(textMode);

    switch (state) {
    case 0:
    case 2:
        f.GUITextoutEx(canvas, text, 1, 1, fg, bg, textMode, 0);
        canvas.Hline(1, h()-3, w()-2, fg);
        break;

    case 1:
        f.GUITextoutEx(canvas, text, 2, 2, fg, bg, textMode, 0);
        canvas.DrawDottedRect(1, 1, w()-1, h()-1, skin->c_font);
        canvas.Hline(1, h()-2, w()-2, fg);
        break;

    case 3:
        f.GUITextoutEx(canvas, text, 1, 1, fg, bg, textMode, 0);
        canvas.DrawDottedRect(0, 0, w()-2, h()-2, skin->c_font);
        canvas.Hline(1, h()-3, w()-2, fg);
        break;
    };
}
Beispiel #13
0
bool UITextEditor::Finalise(void)
{
    if (m_template)
        return true;

    if (!m_textWidget)
    {
        UIWidget *text = FindChildByName("text");
        if (text && text->Type() == UIText::kUITextType)
            m_textWidget = static_cast<UIText*>(text);
    }

    if (!m_cursor && m_textWidget)
    {
        m_cursor = FindChildByName("cursor", true);
        if (m_cursor)
        {
            connect(this, SIGNAL(Selected()),   m_cursor, SLOT(Show()));
            connect(this, SIGNAL(Deselected()), m_cursor, SLOT(Hide()));
            if (!m_selected)
                m_cursor->Hide();
        }
    }

    UpdateCursor();

    return UIWidget::Finalise();
}
Beispiel #14
0
	void CCheckBoxUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
	{
		if( _tcscmp(pstrName, _T("selected")) == 0 ) Selected(_tcscmp(pstrValue, _T("true")) == 0);
		else if( _tcscmp(pstrName, _T("selectedimage")) == 0 ) m_sSelectedImage.reset(new CImage(pstrValue));
		else if( _tcscmp(pstrName, _T("selectedhotimage")) == 0 ) m_sSelectedHotImage.reset(new CImage(pstrValue));
		else if( _tcscmp(pstrName, _T("selectedpushedimage")) == 0 ) m_sSelectedPushedImage.reset(new CImage(pstrValue));		
		else if( _tcscmp(pstrName, _T("selecteddisabledimage")) == 0 ) m_sSelectedDisabledImage.reset(new CImage(pstrValue));
		else if( _tcscmp(pstrName, _T("selectedbkcolor")) == 0 ) {
			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
			LPTSTR pstr = NULL;
			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
			m_dwSelectedBkColor = clrColor;
		}
		else if( _tcscmp(pstrName, _T("selectedtextcolor")) == 0 ) {
			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
			LPTSTR pstr = NULL;
			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
			m_dwSelectedTextColor = clrColor;
		}
		else if( _tcscmp(pstrName, _T("selectedpushedtextcolor")) == 0 ) {
			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
			LPTSTR pstr = NULL;
			DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
			m_dwSelectedPushedTextColor = clrColor;
		}
		else CButtonUI::SetAttribute(pstrName, pstrValue);
	}
Beispiel #15
0
void CEditShape::Render(int priority, bool strictB2F)
{
	inherited::Render(priority, strictB2F);
    if (1==priority){
        if (strictB2F){
	        Device.SetShader			(Device.m_WireShader);
            Device.SetRS				(D3DRS_CULLMODE,D3DCULL_NONE);
            u32 clr 					= Selected()?subst_alpha(m_DrawTranspColor, color_get_A(m_DrawTranspColor)*2):m_DrawTranspColor;
                
            Fvector zero				={0.f,0.f,0.f};
            for (ShapeIt it=shapes.begin(); it!=shapes.end(); ++it)
            {
                switch(it->type)
                {
                case cfSphere:
                {
                    Fsphere& S			= it->data.sphere;
                    Fmatrix B;
                    B.scale				(S.R,S.R,S.R);
                    B.translate_over	(S.P);
                    B.mulA_43			(_Transform());
                    RCache.set_xform_world(B);
                    Device.SetShader	(Device.m_WireShader);
                    DU_impl.DrawCross	(zero,1.f,m_DrawEdgeColor,false);
                    DU_impl.DrawIdentSphere	(true,true,clr,m_DrawEdgeColor);
                }break;
                case cfBox:
                {
                    Fmatrix B			= it->data.box;
                    B.mulA_43			(_Transform());
                    RCache.set_xform_world(B);
                    DU_impl.DrawIdentBox(true,true,clr,m_DrawEdgeColor);
                }break;
                }
            }
            Device.SetRS(D3DRS_CULLMODE,D3DCULL_CCW);
        }else{
            if( Selected()&&m_Box.is_valid() ){
		        Device.SetShader		(Device.m_SelectionShader);
                RCache.set_xform_world	(_Transform());
                u32 clr 				= 0xFFFFFFFF;
                Device.SetShader		(Device.m_WireShader);
                DU_impl.DrawSelectionBox(m_Box,&clr);
            }
        }
    }
}
void PeerListContent::clearAllContent() {
	setSelected(Selected());
	setPressed(Selected());
	setContexted(Selected());
	_mouseSelection = false;
	_lastMousePosition = std::nullopt;
	_rowsById.clear();
	_rowsByPeer.clear();
	_filterResults.clear();
	_searchIndex.clear();
	_rows.clear();
	_searchRows.clear();
	_searchQuery
		= _normalizedSearchQuery
		= _mentionHighlight
		= QString();
}
Beispiel #17
0
void MAS::RadioButton::MsgLPress() {
   if (!Selected()) {
      CheckBox::MsgLPress();
   }
   else {
      Widget::MsgLPress();
   }
}
Beispiel #18
0
void MythDialogBox::Select(MythUIButtonListItem* item)
{
    if (!item)
        return;

    const char *slot = qVariantValue<const char *>(item->GetData());
    if (m_useSlots && slot)
    {
        connect(this, SIGNAL(Selected()), m_retObject, slot,
                Qt::QueuedConnection);
        emit Selected();
    }

    SendEvent(m_buttonList->GetItemPos(item), item->GetText(), item->GetData());
    if (m_ScreenStack)
        m_ScreenStack->PopScreen(false);
}
//=============================================================================
//	eList::Insert
//-----------------------------------------------------------------------------
void eList::Insert(const char* item)
{
	changed = true;
	for(int i = 0; i < MAX_ITEMS; ++i)
	{
		if(items[i])
			continue;
		char* s = new char[strlen(item) + 1];
		memcpy(s, item, strlen(item) + 1);
		items[i] = s;
		items[i + 1] = NULL;
		size = i + 1;
		break;
	}
	if(Selected() < 0)
		Selected(0);
}
Beispiel #20
0
//-----------------------------------------------------------------------------
//! Overrides the Base class Function: we want to show or not Zoom Buttons according
//! to Position View, Full Size, & Panel Size 
//-----------------------------------------------------------------------------
void tSteerPanel::CreateZoomPanelButtons()
{
    if ( m_pZoomButton == 0 )
    {
        m_pZoomButton = new tZoomButton( this );
        m_pZoomButton->SetManualPositioning( true );        
        ShowZoomPanelButtons( Selected() );
    }
}
Beispiel #21
0
void MAS::RadioButton::MsgKey() {
   if (!Selected()) {
      CheckBox::MsgKey();
      GetParent()->DialogMessage(MSG_RADIO, group);
   }
   else {
      Widget::MsgKey();
   }
}
Beispiel #22
0
  GameObjectState* GameObject::GetState() const
    {
    GameObjectState* p_state = IGameObject::GetState();
    p_state->iFlags |= GOF_Position;
		if (Selected())
			p_state->iFlags |= GOF_Selected;
    p_state->iOwnerMask = GetController() ? GetController()->GetMask() : 0;
    p_state->pPosition = new Vector2D(m_position);
    return p_state;
    }
Beispiel #23
0
void CCustomObject::AnimationOnFrame()
{
	VERIFY (m_Motion);

    if (Selected()&&m_MotionParams->bPlay)
    {
    	AnimationUpdate			(m_MotionParams->Frame());
        m_MotionParams->Update	(Device.fTimeDelta,1.f,true);
    }
}
Beispiel #24
0
void MythDialogBox::Select(MythUIButtonListItem* item)
{
    if (!item)
        return;

    if (m_currentMenu)
    {
        MythMenuItem *menuItem = qVariantValue<MythMenuItem *>(item->GetData());

        if (menuItem->SubMenu)
        {
            m_currentMenu->m_selectedItem = m_buttonList->GetCurrentPos();
            m_currentMenu = menuItem->SubMenu;
            updateMenu();
            return;
        }

        const char *slot = qVariantValue<const char *>(menuItem->Data);
        if (menuItem->UseSlot && slot)
        {
            connect(this, SIGNAL(Selected()), m_currentMenu->m_retObject, slot,
                    Qt::QueuedConnection);
            emit Selected();
        }

        SendEvent(m_buttonList->GetItemPos(item), item->GetText(), menuItem->Data);
    }
    else
    {
        const char *slot = qVariantValue<const char *>(item->GetData());
        if (m_useSlots && slot)
        {
            connect(this, SIGNAL(Selected()), m_retObject, slot,
                    Qt::QueuedConnection);
            emit Selected();
        }

        SendEvent(m_buttonList->GetItemPos(item), item->GetText(), item->GetData());
    }

    if (m_ScreenStack)
        m_ScreenStack->PopScreen(false);
}
//=============================================================================
//	eList::Item
//-----------------------------------------------------------------------------
void eList::Item(const char* item)
{
	for(int i = 0; i < size; ++i)
	{
		if(!strcmp(items[i], item))
		{
			Selected(i);
			break;
		}
	}
}
Beispiel #26
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tSteerPanel::showEvent( QShowEvent* /*pEvent*/ )
{
    if( m_helpTimerID )
    {
        killTimer( m_helpTimerID );
    }
    if ( Selected() )
    {
        m_helpTimerID = startTimer( 500 );
    }
}
Beispiel #27
0
nsresult
HTMLOptionElement::CopyInnerTo(Element* aDest)
{
  nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
  NS_ENSURE_SUCCESS(rv, rv);

  if (aDest->OwnerDoc()->IsStaticDocument()) {
    static_cast<HTMLOptionElement*>(aDest)->SetSelected(Selected());
  }
  return NS_OK;
}
Beispiel #28
0
void CSceneObject::OnFrame()
{
	inherited::OnFrame();
	if (!m_pReference) return;
	if (m_pReference) m_pReference->OnFrame();
	if (psDeviceFlags.is(rsStatistic)){
    	if (IsStatic()||IsMUStatic()||Selected()){
            Device.Statistic->dwLevelSelFaceCount 	+= GetFaceCount();
            Device.Statistic->dwLevelSelVertexCount += GetVertexCount();
        }
    }
}
Beispiel #29
0
void cUISelectButton::Select() {
	bool wasSelected = Selected();

	SetSkinState( cUISkinState::StateSelected );

	mControlFlags |= UI_CTRL_FLAG_SELECTED;

	if ( !wasSelected ) {
		cUIMessage tMsg( this, cUIMessage::MsgSelected, 0 );
		MessagePost( &tMsg );
	}
}
Beispiel #30
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tWindPlotPanel::UpdateActionList()
{
    UpdateActions();
    m_ActionList.clear();

    m_ActionList << m_pSelectTimeRangeAct << m_pDatasourcesAct;

    if( Selected() )
    {
        emit QuickActionChanged( 0 );
        emit ActionsChanged( m_ActionList );
    }
}