CHANGED: #1471 CViewBitmapCombo no longer depends on CViewPointer.
--HG-- branch : gui-refactoring
This commit is contained in:
parent
8b84170dec
commit
8193f484bf
5 changed files with 19 additions and 19 deletions
|
@ -18,6 +18,7 @@
|
|||
#ifndef VIEW_POINTER_BASE_H
|
||||
#define VIEW_POINTER_BASE_H
|
||||
|
||||
#include "nel/misc/events.h"
|
||||
#include "nel/gui/view_base.h"
|
||||
|
||||
namespace NLGUI
|
||||
|
@ -53,6 +54,11 @@ namespace NLGUI
|
|||
|
||||
void draw(){}
|
||||
|
||||
/// set button state
|
||||
void setButtonState(NLMISC::TMouseButton state) { _Buttons = state; }
|
||||
/// get buttons state
|
||||
NLMISC::TMouseButton getButtonState() const { return _Buttons; }
|
||||
|
||||
protected:
|
||||
// (x,y) is from the TopLeft corner of the window
|
||||
sint32 _PointerX; // Current pointer position (raw, before snapping)
|
||||
|
@ -66,6 +72,8 @@ namespace NLGUI
|
|||
bool _PointerDrag; // Is the pointer down and we have moved ?
|
||||
bool _PointerVisible; // Is the pointer visible or hidden ?
|
||||
|
||||
NLMISC::TMouseButton _Buttons;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
CViewPointerBase::CViewPointerBase( const CViewBase::TCtorParam ¶m ) :
|
||||
CViewBase( param )
|
||||
CViewBase( param ),
|
||||
_Buttons( NLMISC::noButton )
|
||||
{
|
||||
_PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = 0;
|
||||
_PointerDown = false;
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
#include "stdpch.h"
|
||||
|
||||
#include "view_bitmap_combo.h"
|
||||
#include "interface_manager.h"
|
||||
#include "nel/misc/xml_auto_ptr.h"
|
||||
#include "nel/gui/db_manager.h"
|
||||
#include "nel/gui/view_renderer.h"
|
||||
#include "nel/gui/widget_manager.h"
|
||||
#include "nel/gui/view_pointer_base.h"
|
||||
#include "nel/gui/interface_group.h"
|
||||
|
||||
using namespace NLMISC;
|
||||
|
||||
|
@ -275,7 +275,6 @@ void CViewBitmapCombo::draw()
|
|||
if (numRow == 0 || numCol == 0) return;
|
||||
|
||||
sint32 mx = 0, my = 0;
|
||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
||||
const std::vector<CViewBase *> &rVB = CWidgetManager::getInstance()->getViewsUnderPointer();
|
||||
if (!CWidgetManager::getInstance()->getPointer()) return;
|
||||
|
@ -361,7 +360,7 @@ void CViewBitmapCombo::draw()
|
|||
&& my < py + (sint32) itemh)
|
||||
{
|
||||
overItem = true;
|
||||
if ( static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton)
|
||||
if ( CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton)
|
||||
{
|
||||
textId = getTexId(_TexsPushedId, texIndex);
|
||||
color = getCol(_ColPushed, texIndex);
|
||||
|
@ -416,7 +415,7 @@ void CViewBitmapCombo::draw()
|
|||
//
|
||||
if (_CD.Unrolled.getBool())
|
||||
{
|
||||
if (overItem && static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton)
|
||||
if (overItem && CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton)
|
||||
{
|
||||
textId = getTexId(_TexsId, selectedTexIndex);
|
||||
color = getCol(_Col, selectedTexIndex);
|
||||
|
@ -436,7 +435,7 @@ void CViewBitmapCombo::draw()
|
|||
&& my < py + (sint32) itemh
|
||||
)
|
||||
{
|
||||
if ( static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton)
|
||||
if ( CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton)
|
||||
{
|
||||
textId = getTexId(_TexsPushedId, selectedTexIndex);
|
||||
color = getCol(_ColPushed, selectedTexIndex);
|
||||
|
|
|
@ -42,8 +42,7 @@ NLMISC_REGISTER_OBJECT(CViewBase, CViewPointer, std::string, "pointer");
|
|||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
CViewPointer::CViewPointer (const TCtorParam ¶m)
|
||||
: CViewPointerBase(param),
|
||||
_Buttons(NLMISC::noButton)
|
||||
: CViewPointerBase(param)
|
||||
{
|
||||
_TxIdDefault = -2;
|
||||
_TxIdMoveWindow = -2;
|
||||
|
|
|
@ -63,11 +63,6 @@ public:
|
|||
}
|
||||
// TEMP PATCH
|
||||
|
||||
/// set button state
|
||||
void setButtonState(NLMISC::TMouseButton state) { _Buttons = state; }
|
||||
/// get buttons state
|
||||
NLMISC::TMouseButton getButtonState() const { return _Buttons; }
|
||||
|
||||
private:
|
||||
|
||||
/// Show or hide the pointer. Please, use SetMouseMode (bool freelook) instead.
|
||||
|
@ -120,8 +115,6 @@ private:
|
|||
sint32 _OffsetX;
|
||||
sint32 _OffsetY;
|
||||
|
||||
NLMISC::TMouseButton _Buttons;
|
||||
|
||||
CGroupContainer *_LastHightLight;
|
||||
|
||||
// Cursor mode
|
||||
|
|
Loading…
Reference in a new issue