Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) TestEntrance

 

TestEntrance is a tool to test the WtEntrance class.

 

 

 

 

 

Downloads

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestEntrance/ToolTestEntrance.pro

 

QT       += core
QT       -= gui
LIBS += -lwt -lwthttp -lboost_signals -lboost_regex -lboost_system -lboost_filesystem -lboost_program_options
QMAKE_CXXFLAGS += -std=c++0x
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
INCLUDEPATH += \
  ../../Classes/CppAbout \
  ../../Classes/CppIpAddress \
  ../../Classes/CppWtAboutDialog \
  ../../Classes/CppWtAutoConfig \
  ../../Classes/CppWtEntrance

SOURCES += wtmain.cpp \
    ../../Classes/CppAbout/about.cpp \
    ../../Classes/CppWtAboutDialog/wtaboutdialog.cpp \
    ../../Classes/CppWtAutoConfig/wtautoconfig.cpp \
    testentrancemenudialog.cpp \
    ../../Classes/CppWtEntrance/wtentrance.cpp \
    ../../Classes/CppIpAddress/ipaddress.cpp \
    wttestentrancemenudialog.cpp \
    wttestentrancemaindialog.cpp

HEADERS += \
    ../../Classes/CppAbout/about.h \
    ../../Classes/CppWtAboutDialog/wtaboutdialog.h \
    ../../Classes/CppWtAutoConfig/wtautoconfig.h \
    testentrancemenudialog.h \
    ../../Classes/CppWtEntrance/wtentrance.h \
    ../../Classes/CppIpAddress/ipaddress.h \
    wttestentrancemenudialog.h \
    wttestentrancemaindialog.h

RESOURCES += \
    ToolTestEntrance.qrc

 

 

 

 

 

Qt project file: ./ToolTestEntrance/ToolTestEntranceDesktop.pro

 

include(../../Tools/Tool/ToolConsole.pri)

 

 

 

 

 

Qt project file: ./ToolTestEntrance/ToolTestEntranceWebsite.pro

 

include(../../Tools/Tool/ToolConsole.pri)

 

 

 

 

 

./ToolTestEntrance/ToolTestEntranceConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestEntrance

SOURCES += \
    ../../Tools/ToolTestEntrance/testentrancemenudialog.cpp

HEADERS += \
    ../../Tools/ToolTestEntrance/testentrancemenudialog.h

OTHER_FILES += \
    ../../Tools/ToolTestEntrance/Licence.txt

RESOURCES += \
    ../../Tools/ToolTestEntrance/ToolTestEntrance.qrc

 

 

 

 

 

./ToolTestEntrance/ToolTestEntranceDesktop.pri

 

include(../../Tools/ToolTestEntrance/ToolTestEntranceConsole.pri)

HEADERS +=

SOURCES +=

 

 

 

 

 

./ToolTestEntrance/ToolTestEntranceWebsite.pri

 

include(../../Tools/ToolTestEntrance/ToolTestEntranceConsole.pri)

HEADERS += \
    ../../Tools/ToolTestEntrance/wttestentrancemaindialog.h \
    ../../Tools/ToolTestEntrance/wttestentrancemenudialog.h

SOURCES += \
    ../../Tools/ToolTestEntrance/wttestentrancemaindialog.cpp \
    ../../Tools/ToolTestEntrance/wttestentrancemenudialog.cpp

 

 

 

 

 

./ToolTestEntrance/testentrancemenudialog.h

 

