X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fobjectproperties.cpp;h=70ddb600e953cca5f24f72853fcd34ed6d664095;hb=d3d1850e950f3c38c8ef983228013fc82c287ec4;hp=af090335cf10313afc15e430c8e25e5b33215dee;hpb=b6af6301c76d3664d969a72d8d889020093ac848;p=r2c2.git diff --git a/source/designer/objectproperties.cpp b/source/designer/objectproperties.cpp index af09033..70ddb60 100644 --- a/source/designer/objectproperties.cpp +++ b/source/designer/objectproperties.cpp @@ -63,6 +63,11 @@ ObjectProperties::ObjectProperties(const Selection &selection): lbl_title->set_text("Beam gate properties"); properties = new BeamGateProperties(*this, *gate); } + else if(Terrain *terrain = dynamic_cast(object)) + { + lbl_title->set_text("Terrain properties"); + properties = new TerrainProperties(*this, *terrain); + } } if(!properties) @@ -169,3 +174,17 @@ void ObjectProperties::BeamGateProperties::apply() { gate.set_address(lexical_cast(ent_address->get_text())); } + + +ObjectProperties::TerrainProperties::TerrainProperties(ObjectProperties &p, Terrain &t): + terrain(t), + ent_width(p.add_property("Width", lexical_cast(terrain.get_width()), 4)), + ent_height(p.add_property("Height", lexical_cast(terrain.get_height()), 4)) +{ } + +void ObjectProperties::TerrainProperties::apply() +{ + unsigned width = lexical_cast(ent_width->get_text()); + unsigned height = lexical_cast(ent_height->get_text()); + terrain.set_size(width, height); +}