CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
ContentViewer Class Reference

#include <ContentViewer.h>

Inheritance diagram for ContentViewer:
WebElement

Public Member Functions

 ContentViewer (std::string the_url, std::string top, std::string left)
 position of the widget More...
 
void printHTML (xgi::Output *out)
 
void printSelectHTML (xgi::Output *out, std::string name, std::string onchange)
 
 ~ContentViewer ()
 
- Public Member Functions inherited from WebElement
std::string get_pix_left ()
 
std::string get_pix_top ()
 
std::string get_url ()
 
 WebElement (std::string the_url, std::string top, std::string left)
 
virtual ~WebElement ()
 

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.

22  : WebElement(the_url, top, left)
23  {
24  }
WebElement(std::string the_url, std::string top, std::string left)
Definition: WebElement.h:21
ContentViewer::~ContentViewer ( )
inline

Definition at line 25 of file ContentViewer.h.

26  {
27  }

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(), and asciidump::table.

5 {
6  std::string open_command = "makeContentViewerRequest()";
7  std::string view_or_unview_command = "updateContentViewerNoRequest()";
8  std::string position = "position:absolute; left:" + get_pix_left() + "; top:" + get_pix_top();
9 
10  *out << cgicc::div().set("style", position.c_str()) << std::endl;
11  *out << cgicc::form().set("name", "ContentViewerForm").set("id", "ContentViewerForm") << std::endl;
12  *out << cgicc::table() << std::endl;
13 
14  printSelectHTML(out, "Open", open_command);
15  printSelectHTML(out, "View", view_or_unview_command);
16  printSelectHTML(out, "Unview", view_or_unview_command);
17 
18  *out << cgicc::table() << std::endl;
19  *out << cgicc::form() << std::endl;
20  *out << cgicc::div() << std::endl;
21 }
std::string get_pix_left()
Definition: WebElement.h:38
list table
Definition: asciidump.py:386
void printSelectHTML(xgi::Output *out, std::string name, std::string onchange)
tuple out
Definition: dbtoconf.py:99
std::string get_pix_top()
Definition: WebElement.h:37
static int position[264][3]
Definition: ReadPGInfo.cc:509
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().

24 {
25  *out << cgicc::tr() << std::endl
26  << cgicc::td() << std::endl
27  << name << ":" << std::endl
28  << cgicc::td() << std::endl;
29 
30  *out << cgicc::td() << std::endl;
31 
32  // if this is the "Open" menu, it should contain a "top" option
33  if (name == "Open")
34  {
35  *out << cgicc::select().set("name", name).set("id", name).set("onchange", onchange) << std::endl;
36  *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
37  *out << cgicc::option().set("value", "top") << "top" << cgicc::option() << std::endl;
38  *out << cgicc::select() << std::endl;
39  }
40  else if (name != "Open")
41  {
42  *out << cgicc::select().set("name", name).set("id", name).set("onchange", onchange) << std::endl;
43  *out << cgicc::option().set("value", "").set("selected") << cgicc::option() << std::endl;
44  *out << cgicc::select() << std::endl;
45  }
46 
47  *out << cgicc::td() << std::endl;
48 
49  *out << cgicc::tr() << std::endl;
50 }
tuple out
Definition: dbtoconf.py:99