//---------------------------------------------------------------------------
/*
TestEntrance, tool to test WtEntrance
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestEntrance.htm
//---------------------------------------------------------------------------
#ifndef TESTENTRANCEMENUDIALOG_H
#define TESTENTRANCEMENUDIALOG_H

#include "menudialog.h"

namespace ribi {

namespace ToolTestEntrance {

///The GUI independent part of the menu
struct MenuDialog final : public ::ribi::MenuDialog
{
  About GetAbout() const noexcept override;
  Help GetHelp() const noexcept override;
  boost::shared_ptr<const Program> GetProgram() const noexcept override;
  std::string GetVersion() const noexcept override;
  std::vector<std::string> GetVersionHistory() const noexcept override;

  private:
  int ExecuteSpecific(const std::vector<std::string>& argv) noexcept override;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ToolTestEntrance

} //~namespace ribi

#endif // TESTENTRANCEMENUDIALOG_H

 

 

 

 

 

./ToolTestEntrance/testentrancemenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestEntrance, tool to test WtEntrance
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestEntrance.htm
//---------------------------------------------------------------------------
#include "testentrancemenudialog.h"

#include <cassert>
#include <iostream>

#include "ipaddress.h"
#include "richelbilderbeekprogram.h"
#include "trace.h"
#include "testtimer.h"

int ribi::ToolTestEntrance::MenuDialog::ExecuteSpecific(const std::vector<std::string>& argv) noexcept
{
  #ifndef NDEBUG
  Test();
  #endif
  const int argc = static_cast<int>(argv.size());
  if (argc == 1)
  {
    std::cout << GetHelp() << '\n';
    return 1;
  }
  assert(!"TODO");
  return 1;
}

ribi::About ribi::ToolTestEntrance::MenuDialog::GetAbout() const noexcept
{
  About a(
    "Richel Bilderbeek",
    "TestEntrance",
    "tool to test WtEntrance",
    "the 19th of September 2011",
    "2011-2015",
    "http://www.richelbilderbeek.nl/ToolTestEntrance.htm",
    GetVersion(),
    GetVersionHistory());
  a.AddLibrary("IpAddress version: " + IpAddress::GetVersion());

  return a;
}

ribi::Help ribi::ToolTestEntrance::MenuDialog::GetHelp() const noexcept
{
  return Help(
    this->GetAbout().GetFileTitle(),
    this->GetAbout().GetFileDescription(),
    {

    },
    {

    }
  );
}

boost::shared_ptr<const ribi::Program> ribi::ToolTestEntrance::MenuDialog::GetProgram() const noexcept
{
  const boost::shared_ptr<const Program> p {
    new ProgramTestEntrance
  };
  assert(p);
  return p;
}

std::string ribi::ToolTestEntrance::MenuDialog::GetVersion() const noexcept
{
  return "1.1";
}

std::vector<std::string> ribi::ToolTestEntrance::MenuDialog::GetVersionHistory() const noexcept
{
  return {
    "2011-09-19: Version 1.0: initial version",
    "2013-11-05: version 1.1: conformized for ProjectRichelBilderbeekConsole"
  };
}

#ifndef NDEBUG
void ribi::ToolTestEntrance::MenuDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
}
#endif

 

 

 

 

 

./ToolTestEntrance/wtmain.cpp

 

//---------------------------------------------------------------------------
/*
TestEntrance, tool to test WtEntrance
Copyright (C) 2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestEntrance.htm
//---------------------------------------------------------------------------
#include <iostream>

#include <boost/program_options.hpp>

#include <Wt/WApplication>
#include <Wt/WEnvironment>
#include <Wt/WText>

#include "ipaddress.h"
#include "wttestentrancemenudialog.h"
#include "wtautoconfig.h"
#include "wtentrance.h"

struct WtApplication : public Wt::WApplication
{
  WtApplication(const Wt::WEnvironment& env)
  : WApplication(env)
  {
    setTitle("TestEntrance");
    this->useStyleSheet("wt.css");
    boost::shared_ptr<const IpAddress> ip_address(new IpAddress(env.clientAddress()));
    WtEntrance::Get()->Visit(ip_address.get());
    root()->addWidget(new ToolTestEntrance::WtMenuDialog(ip_address));
  }
};

Wt::WApplication *createApplication(const Wt::WEnvironment& env)
{

  return new WtApplication(env);
}

int main(int argc, char **argv)
{
  WtAutoConfig::SaveDefaultStylesheet();
  WtAutoConfig a(argc,argv,createApplication);
  return a.Run();
}

 

 

 

 

 

./ToolTestEntrance/wttestentrancemaindialog.h

 

//---------------------------------------------------------------------------
/*
TestEntrance, tool to test WtEntrance
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestEntrance.htm
//---------------------------------------------------------------------------
#ifndef WTTESTENTRANCEMAINDIALOG_H
#define WTTESTENTRANCEMAINDIALOG_H

#include <Wt/WContainerWidget>

namespace Wt
{
  struct WLineEdit;
}

namespace ribi {

struct IpAddress;

namespace ToolTestEntrance {

///TestEntrance its main dialog
struct WtMainDialog : public Wt::WContainerWidget
{
  WtMainDialog(boost::shared_ptr<const IpAddress> ip_address);

  private:

  ///Create the Welcome dialog
  Wt::WWidget * CreateNewWelcomeDialog();

  ///Respond to the user changing the name edit
  void OnEditChanged();

  ///Respond to a visitor changing his/her name
  void OnNewName();

  ///Respond to a new visitor
  void OnNewVisit();

  const boost::shared_ptr<const IpAddress> m_ip_address;

  struct Ui
  {
    Ui();
    Wt::WLineEdit * const m_edit;
    Wt::WContainerWidget * const m_view_names_dialog;
    Wt::WContainerWidget * const m_view_visits_dialog;
  } ui;
};

} //~namespace ToolTestEntrance

} //~namespace ribi

#endif // WTTESTENTRANCEMAINDIALOG_H

 

 

 

 

 

./ToolTestEntrance/wttestentrancemaindialog.cpp

 

//---------------------------------------------------------------------------
/*
TestEntrance, tool to test WtEntrance
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestEntrance.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include "wttestentrancemaindialog.h"

#include <cassert>

#include <boost/algorithm/string/trim.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/numeric/conversion/cast.hpp>

#include <Wt/WBreak>
#include <Wt/WContainerWidget>
#include <Wt/WLabel>
#include <Wt/WLineEdit>
#include <Wt/WMenu>
#include <Wt/WMenuItem>
#include <Wt/WStackedWidget>
#include <Wt/WTable>
#include <Wt/WTableRow>

#include "ipaddress.h"
#include "testentrancemenudialog.h"
#include "wtentrance.h"
#include "wtaboutdialog.h"
#pragma GCC diagnostic pop

ribi::ToolTestEntrance::WtMainDialog::Ui::Ui()
  : m_edit(new Wt::WLineEdit),
    m_view_names_dialog(new Wt::WContainerWidget),
    m_view_visits_dialog(new Wt::WContainerWidget)
{
  assert(m_view_visits_dialog);
  m_edit->setMinimumSize(400,Wt::WLength::Auto);
}

ribi::ToolTestEntrance::WtMainDialog::WtMainDialog(boost::shared_ptr<const IpAddress> ip_address)
:  m_ip_address(ip_address),
    ui{}
{
  assert(ip_address);
  this->setContentAlignment(Wt::AlignCenter);
  //Menu
  {
    Wt::WStackedWidget * const contents = new Wt::WStackedWidget;
    Wt::WMenu * const menu = new Wt::WMenu(contents,Wt::Horizontal);
    menu->setStyleClass("menu");
    {

      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "Welcome",
        CreateNewWelcomeDialog());
      menu->addItem(item);
    }
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "View names",
        ui.m_view_names_dialog);
      menu->addItem(item);
    }
    {
      assert(ui.m_view_visits_dialog);
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "View visits",
        ui.m_view_visits_dialog);
      menu->addItem(item);
    }
    //Display menu on top
    this->addWidget(menu);
    this->addWidget(new Wt::WBreak);
    //Display contents below menu
    this->addWidget(contents);
  }

  //DO NOT MAKE THESE CONNECTIONS!
  //When closing the page, and opening one again,
  //these signals connect to the old page!
  //WtEntrance::Get()->m_signal_name_changed.connect(boost::bind(
  //  &ribi::ToolTestEntrance::WtMainDialog::OnNewName,this));

  //WtEntrance::Get()->m_signal_new_visit.connect(boost::bind(
  //  &ribi::ToolTestEntrance::WtMainDialog::OnNewVisit,this));

  OnEditChanged();
  OnNewName();
  OnNewVisit();
}

void ribi::ToolTestEntrance::WtMainDialog::OnNewName()
{
  assert(ui.m_view_names_dialog);
  ui.m_view_names_dialog->clear();
  ui.m_view_names_dialog->addWidget(new Wt::WBreak);
  const std::vector<std::pair<std::string,std::string> > v
    = WtEntrance::Get()->GetNames();
  std::for_each(v.begin(),v.end(),
    [this](const std::pair<std::string,std::string>& p)
    {
      const std::string s
        = p.first
        + std::string(": ")
        + p.second;
      ui.m_view_names_dialog->addWidget(new Wt::WLabel(s.c_str()));
      ui.m_view_names_dialog->addWidget(new Wt::WBreak);
    }
  );
}

void ribi::ToolTestEntrance::WtMainDialog::OnNewVisit()
{
  assert(ui.m_view_visits_dialog);
  ui.m_view_visits_dialog->clear();
  ui.m_view_visits_dialog->addWidget(new Wt::WBreak);
  const std::vector<std::pair<std::string,std::string> > v
    = WtEntrance::Get()->GetVisits();
  std::for_each(v.begin(),v.end(),
    [this](const std::pair<std::string,std::string>& p)
    {
      const std::string s
        = p.first
        + std::string(": ")
        + p.second;
      ui.m_view_visits_dialog->addWidget(new Wt::WLabel(s.c_str()));
      ui.m_view_visits_dialog->addWidget(new Wt::WBreak);
    }
  );
}

Wt::WWidget * ribi::ToolTestEntrance::WtMainDialog::CreateNewWelcomeDialog()
{
  Wt::WContainerWidget * dialog = new Wt::WContainerWidget;
  dialog->setContentAlignment(Wt::AlignCenter);
  new Wt::WBreak(dialog);
  new Wt::WLabel("Welcome",dialog);
  {
    const std::string s = WtEntrance::Get()->GetName(m_ip_address.get());
    ui.m_edit->setText(s.c_str());
    ui.m_edit->keyWentUp().connect(this,&ribi::ToolTestEntrance::WtMainDialog::OnEditChanged);
    dialog->addWidget(ui.m_edit);
  }
  return dialog;
}

void ribi::ToolTestEntrance::WtMainDialog::OnEditChanged()
{
  std::string s = ui.m_edit->text().toUTF8();
  std::replace(s.begin(),s.end(),',',' ');
  s = boost::algorithm::trim_copy(s);
  if (s.empty()) return;
  WtEntrance::Get()->SetName(m_ip_address.get(),s);
  OnNewName();
}

 

 

 

 

 

./ToolTestEntrance/wttestentrancemenudialog.h

 

//---------------------------------------------------------------------------
/*
TestEntrance, tool to test WtEntrance
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestEntrance.htm
//---------------------------------------------------------------------------
#ifndef WTTESTENTRANCEMENUDIALOG_H
#define WTTESTENTRANCEMENUDIALOG_H

#include <boost/shared_ptr.hpp>

#include <Wt/WContainerWidget>

namespace ribi {

struct IpAddress;

namespace ToolTestEntrance {

struct WtMenuDialog : public Wt::WContainerWidget
{
  WtMenuDialog(boost::shared_ptr<const IpAddress> ip_address);
  private:
  Wt::WWidget * CreateNewAboutDialog();
  Wt::WWidget * CreateNewMainDialog(boost::shared_ptr<const IpAddress> ip_address) const;
  Wt::WWidget * CreateNewWelcomeDialog() const;
};

} //~namespace ToolTestEntrance

} //~namespace ribi

#endif // WTTESTENTRANCEMENUDIALOG_H

 

 

 

 

 

./ToolTestEntrance/wttestentrancemenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestEntrance, tool to test WtEntrance
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestEntrance.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>

#include <Wt/WBreak>
#include <Wt/WContainerWidget>
#include <Wt/WGroupBox>
#include <Wt/WImage>
#include <Wt/WLabel>
#include <Wt/WStackedWidget>
#include <Wt/WMenu>
#include <Wt/WMenuItem>

#include "testentrancemenudialog.h"
#include "wtaboutdialog.h"
#include "wtautoconfig.h"
#include "wttestentrancemaindialog.h"
#include "wttestentrancemenudialog.h"
#include "wtentrance.h"

#include <QFile>
#pragma GCC diagnostic pop

ribi::ToolTestEntrance::WtMenuDialog::WtMenuDialog(
  boost::shared_ptr<const IpAddress> ip_address)
{
  {
    std::vector<std::string> image_names;
    image_names.push_back("ToolTestEntranceWelcome.png");

    BOOST_FOREACH(const std::string& filename,image_names)
    {
      if (!(QFile::exists(filename.c_str())))
      {
        QFile f( (std::string(":/ToolTestEntrance/images/") + filename).c_str() );
        f.copy(filename.c_str());
      }
      if (!boost::filesystem::exists(filename.c_str()))
      {
        std::cerr << "File not found: " << filename << '\n';
      }
      assert(boost::filesystem::exists(filename.c_str()));
    }
  }

  this->setContentAlignment(Wt::AlignCenter);
  {
    Wt::WLabel * const title = new Wt::WLabel("TestEntrance");
    title->setStyleClass("title");
    this->addWidget(title);
  }
  //Menu
  {
    Wt::WStackedWidget * const contents = new Wt::WStackedWidget;
    Wt::WMenu * const menu = new Wt::WMenu(contents,Wt::Horizontal);
    menu->setStyleClass("menu");
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "Welcome",
        CreateNewWelcomeDialog());
      menu->addItem(item);
    }
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "Start",
        CreateNewMainDialog(ip_address));
      menu->addItem(item);
    }
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "About",
        CreateNewAboutDialog());
      menu->addItem(item);
    }
    //Display menu on top
    this->addWidget(menu);
    this->addWidget(new Wt::WBreak);
    //Display contents below menu
    this->addWidget(contents);
  }
}

Wt::WWidget * ribi::ToolTestEntrance::WtMenuDialog::CreateNewAboutDialog()
{
  About a = MenuDialog().GetAbout();
  a.AddLibrary("WtAutoConfig version: " + WtAutoConfig::GetVersion());
  a.AddLibrary("WtEntrance version: " + WtEntrance::GetVersion());
  WtAboutDialog * const d = new WtAboutDialog(a,false);
  assert(d);
  return d;
}

Wt::WWidget * ribi::ToolTestEntrance::WtMenuDialog::CreateNewMainDialog(boost::shared_ptr<const IpAddress> ip_address) const
{
  WtMainDialog * const d = new WtMainDialog(ip_address);
  assert(d);
  return d;
}

Wt::WWidget * ribi::ToolTestEntrance::WtMenuDialog::CreateNewWelcomeDialog() const
{
  Wt::WContainerWidget * dialog = new Wt::WContainerWidget;
  dialog->setContentAlignment(Wt::AlignCenter);
  dialog->addWidget(new Wt::WBreak);
  new Wt::WLabel("Welcome to TestEntrance",dialog);
  new Wt::WBreak(dialog);
  new Wt::WBreak(dialog);
  new Wt::WLabel("TestEntrance demonstrates the WtEntrance class",dialog);
  new Wt::WBreak(dialog);
  new Wt::WBreak(dialog);
  Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog);
  box->addWidget(new Wt::WImage("ToolTestEntranceWelcome.png"));
  return dialog;
}

 

 

 

 

 

./ToolTestEntrance/zip.sh

 

#!/bin/sh
#zip packs all the files to port into a single .zip file,
#minicking the same folder structure
#Folder structure
# *
#   * Classes
#     * CppAbout
#     * CppIpAddress
#     * CppWtAboutDialog
#     * CppWtAutoConfig
#     * CppWtEntrance
#   * Tools
#    * ToolTestEntrance

echo "Removing old user information"
FOLDERNAME=ToolTestEntrance
FILENAME=$FOLDERNAME"Source_1_0"
ZIP_FILENAME=$FILENAME".zip"
HTM_FILENAME=$FILENAME".htm"

rm *.user
rm $ZIP_FILENAME
rm $HTM_FILENAME

echo "Mimicking file structure"
mkdir temp_zip
mkdir temp_zip/Classes
mkdir temp_zip/Classes/CppAbout
mkdir temp_zip/Classes/CppIpAddress
mkdir temp_zip/Classes/CppWtAboutDialog
mkdir temp_zip/Classes/CppWtAutoConfig
mkdir temp_zip/Classes/CppWtEntrance

mkdir temp_zip/Tools
mkdir temp_zip/Tools/ToolTestEntrance

echo "Copying files"
cp ../../Classes/CppAbout/*.* temp_zip/Classes/CppAbout
cp ../../Classes/CppIpAddress/*.* temp_zip/Classes/CppIpAddress
cp ../../Classes/CppWtAboutDialog/*.* temp_zip/Classes/CppWtAboutDialog
cp ../../Classes/CppWtAutoConfig/*.* temp_zip/Classes/CppWtAutoConfig
cp ../../Classes/CppWtEntrance/*.* temp_zip/Classes/CppWtEntrance

cp ../../Tools/ToolTestEntrance/*.* temp_zip/Tools/ToolTestEntrance

echo "Compressing files"
cd temp_zip
zip -r $FILENAME Classes
#zip -r $FILENAME Libraries
#zip -r $FILENAME Projects
zip -r $FILENAME Tools
cd ..
cp "temp_zip/"$ZIP_FILENAME $ZIP_FILENAME

echo "Cleaning up"

#Classes
rm temp_zip/Classes/CppAbout/*.*
rm temp_zip/Classes/CppIpAddress/*.*
rm temp_zip/Classes/CppWtAboutDialog/*.*
rm temp_zip/Classes/CppWtAutoConfig/*.*
rm temp_zip/Classes/CppWtEntrance/*.*

rmdir temp_zip/Classes/CppAbout
rmdir temp_zip/Classes/CppIpAddress
rmdir temp_zip/Classes/CppWtAboutDialog
rmdir temp_zip/Classes/CppWtAutoConfig
rmdir temp_zip/Classes/CppWtEntrance
rmdir temp_zip/Classes

#Tools
rm temp_zip/Tools/ToolTestEntrance/*.*
rmdir temp_zip/Tools/ToolTestEntrance
rmdir temp_zip/Tools
rm temp_zip/*.*
rmdir temp_zip
echo "Done"

../../Tools/ToolCodeToHtmlConsole-build-desktop/codetohtml --source "../"$FOLDERNAME
cp $FOLDERNAME".htm" $HTM_FILENAME
rm $FOLDERNAME".htm"

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml