// --------------------------------------------------------------------- void ToolBar::set(string p,string v) { QToolBar *w=(QToolBar *)widget; QStringList opt=qsplit(v); if (p=="add") makeact(opt); else if (p=="addsep") w->addSeparator(); else if (p=="checkable") setbutton(p,opt); else if (p=="checked") setbutton(p,opt); else if (p=="enable") { if (opt.isEmpty()) Child::set(p,v); else if (1==opt.size() && (!opt.at(0).isEmpty()) && opt.at(0)[0].isNumber()) Child::set(p,v); else setbutton(p,opt); } else Child::set(p,v); }
horiz_butt() { int cmdtop=45,cmdbot; int space=100; cmdbot=ym-30; setbutton(&add,cmdtop,cmdbot,"Add Body"); drawbutton(&add); setbutton(&gravtn,cmdtop+space,cmdbot,"Gravity"); drawbutton(&gravtn); setbutton(&frictn,cmdtop+2*space,cmdbot,"Friction"); drawbutton(&frictn); setbutton(&delt,cmdtop+3*space,cmdbot,"Delete"); drawbutton(&delt); setbutton(&exit1,cmdtop+4*space,cmdbot,"EXIT"); drawbutton(&exit1); return 0; }
vert_butt() { int cmdtop=xm-60,cmdbot; int space=40; cmdbot=80; setbutton(&add,cmdtop,cmdbot,"Add Body"); drawbutton(&add); setbutton(&gravtn,cmdtop,cmdbot+space,"Gravity"); drawbutton(&gravtn); setbutton(&frictn,cmdtop,cmdbot+2*space,"Friction"); drawbutton(&frictn); setbutton(&delt,cmdtop,cmdbot+3*space,"Delete"); drawbutton(&delt); setbutton(&exit1,cmdtop,cmdbot+4*space,"EXIT"); drawbutton(&exit1); return 0; }