"include/svn:/svn.code.sf.net/p/irrlicht/code/trunk@1235" did not exist on "f9a0f21befea125b45ca8a6574659ccb1862a3cd"
Commit 1608f3f6 authored by bitplane's avatar bitplane

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-e03cc46cb475
parent 942f6221
...@@ -39,8 +39,10 @@ Changes in version 1.5 (... 2008) ...@@ -39,8 +39,10 @@ Changes in version 1.5 (... 2008)
Nodes are now solid or transparent. ( but still more states are needed ) Nodes are now solid or transparent. ( but still more states are needed )
- GUI: - GUI:
Finally added StarSonata patch with table element and TabControl additions. - Fixed a bug in CGUISpriteBank which caused a crash when a non-looping animated sprite reached the end of its animation.
Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien. - 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 ...@@ -1063,8 +1063,8 @@ void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit
//label = "Row"; label += i; label += "height"; //label = "Row"; label += i; label += "height";
//out->addInt(label.c_str(), Rows[i].Height ); //out->addInt(label.c_str(), Rows[i].Height );
label = "Row"; label += i; label += "ItemCount"; //label = "Row"; label += i; label += "ItemCount";
out->addInt(label.c_str(), Rows[i].Items.size()); //out->addInt(label.c_str(), Rows[i].Items.size());
u32 c; u32 c;
for ( c=0; c < Rows[i].Items.size(); ++c ) for ( c=0; c < Rows[i].Items.size(); ++c )
{ {
...@@ -1120,14 +1120,18 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri ...@@ -1120,14 +1120,18 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
label = "Column"; label += i; label += "width"; label = "Column"; label += i; label += "width";
column.Width = in->getAttributeAsInt(label.c_str()); column.Width = in->getAttributeAsInt(label.c_str());
label = "Column"; label += i; label += "OrderingMode"; 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); Columns.push_back(column);
} }
Rows.clear(); Rows.clear();
u32 rowCount = in->getAttributeAsInt("RowCount"); u32 rowCount = in->getAttributeAsInt("RowCount");
for (i=0;i<rowCount; ++i) for (i=0; i<rowCount; ++i)
{ {
core::stringc label; core::stringc label;
...@@ -1139,10 +1143,10 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri ...@@ -1139,10 +1143,10 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
Rows.push_back(row); Rows.push_back(row);
label = "Row"; label += i; label += "ItemCount"; //label = "Row"; label += i; label += "ItemCount";
u32 itemCount = in->getAttributeAsInt(label.c_str()); //u32 itemCount = in->getAttributeAsInt(label.c_str());
u32 c; u32 c;
for ( c=0; c < itemCount; ++c ) for ( c=0; c < columnCount; ++c )
{ {
Cell cell; Cell cell;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "CGUIAttribute.h" #include "CGUIAttribute.h"
#include "IGUIStaticText.h" #include "IGUIStaticText.h"
#include "IGUIScrollBar.h" #include "IGUIScrollBar.h"
#include "IGUITabControl.h"
namespace irr namespace irr
{ {
...@@ -15,18 +16,25 @@ namespace gui ...@@ -15,18 +16,25 @@ namespace gui
// //
CGUIColorAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) : CGUIColorAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
CGUIAttribute(environment, parent, 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> r0(getAbsolutePosition()),
core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 5, r2(0, fh + 5, r0.getWidth() - 5, fh*2 + 10 ),
r.getWidth() - 5, r3(r2),
Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 10 ); r4(r2.getWidth() - 20, 3, r2.getWidth() - 3, r2.getHeight()-3);
core::rect<s32> r3 = r2;
s32 h=5; AttribColor = Environment->addTab(r4, this, 0);
r2 += core::position2di(0, h*4 + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)*4); AttribColor->grab();
r3.LowerRightCorner.Y = r3.UpperLeftCorner.Y + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH); 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 = environment->addScrollBar(true, r3, this, -1);
AttribSliderA->setMax(255); AttribSliderA->setMax(255);
...@@ -74,6 +82,8 @@ namespace gui ...@@ -74,6 +82,8 @@ namespace gui
AttribSliderB->drop(); AttribSliderB->drop();
if (AttribEditBox) if (AttribEditBox)
AttribEditBox->drop(); AttribEditBox->drop();
if (AttribColor)
AttribColor->drop();
} }
virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex) virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
...@@ -85,6 +95,7 @@ namespace gui ...@@ -85,6 +95,7 @@ namespace gui
AttribSliderG->setPos(col.getGreen()); AttribSliderG->setPos(col.getGreen());
AttribSliderB->setPos(col.getBlue()); AttribSliderB->setPos(col.getBlue());
AttribEditBox->setText( attribs->getAttributeAsStringW(attribIndex).c_str() ); AttribEditBox->setText( attribs->getAttributeAsStringW(attribIndex).c_str() );
AttribColor->setBackgroundColor(col);
CGUIAttribute::setAttrib(attribs, attribIndex); CGUIAttribute::setAttrib(attribs, attribIndex);
} }
...@@ -108,6 +119,8 @@ namespace gui ...@@ -108,6 +119,8 @@ namespace gui
AttribSliderR->setPos(col.getRed()); AttribSliderR->setPos(col.getRed());
AttribSliderG->setPos(col.getGreen()); AttribSliderG->setPos(col.getGreen());
AttribSliderB->setPos(col.getBlue()); AttribSliderB->setPos(col.getBlue());
// update colour
AttribColor->setBackgroundColor(col);
} }
break; break;
case EGET_SCROLL_BAR_CHANGED: case EGET_SCROLL_BAR_CHANGED:
...@@ -118,6 +131,8 @@ namespace gui ...@@ -118,6 +131,8 @@ namespace gui
Attribs->setAttribute(Index, col); Attribs->setAttribute(Index, col);
AttribEditBox->setText( Attribs->getAttributeAsStringW(Index).c_str()); AttribEditBox->setText( Attribs->getAttributeAsStringW(Index).c_str());
// update colour
AttribColor->setBackgroundColor(col);
} }
return updateAttrib(); return updateAttrib();
} }
...@@ -149,6 +164,7 @@ namespace gui ...@@ -149,6 +164,7 @@ namespace gui
IGUIScrollBar* AttribSliderG; IGUIScrollBar* AttribSliderG;
IGUIScrollBar* AttribSliderB; IGUIScrollBar* AttribSliderB;
IGUIEditBox* AttribEditBox; IGUIEditBox* AttribEditBox;
IGUITab* AttribColor;
}; };
} // namespace gui } // namespace gui
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment