Exemplo n.º 1
0
WWidget *FormWidgets::wRadioButton()
{
  WContainerWidget *result = new WContainerWidget();

  topic("WRadioButton", result);
  addText(tr("formwidgets-WRadioButton"), result);
  WRadioButton *rb = 0;
  rb = new WRadioButton("Radio me!", result);
  ed_->showSignal(rb->checked(), "'Radio me!' checked (not in buttongroup)");
  new WBreak(result);
  rb = new WRadioButton("Radio me too!", result);
  ed_->showSignal(rb->checked(), "'Radio me too!' checked "
		 "(not in buttongroup)");
  
  addText(tr("formwidgets-WRadioButton-group"), result);
  WButtonGroup *wgb = new WButtonGroup(result);
  rb = new WRadioButton("Radio me!", result);
  ed_->showSignal(rb->checked(), "'Radio me!' checked");
  wgb->addButton(rb);
  new WBreak(result);
  rb = new WRadioButton("No, radio me!", result);
  ed_->showSignal(rb->checked(), "'No, Radio me!' checked");
  wgb->addButton(rb);
  new WBreak(result);
  rb = new WRadioButton("Nono, radio me!", result);
  ed_->showSignal(rb->checked(), "'Nono, radio me!' checked");
  wgb->addButton(rb);

  wgb->setSelectedButtonIndex(0);

  return result;
}
Exemplo n.º 2
0
void DensityApp::reportButton() {
    kernel_ = group_->checkedId(); 				// get id of selected kernel 
    plot();
}
Exemplo n.º 3
0
 GravatarApp(const WEnvironment& env):
     WApplication(env) {
     GravatarImage* gravatar = new GravatarImage("*****@*****.**", root());
     new WBreak(root());
     WLineEdit* email = new WLineEdit(root());
     email->changed().connect(boost::bind(set_email, gravatar, email));
     email->setText("*****@*****.**");
     new WBreak(root());
     WSlider* size = new WSlider(root());
     size->setRange(1, 512);
     size->setValue(80);
     size->valueChanged().connect(boost::bind(set_size, gravatar, size));
     new WBreak(root());
     WButtonGroup* builtin = new WButtonGroup(this);
     builtin->addButton(new WRadioButton("default", root()),
                        GravatarImage::DEFAULT);
     builtin->addButton(new WRadioButton("404", root()),
                        GravatarImage::RETURN_404);
     builtin->addButton(new WRadioButton("mm", root()),
                        GravatarImage::MM);
     builtin->addButton(new WRadioButton("identicon", root()),
                        GravatarImage::IDENTICON);
     builtin->addButton(new WRadioButton("monsterid", root()),
                        GravatarImage::MONSTERID);
     builtin->addButton(new WRadioButton("wavatar", root()),
                        GravatarImage::WAVATAR);
     builtin->addButton(new WRadioButton("retro", root()),
                        GravatarImage::RETRO);
     builtin->addButton(new WRadioButton("custom url", root()),
                        9000);
     WLineEdit* custom_url = new WLineEdit(root());
     custom_url->setText("https://www.google.com/favicon.ico");
     builtin->setCheckedButton(builtin->button(GravatarImage::DEFAULT));
     builtin->checkedChanged().connect(boost::bind(set_default,
                                       gravatar, builtin, custom_url));
     new WBreak(root());
     WButtonGroup* rating = new WButtonGroup(this);
     rating->addButton(new WRadioButton("G", root()), GravatarImage::G);
     rating->addButton(new WRadioButton("PG", root()), GravatarImage::PG);
     rating->addButton(new WRadioButton("R", root()), GravatarImage::R);
     rating->addButton(new WRadioButton("X", root()), GravatarImage::X);
     rating->setCheckedButton(rating->button(GravatarImage::G));
     rating->checkedChanged().connect(boost::bind(set_rating,
                                      gravatar, rating));
     new WBreak(root());
     WCheckBox* fd = new WCheckBox("Force default", root());
     fd->checked().connect(boost::bind(&GravatarImage::set_force_default,
                                       gravatar, true));
     fd->unChecked().connect(boost::bind(&GravatarImage::set_force_default,
                                         gravatar, false));
     new WBreak(root());
     WCheckBox* sr = new WCheckBox("Use https", root());
     sr->setTristate();
     sr->setCheckState(PartiallyChecked);
     sr->checked().connect(boost::bind(&GravatarImage::set_secure_requests,
                                       gravatar, GravatarImage::ALWAYS));
     sr->unChecked().connect(boost::bind(&GravatarImage::set_secure_requests,
                                         gravatar, GravatarImage::NEVER));
 }