本文整理汇总了C++中Assets_Header::setFadingMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ Assets_Header::setFadingMenu方法的具体用法?C++ Assets_Header::setFadingMenu怎么用?C++ Assets_Header::setFadingMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets_Header
的用法示例。
在下文中一共展示了Assets_Header::setFadingMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: workbench_index
string workbench_index (void * webserver_request)
{
Webserver_Request * request = (Webserver_Request *) webserver_request;
vector <string> desktops = workbench_get_names (request);
// Set the requested desktop as the active one.
if (request->query.count ("bench")) {
unsigned int bench = convert_to_int (request->query ["bench"]);
if (bench < desktops.size ()) {
string workbench = desktops [bench];
request->database_config_user()->setActiveWorkbench (workbench);
}
}
// Check that the active desktop exists, else set the first available desktop as the active one.
{
string desktop = request->database_config_user ()->getActiveWorkbench ();
if (!in_array (desktop, desktops)) {
if (!desktops.empty ()) {
request->database_config_user ()->setActiveWorkbench (desktops [0]);
}
}
}
// Create default set of desktops if there are none.
bool create = desktops.empty ();
if (!create) {
create = (desktops [0] == workbench_get_default_name ());
}
if (create) {
workbench_create_defaults (webserver_request);
}
// In case the desktop is opened from a consultation note email,
// read the note, and set the active passage to the passage the note refers to.
int noteid = convert_to_int (request->query ["note"]);
if (noteid) {
Database_Notes database_notes (webserver_request);
vector <Passage> passages = database_notes.getPassages (noteid);
if (!passages.empty ()) {
Ipc_Focus::set (webserver_request, passages[0].book, passages[0].chapter, convert_to_int (passages[0].verse));
Navigation_Passage::recordHistory (webserver_request, passages[0].book, passages[0].chapter, convert_to_int (passages[0].verse));
}
}
string page;
Assets_Header header = Assets_Header (translate("Desktop"), request);
header.setNavigator ();
header.setFadingMenu (menu_logic_desktop_category (webserver_request));
page = header.run ();
Assets_View view;
map <int, string> urls = workbench_get_urls (request, true);
map <int, string> widths = workbench_get_widths (request);
for (unsigned int key = 0; key < 15; key++) {
string url = urls [key];
string width = widths [key];
int row = round (key / 5) + 1;
int column = key % 5 + 1;
string variable = "url" + convert_to_string (row) + convert_to_string (column);
view.set_variable (variable, url);
variable = "width" + convert_to_string (row) + convert_to_string (column);
view.set_variable (variable, width);
if (convert_to_int (width) > 0) view.enable_zone (variable);
}
map <int, string> heights = workbench_get_heights (request);
for (unsigned int key = 0; key < 3; key++) {
string height = heights [key];
int row = key + 1;
string variable = "height" + convert_to_string (row);
view.set_variable (variable, height);
if (convert_to_int (height) > 0) view.enable_zone (variable);
}
string workbenchwidth = workbench_get_entire_width (request);
if (!workbenchwidth.empty ()) {
workbenchwidth.insert (0, "width: ");
workbenchwidth.append (";");
}
view.set_variable ("workbenchwidth", workbenchwidth);
// The rendered template disables framekillers through the "sandbox" attribute on the iframe elements.
page += view.render ("workbench", "index");
page += Assets_Page::footer ();
return page;
}