From: <ma...@us...> - 2013-02-26 20:32:06
|
Revision: 8614 http://planeshift.svn.sourceforge.net/planeshift/?rev=8614&view=rev Author: magodra Date: 2013-02-26 20:31:59 +0000 (Tue, 26 Feb 2013) Log Message: ----------- -Included patch from Neeon that fixed crash in Chat window when using PageUp/PageDown from the NumPad (PS#5908). Modified Paths: -------------- trunk/src/common/paws/pawstextbox.cpp Modified: trunk/src/common/paws/pawstextbox.cpp =================================================================== --- trunk/src/common/paws/pawstextbox.cpp 2013-02-25 03:21:00 UTC (rev 8613) +++ trunk/src/common/paws/pawstextbox.cpp 2013-02-26 20:31:59 UTC (rev 8614) @@ -998,19 +998,30 @@ { //this function handles if the user uses the page up or down buttons on this text box //and scroll of exactly the size of lines which is shown in the textbox - if(keyCode == CSKEY_PGUP) //go up + switch (key) { - if(scrollBar) - scrollBar->SetCurrentValue(scrollBar->GetCurrentValue() - maxLines); //maxLines is updated on resize - return true; + case CSKEY_PGUP: //go up + { + if(scrollBar) + { + scrollBar->SetCurrentValue(scrollBar->GetCurrentValue() - maxLines); //maxLines is updated on resize + } + break; + } + case CSKEY_PGDN: //go down + { + if(scrollBar) + { + scrollBar->SetCurrentValue(scrollBar->GetCurrentValue() + maxLines); //maxLines is updated on resize + } + break; + } + default: + { + return pawsWidget::OnKeyDown(keyCode, key, modifiers); + } } - else if(keyCode == CSKEY_PGDN) //go down - { - if(scrollBar) - scrollBar->SetCurrentValue(scrollBar->GetCurrentValue() + maxLines); //maxLines is updated on resize - return true; - } - return pawsWidget::OnKeyDown(keyCode, key, modifiers); + return true; } @@ -3153,4 +3164,5 @@ } startLine = 0; text.Replace(str.GetData()); -} \ No newline at end of file +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |