void menu() { int opt,style,size=2,x,y; while(1) { cleardevice(); style = TRIPLEX_FONT; /* select the text style */ settextstyle(style, HORIZ_DIR, size); // outtext("student record project"); outtextxy(200,200," 1.new record"); setcolor(4); outtextxy(220,220,"\n 2.modification in record"); setcolor(5); outtextxy(240,240,"\n 3.delete record"); setcolor(6); outtextxy(260,260,"\n 4.display"); setcolor(7); outtextxy(280,280,"\n 8.exit"); setcolor(8); outtextxy(300,300,"\n option "); setcolor(9); scanf("%d",&opt); if(opt>7||opt<0) break; else switch(opt) { case 1: newrec(); break; case 2: modrec(); break; case 4: display(); break; case 3: delrec(); break; } getch(); } }
void KRuler::slotNewValue(int _value) { int oldvalue = value(); if (oldvalue == _value) { return; } // setValue(_value); setValue(_value); if (value() == oldvalue) { return; } // get the rectangular of the old and the new ruler pointer // and repaint only him if (d->dir == Qt::Horizontal) { QRect oldrec(-5 + oldvalue, 10, 11, 6); QRect newrec(-5 + _value, 10, 11, 6); repaint(oldrec.united(newrec)); } else { QRect oldrec(10, -5 + oldvalue, 6, 11); QRect newrec(10, -5 + _value, 6, 11); repaint(oldrec.united(newrec)); } }
void CmdInterface::onAddRecord(PhoneBook & pb) { Record newrec(""); string tmp; println("Input the person's name:"); newrec.setName(getLine()); println("Input the phone number:"); newrec.setPhone(getLine()); println("Input the address:"); newrec.setAddr(getLine()); pb.addRecord(newrec); println("Record successfully added."); }
void CmdInterface::addRecord(PhoneBook & pb) { Record newrec(""); string tmp; cin.ignore(); cout << "Input the person's name:" << endl; newrec.setName((getline(cin, tmp), tmp)); cout << "Input the phone number:" << endl; newrec.setPhone((getline(cin, tmp), tmp)); cout << "Input the address:" << endl; newrec.setAddr((getline(cin, tmp), tmp)); pb.addRecord(newrec); cout <<"Record successfully added.\n"; }