CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DQM/TrackerCommon/src/Navigator.cc

Go to the documentation of this file.
00001 #include "DQM/TrackerCommon/interface/Navigator.h"
00002 
00003 
00004 void Navigator::printHTML(xgi::Output * out)
00005 {
00006   // std::string js_command = "makeNavigatorRequest('" + get_url() + "')"; 
00007   std::string js_command = "makeNavigatorRequest()"; 
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", "NavigatorForm").set("id", "NavigatorForm") << std::endl;
00012   *out << cgicc::table() << std::endl;
00013 
00014   printSelectHTML(out, "Open",        js_command);
00015   printSelectHTML(out, "Subscribe",   js_command);
00016   printSelectHTML(out, "Unsubscribe", js_command);
00017 
00018   *out << cgicc::table() << std::endl; 
00019   *out << cgicc::form()  << std::endl;
00020   *out << cgicc::div()   << std::endl;
00021 }
00022 
00023 void Navigator::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 }