mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #2090 from Areloch/ConsoleLogFilters
Adds some filtering options to the console log gui
This commit is contained in:
commit
5bf3d67959
5 changed files with 585 additions and 105 deletions
|
|
@ -50,6 +50,12 @@ IMPLEMENT_CALLBACK( GuiConsole, onMessageSelected, void, ( ConsoleLogEntry::Leve
|
||||||
"@param level Diagnostic level of the message.\n"
|
"@param level Diagnostic level of the message.\n"
|
||||||
"@param message Message text.\n" );
|
"@param message Message text.\n" );
|
||||||
|
|
||||||
|
IMPLEMENT_CALLBACK(GuiConsole, onNewMessage, void, (U32 errorCount, U32 warnCount, U32 normalCount), (errorCount, warnCount, normalCount),
|
||||||
|
"Called when a new message is logged.\n\n"
|
||||||
|
"@param errorCount The number of error messages logged.\n"
|
||||||
|
"@param warnCount The number of warning messages logged.\n"
|
||||||
|
"@param normalCount The number of normal messages logged.\n");
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -58,6 +64,11 @@ GuiConsole::GuiConsole()
|
||||||
setExtent(64, 64);
|
setExtent(64, 64);
|
||||||
mCellSize.set(1, 1);
|
mCellSize.set(1, 1);
|
||||||
mSize.set(1, 0);
|
mSize.set(1, 0);
|
||||||
|
|
||||||
|
mDisplayErrors = true;
|
||||||
|
mDisplayWarnings = true;
|
||||||
|
mDisplayNormalMessages = true;
|
||||||
|
mFiltersDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -81,34 +92,77 @@ S32 GuiConsole::getMaxWidth(S32 startIndex, S32 endIndex)
|
||||||
U32 size;
|
U32 size;
|
||||||
ConsoleLogEntry *log;
|
ConsoleLogEntry *log;
|
||||||
|
|
||||||
Con::getLockLog(log, size);
|
if (startIndex < 0 || (U32)endIndex >= mFilteredLog.size() || startIndex > endIndex)
|
||||||
|
|
||||||
if(startIndex < 0 || (U32)endIndex >= size || startIndex > endIndex)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
S32 result = 0;
|
S32 result = 0;
|
||||||
for(S32 i = startIndex; i <= endIndex; i++)
|
for(S32 i = startIndex; i <= endIndex; i++)
|
||||||
result = getMax(result, (S32)(mFont->getStrWidth((const UTF8 *)log[i].mString)));
|
result = getMax(result, (S32)(mFont->getStrWidth((const UTF8 *)mFilteredLog[i].mString)));
|
||||||
|
|
||||||
Con::unlockLog();
|
|
||||||
|
|
||||||
return(result + 6);
|
return(result + 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiConsole::refreshLogText()
|
||||||
|
{
|
||||||
|
U32 size;
|
||||||
|
ConsoleLogEntry *log;
|
||||||
|
|
||||||
|
Con::getLockLog(log, size);
|
||||||
|
|
||||||
|
if (mFilteredLog.size() != size || mFiltersDirty)
|
||||||
|
{
|
||||||
|
mFilteredLog.clear();
|
||||||
|
|
||||||
|
U32 errorCount = 0;
|
||||||
|
U32 warnCount = 0;
|
||||||
|
U32 normalCount = 0;
|
||||||
|
|
||||||
|
//Filter the log if needed
|
||||||
|
for (U32 i = 0; i < size; ++i)
|
||||||
|
{
|
||||||
|
ConsoleLogEntry &entry = log[i];
|
||||||
|
|
||||||
|
if (entry.mLevel == ConsoleLogEntry::Error)
|
||||||
|
{
|
||||||
|
errorCount++;
|
||||||
|
if (mDisplayErrors)
|
||||||
|
{
|
||||||
|
mFilteredLog.push_back(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (entry.mLevel == ConsoleLogEntry::Warning)
|
||||||
|
{
|
||||||
|
warnCount++;
|
||||||
|
if (mDisplayWarnings)
|
||||||
|
{
|
||||||
|
mFilteredLog.push_back(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (entry.mLevel == ConsoleLogEntry::Normal)
|
||||||
|
{
|
||||||
|
normalCount++;
|
||||||
|
if (mDisplayNormalMessages)
|
||||||
|
{
|
||||||
|
mFilteredLog.push_back(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onNewMessage_callback(errorCount, warnCount, normalCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
Con::unlockLog();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void GuiConsole::onPreRender()
|
void GuiConsole::onPreRender()
|
||||||
{
|
{
|
||||||
//see if the size has changed
|
//see if the size has changed
|
||||||
U32 prevSize = getHeight() / mCellSize.y;
|
U32 prevSize = getHeight() / mCellSize.y;
|
||||||
U32 size;
|
|
||||||
ConsoleLogEntry *log;
|
|
||||||
|
|
||||||
Con::getLockLog(log, size);
|
refreshLogText();
|
||||||
Con::unlockLog(); // we unlock immediately because we only use size here, not log.
|
|
||||||
|
|
||||||
if(size != prevSize)
|
|
||||||
{
|
|
||||||
//first, find out if the console was scrolled up
|
//first, find out if the console was scrolled up
|
||||||
bool scrolled = false;
|
bool scrolled = false;
|
||||||
GuiScrollCtrl *parent = dynamic_cast<GuiScrollCtrl*>(getParent());
|
GuiScrollCtrl *parent = dynamic_cast<GuiScrollCtrl*>(getParent());
|
||||||
|
|
@ -117,20 +171,19 @@ void GuiConsole::onPreRender()
|
||||||
scrolled = parent->isScrolledToBottom();
|
scrolled = parent->isScrolledToBottom();
|
||||||
|
|
||||||
//find the max cell width for the new entries
|
//find the max cell width for the new entries
|
||||||
S32 newMax = getMaxWidth(prevSize, size - 1);
|
S32 newMax = getMaxWidth(prevSize, mFilteredLog.size() - 1);
|
||||||
if(newMax > mCellSize.x)
|
if(newMax > mCellSize.x)
|
||||||
mCellSize.set(newMax, mFont->getHeight());
|
mCellSize.set(newMax, mFont->getHeight());
|
||||||
|
|
||||||
//set the array size
|
//set the array size
|
||||||
mSize.set(1, size);
|
mSize.set(1, mFilteredLog.size());
|
||||||
|
|
||||||
//resize the control
|
//resize the control
|
||||||
setExtent( Point2I(mCellSize.x, mCellSize.y * size));
|
setExtent(Point2I(mCellSize.x, mCellSize.y * mFilteredLog.size()));
|
||||||
|
|
||||||
//if the console was not scrolled, make the last entry visible
|
//if the console was not scrolled, make the last entry visible
|
||||||
if (scrolled)
|
if (scrolled)
|
||||||
scrollCellVisible(Point2I(0,mSize.y - 1));
|
scrollCellVisible(Point2I(0,mSize.y - 1));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -140,9 +193,7 @@ void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, b
|
||||||
U32 size;
|
U32 size;
|
||||||
ConsoleLogEntry *log;
|
ConsoleLogEntry *log;
|
||||||
|
|
||||||
Con::getLockLog(log, size);
|
ConsoleLogEntry &entry = mFilteredLog[cell.y];
|
||||||
|
|
||||||
ConsoleLogEntry &entry = log[cell.y];
|
|
||||||
switch (entry.mLevel)
|
switch (entry.mLevel)
|
||||||
{
|
{
|
||||||
case ConsoleLogEntry::Normal: GFX->getDrawUtil()->setBitmapModulation(mProfile->mFontColor); break;
|
case ConsoleLogEntry::Normal: GFX->getDrawUtil()->setBitmapModulation(mProfile->mFontColor); break;
|
||||||
|
|
@ -151,8 +202,6 @@ void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, b
|
||||||
default: AssertFatal(false, "GuiConsole::onRenderCell - Unrecognized ConsoleLogEntry type, update this.");
|
default: AssertFatal(false, "GuiConsole::onRenderCell - Unrecognized ConsoleLogEntry type, update this.");
|
||||||
}
|
}
|
||||||
GFX->getDrawUtil()->drawText(mFont, Point2I(offset.x + 3, offset.y), entry.mString, mProfile->mFontColors);
|
GFX->getDrawUtil()->drawText(mFont, Point2I(offset.x + 3, offset.y), entry.mString, mProfile->mFontColors);
|
||||||
|
|
||||||
Con::unlockLog();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -164,10 +213,75 @@ void GuiConsole::onCellSelected( Point2I cell )
|
||||||
U32 size;
|
U32 size;
|
||||||
ConsoleLogEntry* log;
|
ConsoleLogEntry* log;
|
||||||
|
|
||||||
Con::getLockLog(log, size);
|
ConsoleLogEntry& entry = mFilteredLog[cell.y];
|
||||||
|
|
||||||
ConsoleLogEntry& entry = log[ cell.y ];
|
|
||||||
onMessageSelected_callback( entry.mLevel, entry.mString );
|
onMessageSelected_callback( entry.mLevel, entry.mString );
|
||||||
|
}
|
||||||
Con::unlockLog();
|
|
||||||
|
void GuiConsole::setDisplayFilters(bool errors, bool warns, bool normal)
|
||||||
|
{
|
||||||
|
mDisplayErrors = errors;
|
||||||
|
mDisplayWarnings = warns;
|
||||||
|
mDisplayNormalMessages = normal;
|
||||||
|
mFiltersDirty = true;
|
||||||
|
|
||||||
|
refreshLogText();
|
||||||
|
|
||||||
|
//find the max cell width for the new entries
|
||||||
|
S32 newMax = getMaxWidth(0, mFilteredLog.size() - 1);
|
||||||
|
mCellSize.set(newMax, mFont->getHeight());
|
||||||
|
|
||||||
|
//set the array size
|
||||||
|
mSize.set(1, mFilteredLog.size());
|
||||||
|
|
||||||
|
//resize the control
|
||||||
|
setExtent(Point2I(mCellSize.x, mCellSize.y * mFilteredLog.size()));
|
||||||
|
|
||||||
|
scrollCellVisible(Point2I(0, mSize.y - 1));
|
||||||
|
|
||||||
|
mFiltersDirty = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiConsole, setDisplayFilters, void, (bool errors, bool warns, bool normal), (true, true, true),
|
||||||
|
"Sets the current display filters for the console gui. Allows you to indicate if it should display errors, warns and/or normal messages.\n\n"
|
||||||
|
"@param errors If true, the console gui will display any error messages that were emitted.\n\n"
|
||||||
|
"@param warns If true, the console gui will display any warning messages that were emitted.\n\n"
|
||||||
|
"@param normal If true, the console gui will display any regular messages that were emitted.\n\n")
|
||||||
|
{
|
||||||
|
object->setDisplayFilters(errors, warns, normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiConsole, getErrorFilter, bool, (), ,
|
||||||
|
"Returns if the error filter is on or not.")
|
||||||
|
{
|
||||||
|
return object->getErrorFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiConsole, getWarnFilter, bool, (), ,
|
||||||
|
"Returns if the warning filter is on or not.")
|
||||||
|
{
|
||||||
|
return object->getWarnFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiConsole, getNormalFilter, bool, (), ,
|
||||||
|
"Returns if the normal message filter is on or not.")
|
||||||
|
{
|
||||||
|
return object->getNormalFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiConsole, toggleErrorFilter, void, (), ,
|
||||||
|
"Toggles the error filter.")
|
||||||
|
{
|
||||||
|
object->toggleErrorFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiConsole, toggleWarnFilter, void, (), ,
|
||||||
|
"Toggles the warning filter.")
|
||||||
|
{
|
||||||
|
object->toggleWarnFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiConsole, toggleNormalFilter, void, (), ,
|
||||||
|
"Toggles the normal messages filter.")
|
||||||
|
{
|
||||||
|
object->toggleNormalFilter();
|
||||||
}
|
}
|
||||||
|
|
@ -39,14 +39,22 @@ class GuiConsole : public GuiArrayCtrl
|
||||||
|
|
||||||
Resource<GFont> mFont;
|
Resource<GFont> mFont;
|
||||||
|
|
||||||
|
bool mDisplayErrors;
|
||||||
|
bool mDisplayWarnings;
|
||||||
|
bool mDisplayNormalMessages;
|
||||||
|
bool mFiltersDirty;
|
||||||
|
|
||||||
S32 getMaxWidth(S32 startIndex, S32 endIndex);
|
S32 getMaxWidth(S32 startIndex, S32 endIndex);
|
||||||
|
|
||||||
|
Vector<ConsoleLogEntry> mFilteredLog;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// @name Callbacks
|
/// @name Callbacks
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
DECLARE_CALLBACK( void, onMessageSelected, ( ConsoleLogEntry::Level level, const char* message ) );
|
DECLARE_CALLBACK( void, onMessageSelected, ( ConsoleLogEntry::Level level, const char* message ) );
|
||||||
|
DECLARE_CALLBACK(void, onNewMessage, (U32 errorCount, U32 warnCount, U32 normalCount));
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
@ -63,6 +71,26 @@ class GuiConsole : public GuiArrayCtrl
|
||||||
virtual bool onWake();
|
virtual bool onWake();
|
||||||
virtual void onPreRender();
|
virtual void onPreRender();
|
||||||
virtual void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
|
virtual void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
|
||||||
|
|
||||||
|
void setDisplayFilters(bool errors, bool warns, bool normal);
|
||||||
|
bool getErrorFilter() { return mDisplayErrors; }
|
||||||
|
bool getWarnFilter() { return mDisplayWarnings; }
|
||||||
|
bool getNormalFilter() { return mDisplayNormalMessages; }
|
||||||
|
|
||||||
|
void toggleErrorFilter()
|
||||||
|
{
|
||||||
|
setDisplayFilters(!mDisplayErrors, mDisplayWarnings, mDisplayNormalMessages);
|
||||||
|
}
|
||||||
|
void toggleWarnFilter()
|
||||||
|
{
|
||||||
|
setDisplayFilters(mDisplayErrors, !mDisplayWarnings, mDisplayNormalMessages);
|
||||||
|
}
|
||||||
|
void toggleNormalFilter()
|
||||||
|
{
|
||||||
|
setDisplayFilters(mDisplayErrors, mDisplayWarnings, !mDisplayNormalMessages);
|
||||||
|
}
|
||||||
|
|
||||||
|
void refreshLogText();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,191 @@
|
||||||
new GuiControl(ConsoleDlg) {
|
//--- OBJECT WRITE BEGIN ---
|
||||||
profile = "GuiDefaultProfile";
|
%guiContent = new GuiControl(ConsoleDlg) {
|
||||||
|
position = "0 0";
|
||||||
|
extent = "1024 768";
|
||||||
|
minExtent = "8 8";
|
||||||
horizSizing = "right";
|
horizSizing = "right";
|
||||||
vertSizing = "bottom";
|
vertSizing = "bottom";
|
||||||
position = "0 0";
|
profile = "GuiDefaultProfile";
|
||||||
extent = "640 480";
|
|
||||||
minExtent = "8 8";
|
|
||||||
visible = "1";
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "1";
|
||||||
helpTag = "0";
|
helpTag = "0";
|
||||||
|
|
||||||
new GuiConsoleEditCtrl(ConsoleEntry) {
|
new GuiConsoleEditCtrl(ConsoleEntry) {
|
||||||
profile = "ConsoleTextEditProfile";
|
useSiblingScroller = "1";
|
||||||
horizSizing = "width";
|
|
||||||
vertSizing = "top";
|
|
||||||
position = "0 462";
|
|
||||||
extent = "640 18";
|
|
||||||
minExtent = "8 8";
|
|
||||||
visible = "1";
|
|
||||||
altCommand = "ConsoleEntry::eval();";
|
|
||||||
helpTag = "0";
|
|
||||||
maxLength = "255";
|
|
||||||
historySize = "40";
|
historySize = "40";
|
||||||
password = "0";
|
|
||||||
tabComplete = "0";
|
tabComplete = "0";
|
||||||
sinkAllKeyEvents = "1";
|
sinkAllKeyEvents = "1";
|
||||||
useSiblingScroller = "1";
|
password = "0";
|
||||||
|
passwordMask = "*";
|
||||||
|
maxLength = "255";
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "0 750";
|
||||||
|
extent = "1024 18";
|
||||||
|
minExtent = "8 8";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "ConsoleTextEditProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
altCommand = "ConsoleEntry::eval();";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiContainer() {
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "1 728";
|
||||||
|
extent = "1024 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "GuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
|
new GuiBitmapCtrl() {
|
||||||
|
bitmap = "data/ui/art/hudfill.png";
|
||||||
|
color = "255 255 255 255";
|
||||||
|
wrap = "0";
|
||||||
|
position = "0 0";
|
||||||
|
extent = "1024 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiCheckBoxCtrl(ConsoleDlgErrorFilterBtn) {
|
||||||
|
text = "Errors";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "2 2";
|
||||||
|
extent = "113 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiCheckBoxCtrl(ConsoleDlgWarnFilterBtn) {
|
||||||
|
text = "Warnings";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "119 2";
|
||||||
|
extent = "113 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiCheckBoxCtrl(ConsoleDlgNormalFilterBtn) {
|
||||||
|
text = "Normal Messages";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "236 2";
|
||||||
|
extent = "113 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
new GuiScrollCtrl() {
|
new GuiScrollCtrl() {
|
||||||
internalName = "Scroll";
|
|
||||||
profile = "ConsoleScrollProfile";
|
|
||||||
horizSizing = "width";
|
|
||||||
vertSizing = "height";
|
|
||||||
position = "0 0";
|
|
||||||
extent = "640 462";
|
|
||||||
minExtent = "8 8";
|
|
||||||
visible = "1";
|
|
||||||
helpTag = "0";
|
|
||||||
willFirstRespond = "1";
|
willFirstRespond = "1";
|
||||||
hScrollBar = "alwaysOn";
|
hScrollBar = "alwaysOn";
|
||||||
vScrollBar = "alwaysOn";
|
vScrollBar = "alwaysOn";
|
||||||
lockHorizScroll = "false";
|
lockHorizScroll = "0";
|
||||||
lockVertScroll = "false";
|
lockVertScroll = "0";
|
||||||
constantThumbHeight = "0";
|
constantThumbHeight = "0";
|
||||||
childMargin = "0 0";
|
childMargin = "0 0";
|
||||||
|
mouseWheelScrollSpeed = "-1";
|
||||||
new GuiConsole( ConsoleMessageLogView ) {
|
margin = "0 0 0 0";
|
||||||
profile = "GuiConsoleProfile";
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
position = "0 0";
|
position = "0 0";
|
||||||
|
extent = "1024 730";
|
||||||
|
minExtent = "8 8";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "height";
|
||||||
|
profile = "ConsoleScrollProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
internalName = "Scroll";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
|
new GuiConsole(ConsoleMessageLogView) {
|
||||||
|
position = "1 1";
|
||||||
|
extent = "622 324";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiConsoleProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -99,6 +99,13 @@ function ConsoleDlg::showWindow(%this)
|
||||||
%this-->Scroll.setVisible(true);
|
%this-->Scroll.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ConsoleDlg::onWake(%this)
|
||||||
|
{
|
||||||
|
ConsoleDlgErrorFilterBtn.setStateOn(ConsoleMessageLogView.getErrorFilter());
|
||||||
|
ConsoleDlgWarnFilterBtn.setStateOn(ConsoleMessageLogView.getWarnFilter());
|
||||||
|
ConsoleDlgNormalFilterBtn.setStateOn(ConsoleMessageLogView.getNormalFilter());
|
||||||
|
}
|
||||||
|
|
||||||
function ConsoleDlg::setAlpha( %this, %alpha)
|
function ConsoleDlg::setAlpha( %this, %alpha)
|
||||||
{
|
{
|
||||||
if (%alpha $= "")
|
if (%alpha $= "")
|
||||||
|
|
@ -106,3 +113,26 @@ function ConsoleDlg::setAlpha( %this, %alpha)
|
||||||
else
|
else
|
||||||
ConsoleScrollProfile.fillColor = getWords($ConsoleDefaultFillColor, 0, 2) SPC %alpha * 255.0;
|
ConsoleScrollProfile.fillColor = getWords($ConsoleDefaultFillColor, 0, 2) SPC %alpha * 255.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ConsoleDlgErrorFilterBtn::onClick(%this)
|
||||||
|
{
|
||||||
|
ConsoleMessageLogView.toggleErrorFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConsoleDlgWarnFilterBtn::onClick(%this)
|
||||||
|
{
|
||||||
|
|
||||||
|
ConsoleMessageLogView.toggleWarnFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConsoleDlgNormalFilterBtn::onClick(%this)
|
||||||
|
{
|
||||||
|
ConsoleMessageLogView.toggleNormalFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConsoleMessageLogView::onNewMessage(%this, %errorCount, %warnCount, %normalCount)
|
||||||
|
{
|
||||||
|
ConsoleDlgErrorFilterBtn.setText("(" @ %errorCount @ ") Errors");
|
||||||
|
ConsoleDlgWarnFilterBtn.setText("(" @ %warnCount @ ") Warnings");
|
||||||
|
ConsoleDlgNormalFilterBtn.setText("(" @ %normalCount @ ") Messages");
|
||||||
|
}
|
||||||
|
|
@ -1,52 +1,190 @@
|
||||||
//--- OBJECT WRITE BEGIN ---
|
//--- OBJECT WRITE BEGIN ---
|
||||||
%guiContent = new GuiControl(ConsoleDlg) {
|
%guiContent = new GuiControl(ConsoleDlg) {
|
||||||
profile = "GuiDefaultProfile";
|
position = "0 0";
|
||||||
|
extent = "1024 768";
|
||||||
|
minExtent = "8 8";
|
||||||
horizSizing = "right";
|
horizSizing = "right";
|
||||||
vertSizing = "bottom";
|
vertSizing = "bottom";
|
||||||
position = "0 0";
|
profile = "GuiDefaultProfile";
|
||||||
extent = "640 480";
|
|
||||||
minExtent = "8 8";
|
|
||||||
visible = "1";
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "1";
|
||||||
helpTag = "0";
|
helpTag = "0";
|
||||||
|
|
||||||
new GuiConsoleEditCtrl(ConsoleEntry) {
|
new GuiConsoleEditCtrl(ConsoleEntry) {
|
||||||
profile = "ConsoleTextEditProfile";
|
useSiblingScroller = "1";
|
||||||
horizSizing = "width";
|
|
||||||
vertSizing = "top";
|
|
||||||
position = "0 462";
|
|
||||||
extent = "640 18";
|
|
||||||
minExtent = "8 8";
|
|
||||||
visible = "1";
|
|
||||||
altCommand = "ConsoleEntry::eval();";
|
|
||||||
helpTag = "0";
|
|
||||||
maxLength = "255";
|
|
||||||
historySize = "40";
|
historySize = "40";
|
||||||
password = "0";
|
|
||||||
tabComplete = "0";
|
tabComplete = "0";
|
||||||
sinkAllKeyEvents = "1";
|
sinkAllKeyEvents = "1";
|
||||||
useSiblingScroller = "1";
|
password = "0";
|
||||||
|
passwordMask = "*";
|
||||||
|
maxLength = "255";
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "0 750";
|
||||||
|
extent = "1024 18";
|
||||||
|
minExtent = "8 8";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "ConsoleTextEditProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
altCommand = "ConsoleEntry::eval();";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiContainer() {
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "1 728";
|
||||||
|
extent = "1024 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "GuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
|
new GuiBitmapCtrl() {
|
||||||
|
bitmap = "data/ui/art/hudfill.png";
|
||||||
|
color = "255 255 255 255";
|
||||||
|
wrap = "0";
|
||||||
|
position = "0 0";
|
||||||
|
extent = "1024 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiCheckBoxCtrl(ConsoleDlgErrorFilterBtn) {
|
||||||
|
text = "Errors";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "2 2";
|
||||||
|
extent = "113 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiCheckBoxCtrl(ConsoleDlgWarnFilterBtn) {
|
||||||
|
text = "Warnings";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "119 2";
|
||||||
|
extent = "113 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiCheckBoxCtrl(ConsoleDlgNormalFilterBtn) {
|
||||||
|
text = "Normal Messages";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "ToggleButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "236 2";
|
||||||
|
extent = "113 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiCheckBoxProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
new GuiScrollCtrl() {
|
new GuiScrollCtrl() {
|
||||||
internalName = "Scroll";
|
|
||||||
profile = "ConsoleScrollProfile";
|
|
||||||
horizSizing = "width";
|
|
||||||
vertSizing = "height";
|
|
||||||
position = "0 0";
|
|
||||||
extent = "640 462";
|
|
||||||
minExtent = "8 8";
|
|
||||||
visible = "1";
|
|
||||||
helpTag = "0";
|
|
||||||
willFirstRespond = "1";
|
willFirstRespond = "1";
|
||||||
hScrollBar = "alwaysOn";
|
hScrollBar = "alwaysOn";
|
||||||
vScrollBar = "alwaysOn";
|
vScrollBar = "alwaysOn";
|
||||||
lockHorizScroll = "false";
|
lockHorizScroll = "0";
|
||||||
lockVertScroll = "false";
|
lockVertScroll = "0";
|
||||||
constantThumbHeight = "0";
|
constantThumbHeight = "0";
|
||||||
childMargin = "0 0";
|
childMargin = "0 0";
|
||||||
|
mouseWheelScrollSpeed = "-1";
|
||||||
new GuiConsole( ConsoleMessageLogView ) {
|
margin = "0 0 0 0";
|
||||||
profile = "GuiConsoleProfile";
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
position = "0 0";
|
position = "0 0";
|
||||||
|
extent = "1024 730";
|
||||||
|
minExtent = "8 8";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "height";
|
||||||
|
profile = "ConsoleScrollProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
internalName = "Scroll";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
|
new GuiConsole(ConsoleMessageLogView) {
|
||||||
|
position = "1 1";
|
||||||
|
extent = "622 324";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "GuiConsoleProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -173,3 +311,33 @@ function ConsoleMessageLogView::onMessageSelected( %this, %level, %message )
|
||||||
|
|
||||||
EditorOpenFileInTorsion( %fileName, %lineNumber );
|
EditorOpenFileInTorsion( %fileName, %lineNumber );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ConsoleDlg::onWake(%this)
|
||||||
|
{
|
||||||
|
ConsoleDlgErrorFilterBtn.setStateOn(ConsoleMessageLogView.getErrorFilter());
|
||||||
|
ConsoleDlgWarnFilterBtn.setStateOn(ConsoleMessageLogView.getWarnFilter());
|
||||||
|
ConsoleDlgNormalFilterBtn.setStateOn(ConsoleMessageLogView.getNormalFilter());
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConsoleDlgErrorFilterBtn::onClick(%this)
|
||||||
|
{
|
||||||
|
ConsoleMessageLogView.toggleErrorFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConsoleDlgWarnFilterBtn::onClick(%this)
|
||||||
|
{
|
||||||
|
|
||||||
|
ConsoleMessageLogView.toggleWarnFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConsoleDlgNormalFilterBtn::onClick(%this)
|
||||||
|
{
|
||||||
|
ConsoleMessageLogView.toggleNormalFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConsoleMessageLogView::onNewMessage(%this, %errorCount, %warnCount, %normalCount)
|
||||||
|
{
|
||||||
|
ConsoleDlgErrorFilterBtn.setText("(" @ %errorCount @ ") Errors");
|
||||||
|
ConsoleDlgWarnFilterBtn.setText("(" @ %warnCount @ ") Warnings");
|
||||||
|
ConsoleDlgNormalFilterBtn.setText("(" @ %normalCount @ ") Messages");
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue