From: <eva...@us...> - 2007-09-30 08:58:12
|
Update of /cvsroot/planeshift/planeshift/src/common/paws In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28488/src/common/paws Modified Files: pawslistbox.cpp pawslistbox.h Log Message: paswListBoxRow now uses the standard mouse double-click event handler for selecting listbox rows instead of detecting it in the mouse down handler. Fixes bug #2334 and should in general work better in any other places as well. Index: pawslistbox.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/paws/pawslistbox.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** pawslistbox.cpp 14 Sep 2007 23:59:52 -0000 1.59 --- pawslistbox.cpp 30 Sep 2007 08:57:56 -0000 1.60 *************** *** 1059,1063 **** pawsListBoxRow::pawsListBoxRow() { - ticks = 0; } --- 1059,1062 ---- *************** *** 1078,1093 **** return parentBox->OnMouseDown(button, modifiers, x, y); } ! ! if (ticks!=0&&(csGetTicks()-ticks<500)) ! { ! ticks=csGetTicks(); ! parentBox->SendOnListAction(LISTBOX_SELECTED); ! return true; ! }; ! ! ticks=csGetTicks(); return parentBox->Select( this ); } pawsWidget* pawsListBoxRow::GetColumn( size_t column ) --- 1077,1090 ---- return parentBox->OnMouseDown(button, modifiers, x, y); } ! return parentBox->Select( this ); } + bool pawsListBoxRow::OnDoubleClick(int, int, int, int) + { + pawsListBox * parentBox = (pawsListBox *)parent; + parentBox->SendOnListAction(LISTBOX_SELECTED); + return true; + } pawsWidget* pawsListBoxRow::GetColumn( size_t column ) Index: pawslistbox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/paws/pawslistbox.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** pawslistbox.h 18 Mar 2007 15:37:30 -0000 1.26 --- pawslistbox.h 30 Sep 2007 08:57:56 -0000 1.27 *************** *** 90,98 **** bool OnKeyDown(int keyCode, int keyChar, int modifiers); ! /** A single mouse click (left button) highlights the row ! * A double click selects the row. When this method is called ! * within a 500ms period after the previous call it's a double-click. ! */ ! bool OnMouseDown(int button, int modifiers, int x, int y ); private: --- 90,102 ---- bool OnKeyDown(int keyCode, int keyChar, int modifiers); ! /** ! * A single mouse click (left button) highlights the row ! */ ! bool OnMouseDown(int button, int modifiers, int x, int y ); ! ! /** ! * A double click selects the row. ! */ ! bool OnDoubleClick(int button, int modifiers, int x, int y); private: *************** *** 100,105 **** csArray<pawsWidget*> columns; - /// Timing mechanism used to determine the time between mouse clicks (for detecting a double click) - csTicks ticks; }; --- 104,107 ---- |