void CScreensLinks::updateLinkEditControls(HWND hwnd, const CEdgeLink& link) { // fill link entry controls from link HWND child = getItem(hwnd, IDC_SCREENS_SRC_SIDE); SendMessage(child, CB_SETCURSEL, link.m_srcSide, 0); selectScreen(hwnd, IDC_SCREENS_SRC_SCREEN, link.m_srcName); selectScreen(hwnd, IDC_SCREENS_DST_SCREEN, link.m_dstName); updateLinkIntervalControls(hwnd, link); }
/* * ScreenWndProc - handle messages for the screen and inverse windows */ WPI_MRESULT CALLBACK ScreenWndProc( HWND hwnd, WPI_MSG msg, WPI_PARAM1 wparam, WPI_PARAM2 lparam ) { WPI_POINT pt; WPI_RECT wrect1; WPI_RECT wrect2; int top; int bottom; switch( msg ) { case WM_PAINT: paintScreen( hwnd ); break; case WM_LBUTTONDOWN: IMGED_MAKEPOINT( wparam, lparam, pt ); selectScreen( &pt, LMOUSEBUTTON ); break; case WM_LBUTTONDBLCLK: if( !fShowScreenClr ) { break; } IMGED_MAKEPOINT( wparam, lparam, pt ); top = _wpi_cvth_y( screenColor.box.top, screenHeight ); bottom = _wpi_cvth_y( screenColor.box.bottom, screenHeight ); _wpi_setintwrectvalues( &wrect1, screenColor.box.left, top, screenColor.box.right, bottom ); top = _wpi_cvth_y( inverseColor.box.top, screenHeight ); bottom = _wpi_cvth_y( inverseColor.box.bottom, screenHeight ); _wpi_setintwrectvalues( &wrect2, inverseColor.box.left, top, inverseColor.box.right, bottom ); if( _wpi_ptinrect( &wrect1, pt ) || _wpi_ptinrect( &wrect2, pt ) ) { ChooseBkColor(); } break; case WM_RBUTTONDOWN: IMGED_MAKEPOINT( wparam, lparam, pt ); selectScreen( &pt, RMOUSEBUTTON ); break; default: return( DefWindowProc( hwnd, msg, wparam, lparam ) ); } return( 0 ); } /* ScreenWndProc */
DisplaySettingsDialog::DisplaySettingsDialog(QWidget* parent) : QDialog(parent) { ui.setupUi(this); ui.letterBoxWidget->setMargin(20); ui.letterBoxWidget->setWidget(ui.labelBox); ui.letterBoxWidget->setBackgroundColor(QColor("wheat")); connect(ui.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(apply())); connect(ui.refreshButton, SIGNAL(clicked()), SLOT(refresh())); fillScreens(); selectScreen(qApp->desktop()->primaryScreen()); fillRefreshRates(); fillColorDepths(); connect(ui.comboBoxScreen, SIGNAL(currentIndexChanged(int)), SLOT(selectScreen(int))); connect(ui.comboBoxReso, SIGNAL(currentIndexChanged(int)), SLOT(fillRefreshRates())); connect(ui.comboBoxReso, SIGNAL(currentIndexChanged(int)), SLOT(fillColorDepths())); updateUi(true); connect(ui.comboBoxScreen, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); connect(ui.comboBoxReso, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); connect(ui.comboBoxRate, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); connect(ui.comboBoxDepth, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); }
static void deactivateScreen (ActiveScreen which) { activeScreens &= ~which; selectScreen(); }
/////////////////////////////////////////////////////////////////// // // Function Name: paintNumDests() // Description: Paints the router with the number of its numDests // /////////////////////////////////////////////////////////////////// void Router::paintNumDests(int n) { int black = makecol(0, 0, 0); int number = 5; // whatever double quotient; if (n <= 0) // in this case, total active wks are passed in as a negative number { if (n == 0) quotient = 100.0; else { quotient = 100.0 * double(numWorkstations) / double(-1 * n); } setRadius(quotient); number = routerIndex; } else if (n == 1) // 1 Paints percentage of connection attempts which fail // in reaching each router { if (connAttemptsToThis != 0) quotient = 100 - (100.0 * ((double)connSuccessesToThis / (double)connAttemptsToThis)); else quotient = 0; setRadius(quotient); number = quotient; } else if (n == 2) { if (connAttemptsFromThis != 0) quotient = 100 - (100.0 * ((double)connSuccessesFromThis / (double)connAttemptsFromThis)); else quotient = 0; setRadius(quotient); number = quotient; } else if (n == 3) { quotient = 100.0 * double(numWorkstations) / double(threadZero->getCurrentActiveWorkstations()); setRadius(quotient); number = numWorkstations; } else if (n == 4) // 0 means paint indexes { quotient = 100.0 * double(numWorkstations) / double(threadZero->getCurrentActiveWorkstations()); setRadius(quotient); number = routerIndex; } char bmpFile[40]; sprintf(bmpFile, "bitmaps"); switch (radius) { case 10: sprintf(bmpFile, "%s/router0_1", bmpFile); // routerpic = load_bitmap("bitmaps/router0_1plain.bmp",nullptr); break; case 11: sprintf(bmpFile, "%s/router0_5", bmpFile); // routerpic = load_bitmap("bitmaps/router0_5plain.bmp",nullptr); break; case 12: sprintf(bmpFile, "%s/router1_0", bmpFile); // routerpic = load_bitmap("bitmaps/router1_0plain.bmp",nullptr); break; case 13: sprintf(bmpFile, "%s/router5_0", bmpFile); // routerpic = load_bitmap("bitmaps/router5_0plain.bmp",nullptr); break; case 15: sprintf(bmpFile, "%s/router10_0", bmpFile); // routerpic = load_bitmap("bitmaps/router10_0plain.bmp",nullptr); break; case 17: sprintf(bmpFile, "%s/router20_0", bmpFile); // routerpic = load_bitmap("bitmaps/router20_0plain.bmp",nullptr); break; case 21: sprintf(bmpFile, "%s/router30_0", bmpFile); // routerpic = load_bitmap("bitmaps/router30_0plain.bmp",nullptr); break; case 25: sprintf(bmpFile, "%s/router40_0", bmpFile); // routerpic = load_bitmap("bitmaps/router40_0plain.bmp",nullptr); break; case 29: sprintf(bmpFile, "%s/router50_0", bmpFile); // routerpic = load_bitmap("bitmaps/router50_0plain.bmp",nullptr); break; case 33: sprintf(bmpFile, "%s/router60_0", bmpFile); // routerpic = load_bitmap("bitmaps/router60_0plain.bmp",nullptr); break; case 37: sprintf(bmpFile, "%s/router70_0", bmpFile); // routerpic = load_bitmap("bitmaps/router70_0plain.bmp",nullptr); break; case 41: sprintf(bmpFile, "%s/router80_0", bmpFile); // routerpic = load_bitmap("bitmaps/router80_0plain.bmp",nullptr); break; case 45: sprintf(bmpFile, "%s/router90_0", bmpFile); // routerpic = load_bitmap("bitmaps/router90_0plain.bmp",nullptr); break; case 50: sprintf(bmpFile, "%s/router100_0", bmpFile); // routerpic = load_bitmap("bitmaps/router100_0plain.bmp",nullptr); break; } if (isSelected) { sprintf(bmpFile, "%sselected.bmp", bmpFile); selectScreen(); } else { sprintf(bmpFile, "%splain.bmp", bmpFile); } routerpic = load_bitmap(bmpFile, nullptr); masked_stretch_blit(routerpic, routersbmp, 0, 0, routerpic->w, routerpic->h, xPixel - (radius), yPixel - (radius), radius * 2, radius * 2); textprintf_centre_ex(routersbmp, font, xPixel, yPixel - 3, black, -1, "%d", number); }