//--------------------------------------------------------------------------------------------------------------------------------------------------- void ProgressBar::SetBytes(int all, int recieved) { bytesAll = all; bytesRecieved = recieved; DrawProgress(); }
void LTIndefProgressBar::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here // Do not call CWnd::OnPaint() for painting messages DrawProgress(&dc, true); }
uint_fast8_t progressSetPos(uintmax_t pos) { statusDrawStart(); uint32_t timeleft = 0; if ((pos += progress_offset) >= progress_posmax) { pos = progress_posmax; timerStop(); wcscpy(status_value, lang(S_COMPLETED)); status_features |= STATUS_FINISHED; } if (pos != progress_pos || !pos) { if ((progress_pos = pos) && pos) { timeleft = timerGet(); timeleft = progress_posmax * timeleft / progress_pos - timeleft; } DrawProgress(progress_screen, &progress_rect, progress_frame, progress_done, progress_back, progress_textcolor, progress_fontsize, progress_posmax, progress_pos, timeleft); } if (pos != progress_posmax && status_features & STATUS_CANCELABLE && GetInput() & keys[KEY_B].mask) { wcscpy(status_value, lang(S_CANCELED)); status_features |= STATUS_WAIT | STATUS_FINISHED | STATUS_FAILED; } if (status_features & STATUS_FINISHED) { wcscat(status_value, L" "); swprintf(status_value + wcslen(status_value), _MAX_LFN + 1, lang(SF2_PRESS_BUTTON_ACTION), lang(S_ANY_BUTTON), lang(S_CONTINUE)); } DrawStringRect(&bottomScreen, status_value, &style.activityStatusRect, style.activityColor, style.activityStatusAlign, 16); statusDrawFinish(); if (status_features & STATUS_WAIT && status_features & STATUS_FINISHED) InputWait(); return !(status_features & STATUS_FAILED); }
//--------------------------------------------------------------------------------------------------------------------------------------------------- void ProgressBar::SetParameters(float progress_, float timePassed_, float timeElapsed_, float speed_, String currentFile_) { this->currentFile = currentFile_; this->progress = progress_; this->timePassed = timePassed_; this->timeElapsed = timeElapsed_; this->speed = speed_; DrawProgress(); }
void LTIndefProgressBar::OnTimer(UINT_PTR nIDEvent) { // TODO: Add your message handler code here and/or call default if (nIDEvent == PROGRESS_TIMER) { i_Progress += SLOT_ADVANCE; CClientDC dc(this); DrawProgress(&dc); } CWnd::OnTimer(nIDEvent); }
void ModelDelegate::paint (QPainter *painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { if (index.column () == JobHolderColumn::JobProgress) { auto rowRole = index.data (CustomDataRoles::RoleJobHolderRow).value<JobHolderRow> (); if ((rowRole == JobHolderRow::DownloadProgress || rowRole == JobHolderRow::ProcessProgress) && DrawProgress (painter, option, index)) return; } QStyledItemDelegate::paint (painter, option, index); }
void TUI::Redraw (int drawFlags) { // Redraw the "static" background if (simpleMode) { DrawSimple (); return; } // Clear if (drawFlags & TUI_DRAW_CLEAR) csPrintf (CS_ANSI_CLEAR_SCREEN); // Screen layout (keep to 80x25...) if (drawFlags & TUI_DRAW_STATIC) DrawStatic (); // Draw progress if (drawFlags & TUI_DRAW_PROGRESS) DrawProgress (); // Draw messages if (drawFlags & TUI_DRAW_MESSAGES) DrawMessage (); // Draw RayCore stats if (drawFlags & TUI_DRAW_RAYCORE) DrawRayCore (); // Draw photonmapper stats if (drawFlags & TUI_DRAW_PMCORE) DrawPMCore (); // Draw global settings if (drawFlags & TUI_DRAW_SETTINGS) DrawSettings (); // Draw global stats if (drawFlags & TUI_DRAW_STATS) DrawStats (); if (drawFlags & TUI_DRAW_SWAPCACHE) DrawSwapCacheStats (); /* Linux: output is buffered, and the UI may appear "incomplete" if not * flushed */ fflush (stdout); }
void CProgressST::OnPaint() { PAINTSTRUCT lpPaint; // If there is NO bitmap loaded if (m_bmPattern.m_hObject == NULL) { CProgressCtrl::OnPaint(); return; } BeginPaint(&lpPaint); CWindowDC dc(this); DrawProgress(&dc); EndPaint(&lpPaint); } // End of OnPaint
ProgressBar::ProgressBar(Context *context) : UIElement(context) { sprite = new SpriteT(context); sprite->SetSize((int)width, (int)height); AddChild(sprite); Font *font = gCache->GetResource<Font>("Fonts/Anonymous Pro.ttf"); textPercents = new Text(context); textPercents->SetFont(font); textPercents->SetFixedSize((int)height, (int)height); textPercents->SetPosition((int)width + 3, 2); AddChild(textPercents); text = new Text(context); text->SetFont(font); text->SetPosition(-100, -60); AddChild(text); SetWidth(sprite->GetWidth() + textPercents->GetWidth()); DrawProgress(); }
csPtr<iImage> BaseMapGen::CreateBasemap (int basemap_w, int basemap_h, const AlphaLayers& alphaLayers, MaterialLayers& txt_layers) { csPrintf ("Creating base texturemap... \n\n"); fflush (stdout); // Block: to measure time { CS::MeasureTime lTimeMeasurer ("Time taken"); csArray<LayerSampler> samplers; /* Mipmap the materials to the highest mipmap needed below the required * resolution. This mipmap is then upsampled. */ for (unsigned int i = 0 ; i < txt_layers.GetSize() ; i++) { samplers.Push (LayerSampler (basemap_w, basemap_h, txt_layers[i])); } csRef<iImage> basemapImage; basemapImage.AttachNew (new csImageMemory (basemap_w, basemap_h)); // Get image data. csRGBpixel* bm_dst = (csRGBpixel*)(basemapImage->GetImageData()); float coord_x, coord_y; float inv_basemap_w = 1.0f / basemap_w; float inv_basemap_h = 1.0f / basemap_h; for (int y = 0 ; y < basemap_h ; y++) { // Draw progress. uint percent = uint ((y*100) * inv_basemap_h); DrawProgress(percent); for (int x = 0 ; x < basemap_w ; x++) { // Calculate the destination coordinates. coord_x = x * inv_basemap_w; coord_y = y * inv_basemap_h; csColor col (0, 0, 0); for (size_t l = 0; l < samplers.GetSize(); l++) { if (l >= alphaLayers.GetSize()) break; float a = alphaLayers.GetAlpha (l, coord_x, coord_y); // Blend material colors. col += samplers[l].GetPixel (coord_x, coord_y) * a; } csRGBpixel mat_dst (int (col.red), int (col.green), int (col.blue)); // Set the basemap pixel. bm_dst->Set (mat_dst.red, mat_dst.green, mat_dst.blue); // Increase the pointer. bm_dst++; } // for y } // for x csPrintf ("\n"); return csPtr<iImage> (basemapImage); } // Block to measure time }