Commit 929fed00 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[CHANGE #347] reverted the demo code in Histogram View module. Will write a...

[CHANGE #347] reverted the demo code in Histogram View module. Will write a WMTemplateUI example instead.
parent 348a5fe0
......@@ -218,53 +218,15 @@ void WMHistogramView::moduleMain()
ready();
//! Holds the reference to the custom widget used for displaying the histogram
WUIGridWidget::SPtr m_widgetGrid = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createGridWidget( getName() );
WUITabbedWidget::SPtr m_tab = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createTabbedWidget( "tabs"+ getName(), m_widgetGrid );
m_widget = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createViewWidget(
getName() + string_utils::toString( m_instanceID ),
WGECamera::TWO_D, m_shutdownFlag.getValueChangeCondition(), m_tab );
// WGECamera::TWO_D, m_shutdownFlag.getValueChangeCondition() );
WUIViewWidget::SPtr m_widgetTab2 = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createViewWidget(
getName() + "hey" + string_utils::toString( m_instanceID ),
WGECamera::TWO_D, m_shutdownFlag.getValueChangeCondition(), m_tab );
WGECamera::TWO_D, m_shutdownFlag.getValueChangeCondition() );
osg::ref_ptr< WUIViewEventHandler > eh = new WUIViewEventHandler( m_widget );
eh->subscribeMove( boost::bind( &WMHistogramView::handleMouseMove, this, _1 ) );
eh->subscribeResize( boost::bind( &WMHistogramView::handleResize, this, _1, _2, _3, _4 ) );
m_widget->addEventHandler( eh );
//! Holds the reference to the custom widget used for displaying the histogram
WUIGridWidget::SPtr m_widgetGrid2 = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createGridWidget( "23"+ getName(), m_widgetGrid );
WUIViewWidget::SPtr m_widget2 = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createViewWidget(
getName() + "kk" + string_utils::toString( m_instanceID ),
WGECamera::TWO_D, m_shutdownFlag.getValueChangeCondition(), m_widgetGrid2 );
WUIViewWidget::SPtr m_widget3 = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createViewWidget(
getName() + "kk2" + string_utils::toString( m_instanceID ),
WGECamera::TWO_D, m_shutdownFlag.getValueChangeCondition(), m_widgetGrid2 );
WUIPropertyGroupWidget::SPtr m_widgetProps = WKernel::getRunningKernel()->getUI()->getWidgetFactory()->createPropertyGroupWidget( "Propsy",
m_properties, m_widgetGrid2 );
debugLog() << "huhu 1" << m_tab->addTab( m_widget, "Widget 1" );
debugLog() << "huhu 2" << m_tab->addTab( m_widgetTab2, "Widget 2" );
m_widgetGrid->placeWidget( m_tab, 0, 0 );
m_widgetGrid->placeWidget( m_widgetGrid2, 0, 1 );
m_widgetGrid->setColumnStretch( 0, 2 );
m_widgetGrid->setColumnStretch( 1, 1 );
m_widgetGrid2->placeWidget( m_widget2, 0, 0 );
m_widgetGrid2->placeWidget( m_widget3, 1, 0 );
m_widgetGrid2->placeWidget( m_widgetProps, 2, 0 );
m_widgetGrid->show();
m_widget->show();
if( m_widget )
{
......@@ -350,7 +312,7 @@ void WMHistogramView::moduleMain()
m_mainNode->clear();
}
m_widgetGrid->close();
m_widget->close();
debugLog() << "Finished. Good bye!";
}
......
This is your entry point into OpenWalnut module development!
This directory contains a bunch of modules that demonstrate how to develop with/for
OpenWalnut. Get started with WToolkit. This file contains definitions for all the modules
that are required by OpenWalnut during load of your module. Each module listed there can
than be found in the corresponding C++ files. They are extensively documented and describe
each step in detail.
You need help? Check out our extensive code documentation when something is unclear, check
out http://www.openwalnut.org for more documentation or simply contact our developer
mailing list openwalnut-dev@lists.informatik.uni-leipzig.de.
Now, directly dive into the code. You will see, getting started with OpenWalnut module
development is easy!
Enjoy,
the OpenWalnut Team
......@@ -67,7 +67,6 @@
#include "core/common/WPropertyHelper.h"
#include "core/common/WItemSelection.h"
#include "core/common/WItemSelectionItem.h"
#include "core/common/WItemSelectionItemTyped.h"
#include "core/common/WItemSelector.h"
#include "core/graphicsEngine/WGEUtils.h"
#include "core/graphicsEngine/WGERequirement.h"
......@@ -77,9 +76,6 @@
#include "icons/steak.xpm"
#include "WMTemplate.h"
// This line is needed by the module loader to actually find your module. You need to add this to your module too. Do NOT add a ";" here.
W_LOADABLE_MODULE( WMTemplate )
WMTemplate::WMTemplate():
WModule()
{
......
......@@ -31,6 +31,7 @@
#include "core/common/WItemSelection.h"
#include "core/common/WItemSelector.h"
#include "core/common/WItemSelectionItemTyped.h"
#include "core/graphicsEngine/WGEManagedGroupNode.h"
#include "core/graphicsEngine/shaders/WGEShader.h"
......
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV-Leipzig and CNCF-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
// This file's purpose is to provide a list of modules and additional extensions as entry point for OpenWalnut's module loader.
// Both functAdd your modules here. If you miss this step, OpenWalnut will not be able to load your modules/extensions.
#include <boost/shared_ptr.hpp>
#include <core/kernel/WModule.h>
#include "WMTemplate.h"
//#include "WMTemplateUI.h"
// #include "WToolkit.h"
/**
* This function is called by OpenWalnut, when loading your library to learn about the modules you provide. The function is called with a given
* list reference, where you add all of your modules. Modules which are not registered this way, cannot be used in OpenWalnut. As this is called
* before loading any project file or running any module, it is ensured that you can rely on the modules provided here in your project files and
* other modules.
*
* \note this function is optional. You can remove it if you do not need it.
*
* \param m the list of modules. Add you module instances into this list.
*/
extern "C" void WLoadModule( WModuleList& m ) // NOLINT
{
// This line is needed by the module loader to actually find your module. You need to add this to your module too. Do NOT add a ";" here.
m.push_back( boost::shared_ptr< WModule >( new WMTemplate ) );
//m.push_back( boost::shared_ptr< WModule >( new WMTemplateUI ) );
}
/**
* This function is called by OpenWalnut, when loading your module to allow registration of additional classes and implementations that are not
* WModule classes. At this point, OW is completely initialized, thus allowing you to register nearly everything to the sub-systems supporting
* this. A typical example is the postprocessing meachnism in OpenWalnut. It allows you to register your own postprocessors easily. As this
* function is called on start-up, before loading project files, you can rely on additional functionality in your project files and modules.
*
* \note this function is optional. You can remove it if you do not need it.
*
* \param localPath this is the path to the toolkit. Our build system ensures, that your resources and shaders get placed there.
*/
extern "C" void WRegisterArbitrary( const boost::filesystem::path& /*localPath*/ )
{
// Example for registering your own postprocessor:
// WGEPostprocessor::addPostprocessor( WGEPostprocessor::SPtr( new MyStylishPostprocessing( localPath ) ) );
// wlog::debug( "TemplateToolbox - Arbitrary Extension" ) << "My resource path is: " << localPath.string();
}
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV-Leipzig and CNCF-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WTOOLKIT_H
#define WTOOLKIT_H
// nothing to do here. Have a look at WToolkit.cpp for registration of all the modules inside the toolbox.
#endif // WTOOLKIT_H
/* XPM */
static const char * template_xpm[] = {
"16 16 2 1",
" c None",
". c #000000",
" ",
" ",
" .......... ",
" .......... ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" "};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment