CMS 3D CMS Logo

Public Member Functions

ContentViewer Class Reference

#include <ContentViewer.h>

Inheritance diagram for ContentViewer:
WebElement

List of all members.

Public Member Functions

 ContentViewer (std::string the_url, std::string top, std::string left)
 position of the widget
void printHTML (xgi::Output *out)
void printSelectHTML (xgi::Output *out, std::string name, std::string onchange)
 ~ContentViewer ()

Detailed Description

This is the class that should be instantiated in case the user wants to have a select menu, the elements of which, submit a request when clicked on.

Definition at line 14 of file ContentViewer.h.


Constructor & Destructor Documentation

ContentViewer::ContentViewer ( std::string  the_url,
std::string  top,
std::string  left 
) [inline]

position of the widget

Parameters:
topurl of the application

Definition at line 20 of file ContentViewer.h.

    : WebElement(the_url, top, left)
    {
    }
ContentViewer::~ContentViewer ( ) [inline]

Definition at line 25 of file ContentViewer.h.

    {
    }

Member Function Documentation

void ContentViewer::printHTML ( xgi::Output *  out) [virtual]

Implements WebElement.

Definition at line 4 of file ContentViewer.cc.

References WebElement::get_pix_left(), WebElement::get_pix_top(), position, printSelectHTML(), AlCaHLTBitMon_QueryRunRegistry::string, and asciidump::table.

{
  std::string open_command = "makeContentViewerRequest()"; 
  std::string view_or_unview_command = "updateContentViewerNoRequest()";
  std::string position = "position:absolute; left:" + get_pix_left() + "; top:" + get_pix_top();

  *out << cgicc::div().set("style", position.c_str()) << std::endl;
  *out << cgicc::form().set("name", "ContentViewerForm").set("id", "ContentViewerForm") << std::endl;
  *out << cgicc::table() << std::endl;

  printSelectHTML(out, "Open",   open_command);
  printSelectHTML(out, "View",   view_or_unview_command);
  printSelectHTML(out, "Unview", view_or_unview_command);

  *out << cgicc::table() << std::endl; 
  *out << cgicc::form()  << std::endl;
  *out << cgicc::div()   << std::endl;
}
void ContentViewer::printSelectHTML ( xgi::Output *  out,
std::string  name,
std::string  onchange 
)

Definition at line 23 of file ContentViewer.cc.

References benchmark_cfg::select.

Referenced by printHTML().

{
  *out << cgicc::tr() << std::endl
       << cgicc::td() << std::endl
       << name << ":" << std::endl
       << cgicc::td() << std::endl;

  *out << cgicc::td() << std::endl;

  // if this is the "Open" menu, it should contain a "top" option
  if (name == "Open") 
    {
      *out << cgicc::select().set("name", name).set("id", name).set("onchange", onchange) << std::endl; 
      *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
      *out << cgicc::option().set("value", "top") << "top" << cgicc::option() << std::endl;
      *out << cgicc::select() << std::endl;
    }
  else if (name != "Open")
    {
      *out << cgicc::select().set("name", name).set("id", name).set("onchange", onchange) << std::endl; 
      *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
      *out << cgicc::select() << std::endl;
   }

  *out << cgicc::td() << std::endl;
  
  *out << cgicc::tr() << std::endl;
}