Table serialization fix, small update to gui editor colour attribute, updated readme.txt
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1180 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
942f6221c3
commit
1608f3f6fe
|
@ -8,7 +8,7 @@ Changes in version 1.5 (... 2008)
|
|||
- added Initial Windows Mobile 6 Version. (30.12.2006 TA)
|
||||
- Windows Mobile 6 SDK
|
||||
- Visual Studio 2005
|
||||
|
||||
|
||||
- Burningvideo: MipMap Selection repaired
|
||||
|
||||
- renamed private Driver function getTextureSizeFromImageSize to getTextureSizeFromSurfaceSize
|
||||
|
@ -39,8 +39,10 @@ Changes in version 1.5 (... 2008)
|
|||
Nodes are now solid or transparent. ( but still more states are needed )
|
||||
|
||||
- GUI:
|
||||
Finally added StarSonata patch with table element and TabControl additions.
|
||||
Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien.
|
||||
- Fixed a bug in CGUISpriteBank which caused a crash when a non-looping animated sprite reached the end of its animation.
|
||||
- Modal screens no longer flash invisible children when rejecting a focus change.
|
||||
- Finally added StarSonata patch with table element and TabControl additions. Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien.
|
||||
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
|
|
|
@ -1063,8 +1063,8 @@ void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit
|
|||
//label = "Row"; label += i; label += "height";
|
||||
//out->addInt(label.c_str(), Rows[i].Height );
|
||||
|
||||
label = "Row"; label += i; label += "ItemCount";
|
||||
out->addInt(label.c_str(), Rows[i].Items.size());
|
||||
//label = "Row"; label += i; label += "ItemCount";
|
||||
//out->addInt(label.c_str(), Rows[i].Items.size());
|
||||
u32 c;
|
||||
for ( c=0; c < Rows[i].Items.size(); ++c )
|
||||
{
|
||||
|
@ -1120,14 +1120,18 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
|
|||
label = "Column"; label += i; label += "width";
|
||||
column.Width = in->getAttributeAsInt(label.c_str());
|
||||
label = "Column"; label += i; label += "OrderingMode";
|
||||
column.OrderingMode = (EGUI_COLUMN_ORDERING) in->getAttributeAsEnumeration(label.c_str(), GUIColumnOrderingNames);
|
||||
|
||||
column.OrderingMode = EGCO_NONE;
|
||||
s32 co = in->getAttributeAsEnumeration(label.c_str(), GUIColumnOrderingNames);
|
||||
if (co > 0)
|
||||
column.OrderingMode = EGUI_COLUMN_ORDERING(co);
|
||||
|
||||
Columns.push_back(column);
|
||||
}
|
||||
|
||||
Rows.clear();
|
||||
u32 rowCount = in->getAttributeAsInt("RowCount");
|
||||
for (i=0;i<rowCount; ++i)
|
||||
for (i=0; i<rowCount; ++i)
|
||||
{
|
||||
core::stringc label;
|
||||
|
||||
|
@ -1139,10 +1143,10 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
|
|||
|
||||
Rows.push_back(row);
|
||||
|
||||
label = "Row"; label += i; label += "ItemCount";
|
||||
u32 itemCount = in->getAttributeAsInt(label.c_str());
|
||||
//label = "Row"; label += i; label += "ItemCount";
|
||||
//u32 itemCount = in->getAttributeAsInt(label.c_str());
|
||||
u32 c;
|
||||
for ( c=0; c < itemCount; ++c )
|
||||
for ( c=0; c < columnCount; ++c )
|
||||
{
|
||||
Cell cell;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "CGUIAttribute.h"
|
||||
#include "IGUIStaticText.h"
|
||||
#include "IGUIScrollBar.h"
|
||||
#include "IGUITabControl.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
@ -15,18 +16,25 @@ namespace gui
|
|||
//
|
||||
CGUIColorAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
|
||||
CGUIAttribute(environment, parent, myParentID),
|
||||
AttribEditBox(0), AttribSliderA(0), AttribSliderR(0), AttribSliderG(0), AttribSliderB(0)
|
||||
AttribEditBox(0), AttribSliderA(0), AttribSliderR(0), AttribSliderG(0), AttribSliderB(0),
|
||||
AttribColor(0)
|
||||
{
|
||||
s32 fh = Environment->getSkin()->getFont()->getDimension(L"A").Height;
|
||||
|
||||
core::rect<s32> r = getAbsolutePosition();
|
||||
core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 5,
|
||||
r.getWidth() - 5,
|
||||
Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 10 );
|
||||
core::rect<s32> r3 = r2;
|
||||
core::rect<s32> r0(getAbsolutePosition()),
|
||||
r2(0, fh + 5, r0.getWidth() - 5, fh*2 + 10 ),
|
||||
r3(r2),
|
||||
r4(r2.getWidth() - 20, 3, r2.getWidth() - 3, r2.getHeight()-3);
|
||||
|
||||
s32 h=5;
|
||||
r2 += core::position2di(0, h*4 + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)*4);
|
||||
r3.LowerRightCorner.Y = r3.UpperLeftCorner.Y + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH);
|
||||
AttribColor = Environment->addTab(r4, this, 0);
|
||||
AttribColor->grab();
|
||||
AttribColor->setDrawBackground(true);
|
||||
AttribColor->setSubElement(true);
|
||||
AttribColor->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
|
||||
|
||||
s32 h=2;
|
||||
r2 += core::position2di(0, h*4 + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)*2);
|
||||
r3.LowerRightCorner.Y = r3.UpperLeftCorner.Y + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)/2;
|
||||
|
||||
AttribSliderA = environment->addScrollBar(true, r3, this, -1);
|
||||
AttribSliderA->setMax(255);
|
||||
|
@ -74,6 +82,8 @@ namespace gui
|
|||
AttribSliderB->drop();
|
||||
if (AttribEditBox)
|
||||
AttribEditBox->drop();
|
||||
if (AttribColor)
|
||||
AttribColor->drop();
|
||||
}
|
||||
|
||||
virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
|
||||
|
@ -85,6 +95,7 @@ namespace gui
|
|||
AttribSliderG->setPos(col.getGreen());
|
||||
AttribSliderB->setPos(col.getBlue());
|
||||
AttribEditBox->setText( attribs->getAttributeAsStringW(attribIndex).c_str() );
|
||||
AttribColor->setBackgroundColor(col);
|
||||
|
||||
CGUIAttribute::setAttrib(attribs, attribIndex);
|
||||
}
|
||||
|
@ -108,6 +119,8 @@ namespace gui
|
|||
AttribSliderR->setPos(col.getRed());
|
||||
AttribSliderG->setPos(col.getGreen());
|
||||
AttribSliderB->setPos(col.getBlue());
|
||||
// update colour
|
||||
AttribColor->setBackgroundColor(col);
|
||||
}
|
||||
break;
|
||||
case EGET_SCROLL_BAR_CHANGED:
|
||||
|
@ -118,6 +131,8 @@ namespace gui
|
|||
|
||||
Attribs->setAttribute(Index, col);
|
||||
AttribEditBox->setText( Attribs->getAttributeAsStringW(Index).c_str());
|
||||
// update colour
|
||||
AttribColor->setBackgroundColor(col);
|
||||
}
|
||||
return updateAttrib();
|
||||
}
|
||||
|
@ -149,6 +164,7 @@ namespace gui
|
|||
IGUIScrollBar* AttribSliderG;
|
||||
IGUIScrollBar* AttribSliderB;
|
||||
IGUIEditBox* AttribEditBox;
|
||||
IGUITab* AttribColor;
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
|
|
Loading…
Reference in New Issue