BOOL COXStatusBar::SetUpBar(int nIndex, BOOL bUpdate /*=TRUE */, BOOL bPercentText /*=TRUE */) { UNREFERENCED_PARAMETER(bUpdate); CEvolInfo* pEvolutionInfo; if(m_EvolArray[nIndex] != NULL) { pEvolutionInfo=(CEvolInfo*)m_EvolArray[nIndex]; delete pEvolutionInfo; m_EvolArray[nIndex]=NULL; } if(m_EvolArray[nIndex]==NULL) // a new progress ctrl has to be created { pEvolutionInfo=new CEvolInfo; m_EvolArray[nIndex]=pEvolutionInfo; pEvolutionInfo->m_nPercentDone=0; pEvolutionInfo->m_ProgressRect.SetRectEmpty(); pEvolutionInfo->m_bPercentText=bPercentText; pEvolutionInfo->m_bRectInitialized=FALSE; pEvolutionInfo->m_bRectInitialized=CreateEvolutionPane(nIndex, pEvolutionInfo); } else ResetBar(nIndex); return TRUE; }
G_MODULE_EXPORT void VideoOk_released() // Change video mode { ResetBar(); MoveWindows(); gtk_widget_hide(Window_VideoMode); KbootRun(); }
void Meter::Reset(double sampleRate, bool resetClipping) { int j; mT = 0; mRate = sampleRate; for(j=0; j<mNumBars; j++) ResetBar(&mBar[j], resetClipping); // wxTimers seem to be a little unreliable - sometimes they stop for // no good reason, so this "primes" it every now and then... mTimer.Stop(); // While it's stopped, empty the queue MeterUpdateMsg msg; while(mQueue.Get(msg)) { } mTimer.Start(25); // every 25 ms -> ~40 updates per second mLayoutValid = false; Refresh(false); }
void Meter::HandleLayout() { int iconWidth = mIcon->GetWidth(); int iconHeight = mIcon->GetHeight(); int menuWidth = 17; int menuHeight = 14; int width = mWidth; int height = mHeight; int left = 0, top = 0; int right, bottom; int barw, barh; int i; mRuler.SetFlip(true); mRuler.SetLabelEdges(true); switch(mStyle) { default: wxPrintf(wxT("Style not handled yet!\n")); break; case VerticalStereo: #if WANT_METER_MENU mMenuRect = wxRect(mWidth - menuWidth - 5, mHeight - menuHeight - 2, menuWidth, menuHeight); if (mHeight < (menuHeight + iconHeight + 8)) mIconPos = wxPoint(-999, -999); // Don't display else #endif // WANT_METER_MENU mIconPos = wxPoint(mWidth - iconWidth - 1, 1); width = intmin(mWidth-(iconWidth+2), mWidth-(menuWidth+3)); if (width >= mLeftSize.x + mRightSize.x + 24) { mLeftTextPos = wxPoint(2, height-2-mLeftSize.y); mRightTextPos = wxPoint(width-mLeftSize.x, height-2-mLeftSize.y); left += mLeftSize.x+4; width -= mLeftSize.x + mRightSize.x + 8; } barw = (width-2)/2; barh = height - 4; mNumBars = 2; mBar[0].vert = true; ResetBar(&mBar[0], false); mBar[0].r = wxRect(left + width/2 - barw - 1, 2, barw, barh); if (mClip) { mBar[0].rClip = mBar[0].r; mBar[0].rClip.height = 3; mBar[0].r.y += 4; mBar[0].r.height -= 4; } mBar[1].vert = true; ResetBar(&mBar[1], false); mBar[1].r = wxRect(left + width/2 + 1, 2, barw, barh); if (mClip) { mBar[1].rClip = mBar[1].r; mBar[1].rClip.height = 3; mBar[1].r.y += 4; mBar[1].r.height -= 4; } mRuler.SetOrientation(wxVERTICAL); mRuler.SetBounds(mBar[1].r.x + mBar[1].r.width + 1, mBar[1].r.y, mBar[1].r.x + width, mBar[1].r.y + mBar[1].r.height); if (mDB) { mRuler.SetRange(0, -mDBRange); mRuler.SetFormat(Ruler::LinearDBFormat); } else { mRuler.SetRange(1, 0); mRuler.SetFormat(Ruler::RealFormat); } #if WANT_METER_MENU mRuler.OfflimitsPixels(mMenuRect.y-mBar[1].r.y, mBar[1].r.height); #endif // WANT_METER_MENU break; case HorizontalStereo: if (mWidth < menuWidth + iconWidth + 8) { mIconPos = wxPoint(-999, -999); // Don't display icon #if WANT_METER_MENU mMenuRect = wxRect(2, mHeight - menuHeight - 2, menuWidth, menuHeight); #endif // WANT_METER_MENU } else { mIconPos = wxPoint(2, mHeight - iconHeight); #if WANT_METER_MENU mMenuRect = wxRect(iconWidth + 2, mHeight - menuHeight - 5, menuWidth, menuHeight); #endif // WANT_METER_MENU } height = intmin(height-(menuHeight+3), height-iconHeight) - 2; left = 2 + intmax(mLeftSize.x, mRightSize.x); width -= left; mLeftTextPos = wxPoint(2, (height)/4 - mLeftSize.y/2); mRightTextPos = wxPoint(2, (height*3)/4 - mLeftSize.y/2); barw = width - 4; barh = (height-2)/2; mNumBars = 2; mBar[0].vert = false; ResetBar(&mBar[0], false); mBar[0].r = wxRect(left+2, height/2 - barh - 1, barw, barh); if (mClip) { mBar[0].rClip = mBar[0].r; mBar[0].rClip.x += mBar[0].rClip.width-3; mBar[0].rClip.width = 3; mBar[0].r.width -= 4; } mBar[1].vert = false; ResetBar(&mBar[1], false); mBar[1].r = wxRect(left+2, height/2 + 1, barw, barh); if (mClip) { mBar[1].rClip = mBar[1].r; mBar[1].rClip.x += mBar[1].rClip.width-3; mBar[1].rClip.width = 3; mBar[1].r.width -= 4; } mRuler.SetOrientation(wxHORIZONTAL); mRuler.SetBounds(mBar[1].r.x, mBar[1].r.y + mBar[1].r.height + 1, mBar[1].r.x + mBar[1].r.width, mWidth); if (mDB) { mRuler.SetRange(-mDBRange, 0); mRuler.SetFormat(Ruler::LinearDBFormat); } else { mRuler.SetRange(0, 1); mRuler.SetFormat(Ruler::RealFormat); } #if WANT_METER_MENU mRuler.OfflimitsPixels(0, mMenuRect.x+mMenuRect.width-4); #endif // WANT_METER_MENU break; case Waveform: mNumBars = 0; break; } if (mNumBars > 0) { // Compute bounding rectangle of all bars (to save time when // blitting just the bars to the screen) left = mBar[0].r.x; top = mBar[0].r.y; right = mBar[0].r.x + mBar[0].r.width; bottom = mBar[0].r.y + mBar[0].r.height; for(i=1; i<mNumBars; i++) { left = intmin(left, mBar[i].r.x); top = intmin(top, mBar[i].r.y); right = intmax(right, mBar[i].r.x + mBar[i].r.width); bottom = intmax(bottom, mBar[i].r.y + mBar[i].r.height); left = intmin(left, mBar[i].rClip.x); top = intmin(top, mBar[i].rClip.y); right = intmax(right, mBar[i].rClip.x + mBar[i].rClip.width); bottom = intmax(bottom, mBar[i].rClip.y + mBar[i].rClip.height); } mAllBarsRect = wxRect(left, top, right-left+1, bottom-top+1); } CreateIcon(mIconPos.y % 4); mLayoutValid = true; }