Merge branch 'master' into console-func-refactor

Conflicts:
	Engine/source/app/net/net.cpp
	Engine/source/console/astNodes.cpp
	Engine/source/console/compiledEval.cpp
	Engine/source/console/console.h
	Engine/source/console/consoleInternal.h
	Engine/source/console/engineAPI.h
This commit is contained in:
Daniel Buckmaster 2014-10-14 14:40:17 +11:00
commit b507dc9555
6487 changed files with 315149 additions and 609761 deletions

View file

@ -178,13 +178,13 @@ void GuiBitmapCtrl::onRender(Point2I offset, const RectI &updateRect)
GFXTextureObject* texture = mTextureObject;
RectI srcRegion;
RectI dstRegion;
float xdone = ((float)getExtent().x/(float)texture->mBitmapSize.x)+1;
float ydone = ((float)getExtent().y/(float)texture->mBitmapSize.y)+1;
F32 xdone = ((F32)getExtent().x/(F32)texture->mBitmapSize.x)+1;
F32 ydone = ((F32)getExtent().y/(F32)texture->mBitmapSize.y)+1;
int xshift = mStartPoint.x%texture->mBitmapSize.x;
int yshift = mStartPoint.y%texture->mBitmapSize.y;
for(int y = 0; y < ydone; ++y)
for(int x = 0; x < xdone; ++x)
S32 xshift = mStartPoint.x%texture->mBitmapSize.x;
S32 yshift = mStartPoint.y%texture->mBitmapSize.y;
for(S32 y = 0; y < ydone; ++y)
for(S32 x = 0; x < xdone; ++x)
{
srcRegion.set(0,0,texture->mBitmapSize.x,texture->mBitmapSize.y);
dstRegion.set( ((texture->mBitmapSize.x*x)+offset.x)-xshift,

View file

@ -528,10 +528,11 @@ void GuiColorPickerCtrl::setScriptValue(const char *value)
ConsoleMethod(GuiColorPickerCtrl, getSelectorPos, const char*, 2, 2, "Gets the current position of the selector")
{
char *temp = Con::getReturnBuffer(256);
static const U32 bufSize = 256;
char *temp = Con::getReturnBuffer(bufSize);
Point2I pos;
pos = object->getSelectorPos();
dSprintf(temp,256,"%d %d",pos.x, pos.y);
dSprintf(temp,bufSize,"%d %d",pos.x, pos.y);
return temp;
}

View file

@ -169,17 +169,18 @@ DefineEngineMethod( GuiDirectoryFileListCtrl, getSelectedFiles, const char*, (),
return StringTable->insert( "" );
// Get an adequate buffer
char itemBuffer[256];
dMemset( itemBuffer, 0, 256 );
static const U32 itemBufSize = 256;
char itemBuffer[itemBufSize];
char* returnBuffer = Con::getReturnBuffer( ItemVector.size() * 64 );
dMemset( returnBuffer, 0, ItemVector.size() * 64 );
static const U32 bufSize = ItemVector.size() * 64;
char* returnBuffer = Con::getReturnBuffer( bufSize );
dMemset( returnBuffer, 0, bufSize );
// Fetch the first entry
StringTableEntry itemText = object->getItemText( ItemVector[0] );
if( !itemText )
return StringTable->lookup("");
dSprintf( returnBuffer, ItemVector.size() * 64, "%s", itemText );
dSprintf( returnBuffer, bufSize, "%s", itemText );
// If only one entry, return it.
if( ItemVector.size() == 1 )
@ -192,8 +193,8 @@ DefineEngineMethod( GuiDirectoryFileListCtrl, getSelectedFiles, const char*, (),
if( !itemText )
continue;
dMemset( itemBuffer, 0, 256 );
dSprintf( itemBuffer, 256, " %s", itemText );
dMemset( itemBuffer, 0, itemBufSize );
dSprintf( itemBuffer, itemBufSize, " %s", itemText );
dStrcat( returnBuffer, itemBuffer );
}

View file

@ -260,7 +260,7 @@ bool GuiFileTreeCtrl::matchesFilters(const char* filename)
if( !mFilters.size() )
return true;
for(int i = 0; i < mFilters.size(); i++)
for(S32 i = 0; i < mFilters.size(); i++)
{
if(FindMatch::isMatch( mFilters[i], filename))
return true;

View file

@ -736,7 +736,7 @@ bool GuiGameListMenuProfile::onAdd()
// We can't call enforceConstraints() here because incRefCount initializes
// some of the things to enforce. Do a basic sanity check here instead.
if( !dStrlen(mBitmapName) )
if( !mBitmapName || !dStrlen(mBitmapName) )
{
Con::errorf( "GuiGameListMenuProfile: %s can't be created without a bitmap. Please add a 'Bitmap' property to the object definition.", getName() );
return false;

View file

@ -213,7 +213,7 @@ void GuiGameListOptionsCtrl::addRow(const char* label, const char* optionsList,
Row * row = new Row();
Vector<StringTableEntry> options( __FILE__, __LINE__ );
S32 count = StringUnit::getUnitCount(optionsList, DELIM);
for (int i = 0; i < count; ++i)
for (S32 i = 0; i < count; ++i)
{
const char * option = StringUnit::getUnit(optionsList, i, DELIM);
options.push_back(StringTable->insert(option, true));
@ -238,7 +238,7 @@ void GuiGameListOptionsCtrl::setOptions(S32 rowIndex, const char * optionsList)
S32 count = StringUnit::getUnitCount(optionsList, DELIM);
row->mOptions.setSize(count);
for (int i = 0; i < count; ++i)
for (S32 i = 0; i < count; ++i)
{
const char * option = StringUnit::getUnit(optionsList, i, DELIM);
row->mOptions[i] = StringTable->insert(option, true);

View file

@ -89,11 +89,9 @@ bool GuiGradientSwatchCtrl::onWake()
if ( !Parent::onWake() )
return false;
if ( mPointer.isNull() )
mPointer.set( "core/art/gui/images/arrowbtn_d", &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) );
char* altCommand = Con::getReturnBuffer(512);
dSprintf( altCommand, 512, "%s(%i.color, \"%i.setColor\");", mColorFunction, getId(), getId() );
static const U32 bufSize = 512;
char* altCommand = Con::getReturnBuffer(bufSize);
dSprintf( altCommand, bufSize, "%s(%i.color, \"%i.setColor\");", mColorFunction, getId(), getId() );
setField( "altCommand", altCommand );
return true;
@ -619,10 +617,11 @@ ConsoleMethod(GuiGradientCtrl, getColor, const char*, 3, 3, "Get color value")
{
if ( idx >= 0 && idx < object->mColorRange.size() )
{
char* rColor = Con::getReturnBuffer(256);
static const U32 bufSize = 256;
char* rColor = Con::getReturnBuffer(bufSize);
rColor[0] = 0;
dSprintf(rColor, 256, "%f %f %f %f",
dSprintf(rColor, bufSize, "%f %f %f %f",
object->mColorRange[idx].swatch->getColor().red,
object->mColorRange[idx].swatch->getColor().green,
object->mColorRange[idx].swatch->getColor().blue,
@ -635,10 +634,11 @@ ConsoleMethod(GuiGradientCtrl, getColor, const char*, 3, 3, "Get color value")
{
if ( idx >= 0 && idx < object->mAlphaRange.size() )
{
char* rColor = Con::getReturnBuffer(256);
static const U32 bufSize = 256;
char* rColor = Con::getReturnBuffer(bufSize);
rColor[0] = 0;
dSprintf(rColor, 256, "%f %f %f %f",
dSprintf(rColor, bufSize, "%f %f %f %f",
object->mAlphaRange[idx].swatch->getColor().red,
object->mAlphaRange[idx].swatch->getColor().green,
object->mAlphaRange[idx].swatch->getColor().blue,

View file

@ -48,7 +48,6 @@ public:
void onRender(Point2I offset, const RectI &updateRect);
bool onWake();
protected:
GFXTexHandle mPointer;
StringTableEntry mColorFunction;
};
//----------------------------

View file

@ -450,8 +450,9 @@ DefineEngineMethod( GuiListBoxCtrl, getSelectedItems, const char*, (),,
if( selItems.empty() )
return StringTable->lookup("-1");
UTF8 *retBuffer = Con::getReturnBuffer( selItems.size() * 4 );
dMemset( retBuffer, 0, selItems.size() * 4 );
static const U32 bufSize = selItems.size() * 4;
UTF8 *retBuffer = Con::getReturnBuffer( bufSize );
dMemset( retBuffer, 0, bufSize );
Vector<S32>::iterator i = selItems.begin();
for( ; i != selItems.end(); i++ )
{

View file

@ -91,7 +91,7 @@ GFX_ImplementTextureProfile(GFXMLTextureProfile,
GFXTextureProfile::DiffuseMap,
GFXTextureProfile::PreserveSize |
GFXTextureProfile::Static,
GFXTextureProfile::None);
GFXTextureProfile::NONE);
const U32 GuiMLTextCtrl::csmTextBufferGrowthSize = 1024;
@ -121,10 +121,10 @@ DefineEngineMethod( GuiMLTextCtrl, getText, const char*, (),,
return( object->getTextContent() );
}
DefineEngineMethod( GuiMLTextCtrl, addText, void, ( const char* text, bool reformat),,
DefineEngineMethod( GuiMLTextCtrl, addText, void, ( const char* text, bool reformat), (true),
"@brief Appends the text in the control with additional text. Also .\n\n"
"@param text New text to append to the existing text.\n"
"@param reformat If true, the control will also be visually reset.\n"
"@param reformat If true, the control will also be visually reset (defaults to true).\n"
"@tsexample\n"
"// Define new text to add\n"
"%text = \"New Text to Add\";\n\n"
@ -138,7 +138,7 @@ DefineEngineMethod( GuiMLTextCtrl, addText, void, ( const char* text, bool refor
object->addText(text, dStrlen(text), reformat);
}
DefineEngineMethod( GuiMLTextCtrl, setCursorPosition, bool, (int newPos),,
DefineEngineMethod( GuiMLTextCtrl, setCursorPosition, bool, (S32 newPos),,
"@brief Change the text cursor's position to a new defined offset within the text in the control.\n\n"
"@param newPos Offset to place cursor.\n"
"@tsexample\n"
@ -153,7 +153,7 @@ DefineEngineMethod( GuiMLTextCtrl, setCursorPosition, bool, (int newPos),,
return object->setCursorPosition(newPos);
}
DefineEngineMethod( GuiMLTextCtrl, scrollToTag, void, (int tagID),,
DefineEngineMethod( GuiMLTextCtrl, scrollToTag, void, (S32 tagID),,
"@brief Scroll down to a specified tag.\n\n"
"Detailed description\n\n"
"@param tagID TagID to scroll the control to\n"

View file

@ -24,7 +24,6 @@
#include "gui/containers/guiScrollCtrl.h"
#include "gui/core/guiCanvas.h"
#include "console/consoleTypes.h"
#include "platform/event.h"
#include "core/frameAllocator.h"
#include "core/stringBuffer.h"
#include "gfx/gfxDrawUtil.h"

View file

@ -1011,8 +1011,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w;
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w;
}
else
{
@ -1024,8 +1024,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = (getWidth() - mBitmapBounds[2].extent.x - txt_w) / 2;
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = (getWidth() - bitmapBounds[2].extent.x - txt_w) / 2;
} else
{
@ -1043,8 +1043,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w;
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w;
}
else
{
@ -1095,8 +1095,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - mBitmapBounds[2].extent.x, localStart.y ) );
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) );
GFX->getDrawUtil()->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors );
} else

View file

@ -579,8 +579,9 @@ ConsoleMethod( GuiPopUpMenuCtrlEx, getColorById, const char*, 3, 3,
ColorI color;
object->getColoredBox(color, dAtoi(argv[2]));
char *strBuffer = Con::getReturnBuffer(512);
dSprintf(strBuffer, 512, "%d %d %d %d", color.red, color.green, color.blue, color.alpha);
static const U32 bufSize = 512;
char *strBuffer = Con::getReturnBuffer(bufSize);
dSprintf(strBuffer, bufSize, "%d %d %d %d", color.red, color.green, color.blue, color.alpha);
return strBuffer;
}
@ -1167,8 +1168,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w;
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w;
}
else
{
@ -1180,8 +1181,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = (getWidth() - mBitmapBounds[2].extent.x - txt_w) / 2;
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = (getWidth() - bitmapBounds[2].extent.x - txt_w) / 2;
} else
{
@ -1199,8 +1200,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w;
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w;
}
else
{
@ -1251,8 +1252,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
{
// We're making use of a bitmap border, so take into account the
// right cap of the border.
RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - mBitmapBounds[2].extent.x, localStart.y ) );
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) );
GFX->getDrawUtil()->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors );
} else

View file

@ -26,7 +26,6 @@
#include "gfx/gfxTextureManager.h"
#include "gui/controls/guiSliderCtrl.h"
#include "gui/core/guiDefaultControlRender.h"
#include "platform/event.h"
#include "gfx/primBuilder.h"
#include "gfx/gfxDrawUtil.h"
#include "sfx/sfxSystem.h"

View file

@ -1688,7 +1688,7 @@ DefineEngineMethod( GuiTextEditCtrl, getCursorPos, S32, (),,
return( object->getCursorPos() );
}
DefineEngineMethod( GuiTextEditCtrl, setCursorPos, void, (int position),,
DefineEngineMethod( GuiTextEditCtrl, setCursorPos, void, (S32 position),,
"@brief Sets the text cursor at the defined position within the control.\n\n"
"@param position Text position to set the text cursor.\n"
"@tsexample\n"

View file

@ -79,12 +79,12 @@ IMPLEMENT_CALLBACK( GuiTextListCtrl, onDeleteKey, void, ( const char* id ),( id
"@see GuiControl\n\n"
);
static int sortColumn;
static S32 sortColumn;
static bool sIncreasing;
static const char *getColumn(const char *text)
{
int ct = sortColumn;
S32 ct = sortColumn;
while(ct--)
{
text = dStrchr(text, '\t');
@ -530,7 +530,7 @@ DefineEngineMethod( GuiTextListCtrl, getSelectedId, S32, (),,
return object->getSelectedId();
}
DefineEngineMethod( GuiTextListCtrl, setSelectedById, void, (int id),,
DefineEngineMethod( GuiTextListCtrl, setSelectedById, void, (S32 id),,
"@brief Finds the specified entry by id, then marks its row as selected.\n\n"
"@param id Entry within the text list to make selected.\n"
"@tsexample\n"
@ -548,7 +548,7 @@ DefineEngineMethod( GuiTextListCtrl, setSelectedById, void, (int id),,
object->setSelectedCell(Point2I(0, index));
}
DefineEngineMethod( GuiTextListCtrl, setSelectedRow, void, (int rowNum),,
DefineEngineMethod( GuiTextListCtrl, setSelectedRow, void, (S32 rowNum),,
"@briefSelects the specified row.\n\n"
"@param rowNum Row number to set selected.\n"
"@tsexample\n"
@ -584,7 +584,7 @@ DefineEngineMethod( GuiTextListCtrl, clearSelection, void, (),,
object->setSelectedCell(Point2I(-1, -1));
}
DefineEngineMethod( GuiTextListCtrl, addRow, S32, (int id, const char* text, int index),(0,"",-1),
DefineEngineMethod( GuiTextListCtrl, addRow, S32, (S32 id, const char* text, S32 index),(0,"",-1),
"@brief Adds a new row at end of the list with the defined id and text.\n"
"If index is used, then the new row is inserted at the row location of 'index'.\n\n"
"@param id Id of the new row.\n"
@ -612,7 +612,7 @@ DefineEngineMethod( GuiTextListCtrl, addRow, S32, (int id, const char* text, int
return ret;
}
DefineEngineMethod( GuiTextListCtrl, setRowById, void, (int id, const char* text),,
DefineEngineMethod( GuiTextListCtrl, setRowById, void, (S32 id, const char* text),,
"@brief Sets the text at the defined id.\n\n"
"@param id Id to change.\n"
"@param text Text to use at the Id.\n"
@ -629,7 +629,7 @@ DefineEngineMethod( GuiTextListCtrl, setRowById, void, (int id, const char* text
object->setEntry(id, text);
}
DefineEngineMethod( GuiTextListCtrl, sort, void, ( int columnId, bool increasing ), ( true ),
DefineEngineMethod( GuiTextListCtrl, sort, void, ( S32 columnId, bool increasing ), ( true ),
"@brief Performs a standard (alphabetical) sort on the values in the specified column.\n\n"
"@param columnId Column ID to perform the sort on.\n"
"@param increasing If false, sort will be performed in reverse.\n"
@ -646,7 +646,7 @@ DefineEngineMethod( GuiTextListCtrl, sort, void, ( int columnId, bool increasing
object->sort( columnId, increasing );
}
DefineEngineMethod( GuiTextListCtrl, sortNumerical, void, (int columnID, bool increasing), ( true ),
DefineEngineMethod( GuiTextListCtrl, sortNumerical, void, (S32 columnID, bool increasing), ( true ),
"@brief Perform a numerical sort on the values in the specified column.\n\n"
"Detailed description\n\n"
"@param columnId Column ID to perform the sort on.\n"
@ -687,7 +687,7 @@ DefineEngineMethod( GuiTextListCtrl, rowCount, S32, (),,
return object->getNumEntries();
}
DefineEngineMethod( GuiTextListCtrl, getRowId, S32, (int index),,
DefineEngineMethod( GuiTextListCtrl, getRowId, S32, (S32 index),,
"@brief Get the row ID for an index.\n\n"
"@param index Index to get the RowID at\n"
"@tsexample\n"
@ -705,7 +705,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowId, S32, (int index),,
return object->mList[index].id;
}
DefineEngineMethod( GuiTextListCtrl, getRowTextById, const char*, (int id),,
DefineEngineMethod( GuiTextListCtrl, getRowTextById, const char*, (S32 id),,
"@brief Get the text of a row with the specified id.\n\n"
"@tsexample\n"
"// Define the id\n"
@ -722,7 +722,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowTextById, const char*, (int id),,
return object->mList[index].text;
}
DefineEngineMethod( GuiTextListCtrl, getRowNumById, S32, (int id),,
DefineEngineMethod( GuiTextListCtrl, getRowNumById, S32, (S32 id),,
"@brief Get the row number for a specified id.\n\n"
"@param id Id to get the row number at\n"
"@tsexample\n"
@ -739,7 +739,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowNumById, S32, (int id),,
return index;
}
DefineEngineMethod( GuiTextListCtrl, getRowText, const char*, (int index),,
DefineEngineMethod( GuiTextListCtrl, getRowText, const char*, (S32 index),,
"@brief Get the text of the row with the specified index.\n\n"
"@param index Row index to acquire the text at.\n"
"@tsexample\n"
@ -756,7 +756,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowText, const char*, (int index),,
return object->mList[index].text;
}
DefineEngineMethod( GuiTextListCtrl, removeRowById, void, (int id),,
DefineEngineMethod( GuiTextListCtrl, removeRowById, void, (S32 id),,
"@brief Remove row with the specified id.\n\n"
"@param id Id to remove the row entry at\n"
"@tsexample\n"
@ -770,7 +770,7 @@ DefineEngineMethod( GuiTextListCtrl, removeRowById, void, (int id),,
object->removeEntry(id);
}
DefineEngineMethod( GuiTextListCtrl, removeRow, void, (int index),,
DefineEngineMethod( GuiTextListCtrl, removeRow, void, (S32 index),,
"@brief Remove a row from the table, based on its index.\n\n"
"@param index Row index to remove from the list.\n"
"@tsexample\n"
@ -784,7 +784,7 @@ DefineEngineMethod( GuiTextListCtrl, removeRow, void, (int index),,
object->removeEntryByIndex(index);
}
DefineEngineMethod( GuiTextListCtrl, scrollVisible, void, (int rowNum),,
DefineEngineMethod( GuiTextListCtrl, scrollVisible, void, (S32 rowNum),,
"@brief Scroll so the specified row is visible\n\n"
"@param rowNum Row number to make visible\n"
"@tsexample\n"
@ -813,7 +813,7 @@ DefineEngineMethod( GuiTextListCtrl, findTextIndex, S32, (const char* needle),,
return( object->findEntryByText(needle) );
}
DefineEngineMethod( GuiTextListCtrl, setRowActive, void, (int rowNum, bool active),,
DefineEngineMethod( GuiTextListCtrl, setRowActive, void, (S32 rowNum, bool active),,
"@brief Mark a specified row as active/not.\n\n"
"@param rowNum Row number to change the active state.\n"
"@param active Boolean active state to set the row number.\n"
@ -830,7 +830,7 @@ DefineEngineMethod( GuiTextListCtrl, setRowActive, void, (int rowNum, bool activ
object->setEntryActive( U32( rowNum ), active );
}
DefineEngineMethod( GuiTextListCtrl, isRowActive, bool, (int rowNum),,
DefineEngineMethod( GuiTextListCtrl, isRowActive, bool, (S32 rowNum),,
"@brief Check if the specified row is currently active or not.\n\n"
"@param rowNum Row number to check the active state.\n"
"@tsexample\n"

View file

@ -30,7 +30,6 @@
#include "console/consoleTypes.h"
#include "console/console.h"
#include "gui/core/guiTypes.h"
#include "platform/event.h"
#include "gfx/gfxDrawUtil.h"
#include "gui/controls/guiTextEditCtrl.h"
#ifdef TORQUE_TOOLS
@ -3438,6 +3437,8 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
scrollVisible(newItem);
onDragDropped_callback();
buildVisibleTree(false);
}
mDragMidPoint = NomDragMidPoint;
@ -3582,7 +3583,7 @@ void GuiTreeViewCtrl::onMiddleMouseDown(const GuiEvent & event)
for (S32 j = 0; j < mSelected.size(); j++) {
Con::printf("%d", mSelected[j]);
}
S32 mCurrentDragCell = mMouseOverCell.y;
mCurrentDragCell = mMouseOverCell.y;
S32 midpCell = (mCurrentDragCell) * mItemHeight + (mItemHeight/2);
S32 currentY = pt.y;
S32 yDiff = currentY-midpCell;
@ -3647,7 +3648,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
break;
}
}
S32 mCurrentDragCell = mMouseOverCell.y;
mCurrentDragCell = mMouseOverCell.y;
if (mVisibleItems[firstSelectedIndex] != firstItem )
{
/*
@ -4919,7 +4920,7 @@ ConsoleMethod( GuiTreeViewCtrl, open, void, 3, 4, "(SimSet obj, bool okToEdit=tr
ConsoleMethod( GuiTreeViewCtrl, setItemTooltip, void, 4, 4, "( int id, string text ) - Set the tooltip to show for the given item." )
{
int id = dAtoi( argv[ 2 ] );
S32 id = dAtoi( argv[ 2 ] );
GuiTreeViewCtrl::Item* item = object->getItem( id );
if( !item )
@ -4933,7 +4934,7 @@ ConsoleMethod( GuiTreeViewCtrl, setItemTooltip, void, 4, 4, "( int id, string te
ConsoleMethod( GuiTreeViewCtrl, setItemImages, void, 5, 5, "( int id, int normalImage, int expandedImage ) - Sets the normal and expanded images to show for the given item." )
{
int id = dAtoi( argv[ 2 ] );
S32 id = dAtoi( argv[ 2 ] );
GuiTreeViewCtrl::Item* item = object->getItem( id );
if( !item )
@ -4948,7 +4949,7 @@ ConsoleMethod( GuiTreeViewCtrl, setItemImages, void, 5, 5, "( int id, int normal
ConsoleMethod( GuiTreeViewCtrl, isParentItem, bool, 3, 3, "( int id ) - Returns true if the given item contains child items." )
{
int id = dAtoi( argv[ 2 ] );
S32 id = dAtoi( argv[ 2 ] );
if( !id && object->getItemCount() )
return true;
@ -5060,11 +5061,12 @@ ConsoleMethod(GuiTreeViewCtrl, getSelectedObject, S32, 2, 3, "( int index=0 ) -
ConsoleMethod(GuiTreeViewCtrl, getSelectedObjectList, const char*, 2, 2,
"Returns a space sperated list of all selected object ids.")
{
char* buff = Con::getReturnBuffer(1024);
dSprintf(buff,1024,"");
static const U32 bufSize = 1024;
char* buff = Con::getReturnBuffer(bufSize);
dSprintf(buff,bufSize,"");
const Vector< GuiTreeViewCtrl::Item* > selectedItems = object->getSelectedItems();
for(int i = 0; i < selectedItems.size(); i++)
for(S32 i = 0; i < selectedItems.size(); i++)
{
GuiTreeViewCtrl::Item *item = selectedItems[i];
@ -5076,7 +5078,7 @@ ConsoleMethod(GuiTreeViewCtrl, getSelectedObjectList, const char*, 2, 2,
//the start of the buffer where we want to write
char* buffPart = buff+len;
//the size of the remaining buffer (-1 cause dStrlen doesn't count the \0)
S32 size = 1024-len-1;
S32 size = bufSize-len-1;
//write it:
if(size < 1)
{
@ -5125,11 +5127,12 @@ ConsoleMethod(GuiTreeViewCtrl, getTextToRoot, const char*,4,4,"(TreeItemId item,
ConsoleMethod(GuiTreeViewCtrl, getSelectedItemList,const char*, 2,2,"returns a space seperated list of mulitple item ids")
{
char* buff = Con::getReturnBuffer(1024);
dSprintf(buff,1024,"");
static const U32 bufSize = 1024;
char* buff = Con::getReturnBuffer(bufSize);
dSprintf(buff,bufSize,"");
const Vector< S32 >& selected = object->getSelected();
for(int i = 0; i < selected.size(); i++)
for(S32 i = 0; i < selected.size(); i++)
{
S32 id = selected[i];
//get the current length of the buffer
@ -5137,7 +5140,7 @@ ConsoleMethod(GuiTreeViewCtrl, getSelectedItemList,const char*, 2,2,"returns a s
//the start of the buffer where we want to write
char* buffPart = buff+len;
//the size of the remaining buffer (-1 cause dStrlen doesn't count the \0)
S32 size = 1024-len-1;
S32 size = bufSize-len-1;
//write it:
if(size < 1)
{