//============================== // ResumeMovieComponent::Frame eMsgStatus ResumeMovieComponent::Frame( OvrGuiSys & guiSys, VrFrame const & vrFrame, VRMenuObject * self, VRMenuEvent const & event ) { UpdateColor( self ); return MSG_STATUS_ALIVE; }
void CRightView::OnInitialUpdate() { CFormView::OnInitialUpdate(); m_bR = 0x0f; m_bG = 0x0f; m_bB = 0x0f; m_bHFieldAlpha = (BYTE)g_pTool->GetAlphaHField(); m_bViewOnlyHFieldAlpha = (BYTE)g_pTool->GetAlphaViewOnlyHField(); m_bSTMAlpha = (BYTE)g_pTool->GetAlphaStaticModel(); // Set back ground color; g_pTool->SetBackGroundColor(m_byBackRed, m_byBackGreen, m_byBackBlue); UpdateData(FALSE); UpdateColor(); // TODO: Add your specialized code here and/or call the base class }
// Create the color area for the button. // The frame will be generated by the frame constructor. nsresult nsColorControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements) { nsCOMPtr<nsIDocument> doc = mContent->GetCurrentDoc(); nsCOMPtr<nsINodeInfo> nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::div, nullptr, kNameSpaceID_XHTML, nsIDOMNode::ELEMENT_NODE); nsresult rv = NS_NewHTMLElement(getter_AddRefs(mColorContent), nodeInfo.forget(), mozilla::dom::NOT_FROM_PARSER); NS_ENSURE_SUCCESS(rv, rv); // Mark the element to be native anonymous before setting any attributes. mColorContent->SetIsNativeAnonymousRoot(); rv = UpdateColor(); NS_ENSURE_SUCCESS(rv, rv); nsCSSPseudoElements::Type pseudoType = nsCSSPseudoElements::ePseudo_mozColorSwatch; nsRefPtr<nsStyleContext> newStyleContext = PresContext()->StyleSet()-> ResolvePseudoElementStyle(mContent->AsElement(), pseudoType, StyleContext(), mColorContent->AsElement()); if (!aElements.AppendElement(ContentInfo(mColorContent, newStyleContext))) { return NS_ERROR_OUT_OF_MEMORY; } return NS_OK; }
//----------------------------------------------------------------------------- // Purpose: Simulate motion and render all child particles // Input : *pInParticle - // *pDraw - // &sortKey - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CSimpleEmitter::SimulateAndRender( Particle *pInParticle, ParticleDraw *pDraw, float &sortKey) { SimpleParticle *pParticle = (SimpleParticle *) pInParticle; float timeDelta = pDraw->GetTimeDelta(); //Render Vector tPos; TransformParticle( g_ParticleMgr.GetModelView(), pParticle->m_Pos, tPos ); sortKey = (int) tPos.z; //Render it RenderParticle_ColorSizeAngle( pDraw, tPos, UpdateColor( pParticle, timeDelta ), UpdateAlpha( pParticle, timeDelta ) * GetAlphaDistanceFade( tPos, m_flNearClipMin, m_flNearClipMax ), UpdateScale( pParticle, timeDelta ), UpdateRoll( pParticle, timeDelta ) ); //Update velocity UpdateVelocity( pParticle, timeDelta ); pParticle->m_Pos += pParticle->m_vecVelocity * timeDelta; //Should this particle die? pParticle->m_flLifetime += timeDelta; if ( pParticle->m_flLifetime >= pParticle->m_flDieTime ) return false; return true; }
void CRightView::DoDataExchange(CDataExchange* pDX) { CFormView::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRightView) DDX_Control(pDX, IDC_LIST_TILE_BRUSH, m_lcTileBrushList); DDX_Control(pDX, IDC_LIST_GXOBJECT, m_lcGXObjects); DDX_Control(pDX, IDC_LIST_BRUSH, m_lcBrushList); DDX_Text(pDX, IDC_EDIT_SHADE_COLOR_R, m_bR); DDV_MinMaxByte(pDX, m_bR, 0, 255); DDX_Text(pDX, IDC_EDIT_SHADE_COLOR_G, m_bG); DDV_MinMaxByte(pDX, m_bG, 0, 255); DDX_Text(pDX, IDC_EDIT_SHADE_COLOR_B, m_bB); DDV_MinMaxByte(pDX, m_bB, 0, 255); DDX_Check(pDX, IDC_CHECK_ENABLE_SHADOW, m_bEnableShadow); DDX_Text(pDX, IDC_EDIT_HFIELD_ALPHA, m_bHFieldAlpha); DDV_MinMaxByte(pDX, m_bHFieldAlpha, 0, 255); DDX_Text(pDX, IDC_EDIT_STATIC_MODEL_ALPHA, m_bSTMAlpha); DDV_MinMaxByte(pDX, m_bSTMAlpha, 0, 255); DDX_Check(pDX, IDC_CHECK_TILE_BRUSH_MODE, m_btTileBrushToggle); DDX_Text(pDX, IDC_EDIT_VIEW_ONLY_HFIELD_ALPHA, m_bViewOnlyHFieldAlpha); DDV_MinMaxByte(pDX, m_bViewOnlyHFieldAlpha, 0, 255); //}}AFX_DATA_MAP DDX_Text(pDX, IDC_EDIT_BACK_RED, m_byBackRed); DDV_MinMaxByte(pDX, m_byBackRed, 0, 255); DDX_Text(pDX, IDC_EDIT_BACK_GREEN, m_byBackGreen); DDV_MinMaxByte(pDX, m_byBackGreen, 0, 255); DDX_Text(pDX, IDC_EDIT_BACK_BLUE, m_byBackBlue); DDV_MinMaxByte(pDX, m_byBackBlue, 0, 255); UpdateColor(); }
inline void C2DRoundRect::SetColor( const SFloatRGBAColor& color ) { m_Color = color; if( 0 < m_vecRectVertex.size() ) // avoid calling this from ctor UpdateColor(); }
void CFillProp::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar) { CPropertyPage::OnHScroll(nSBCode, nPos, pScrollBar); CSliderCtrl * pSlider=(CSliderCtrl *)pScrollBar; CString str; int pos = pSlider->GetPos(); str.Format("%d",pos); byte r,g,b; r = GetRValue(m_Color); g = GetGValue(m_Color); b = GetBValue(m_Color); switch(pSlider->GetDlgCtrlID()) { case IDC_SLIDER1: SetDlgItemText(IDC_STATIC_RED,str); m_Color=RGB((byte)pos,g,b); break; case IDC_SLIDER2: SetDlgItemText(IDC_STATIC_GREEN,str); m_Color=RGB(r,(byte)pos,b); break; case IDC_SLIDER3: SetDlgItemText(IDC_STATIC_BLUE,str); m_Color=RGB(r,g,(byte)pos); break; } UpdateColor(); }
void CLocalSpaceEmitter::RenderParticles( CParticleRenderIterator *pIterator ) { const matrix3x4_t &mLocalToWorld = GetTransformMatrix(); const VMatrix &mModelView = ParticleMgr()->GetModelView(); const SimpleParticle *pParticle = (const SimpleParticle *)pIterator->GetFirst(); while ( pParticle ) { // Transform it Vector screenPos, worldPos; VectorTransform( pParticle->m_Pos, mLocalToWorld, worldPos ); // Correct viewmodel squashing if ( m_fFlags & FLE_VIEWMODEL ) { FormatViewModelAttachment( NULL, worldPos, false ); } TransformParticle( mModelView, worldPos, screenPos ); float sortKey = (int) screenPos.z; // Render it RenderParticle_ColorSizeAngle( pIterator->GetParticleDraw(), screenPos, UpdateColor( pParticle ), UpdateAlpha( pParticle ) * GetAlphaDistanceFade( screenPos, m_flNearClipMin, m_flNearClipMax ), UpdateScale( pParticle ), pParticle->m_flRoll ); pParticle = (const SimpleParticle *)pIterator->GetNext( sortKey ); } }
void CMultColorLED::SetLight(int iNewStatus) { switch (iNewStatus) { case 0: /* Green light */ bFlagGreenLi = true; TimerGreenLight.changeInterval(iUpdateTime); break; case 1: /* Yellow light */ bFlagYellowLi = true; TimerYellowLight.changeInterval(iUpdateTime); break; case 2: /* Red light */ bFlagRedLi = true; TimerRedLight.changeInterval(iUpdateTime); break; } UpdateColor(); }
//============================== // ResumeMovieComponent::Frame eMsgStatus ResumeMovieComponent::Frame( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr, VRMenuObject * self, VRMenuEvent const & event ) { UpdateColor( self ); return MSG_STATUS_ALIVE; }
Brick::Brick() { BrickCount++; Strength = 1; Live = true; Collides = true; Hit = false; UpdateColor(); }
void CFillProp::OnColor() { if (m_Color == m_ctrlColor.m_Color) return; m_Color = m_ctrlColor.m_Color; UpdateColor(); }
inline void C2DRoundFrameRect::SetColor( const SFloatRGBAColor& color ) { // set the color to all 4 corners for( int i=0; i<4; i++ ) m_aCornerColor[i] = color; if( 0 <= m_vecRectVertex.size() ) // avoid calling this from ctor UpdateColor(); }
void CRygCtrl::OnPaint() { CPaintDC dc(this); SetMapping(&dc); dc.SelectStockObject(DKGRAY_BRUSH); dc.RoundRect(RectRnd, Point); for (int i = 0; i < 3; i++) UpdateColor(&dc, i); }
void CSecondCurConfig::OnColor() { // TODO: Add your control notification handler code here if (m_color==m_corls.m_Color) return; m_color=m_corls.m_Color; UpdateColor(); }
void CMultColorLED::Reset() { /* Reset color flags */ bFlagRedLi = false; bFlagGreenLi = false; bFlagYellowLi = false; UpdateColor(); }
//! updates the visitor void ColorVisitor::Update() { if(!m_bActive) { return; } if(m_fInterpolator < 1.0f) { Color color = Math::Lerp(m_SrcColor, m_DestColor, m_fInterpolator); UpdateColor(color); m_fInterpolator += (g_fDeltaTime/m_fDuration); } else { UpdateColor(m_DestColor); m_iPlayCount++; switch(m_ePlaybackType) { case PT_Once: Leave(); break; case PT_Loop: case PT_Toggle: if((m_iMaxPlayCount < 0) || (m_iPlayCount < m_iMaxPlayCount)) { (m_ePlaybackType == PT_Toggle) ? Math::Swap(m_SrcColor, m_DestColor) : void(); m_fInterpolator = 0.0f; } else { Leave(); } break; default: Leave(); } } }
Brick::Brick(int x, int y, int s) { BrickCount++; Position.X = x; Position.Y = y; Strength = s; Live = true; Collides = true; Hit = false; UpdateColor(); }
void SetTargetted(bool targetted) { if (m_targetted == targetted) return; m_targetted = targetted; if (!UpdateColor()) Rebuild(); }
//--------------------------------------------------------------- // Purpose: //--------------------------------------------------------------- void CEntityDialogClassInfo::OnBnClickedSelectColor() { CString currentColor; m_ecValueRaw.GetWindowText(currentColor); Vector3f vCurrentColor = StrUtils::GetVector3(CT2A(currentColor)) + 0.5f; COLORREF colorref = RGB(vCurrentColor.x, vCurrentColor.y, vCurrentColor.z); CHOOSECOLOR cc; memset(&cc, 0, sizeof(cc)); cc.lStructSize = sizeof(cc); cc.hwndOwner = this->GetSafeHwnd(); cc.lCustData = (LPARAM)(this); cc.lpCustColors = g_colorRefs; cc.lpfnHook = &CCHookProc; cc.rgbResult = colorref; cc.Flags = CC_ANYCOLOR | CC_ENABLEHOOK | CC_FULLOPEN | CC_RGBINIT; if(::ChooseColor(&cc)) UpdateColor(cc.rgbResult); else UpdateColor(colorref); }
Brick::Brick(int x, int y, int s, int w, int h) { BrickCount++; Position.X = x; Position.Y = y; Width = w; Height = h; Strength = s; Live = true; Collides = true; Hit = false; UpdateColor(); }
bool Brick::Harm(int Damage) { if(Strength > 0) { Strength -= Damage; if(Strength < 1) { BrickCount--; Live = false; } UpdateColor(); return true; } return false; }
NS_IMETHODIMP nsColorControlFrame::AttributeChanged(int32_t aNameSpaceID, nsIAtom* aAttribute, int32_t aModType) { NS_ASSERTION(mColorContent, "The color div must exist"); // If the value attribute is set, update the color box if (aNameSpaceID == kNameSpaceID_None && nsGkAtoms::value == aAttribute) { UpdateColor(); } return nsColorControlFrameSuper::AttributeChanged(aNameSpaceID, aAttribute, aModType); }
void CRightView::OnLButtonDblClk(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default HWND hColorBox = ::GetDlgItem(m_hWnd,IDC_STATIC_SHADING_COLOR); RECT rect; ::GetWindowRect(hColorBox,&rect); POINT p; p.x = 0; p.y = 0; ::ScreenToClient(m_hWnd,&p); rect.left += p.x; rect.right += p.x; rect.top += p.y; rect.bottom += p.y; if (point.x < rect.left) return; if (point.x > rect.right) return; if (point.y < rect.top) return; if (point.y > rect.bottom) return; DWORD dwColor = (m_bB<<16) | (m_bG<<8) | m_bR; CColorDialog colorDlg(dwColor,CC_FULLOPEN,NULL); colorDlg.DoModal(); dwColor = colorDlg.GetColor(); m_bR = dwColor & 0x000000ff; m_bG = (dwColor & 0x0000ff00)>>8; m_bB = (dwColor & 0x00ff0000)>>16; UpdateData(FALSE); UpdateColor(); CFormView::OnLButtonDblClk(nFlags, point); }
void ListLog::transportChangedData() { int transport_line[TRANSPORT_QUANTITY]; SetColor(); list_log->transportEvents(transport_line); for(int i=0; i<TRANSPORT_QUANTITY; i++) { if(transport_line[i]!=-1) { UpdateColor(transport_line[i],true); } } if(list_scroll&&(transport_line[0]>=0)) { ScrollTo(transport_line[0]); } }
BOOL CSecondCurConfig::OnInitDialog() { CPropertyPage::OnInitDialog(); LV_COLUMN m_lvcolumn; m_lvcolumn.mask=LVCF_FMT|LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM; m_lvcolumn.fmt=LVCFMT_CENTER; m_lvcolumn.cx=350; m_lvcolumn.iSubItem=0; m_lvcolumn.pszText="曲线名称"; m_infolist.InsertColumn(0,&m_lvcolumn); for(int i=0;i<m_curcount;i++) { LV_ITEM lvItem; lvItem.mask=LVIF_TEXT|LVIF_STATE; lvItem.state=0; lvItem.stateMask=0; lvItem.iItem=i; lvItem.iSubItem=0; lvItem.pszText=m_curinfolist[i].cname; m_infolist.InsertItem(&lvItem); } //m_corls.SubclassDlgItem(IDC_COLOR,this); UpdateColor(); UpdateColor3(); if( !m_bChecked) { GetDlgItem(IDC_COMBO1)->EnableWindow(FALSE); GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE); GetDlgItem(IDC_EDIT26)->EnableWindow(FALSE); GetDlgItem(IDC_COLOR)->EnableWindow(FALSE); GetDlgItem(IDC_COLOR3)->EnableWindow(FALSE); GetDlgItem(IDC_EDIT29)->EnableWindow(FALSE); } // m_color = 0; // m_color3 = 0; UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void MyColorButton::contextMenuEvent(QContextMenuEvent *event) { QMenu *menu = new QMenu; menu->addSeparator(); actionResetToDefault = menu->addAction(tr("Reset to default")); actionAddToFlightAnimation = menu->addAction(tr("Add to flight animation")); actionAddToKeyframeAnimation = menu->addAction(tr("Add to keyframe animation")); QAction *selectedItem = menu->exec(event->globalPos()); if (selectedItem) { if (selectedItem == actionResetToDefault) { if (parameterContainer) { currentValue = defaultValue; UpdateColor(); } else { qCritical() << "MyColorButton::contextMenuEvent(QContextMenuEvent *event): parameter container not assigned. Object:" << objectName(); } } else if (selectedItem == actionAddToFlightAnimation) { if (parameterContainer) { gAnimFrames->AddAnimatedParameter(parameterName, parameterContainer->GetAsOneParameter(parameterName)); gFlightAnimation->RefreshTable(); } } else if (selectedItem == actionAddToKeyframeAnimation) { if (parameterContainer) { gKeyframes->AddAnimatedParameter(parameterName, parameterContainer->GetAsOneParameter(parameterName)); gKeyframeAnimation->RefreshTable(); } } } delete menu; }
inline void C2DRoundRect::ResizeBuffer() { const int num_vertices = GetNumVertices(); if( num_vertices == 0 ) return; // buffer for FVF vertices General2DVertex vert; vert.m_DiffuseColor.SetToBlack(); // opaque by default vert.m_fRHW = 1.0f; vert.m_TextureCoord[0].u = 0.0f; vert.m_TextureCoord[0].v = 0.0f; vert.m_vPosition = Vector3(0,0,0); m_vecRectVertex.resize( num_vertices, vert ); // buffer for cache of vertex positions m_vecLocalVertexPosition.resize( num_vertices, Vector2(0,0) ); UpdateColor(); }
BOOL CFillProp::OnInitDialog() { CButton * pBtn = (CButton *)GetDlgItem(IDC_CHECK1); ASSERT(pBtn != NULL); pBtn->SetCheck(m_bFill); m_ctrlColor.SubclassDlgItem(IDC_COLOR,this); CSliderCtrl *pCtrlRed = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1); ASSERT(pCtrlRed != NULL); pCtrlRed->SetRange(0,255); pCtrlRed->SetTicFreq(64); pCtrlRed->SetLineSize(1); pCtrlRed->SetPageSize(64); CSliderCtrl *pCtrlGreen = (CSliderCtrl *)GetDlgItem(IDC_SLIDER2); ASSERT(pCtrlGreen != NULL); pCtrlGreen->SetRange(0,255); pCtrlGreen->SetTicFreq(64); pCtrlGreen->SetLineSize(1); pCtrlGreen->SetPageSize(64); CSliderCtrl *pCtrlBlue = (CSliderCtrl *)GetDlgItem(IDC_SLIDER3); ASSERT(pCtrlBlue != NULL); pCtrlBlue->SetRange(0,255); pCtrlBlue->SetTicFreq(64); pCtrlBlue->SetLineSize(1); pCtrlBlue->SetPageSize(64); UpdateColor(); return TRUE; }
void CDlgBarHField::DoDataExchange(CDataExchange* pDX) { CDialogBar::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDlgBarHField) DDX_Control(pDX, IDC_CHECK_PICK_COLOR, m_btPickColor); DDX_Control(pDX, IDC_CHECK_SELECT, m_btSelect); DDX_Text(pDX, IDC_EDIT_BRUSH_SIZE, m_dwBrushSize); DDV_MinMaxDWord(pDX, m_dwBrushSize, 1, 128); DDX_Text(pDX, IDC_EDIT_HEIGHT_PITCH, m_fHeightPitch); DDV_MinMaxFloat(pDX, m_fHeightPitch, 0.f, 10000.f); DDX_Text(pDX, IDC_EDIT_INTERPOLATION_BIAS, m_fBias); DDV_MinMaxFloat(pDX, m_fBias, 1.f, 64.f); DDX_Text(pDX, IDC_EDIT_RADIUS, m_fRadius); DDV_MinMaxFloat(pDX, m_fRadius, 1.f, 9000.f); DDX_Text(pDX, IDC_EDIT_HFIELD_DETAIL, m_dwHFieldDetail); DDV_MinMaxDWord(pDX, m_dwHFieldDetail, 0, 8); DDX_Text(pDX, IDC_EDIT_FREEZE_DETAIL, m_dwFreezeDetailLevel); DDV_MinMaxDWord(pDX, m_dwFreezeDetailLevel, 0, 8); DDX_Text(pDX, IDC_EDIT_LM_G, m_bG); DDV_MinMaxByte(pDX, m_bG, 0, 255); DDX_Text(pDX, IDC_EDIT_LM_R, m_bR); DDV_MinMaxByte(pDX, m_bR, 0, 255); DDX_Text(pDX, IDC_EDIT_LM_B, m_bB); DDV_MinMaxByte(pDX, m_bB, 0, 255); DDX_Text(pDX, IDC_EDIT_HFBRUSH_SIZE, m_fHFieldColorBrushSize); DDX_Check(pDX, IDC_CHECK_HFIELD_BLEND, m_bEnableHFieldBlend); //}}AFX_DATA_MAP UpdateColor(); }