diff --git a/examples/SimpleOpenGL3/main.cpp b/examples/SimpleOpenGL3/main.cpp index bb833f33c..97caf8b91 100644 --- a/examples/SimpleOpenGL3/main.cpp +++ b/examples/SimpleOpenGL3/main.cpp @@ -14,7 +14,7 @@ static b3ResizeCallback sOldResizeCB = 0; static b3MouseMoveCallback sOldMouseMoveCB = 0; static b3MouseButtonCallback sOldMouseButtonCB = 0; static b3KeyboardCallback sOldKeyboardCB = 0; -static b3RenderCallback sOldRenderCB = 0; +//static b3RenderCallback sOldRenderCB = 0; void MyWheelCallback(float deltax, float deltay) diff --git a/examples/ThirdPartyLibs/Gwen/Controls/CrossSplitter.h b/examples/ThirdPartyLibs/Gwen/Controls/CrossSplitter.h index f5840e5cf..4b2c158b5 100644 --- a/examples/ThirdPartyLibs/Gwen/Controls/CrossSplitter.h +++ b/examples/ThirdPartyLibs/Gwen/Controls/CrossSplitter.h @@ -52,7 +52,7 @@ namespace Gwen float m_fVVal; int m_fBarSize; - char m_iZoomedSection; + int m_iZoomedSection; Gwen::Event::Caller onZoomed; Gwen::Event::Caller onUnZoomed; diff --git a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Splitter (2).h b/examples/ThirdPartyLibs/Gwen/Controls/Layout/Splitter (2).h deleted file mode 100644 index 847f65ce8..000000000 --- a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Splitter (2).h +++ /dev/null @@ -1,83 +0,0 @@ -/* - GWEN - Copyright (c) 2011 Facepunch Studios - See license in Gwen.h -*/ - -#pragma once -#pragma once -#include "Gwen/Controls/Base.h" - -namespace Gwen -{ - namespace Controls - { - namespace Layout - { - - class Splitter : public Base - { - public: - - typedef Base BaseClass; - - Splitter( Base* pParent ) : BaseClass( pParent ) - { - for ( int i=0; i<2; i++ ) - m_pPanel[i] = NULL; - } - - void SetPanel( int i, Base* pPanel ) - { - if ( i < 0 || i > 1 ) return; - - m_pPanel[i] = pPanel; - - if ( m_pPanel[i] ) - { - m_pPanel[i] ->SetParent( this ); - } - } - - Base* GetPanel( int i ) const - { - if ( i < 0 || i > 1 ) return NULL; - return m_pPanel[i]; - } - - void Layout( Skin::Base* skin ) - { - LayoutVertical( skin ); - } - - private: - - void LayoutVertical( Skin::Base* skin ) - { - int w = Width(); - int h = Height(); - - if ( m_pPanel[0] ) - { - const Margin& m = m_pPanel[0]->GetMargin(); - m_pPanel[0]->SetBounds( m.left, m.top, w-m.left-m.right, (h * 0.5) - m.top - m.bottom ); - } - - if ( m_pPanel[1] ) - { - const Margin& m = m_pPanel[1]->GetMargin(); - m_pPanel[1]->SetBounds( m.left, m.top + (h * 0.5f), w-m.left-m.right, (h * 0.5f) - m.top - m.bottom ); - } - } - - void LayoutHorizontal( Skin::Base* skin ) - { - // Todo. - } - - Base* m_pPanel[2]; - - }; - } - } -} diff --git a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Splitter - Copy.h b/examples/ThirdPartyLibs/Gwen/Controls/Layout/Splitter - Copy.h deleted file mode 100644 index f72b19663..000000000 --- a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Splitter - Copy.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ - - -#pragma once -#ifndef GWEN_CONTROLS_LAYOUT_SPLITTER_H -#define GWEN_CONTROLS_LAYOUT_SPLITTER_H - -#include "Gwen/Controls/Base.h" - -namespace Gwen -{ - namespace Controls - { - namespace Layout - { - - class GWEN_EXPORT Splitter : public Base - { - public: - - typedef Base BaseClass; - - Splitter( Base* pParent ) : BaseClass( pParent ) - { - for ( int i=0; i<2; i++ ) - m_pPanel[i] = NULL; - } - - void SetPanel( int i, Base* pPanel ) - { - if ( i < 0 || i > 1 ) return; - - m_pPanel[i] = pPanel; - - if ( m_pPanel[i] ) - { - m_pPanel[i] ->SetParent( this ); - } - } - - Base* GetPanel( int i ) const - { - if ( i < 0 || i > 1 ) return NULL; - return m_pPanel[i]; - } - - void Layout( Skin::Base* skin ) - { - LayoutVertical( skin ); - } - - private: - - void LayoutVertical( Skin::Base* /*skin*/ ) - { - int w = Width(); - int h = Height(); - - if ( m_pPanel[0] ) - { - const Margin& m = m_pPanel[0]->GetMargin(); - m_pPanel[0]->SetBounds( m.left, m.top, w-m.left-m.right, (h * 0.5) - m.top - m.bottom ); - } - - if ( m_pPanel[1] ) - { - const Margin& m = m_pPanel[1]->GetMargin(); - m_pPanel[1]->SetBounds( m.left, m.top + (h * 0.5f), w-m.left-m.right, (h * 0.5f) - m.top - m.bottom ); - } - } - - void LayoutHorizontal( Skin::Base* /*skin*/ ) - { - // Todo. - } - - Base* m_pPanel[2]; - - }; - } - } -} -#endif diff --git a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Table (2).h b/examples/ThirdPartyLibs/Gwen/Controls/Layout/Table (2).h deleted file mode 100644 index 43dd667c7..000000000 --- a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Table (2).h +++ /dev/null @@ -1,264 +0,0 @@ -/* - GWEN - Copyright (c) 2011 Facepunch Studios - See license in Gwen.h -*/ - -#pragma once -#pragma once -#include "Gwen/Controls/Label.h" - -namespace Gwen -{ - namespace Controls - { - namespace Layout - { - class Table; - - class TableRow : public Base - { - static const int MaxColumns = 5; - - GWEN_CONTROL_INLINE( TableRow, Base ) - { - for ( int i=0; i= MaxColumns ) - m_ColumnCount = MaxColumns; - - for ( int i=0; iDock( Pos::Left ); - m_Columns[i]->SetTextPadding( Gwen::Rect( 3, 3, 3, 3 ) ); - } - } - else if ( m_Columns[i] ) - { - m_Columns[i]->DelayedDelete(); - m_Columns[i] = NULL; - } - - m_ColumnCount = iCount; - } - } - - void SetColumnWidth( int i, int iWidth ) - { - if ( !m_Columns[i] ) return; - if ( m_Columns[i]->Width() == iWidth ) return; - - m_Columns[i]->SetWidth( iWidth ); - } - - template - void SetCellText( int i, const T& strString ) - { - if ( !m_Columns[i] ) return; - m_Columns[i]->SetText( strString ); - } - - void SetCellContents( int i, Base* pControl, bool bEnableMouseInput = false ) - { - if ( !m_Columns[i] ) return; - pControl->SetParent( m_Columns[i] ); - - m_Columns[i]->SetMouseInputEnabled( bEnableMouseInput ); - } - - Label* GetCellContents( int i ) - { - return m_Columns[i]; - } - - void SizeToContents() - { - int iHeight = 0; - - for ( int i=0; iNumChildren() > 1 ) - { - m_Columns[i]->SizeToChildren(); - } - else - { - m_Columns[i]->SizeToContents(); - } - - iHeight = max( iHeight, m_Columns[i]->Height() ); - } - - SetHeight( iHeight ); - } - - void SetTextColor( const Gwen::Color& color ) - { - for ( int i=0; iSetTextColor( color ); - } - } - - //You might hate this. Actually I know you will - virtual UnicodeString GetText( int i ) - { - return m_Columns[i]->GetText(); - } - virtual void SetSelected( bool b ) {} - - private: - - int m_ColumnCount; - Label* m_Columns[MaxColumns]; - - friend class Table; - - - }; - - class Table : public Base - { - public: - - GWEN_CONTROL_INLINE( Table, Base ) - { - m_iColumnCount = 1; - m_iDefaultRowHeight = 22; - - for (int i=0; igetType()!=TypeTableRow) - continue; - - TableRow* pRow = static_cast(*it); - - pRow->SetColumnCount( i ); - } - - m_iColumnCount = i; - } - - void SetColumnWidth( int i, int iWidth ) - { - if ( m_ColumnWidth[i] == iWidth ) return; - - m_ColumnWidth[i] = iWidth; - Invalidate(); - } - - TableRow* AddRow() - { - TableRow* row = new TableRow( this ); - row->SetColumnCount( m_iColumnCount ); - row->SetHeight( m_iDefaultRowHeight ); - row->Dock( Pos::Top ); - return row; - } - - void AddRow( TableRow* pRow ) - { - pRow->SetParent( this ); - pRow->SetColumnCount( m_iColumnCount ); - pRow->SetHeight( m_iDefaultRowHeight ); - pRow->Dock( Pos::Top ); - } - - void Layout( Skin::Base* skin ) - { - Debug::Msg( "TABLE LAYOUT\n" ); - BaseClass::Layout( skin ); - - if ( m_bSizeToContents ) - { - DoSizeToContents(); - m_bSizeToContents = false; - } - - for ( Base::List::iterator it = m_Children.begin(); it != m_Children.end(); ++it ) - { - TableRow* pRow = static_cast(*it); - if ( !pRow ) continue; - - for (int i=0; iSetColumnWidth( i, m_ColumnWidth[i] ); - } - } - } - - void SizeToContents() - { - m_bSizeToContents = true; - Invalidate(); - } - - void DoSizeToContents() - { - for (int i=0; i(*it); - if ( !pRow ) continue; - - pRow->SizeToContents(); - - for (int i=0; im_Columns[i] ) - { - m_ColumnWidth[i] = max( m_ColumnWidth[i], pRow->m_Columns[i]->Width() ); - } - } - } - - Invalidate(); - } - - private: - - bool m_bSizeToContents; - int m_iColumnCount; - int m_iDefaultRowHeight; - - int m_ColumnWidth[ TableRow::MaxColumns ]; - }; - } - } -} diff --git a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Table - Copy.h b/examples/ThirdPartyLibs/Gwen/Controls/Layout/Table - Copy.h deleted file mode 100644 index 6fee90d59..000000000 --- a/examples/ThirdPartyLibs/Gwen/Controls/Layout/Table - Copy.h +++ /dev/null @@ -1,294 +0,0 @@ -/* - GWEN - Copyright (c) 2010 Facepunch Studios - See license in Gwen.h -*/ - -#pragma once -#ifndef GWEN_CONTROLS_LAYOUT_TABLE_H -#define GWEN_CONTROLS_LAYOUT_TABLE_H - -#include "Gwen/Controls/Label.h" -#include "Gwen/Utility.h" - - -namespace Gwen -{ - namespace Controls - { - namespace Layout - { - class Table; - - class GWEN_EXPORT TableRow : public Base - { - static const int MaxColumns = 5; - - GWEN_CONTROL_INLINE( TableRow, Base ) - { - for ( int i=0; i= MaxColumns ) - m_ColumnCount = MaxColumns; - - for ( int i=0; iDock( Pos::Left ); - m_Columns[i]->SetPadding( Padding( 3, 3, 3, 3 ) ); - } - } - else if ( m_Columns[i] ) - { - m_Columns[i]->DelayedDelete(); - m_Columns[i] = NULL; - } - - m_ColumnCount = iCount; - } - } - - void SetColumnWidth( int i, int iWidth ) - { - if ( !m_Columns[i] ) return; - if ( m_Columns[i]->Width() == iWidth ) return; - - m_Columns[i]->SetWidth( iWidth ); - } - - template - void SetCellText( int i, const T& strString ) - { - if ( !m_Columns[i] ) return; - m_Columns[i]->SetText( strString ); - } - - void SetCellContents( int i, Base* pControl, bool bEnableMouseInput = false ) - { - if ( !m_Columns[i] ) return; - pControl->SetParent( m_Columns[i] ); - - m_Columns[i]->SetMouseInputEnabled( bEnableMouseInput ); - } - - Label* GetCellContents( int i ) - { - return m_Columns[i]; - } - - void SizeToContents() - { - int iHeight = 0; - - for ( int i=0; iNumChildren() > 1 ) - { - m_Columns[i]->SizeToChildren(); - } - else - { - m_Columns[i]->SizeToContents(); - } - - iHeight = Utility::Max( iHeight, m_Columns[i]->Height() ); - } - - SetHeight( iHeight ); - } - - void SetTextColor( const Gwen::Color& color ) - { - for ( int i=0; iSetTextColor( color ); - } - } - - //You might hate this. Actually I know you will - virtual UnicodeString GetText( int i ) - { - return m_Columns[i]->GetText(); - } - virtual void SetSelected( bool /*b*/ ) {} - - // - // This is sometimes called by derivatives. - // - Gwen::Event::Caller onRowSelected; - - private: - - int m_ColumnCount; - Label* m_Columns[MaxColumns]; - - friend class Table; - - - }; - - class GWEN_EXPORT Table : public Base - { - public: - - GWEN_CONTROL_INLINE( Table, Base ) - { - m_iColumnCount = 1; - m_iDefaultRowHeight = 22; - - for (int i=0; i(*it); - if ( !pRow ) continue; - - pRow->SetColumnCount( i ); - } - - m_iColumnCount = i; - } - - void SetColumnWidth( int i, int iWidth ) - { - if ( m_ColumnWidth[i] == iWidth ) return; - - m_ColumnWidth[i] = iWidth; - Invalidate(); - } - - TableRow* AddRow() - { - TableRow* row = new TableRow( this ); - row->SetColumnCount( m_iColumnCount ); - row->SetHeight( m_iDefaultRowHeight ); - row->Dock( Pos::Top ); - return row; - } - - void AddRow( TableRow* pRow ) - { - pRow->SetParent( this ); - pRow->SetColumnCount( m_iColumnCount ); - pRow->SetHeight( m_iDefaultRowHeight ); - pRow->Dock( Pos::Top ); - } - - void Remove( TableRow* pRow ) - { - pRow->DelayedDelete(); - } - - void Clear() - { - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - TableRow* pRow = static_cast(*it); - if ( !pRow ) continue; - Remove( pRow ); - } - } - - void Layout( Skin::Base* skin ) - { - BaseClass::Layout( skin ); - - if ( m_bSizeToContents ) - { - DoSizeToContents(); - } - - for ( Base::List::iterator it = Children.begin(); it != Children.end(); ++it ) - { - TableRow* pRow = static_cast(*it); - if ( !pRow ) continue; - - for (int i=0; iSetColumnWidth( i, m_ColumnWidth[i] ); - } - } - } - - void PostLayout( Skin::Base* /*skin*/ ) - { - if ( m_bSizeToContents ) - { - SizeToChildren(); - m_bSizeToContents = false; - } - } - - void SizeToContents() - { - m_bSizeToContents = true; - Invalidate(); - } - - void DoSizeToContents() - { - for (int i=0; i(*it); - if ( !pRow ) continue; - - pRow->SizeToContents(); - - for (int i=0; im_Columns[i] ) - { - m_ColumnWidth[i] = Utility::Max( m_ColumnWidth[i], pRow->m_Columns[i]->Width() ); - } - } - //iBottom += pRow->Height(); - } - - InvalidateParent(); - } - - private: - - bool m_bSizeToContents; - int m_iColumnCount; - int m_iDefaultRowHeight; - - int m_ColumnWidth[ TableRow::MaxColumns ]; - }; - } - } -} -#endif