Merge remote-tracking branch 'jamesu/console_stack_fix2' into development

Conflicts:
	Engine/source/console/console.cpp
This commit is contained in:
Daniel Buckmaster 2015-03-01 20:33:29 +11:00
commit 6c92ab065e
48 changed files with 2979 additions and 449 deletions

View file

@ -113,7 +113,7 @@ void GuiConsoleTextCtrl::onPreRender()
{
if ( mConsoleExpression.isNotEmpty() )
{
mResult = Con::evaluatef( "$guiConsoleTextCtrlTemp = %s;", mConsoleExpression.c_str() );
mResult = (const char*)Con::evaluatef( "$guiConsoleTextCtrlTemp = %s;", mConsoleExpression.c_str() );
// Of the resulting string we will be printing,
// Find the number of lines and length of each.

View file

@ -71,7 +71,7 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onClearSelection, void, (),(),
"@see GuiControl\n\n"
);
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( const char* index, const char* itemText),( index, itemText ),
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( S32 index, const char* itemText),( index, itemText ),
"@brief Called whenever a selected item in the list has been unselected.\n\n"
"@param index Index id of the item that was unselected\n"
"@param itemText Text for the list entry at the index id that was unselected\n\n"
@ -85,7 +85,7 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( const char* index, const
"@see GuiControl\n\n"
);
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onSelect, void, ( const char* index , const char* itemText ),( index, itemText ),
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onSelect, void, ( S32 index , const char* itemText ),( index, itemText ),
"@brief Called whenever an item in the list is selected.\n\n"
"@param index Index id for the item in the list that was selected.\n"
"@param itemText Text for the list item at the index that was selected.\n\n"
@ -111,7 +111,7 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onDoubleClick, void, (),(),
"@see GuiControl\n\n"
);
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseUp, void, (const char* itemHit, const char* mouseClickCount),( itemHit,mouseClickCount),
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseUp, void, ( S32 itemHit, S32 mouseClickCount ),( itemHit,mouseClickCount ),
"@brief Called whenever the mouse has previously been clicked down (onMouseDown) and has now been raised on the control.\n"
"If an item in the list was hit during the click cycle, then the index id of the clicked object along with how many clicks occured are passed\n"
"into the callback.\n\n"
@ -309,7 +309,7 @@ void GuiListBoxCtrl::removeSelection( LBItem *item, S32 index )
{
mSelectedItems.erase( &mSelectedItems[i] );
item->isSelected = false;
onUnSelect_callback(Con::getIntArg(index), item->itemText);
onUnSelect_callback(index, item->itemText);
return;
}
}
@ -355,7 +355,7 @@ void GuiListBoxCtrl::addSelection( LBItem *item, S32 index )
item->isSelected = true;
mSelectedItems.push_front( item );
onSelect_callback(Con::getIntArg( index ), item->itemText);
onSelect_callback(index, item->itemText);
}
S32 GuiListBoxCtrl::getItemIndex( LBItem *item )
@ -1224,7 +1224,7 @@ void GuiListBoxCtrl::onMouseUp( const GuiEvent& event )
{
S32 itemHit = -1;
if( hitTest( event.mousePoint, itemHit ) )
onMouseUp_callback(Con::getIntArg( itemHit ), Con::getIntArg( event.mouseClickCount ) );
onMouseUp_callback( itemHit, event.mouseClickCount );
// Execute console command
execConsoleCallback();

View file

@ -57,10 +57,10 @@ public:
DECLARE_CALLBACK( void, onMouseDragged, ());
DECLARE_CALLBACK( void, onClearSelection, ());
DECLARE_CALLBACK( void, onUnSelect, ( const char* index, const char* itemText));
DECLARE_CALLBACK( void, onSelect, ( const char* index , const char* itemText ));
DECLARE_CALLBACK( void, onUnSelect, ( S32 index, const char* itemText));
DECLARE_CALLBACK( void, onSelect, ( S32 index , const char* itemText ));
DECLARE_CALLBACK( void, onDoubleClick, ());
DECLARE_CALLBACK( void, onMouseUp, (const char* itemHit, const char* mouseClickCount));
DECLARE_CALLBACK( void, onMouseUp, ( S32 itemHit, S32 mouseClickCount ));
DECLARE_CALLBACK( void, onDeleteKey, ());
DECLARE_CALLBACK( bool, isObjectMirrored, ( const char* indexIdString ));

View file

@ -73,7 +73,7 @@ IMPLEMENT_CALLBACK( GuiMLTextCtrl, onURL, void, ( const char* url ),( url ),
"@see GuiControl\n\n"
);
IMPLEMENT_CALLBACK( GuiMLTextCtrl, onResize, void, ( const char* width, const char* maxY ),( width, maxY ),
IMPLEMENT_CALLBACK( GuiMLTextCtrl, onResize, void, ( S32 width, S32 maxY ),( width, maxY ),
"@brief Called whenever the control size changes.\n\n"
"@param width The new width value for the control\n"
"@param maxY The current maximum allowed Y value for the control\n\n"
@ -2133,7 +2133,7 @@ textemit:
processEmitAtoms();
emitNewLine(mScanPos);
setHeight( mMaxY );
onResize_callback(Con::getIntArg( getWidth() ), Con::getIntArg( mMaxY ) );
onResize_callback( getWidth(), mMaxY );
//make sure the cursor is still visible - this handles if we're a child of a scroll ctrl...
ensureCursorOnScreen();

View file

@ -128,7 +128,7 @@ class GuiMLTextCtrl : public GuiControl
~GuiMLTextCtrl();
DECLARE_CALLBACK( void, onURL, (const char* url));
DECLARE_CALLBACK( void, onResize, ( const char* width, const char* maxY ));
DECLARE_CALLBACK( void, onResize, ( S32 width, S32 maxY ));
// Text retrieval functions
U32 getNumChars() const;

View file

@ -52,7 +52,7 @@ ConsoleDocClass( GuiTextListCtrl,
);
IMPLEMENT_CALLBACK( GuiTextListCtrl, onSelect, void, (const char* cellid, const char* text),( cellid , text ),
IMPLEMENT_CALLBACK( GuiTextListCtrl, onSelect, void, (S32 cellid, const char* text),( cellid , text ),
"@brief Called whenever an item in the list is selected.\n\n"
"@param cellid The ID of the cell that was selected\n"
"@param text The text in the selected cel\n\n"
@ -66,7 +66,7 @@ IMPLEMENT_CALLBACK( GuiTextListCtrl, onSelect, void, (const char* cellid, const
"@see GuiControl\n\n"
);
IMPLEMENT_CALLBACK( GuiTextListCtrl, onDeleteKey, void, ( const char* id ),( id ),
IMPLEMENT_CALLBACK( GuiTextListCtrl, onDeleteKey, void, ( S32 id ),( id ),
"@brief Called when the delete key has been pressed.\n\n"
"@param id Id of the selected item in the list\n"
"@tsexample\n"
@ -172,7 +172,7 @@ bool GuiTextListCtrl::cellSelected(Point2I cell)
void GuiTextListCtrl::onCellSelected(Point2I cell)
{
onSelect_callback(Con::getIntArg(mList[cell.y].id), mList[cell.y].text);
onSelect_callback(mList[cell.y].id, mList[cell.y].text);
execConsoleCallback();
}
@ -497,7 +497,7 @@ bool GuiTextListCtrl::onKeyDown( const GuiEvent &event )
break;
case KEY_DELETE:
if ( mSelectedCell.y >= 0 && mSelectedCell.y < mList.size() )
onDeleteKey_callback(Con::getIntArg( mList[mSelectedCell.y].id ) );
onDeleteKey_callback( mList[mSelectedCell.y].id );
break;
default:
return( Parent::onKeyDown( event ) );

View file

@ -67,8 +67,8 @@ class GuiTextListCtrl : public GuiArrayCtrl
DECLARE_CATEGORY( "Gui Lists" );
DECLARE_DESCRIPTION( "A control that displays text in tabular form." );
DECLARE_CALLBACK( void, onSelect, (const char* cellid, const char* text));
DECLARE_CALLBACK( void, onDeleteKey, ( const char* id ));
DECLARE_CALLBACK( void, onSelect, (S32 cellid, const char* text));
DECLARE_CALLBACK( void, onDeleteKey, ( S32 id ));
static void initPersistFields();