ToyMetroGrid::ToyMetroGrid(Client *pClient, QWidget *parent, Qt::WindowFlags flags) : ToyGrid(TOY_METRO_GRID, pClient, parent, flags) { m_Timer = new QTimer(this); connect(m_Timer, SIGNAL(timeout()), this, SLOT(onTimeout())); m_Play = new FadeButton(this); m_Play->setText( tr("Play All") ); m_Play->resize( m_Play->sizeHint() ); connect(m_Play, SIGNAL(clicked(bool)), this, SLOT(onPlayClicked(bool))); m_Pause = new FadeButton(this); m_Pause->setText( tr("Pause All") ); connect(m_Pause, SIGNAL(clicked(bool)), this, SLOT(onPauseClicked(bool))); m_ReCenter = new FadeButton(this); m_ReCenter->setText( tr("Reset All") ); connect(m_ReCenter, SIGNAL(clicked(bool)), this, SLOT(onReCenterClicked(bool))); m_Fan = new FadeButton(this); m_Fan->setText( tr("Fan") ); connect(m_Fan, SIGNAL(clicked(bool)), this, SLOT(onFanClicked(bool))); SetGridSize( QSize(1,1) ); StartTimer(); }
JelloMesh::JelloMesh() : m_integrationType(JelloMesh::RK4), m_drawflags(MESH | STRUCTURAL), m_cols(0), m_rows(0), m_stacks(0), m_width(0.0), m_height(0.0), m_depth(0.0) { SetSize(1.0, 1.0, 1.0); SetGridSize(6, 6, 6); }
void Window_Selectable::SetRowByContentSize(int _column){ int num = GetContentSize(); column = _column; if(num == 0){ row = 1; }else{ row = (num + column - 1) / column; } SetGridSize(column, row); }
ToyPedalGrid::ToyPedalGrid(Client *pClient, QWidget *parent, Qt::WindowFlags flags) : ToyGrid(TOY_PEDAL_GRID, pClient, parent, flags) { m_Timer = new QTimer(this); connect(m_Timer, SIGNAL(timeout()), this, SLOT(onTimeout())); m_Press = new FadeButton(this); m_Press->setText( tr("Press All") ); m_Press->resize( m_Press->sizeHint() ); connect(m_Press, SIGNAL(pressed()), this, SLOT(onPressPressed())); connect(m_Press, SIGNAL(released()), this, SLOT(onPressReleased())); SetGridSize( QSize(5,1) ); StartTimer(); }
Animation(float w,float h):Animation(){ SetGridSize(w,h); ResetAnimation(); };
/* * ResizeChild - resizes the draw area of the child window. */ void ResizeChild( WPI_PARAM2 lparam, HWND hwnd, BOOL firsttime ) { short min_width; short width; short height; img_node *node; short x_adjustment; short y_adjustment; short new_width; short new_height; WPI_POINT point_size; WPI_POINT max; HWND frame; HMENU hmenu; WPI_RECT rc; WPI_RECT rect; frame = _wpi_getframe( hwnd ); width = LOWORD( lparam ); #ifdef __OS2_PM__ height = SHORT2FROMMP( lparam ); #else height = HIWORD( lparam ); #endif GetClientRect( hwnd, &rc ); GetWindowRect( hwnd, &rect ); if( frame ) { GetClientRect( frame, &rc ); GetWindowRect( frame, &rect ); } max.x = _wpi_getsystemmetrics( SM_CXSCREEN ); max.y = _wpi_getsystemmetrics( SM_CYSCREEN ); x_adjustment = _wpi_getwidthrect( rect ) - _wpi_getwidthrect( rc ); y_adjustment = _wpi_getheightrect( rect ) - _wpi_getheightrect( rc ); #if 1 min_width = MIN_DRAW_WIN_WIDTH; #else min_width = (short)(2*_wpi_getsystemmetrics(SM_CXSIZE)) + x_adjustment + 8; // fudge factor to allow some of title bar to show #endif #ifdef __OS2_PM__ ++y_adjustment; #endif node = SelectImage( hwnd ); if (!node) return; // the following assumes that max.x >> min_width point_size.x = min( max.x / node->width, width / node->width ); point_size.x = max( min_width / node->width + 1, point_size.x ); point_size.y = min( max.y / node->height, height / node->height ); point_size.y = max( 1, point_size.y ); if( ImgedConfigInfo.square_grid ) { point_size.x = min( point_size.x, point_size.y ); if( point_size.x < ( min_width / node->width + 1 ) ) { point_size.x = min_width / node->width + 1; } if( point_size.x > ( max.y / node->height ) ) { hmenu = GetMenu( _wpi_getframe(HMainWindow) ); CheckSquareGrid( hmenu ); } else { point_size.y = point_size.x; } } new_width = (short)(point_size.x * node->width + x_adjustment); new_height = (short)(point_size.y * node->height + y_adjustment); pointSize = point_size; if( (pointSize.x*node->width != width) || (pointSize.y*node->height != height) ) { SetWindowPos( frame, HWND_TOP, 0, 0, new_width, new_height, SWP_SIZE | SWP_ZORDER | SWP_NOMOVE | SWP_SHOWWINDOW); SetGridSize( pointSize.x, pointSize.y ); } if( !firsttime ) { BlowupImage( node->hwnd, NULL ); } } /* ResizeChild */
ToyButtonGrid::ToyButtonGrid(Client *pClient, QWidget *parent, Qt::WindowFlags flags) : ToyGrid(TOY_BUTTON_GRID, pClient, parent, flags) { SetGridSize( QSize(5,1) ); }
void ToyGrid::Clear() { SetGridSize( QSize(0,0) ); }