Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsTopBanner.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-Today Guy Deleeuw
3  *
4  * See the LICENSE file for terms of use.
5 */
6 
7 #include <Wt/WApplication>
8 #include <Wt/WLogger>
9 #include <Wt/WHBoxLayout>
10 
11 #include "WsLogo.h"
12 #include "WsSiteMap.h"
13 #include "WsSearchObject.h"
14 #include <Wt/WTheme>
15 
16 #include "WsTopBanner.h"
17 
19 #include <Include/WsGlobalConfig.h>
20 
21 using namespace Wt;
22 
23 WsTopBanner::WsTopBanner(WContainerWidget* parent)
24  : WContainerWidget(parent)
25 {
26  // if ( WsLayoutProperties::instance()->get("global", "by_object_stylesheet", "false") == "true" )
27  if ( WString::tr("byObjectStyleSheet").narrow() == "true" )
28  wApp->useStyleSheet(wApp->theme()->resourcesUrl() + "wittyshare/Css/WsTopBanner.css");
29  addStyleClass("WsopBanner");
30  WHBoxLayout* hbox = new WHBoxLayout();
31  hbox->setContentsMargins(0, 0, 0, 0);
32  if ( WsLayoutProperties::instance()->get("global", "topbanner_use_logo", "true") == "true" ) {
33  WsLogo* pLogo = new WsLogo();
34  WContainerWidget* cw = new WContainerWidget();
35  cw->addWidget(pLogo);
36  hbox->addWidget(cw, 1, AlignLeft);
37  }
38  if ( WsLayoutProperties::instance()->get("global", "topbanner_use_sitemap", "true") == "true" ) {
39  WsSiteMap* pSiteMap = new WsSiteMap();
40  hbox->addWidget(pSiteMap, 0, AlignRight);
41  }
42  if ( WsLayoutProperties::instance()->get("global", "topbanner_use_search", "true") == "true" ) {
43  WsSearchObject* pSearch = new WsSearchObject();
44  hbox->addWidget(pSearch, 0, Wt::AlignTop | Wt::AlignRight);
45  }
46  setLayout(hbox);
47 }
48 
50 { }
51 
Definition: WsLogo.h:13
static WsLayoutProperties * instance()
Get the singleton instance.
WsTopBanner(Wt::WContainerWidget *parent=0)
Definition: WsTopBanner.cpp:23