|
From: | Sebastien Metrot <address@hidden> |
Subject: | [ngl-commits] added nuiScrollView (can be much improved but it's ok as a draft... [...] |
Date: | Fri, 17 Oct 2003 20:56:45 -0400 |
Commit from meeloo | 2003-10-17 20:56 EDT |
added nuiScrollView (can be much improved but it's ok as a draft... move nuiWindowDecoration back into nuiWindow fixed a bunch of bugs here and there improved parts of the memory draw context code. fixed some strangeness in nuiWidgetBox. the packing algorithm is still not completely right... added some useful methods to nuiTable
Module | File name | Revision | |||
---|---|---|---|---|---|
nui | ChangeLog | 1.148 | >>> | 1.149 | |
nui | libnui.vcproj | 1.36 | >>> | 1.37 | |
nui | include/nuiDrawContext.h | 1.41 | >>> | 1.42 | |
nui | include/nuiMemoryDrawContext.h | 1.21 | >>> | 1.22 | |
+ | nui | include/nuiScrollView.h | 1.1 | ||
nui | include/nuiTable.h | 1.39 | >>> | 1.40 | |
nui | include/nuiWindow.h | 1.28 | >>> | 1.29 | |
nui | include/nuiWindowManager.h | 1.1 | >>> | 1.2 | |
nui | src/core/nuiDrawContext.cpp | 1.55 | >>> | 1.56 | |
nui | src/core/nuiMemoryDrawContext.cpp | 1.35 | >>> | 1.36 | |
nui | src/core/nuiTheme.cpp | 1.56 | >>> | 1.57 | |
nui | src/core/nuiWindow.cpp | 1.51 | >>> | 1.52 | |
nui | src/core/nuiWindowManager.cpp | 1.1 | >>> | 1.2 | |
nui | src/widgets/nuiFileSelector.cpp | 1.3 | >>> | 1.4 | |
nui | src/widgets/nuiFileTable.cpp | 1.16 | >>> | 1.17 | |
+ | nui | src/widgets/nuiScrollView.cpp | 1.1 | ||
nui | src/widgets/nuiTable.cpp | 1.73 | >>> | 1.74 | |
nui | src/widgets/nuiWidgetBox.cpp | 1.21 | >>> | 1.22 |
nui/ChangeLog 1.148 >>> 1.149 |
---|
Line 1 |
+ 2003/10/18 02:44 meeloo + - changed nuiWindowManager and nuiWindow. Removed nuiWindowDecoration and integrated it back into nuiWindow (the added complexity was not worth the trouble...) + - many small bug fixes. + + |
2003/06/13 03:14 zerodeux - nuiMemoryDrawContext * updated nglFont1 GlyphHandler's bitmap type |
nui/include/nuiDrawContext.h 1.41 >>> 1.42 |
---|
Line 138 |
virtual void PushClipping(); virtual void PopClipping(); |
+ virtual bool Clip(const nuiRect& rGlobalRect); ///< This method restricts all the rendering operation to the given global rectangle. |
virtual bool Clip(nuiWidgetPtr pWidget, const nuiRect& rLocalRect, bool IgnorePosition = true); ///< This method restricts all the rendering operation to the given local rectangle. virtual bool Clip(nuiWidgetPtr pWidget); ///< This method restricts all the rendering operation to the client rectangle. virtual bool SetClipping(bool set); ///< Enables or disable clipping. |
nui/include/nuiMemoryDrawContext.h 1.21 >>> 1.22 |
---|
Line 33 |
virtual void PushClipping(); virtual void PopClipping(); |
+ virtual bool Clip(const nuiRect& rRect); |
virtual bool Clip(nuiWidgetPtr pWidget, const nuiRect& rLocalRect, bool IgnorePosition = true); ///< This method restricts all the rendering operation to the given local rectangle. virtual bool Clip(nuiWidgetPtr pWidget); ///< This method restricts all the rendering operation to the client rectangle. virtual bool SetClipping(bool set); ///< Enables or disable clipping. |
nui/include/nuiScrollView.h 1.1 |
---|
Line 0 |
+ /* + NUI - C++ cross-platform GUI framework for OpenGL based applications + Copyright (C) 2002-2003 Sébastien Métrot + + This library 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 2.1 of the License, or (at your option) any later version. + + This library 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 this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + #ifndef __nuiScrollView_h__ + #define __nuiScrollView_h__ + + #include "ngl.h" + #include "nuiWidget.h" + #include "nuiScrollBar.h" + #include "nuiContainer.h" + + class nuiScrollView : public nuiComposite + { + public: + nuiScrollView(nuiContainerPtr pParent, bool Horizontal = true, bool Vertical = true); + nuiScrollView(nuiContainerPtr pParent, nuiXMLNode* pNode); + virtual ~nuiScrollView(); + + virtual nuiRect CalcIdealSize(); + virtual bool SetRect(const nuiRect& rRect); + virtual bool Draw(nuiDrawContext* pContext); + + bool Scrolled(nuiEvent* pEvent); + + virtual bool Clear(bool Delete); + private: + void Init(bool Horizontal, bool Vertical); + + nuiScrollBar* mpHorizontal; + nuiScrollBar* mpVertical; + + nuiEventSink<nuiScrollView> mSVSink; + }; + + #endif // __nuiScrollView_h__ |
nui/include/nuiTable.h 1.39 >>> 1.40 |
---|
Line 129 |
//@{ virtual uint GetRowCount(); ///< Return the total number of lines. virtual bool RemoveRow(uint row, bool Delete = true); |
- virtual nuiObjectPtr InsertRow(uint row, const nuiWidgetList& rList); - virtual nuiObjectPtr InsertRow(uint row); |
+ virtual nuiTableRowPtr InsertRow(uint row, const nuiWidgetList& rList); ///< Insert a row in the table at the given index, fill it with given widget list and return a pointer to this row. + virtual nuiTableRowPtr InsertRow(uint row); ///< Insert an empty row in the table at the given index and return a pointer to this row. |
virtual bool ClearRow(uint row, bool Delete = true); virtual int GetRow(nuiSize X, nuiSize Y); /// Return the row pointed to by X,Y or -1. virtual nuiTableRowPtr GetRowPtr(nuiSize X, nuiSize Y); /// Return the row pointed to by X,Y or -1. |
Line 160 |
virtual uint SelectAll(); ///< Select all items (if the list is multiselectable only). virtual uint GetSelected(std::list<uint>& selitems); ///< Populate \param selitems with all the selected row numbers. virtual uint GetUnselected(std::list<uint>& unselitems); ///< Populate \param unselitems with all the not selected row numbers. |
- virtual uint GetSelected(nuiObjectList& selitems); ///< Populate \param selitems with all the selected row objects. (1 object per row for property access). - virtual uint GetUnselected(nuiObjectList& unselitems); ///< Populate \param unselitems with all the not selected row objects. (1 object per row for property access). |
+ virtual uint GetSelected(nuiTableRowList& selitems); ///< Populate \param selitems with all the selected row objects. (1 object per row for property access). + virtual uint GetUnselected(nuiTableRowList& unselitems); ///< Populate \param unselitems with all the not selected row objects. (1 object per row for property access). |
virtual void ClearTable(bool Delete); ///< Remove all the elements from the table. virtual bool Clear(bool Delete = true); ///< Inherited from nuiContainer and redirected to ClearTable(). //@} |
nui/include/nuiWindow.h 1.28 >>> 1.29 |
---|
Line 43 |
static const nuiWindowFlags NoCaption; ///< The window have no caption bar. It implies also the NoClose flag. static const nuiWindowFlags NoClose; ///< The window have no to close button. static const nuiWindowFlags Modal; ///< The window if modal: no other window created before it can receive any mouse of keyboard event until it is destroyed. |
+ virtual nuiRect GetRectFromFlags(const nuiRect& Rect, nuiWindowFlags flags, bool RectIsClient); |
// Construction/Destruction nuiWindow(nuiWindowManager* pParent, const nuiRect& rRect, nuiWindowFlags Flags=NoFlag, nglString Title=nglString(_T("nuiWindow"))); |
Line 59 |
virtual bool Draw(nuiDrawContext* pContext); virtual nuiRect CalcIdealSize(); virtual bool SetRect(const nuiRect& rRect); |
- virtual bool IsInside(nuiSize X, nuiSize Y); |
+ // virtual bool IsInside(nuiSize X, nuiSize Y); + |
// Background methods: virtual void SetBackground(nuiImage* pImage); ///< set image bg color. |
Line 76 |
virtual void OnActivation(); ///< Called when the window gains the keyboard focus. virtual void OnDesactivation(); ///< Called when the window looses the keyboard focus. |
+ virtual bool MouseClicked (nuiSize X, nuiSize Y, nglMouseInfo::Flags Button); + virtual bool MouseUnclicked (nuiSize X, nuiSize Y, nglMouseInfo::Flags Button); + virtual bool MouseMoved (nuiSize X, nuiSize Y); + |
// Flags: virtual void SetFlags(nuiWindowFlags Flags); virtual nuiWindowFlags GetFlags(); |
Line 122 |
bool HandleCloseButtonPressed(nuiEvent* pEvent); |
- |
nuiEventSink<nuiWindow> mNuiWindowSink; |
+ + nuiWidget* mpCloseButton; + + nuiSize mClickX, mClickY; ///< Mouse coordinates captured from last click. + nuiRect mClickRect; ///< Window rect captured from last click. + enum + { + eNoMove, + ePreMove, + eMove + } mMoving; + nuiPosition mClickPos; ///< Indicate where the last click was (Center is inside the client area, Fill is the caption bar, the other values are the border if the window is resizable). |
}; //typedef nuiSmartPtr<nuiWindow> nuiWindowPtr; |
nui/include/nuiWindowManager.h 1.1 >>> 1.2 |
---|
Line 26 |
class nuiWindow; typedef nuiWindow* nuiWindowPtr; |
- class nuiWindowDecoration; |
+ class nuiWindow; |
class nuiWindowManager : public nuiContainer { |
Line 76 |
private: /** This class contains informations about each window contained in the window manager */ bool WindowFlagChanged(nuiEvent* pEvent); |
- std::list<nuiWindowDecoration*> mWindows; |
+ std::list<nuiWindow*> mWindows; |
|
- nuiWindowDecoration* GetWindow(nuiWindow* pWindow); |
nuiEventSink<nuiWindowManager> mWMSink; }; |
- class nuiWindowDecoration : public nuiComposite |
+ /* + class nuiWindow : public nuiComposite |
{ public: |
- nuiWindowDecoration(nuiWindowManager* pParent, nuiWindow* pWindow); - virtual ~nuiWindowDecoration(); |
+ nuiWindow(nuiWindowManager* pParent, nuiWindow* pWindow); + virtual ~nuiWindow(); |
nuiWindow* GetWindow(); |
Line 95 |
virtual bool ApplyWindowFlags(nuiEvent* pEvent); virtual bool TargetRectChanged(nuiEvent* pEvent); virtual bool HandleCloseButtonPressed(nuiEvent* pEvent); |
- virtual nuiRect GetRectFromFlags(const nuiRect& Rect, nuiWindowFlags flags); - - virtual bool MouseClicked (nuiSize X, nuiSize Y, nglMouseInfo::Flags Button); - virtual bool MouseUnclicked (nuiSize X, nuiSize Y, nglMouseInfo::Flags Button); - virtual bool MouseMoved (nuiSize X, nuiSize Y); - virtual bool SetRect(const nuiRect& rRect); - private: - nuiWindow* mpWindow; - nuiWidget* mpCloseButton; - nuiEventSink<nuiWindowDecoration> mWDSink; - - nuiSize mClickX, mClickY; ///< Mouse coordinates captured from last click. - nuiRect mClickRect; ///< Window rect captured from last click. - enum - { - eNoMove, - ePreMove, - eMove - } mMoving; - nuiPosition mClickPos; ///< Indicate where the last click was (Center is inside the client area, Fill is the caption bar, the other values are the border if the window is resizable). |
}; |
- |
+ */ |
#endif __nuiWindowManager_h__ |
[Prev in Thread] | Current Thread | [Next in Thread] |