CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DQM/TrackerCommon/src/ContentViewer.cc

Go to the documentation of this file.
00001 #include "DQM/TrackerCommon/interface/ContentViewer.h"
00002 
00003 
00004 void ContentViewer::printHTML(xgi::Output * out)
00005 {
00006   std::string open_command = "makeContentViewerRequest()"; 
00007   std::string view_or_unview_command = "updateContentViewerNoRequest()";
00008   std::string position = "position:absolute; left:" + get_pix_left() + "; top:" + get_pix_top();
00009 
00010   *out << cgicc::div().set("style", position.c_str()) << std::endl;
00011   *out << cgicc::form().set("name", "ContentViewerForm").set("id", "ContentViewerForm") << std::endl;
00012   *out << cgicc::table() << std::endl;
00013 
00014   printSelectHTML(out, "Open",   open_command);
00015   printSelectHTML(out, "View",   view_or_unview_command);
00016   printSelectHTML(out, "Unview", view_or_unview_command);
00017 
00018   *out << cgicc::table() << std::endl; 
00019   *out << cgicc::form()  << std::endl;
00020   *out << cgicc::div()   << std::endl;
00021 }
00022 
00023 void ContentViewer::printSelectHTML(xgi::Output * out, std::string name, std::string onchange)
00024 {
00025   *out << cgicc::tr() << std::endl
00026        << cgicc::td() << std::endl
00027        << name << ":" << std::endl
00028        << cgicc::td() << std::endl;
00029 
00030   *out << cgicc::td() << std::endl;
00031 
00032   // if this is the "Open" menu, it should contain a "top" option
00033   if (name == "Open") 
00034     {
00035       *out << cgicc::select().set("name", name).set("id", name).set("onchange", onchange) << std::endl; 
00036       *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
00037       *out << cgicc::option().set("value", "top") << "top" << cgicc::option() << std::endl;
00038       *out << cgicc::select() << std::endl;
00039     }
00040   else if (name != "Open")
00041     {
00042       *out << cgicc::select().set("name", name).set("id", name).set("onchange", onchange) << std::endl; 
00043       *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
00044       *out << cgicc::select() << std::endl;
00045    }
00046 
00047   *out << cgicc::td() << std::endl;
00048   
00049   *out << cgicc::tr() << std::endl;
00050 }