[Scummvm-cvs-logs] SF.net SVN: scummvm: [22672] scummvm/trunk/gui

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri May 26 23:39:03 CEST 2006


Revision: 22672
Author:   eriktorbjorn
Date:     2006-05-26 23:38:45 -0700 (Fri, 26 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22672&view=rev

Log Message:
-----------
Override the list widget's FindWidget() function, to allow it to return the
scrollbar widget.

Modified Paths:
--------------
    scummvm/trunk/gui/ListWidget.cpp
    scummvm/trunk/gui/ListWidget.h
Modified: scummvm/trunk/gui/ListWidget.cpp
===================================================================
--- scummvm/trunk/gui/ListWidget.cpp	2006-05-27 06:08:44 UTC (rev 22671)
+++ scummvm/trunk/gui/ListWidget.cpp	2006-05-27 06:38:45 UTC (rev 22672)
@@ -78,6 +78,13 @@
 	delete[] _textWidth;
 }
 
+Widget *ListWidget::findWidget(int x, int y) {
+	if (x >= _w - _scrollBarWidth)
+		return _scrollBar;
+
+	return this;
+}
+
 void ListWidget::setSelected(int item) {
 	assert(item >= -1 && item < (int)_list.size());
 
@@ -138,11 +145,6 @@
 	if (!isEnabled())
 		return;
 
-	if (x >= _w - _scrollBarWidth) {
-		_scrollBar->handleMouseDown(x, y, button, clickCount);
-		return;
-	}
-
 	// First check whether the selection changed
 	int newSelectedItem;
 	newSelectedItem = findItem(x, y);

Modified: scummvm/trunk/gui/ListWidget.h
===================================================================
--- scummvm/trunk/gui/ListWidget.h	2006-05-27 06:08:44 UTC (rev 22671)
+++ scummvm/trunk/gui/ListWidget.h	2006-05-27 06:38:45 UTC (rev 22672)
@@ -73,6 +73,8 @@
 	ListWidget(GuiObject *boss, String name);
 	virtual ~ListWidget();
 
+	virtual Widget *findWidget(int x, int y);
+
 	void setList(const StringList& list);
 	const StringList& getList()	const			{ return _list; }
 	int getSelected() const						{ return _selectedItem; }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list