void KviAnimatedPixmap::resize(QSize newSize,Qt::AspectRatioMode ratioMode) { QSize curSize(size()); curSize.scale(newSize,ratioMode); m_pFrameData = KviAnimatedPixmapCache::resize(m_pFrameData,curSize); }
int Bank::newAccount() { if(curSize() >= size) { std::cout << "Yellen says no more customers allowed!" << std::endl; return 1; } std::string id; std::cout << "Enter user id:" << std::endl << "# "; std::getline(std::cin, id); if(!std::regex_match(id, id_re)) { std::cout << "Invalid user id format" << std::endl; return 1; } for(Customer& c : customers) { if(c.getId() == id) { std::cout << "User already exists" << std::endl; return 1; } } Customer *c = new Customer(id); if(c -> isOk) { customers.push_back(*c); return 0; } return 1; }
void AkVideoCaps::setSize(const QSize &size) { QSize curSize(this->d->m_width, this->d->m_height); if (curSize == size) return; this->setWidth(size.width()); this->setHeight(size.height()); emit sizeChanged(size); }
void DropDownBase::DoSetSize(int x, int y, int width, int height, int sizeFlags) { wxSize curSize( GetSize() ); if (width == -1) width = curSize.GetWidth(); if (height == -1) height = curSize.GetHeight(); wxControl::DoSetSize(x, y, width, height, sizeFlags); wxSize dropSize = m_dropdownButton->GetSize(); m_dropdownButton->SetSize(width-dropSize.x, 0, dropSize.x, height); }
void Bank::load(std::string filename) { std::ifstream in; in.open(filename); if(in.is_open()) { while(!in.eof()) { std::string lname; std::string fname; std::string userid; std::string password; unsigned int age; unsigned int streetnum; std::string streetname; std::string town; std::string zip; std::string state; std::string temp; std::string temp2; getline(in, lname); getline(in, fname); getline(in, userid); getline(in, password); getline(in, temp); age = atoi(temp.c_str()); getline(in, temp2); streetnum = atoi(temp2.c_str()); getline(in, streetname); getline(in, town); getline(in, zip); getline(in, state); State st = makeState(state); if(curSize() >= size) { std::cout << "Yellen says no more customers allowed!" << std::endl; return; } for(Customer& c : customers) { if(c.getId() == userid) { std::cout << "User already exists" << std::endl; return; } } Customer *c = new Customer(lname, fname, userid, password, age, streetnum, streetname, town, zip, st); customers.push_back(*c); } } }
void KviMdiManager::cascadeMaximized() { cascadeSubWindows(); QList<QMdiSubWindow*> tmp = subWindowList(QMdiArea::StackingOrder); QListIterator<QMdiSubWindow*> it(tmp); KviMdiChild * lpC; while (it.hasNext()) { lpC = (KviMdiChild *) it.next(); if(lpC->windowState() & Qt::WindowMinimized) continue; QPoint pnt(lpC->pos()); QSize curSize(viewport()->width() - pnt.x(),viewport()->height() - pnt.y()); if((lpC->minimumSize().width() > curSize.width()) || (lpC->minimumSize().height() > curSize.height()))lpC->resize(lpC->minimumSize()); else lpC->resize(curSize); } }
void wxMenuButton::DoSetSize(int x, int y, int width, int height, int sizeFlags) { wxSize curSize( GetSize() ); wxSize bestSize( DoGetBestSize() ); if (width == -1) width = curSize.GetWidth(); if (width < 10) width = bestSize.GetWidth(); if (height == -1) height = curSize.GetHeight(); if (height < 5) height = bestSize.GetHeight(); wxWindow::DoSetSize(x, y, width, height, sizeFlags); if (m_labelButton) m_labelButton->SetSize(0, 0, width - wxMENUBUTTON_DROP_WIDTH, height); if (m_dropdownButton) m_dropdownButton->SetSize(width-wxMENUBUTTON_DROP_WIDTH, 0, wxMENUBUTTON_DROP_WIDTH, height); }
void KMdiChildArea::cascadeMaximized() { int idx=0; QPtrList<KMdiChildFrm> list(*m_pZ); list.setAutoDelete(false); while(!list.isEmpty()){ KMdiChildFrm *lpC=list.first(); if(lpC->m_state != KMdiChildFrm::Minimized){ if(lpC->m_state==KMdiChildFrm::Maximized)lpC->restorePressed(); QPoint pnt(getCascadePoint(idx)); lpC->move(pnt); QSize curSize(width()-pnt.x(),height()-pnt.y()); if((lpC->minimumSize().width() > curSize.width()) || (lpC->minimumSize().height() > curSize.height()))lpC->resize(lpC->minimumSize()); else lpC->resize(curSize); idx++; } list.removeFirst(); } focusTopChild(); }