mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Initial import.
git-svn-id: svn://localhost@37 8062f311-0dae-4547-b526-b8ab9ac864a5
This commit is contained in:
163
Extensions/PrimitiveDrawing/DrawerActions.cpp
Normal file
163
Extensions/PrimitiveDrawing/DrawerActions.cpp
Normal file
@@ -0,0 +1,163 @@
|
||||
#include "GDL/Access.h"
|
||||
#include "GDL/Instruction.h"
|
||||
#include "GDL/ObjectsConcerned.h"
|
||||
#include "GDL/RuntimeScene.h"
|
||||
#include "GDL/StdAlgo.h"
|
||||
#include "DrawerObject.h"
|
||||
|
||||
bool DrawerObject::ActOutlineSize( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Set )
|
||||
SetOutlineSize( static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Add )
|
||||
SetOutlineSize( GetOutlineSize() + static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Substract )
|
||||
SetOutlineSize( GetOutlineSize() - static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Multiply )
|
||||
SetOutlineSize( GetOutlineSize() * static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Divide )
|
||||
SetOutlineSize( GetOutlineSize() / static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify fill color opacity
|
||||
*/
|
||||
bool DrawerObject::ActFillOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Set )
|
||||
SetFillOpacity( static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Add )
|
||||
SetFillOpacity( GetFillOpacity() + static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Substract )
|
||||
SetFillOpacity( GetFillOpacity() - static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Multiply )
|
||||
SetFillOpacity( GetFillOpacity() * static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Divide )
|
||||
SetFillOpacity( GetFillOpacity() / static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify opacity
|
||||
*/
|
||||
bool DrawerObject::ActOutlineOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Set )
|
||||
SetOutlineOpacity( static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Add )
|
||||
SetOutlineOpacity( GetOutlineOpacity() + static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Substract )
|
||||
SetOutlineOpacity( GetOutlineOpacity() - static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Multiply )
|
||||
SetOutlineOpacity( GetOutlineOpacity() * static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
else if ( action.GetParameter( 2 ).GetAsModOperator() == GDExpression::Divide )
|
||||
SetOutlineOpacity( GetOutlineOpacity() / static_cast<int>(eval.EvalExp( action.GetParameter( 1 ), shared_from_this())));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the fill color
|
||||
*/
|
||||
bool DrawerObject::ActFillColor( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
vector < string > colors = SpliterStringToVector <string> (eval.EvalTxt(action.GetParameter(1), shared_from_this()), ';');
|
||||
|
||||
if ( colors.size() < 3 ) return false; //La couleur est incorrecte
|
||||
|
||||
fillColorR = toInt(colors[0]);
|
||||
fillColorG = toInt(colors[1]);
|
||||
fillColorB = toInt(colors[2]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the color of the outline
|
||||
*/
|
||||
bool DrawerObject::ActOutlineColor( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
vector < string > colors = SpliterStringToVector <string> (eval.EvalTxt(action.GetParameter(1), shared_from_this()), ';');
|
||||
|
||||
if ( colors.size() < 3 ) return false; //La couleur est incorrecte
|
||||
|
||||
outlineColorR = toInt(colors[0]);
|
||||
outlineColorG = toInt(colors[1]);
|
||||
outlineColorB = toInt(colors[2]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DrawerObject::ActRectangle( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
float Xgap = absoluteCoordinates ? 0 : GetX();
|
||||
float Ygap = absoluteCoordinates ? 0 : GetY();
|
||||
|
||||
shapesToDraw.push_back(sf::Shape::Rectangle(eval.EvalExp(action.GetParameter(1), shared_from_this())+Xgap,
|
||||
eval.EvalExp(action.GetParameter(2), shared_from_this())+Ygap,
|
||||
eval.EvalExp(action.GetParameter(3), shared_from_this())+Xgap,
|
||||
eval.EvalExp(action.GetParameter(4), shared_from_this())+Ygap,
|
||||
sf::Color(fillColorR, fillColorG, fillColorB, fillOpacity),
|
||||
outlineSize,
|
||||
sf::Color(outlineColorR, outlineColorG, outlineColorB, outlineOpacity)
|
||||
));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DrawerObject::ActLine( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
float Xgap = absoluteCoordinates ? 0 : GetX();
|
||||
float Ygap = absoluteCoordinates ? 0 : GetY();
|
||||
|
||||
shapesToDraw.push_back(sf::Shape::Line(eval.EvalExp(action.GetParameter(1), shared_from_this())+Xgap,
|
||||
eval.EvalExp(action.GetParameter(2), shared_from_this())+Ygap,
|
||||
eval.EvalExp(action.GetParameter(3), shared_from_this())+Xgap,
|
||||
eval.EvalExp(action.GetParameter(4), shared_from_this())+Ygap,
|
||||
eval.EvalExp(action.GetParameter(5), shared_from_this()),
|
||||
sf::Color(fillColorR, fillColorG, fillColorB, fillOpacity),
|
||||
outlineSize,
|
||||
sf::Color(outlineColorR, outlineColorG, outlineColorB, outlineOpacity)
|
||||
));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DrawerObject::ActCircle( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
float Xgap = absoluteCoordinates ? 0 : GetX();
|
||||
float Ygap = absoluteCoordinates ? 0 : GetY();
|
||||
|
||||
shapesToDraw.push_back(sf::Shape::Circle(eval.EvalExp(action.GetParameter(1), shared_from_this())+Xgap,
|
||||
eval.EvalExp(action.GetParameter(2), shared_from_this())+Ygap,
|
||||
eval.EvalExp(action.GetParameter(3), shared_from_this()),
|
||||
sf::Color(fillColorR, fillColorG, fillColorB, fillOpacity),
|
||||
outlineSize,
|
||||
sf::Color(outlineColorR, outlineColorG, outlineColorB, outlineOpacity)
|
||||
));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ActCopyImageOnAnother( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval )
|
||||
{
|
||||
std::map < string, sf::Image >::iterator dest = scene->game->imageManager.images.find(eval.EvalTxt(action.GetParameter(0)));
|
||||
if ( dest == scene->game->imageManager.images.end() ) return false;
|
||||
|
||||
std::map < string, sf::Image >::const_iterator src = scene->game->imageManager.images.find(eval.EvalTxt(action.GetParameter(1)));
|
||||
if ( src == scene->game->imageManager.images.end() ) return false;
|
||||
|
||||
//Make sure the coordinates are correct.
|
||||
int destX = eval.EvalExp(action.GetParameter(2));
|
||||
if ( destX < 0 || static_cast<unsigned>(destX) >= dest->second.GetWidth()) return false;
|
||||
|
||||
int destY = eval.EvalExp(action.GetParameter(3));
|
||||
if ( destY < 0 || static_cast<unsigned>(destY) >= dest->second.GetWidth()) return false;
|
||||
|
||||
dest->second.Copy(src->second, destX, destY);
|
||||
|
||||
return true;
|
||||
}
|
63
Extensions/PrimitiveDrawing/DrawerConditions.cpp
Normal file
63
Extensions/PrimitiveDrawing/DrawerConditions.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
#include "GDL/Access.h"
|
||||
#include "GDL/Instruction.h"
|
||||
#include "GDL/ObjectsConcerned.h"
|
||||
#include "GDL/RuntimeScene.h"
|
||||
#include "DrawerObject.h"
|
||||
|
||||
bool DrawerObject::CondOutlineSize( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & condition, const Evaluateur & eval )
|
||||
{
|
||||
//optimisation : le test de signe en premier
|
||||
if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetOutlineSize() == eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetOutlineSize() < eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetOutlineSize() > eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetOutlineSize() <= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetOutlineSize() >= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetOutlineSize() != eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) )
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test the fill color opacity
|
||||
*/
|
||||
bool DrawerObject::CondFillOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & condition, const Evaluateur & eval )
|
||||
{
|
||||
//optimisation : le test de signe en premier
|
||||
if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetFillOpacity() == eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetFillOpacity() < eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetFillOpacity() > eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetFillOpacity() <= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetFillOpacity() >= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetFillOpacity() != eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) )
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the opacity
|
||||
*/
|
||||
bool DrawerObject::CondOutlineOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & condition, const Evaluateur & eval )
|
||||
{
|
||||
//optimisation : le test de signe en premier
|
||||
if (( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Equal && GetOutlineOpacity() == eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Inferior && GetOutlineOpacity() < eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Superior && GetOutlineOpacity() > eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::InferiorOrEqual && GetOutlineOpacity() <= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::SuperiorOrEqual && GetOutlineOpacity() >= eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) ) ||
|
||||
( condition.GetParameter( 2 ).GetAsCompOperator() == GDExpression::Different && GetOutlineOpacity() != eval.EvalExp( condition.GetParameter( 1 ), shared_from_this() ) )
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
15
Extensions/PrimitiveDrawing/DrawerExpressions.cpp
Normal file
15
Extensions/PrimitiveDrawing/DrawerExpressions.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "GDL/Object.h"
|
||||
#include "GDL/ExpressionInstruction.h"
|
||||
#include "GDL/RuntimeScene.h"
|
||||
#include "GDL/ObjectsConcerned.h"
|
||||
#include "DrawerObject.h"
|
||||
|
||||
double DrawerObject::ExpFillOpacity( const RuntimeScene * scene, ObjectsConcerned * objectsConcerned, ObjSPtr obj1, ObjSPtr obj2, const ExpressionInstruction & exprInstruction )
|
||||
{
|
||||
return fillOpacity;
|
||||
}
|
||||
|
||||
double DrawerObject::ExpOutlineOpacity( const RuntimeScene * scene, ObjectsConcerned * objectsConcerned, ObjSPtr obj1, ObjSPtr obj2, const ExpressionInstruction & exprInstruction )
|
||||
{
|
||||
return outlineOpacity;
|
||||
}
|
425
Extensions/PrimitiveDrawing/DrawerObject.cpp
Normal file
425
Extensions/PrimitiveDrawing/DrawerObject.cpp
Normal file
@@ -0,0 +1,425 @@
|
||||
#include "DrawerObject.h"
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "GDL/Object.h"
|
||||
#include "GDL/Access.h"
|
||||
#include "GDL/ImageManager.h"
|
||||
#include "GDL/tinyxml.h"
|
||||
#include "GDL/FontManager.h"
|
||||
#include "GDL/Position.h"
|
||||
|
||||
#ifdef GDE
|
||||
#include <wx/wx.h>
|
||||
#include "GDL/StdAlgo.h"
|
||||
#include "GDL/MainEditorCommand.h"
|
||||
#include "DrawerObjectEditor.h"
|
||||
#endif
|
||||
|
||||
DrawerObject::DrawerObject(std::string name_) :
|
||||
Object(name_),
|
||||
fillColorR( 255 ),
|
||||
fillColorG( 255 ),
|
||||
fillColorB( 255 ),
|
||||
fillOpacity( 255 ),
|
||||
outlineSize(1),
|
||||
outlineColorR(0),
|
||||
outlineColorG(0),
|
||||
outlineColorB(0),
|
||||
outlineOpacity(255),
|
||||
absoluteCoordinates(true)
|
||||
{
|
||||
}
|
||||
|
||||
void DrawerObject::LoadFromXml(const TiXmlElement * object)
|
||||
{
|
||||
if ( object->FirstChildElement( "FillColor" ) == NULL ||
|
||||
object->FirstChildElement( "FillColor" )->Attribute("r") == NULL ||
|
||||
object->FirstChildElement( "FillColor" )->Attribute("g") == NULL ||
|
||||
object->FirstChildElement( "FillColor" )->Attribute("b") == NULL )
|
||||
{
|
||||
cout << "Les informations concernant la couleur de remplissage d'un objet Drawer manquent.";
|
||||
}
|
||||
else
|
||||
{
|
||||
int r = 255;
|
||||
int g = 255;
|
||||
int b = 255;
|
||||
object->FirstChildElement("FillColor")->QueryIntAttribute("r", &r);
|
||||
object->FirstChildElement("FillColor")->QueryIntAttribute("g", &g);
|
||||
object->FirstChildElement("FillColor")->QueryIntAttribute("b", &b);
|
||||
|
||||
SetFillColor(r,g,b);
|
||||
}
|
||||
|
||||
if ( object->FirstChildElement( "FillOpacity" ) == NULL ||
|
||||
object->FirstChildElement( "FillOpacity" )->Attribute("value") == NULL )
|
||||
{
|
||||
cout << "Les informations concernant l'opacit<69> du remplissage d'un objet Drawer manquent.";
|
||||
}
|
||||
else
|
||||
{
|
||||
object->FirstChildElement("FillOpacity")->QueryIntAttribute("value", &fillOpacity);
|
||||
}
|
||||
|
||||
|
||||
if ( object->FirstChildElement( "OutlineColor" ) == NULL ||
|
||||
object->FirstChildElement( "OutlineColor" )->Attribute("r") == NULL ||
|
||||
object->FirstChildElement( "OutlineColor" )->Attribute("g") == NULL ||
|
||||
object->FirstChildElement( "OutlineColor" )->Attribute("b") == NULL )
|
||||
{
|
||||
cout << "Les informations concernant la couleur du contour d'un objet Drawer manquent.";
|
||||
}
|
||||
else
|
||||
{
|
||||
int r = 255;
|
||||
int g = 255;
|
||||
int b = 255;
|
||||
object->FirstChildElement("OutlineColor")->QueryIntAttribute("r", &r);
|
||||
object->FirstChildElement("OutlineColor")->QueryIntAttribute("g", &g);
|
||||
object->FirstChildElement("OutlineColor")->QueryIntAttribute("b", &b);
|
||||
|
||||
SetOutlineColor(r,g,b);
|
||||
}
|
||||
|
||||
if ( object->FirstChildElement( "OutlineOpacity" ) == NULL ||
|
||||
object->FirstChildElement( "OutlineOpacity" )->Attribute("value") == NULL )
|
||||
{
|
||||
cout << "Les informations concernant l'opacit<69> du contour d'un objet Drawer manquent.";
|
||||
}
|
||||
else
|
||||
{
|
||||
object->FirstChildElement("OutlineOpacity")->QueryIntAttribute("value", &outlineOpacity);
|
||||
}
|
||||
|
||||
if ( object->FirstChildElement( "OutlineSize" ) == NULL ||
|
||||
object->FirstChildElement( "OutlineSize" )->Attribute("value") == NULL )
|
||||
{
|
||||
cout << "Les informations concernant la taille du contour d'un objet Drawer manquent.";
|
||||
}
|
||||
else
|
||||
{
|
||||
object->FirstChildElement("OutlineSize")->QueryIntAttribute("value", &outlineSize);
|
||||
}
|
||||
|
||||
absoluteCoordinates = true;
|
||||
if ( object->FirstChildElement( "AbsoluteCoordinates" ) == NULL ||
|
||||
object->FirstChildElement( "AbsoluteCoordinates" )->Attribute("value") == NULL )
|
||||
{
|
||||
cout << "Les informations concernant le type des coordonn<6E>es d'un objet Drawer manquent.";
|
||||
}
|
||||
else
|
||||
{
|
||||
string result = object->FirstChildElement("AbsoluteCoordinates")->Attribute("value");
|
||||
if ( result == "false" )
|
||||
absoluteCoordinates = false;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawerObject::SaveToXml(TiXmlElement * object)
|
||||
{
|
||||
TiXmlElement * fillOpacityElem = new TiXmlElement( "FillOpacity" );
|
||||
object->LinkEndChild( fillOpacityElem );
|
||||
fillOpacityElem->SetAttribute("value", outlineOpacity);
|
||||
|
||||
TiXmlElement * fillColorElem = new TiXmlElement( "FillColor" );
|
||||
object->LinkEndChild( fillColorElem );
|
||||
fillColorElem->SetAttribute("r", fillColorR);
|
||||
fillColorElem->SetAttribute("g", fillColorG);
|
||||
fillColorElem->SetAttribute("b", fillColorB);
|
||||
|
||||
TiXmlElement * outlineSizeElem = new TiXmlElement( "OutlineSize" );
|
||||
object->LinkEndChild( outlineSizeElem );
|
||||
outlineSizeElem->SetAttribute("value", outlineSize);
|
||||
|
||||
TiXmlElement * outlineOpacityElem = new TiXmlElement( "OutlineOpacity" );
|
||||
object->LinkEndChild( outlineOpacityElem );
|
||||
outlineOpacityElem->SetAttribute("value", outlineOpacity);
|
||||
|
||||
TiXmlElement * outlineColorElem = new TiXmlElement( "OutlineColor" );
|
||||
object->LinkEndChild( outlineColorElem );
|
||||
outlineColorElem->SetAttribute("r", outlineColorR);
|
||||
outlineColorElem->SetAttribute("g", outlineColorG);
|
||||
outlineColorElem->SetAttribute("b", outlineColorB);
|
||||
|
||||
TiXmlElement * absoluteCoordinatesElem = new TiXmlElement( "AbsoluteCoordinates" );
|
||||
object->LinkEndChild( absoluteCoordinatesElem );
|
||||
if ( absoluteCoordinates )
|
||||
absoluteCoordinatesElem->SetAttribute("value", "true");
|
||||
else
|
||||
absoluteCoordinatesElem->SetAttribute("value", "false");
|
||||
}
|
||||
|
||||
bool DrawerObject::LoadResources(const ImageManager & imageMgr )
|
||||
{
|
||||
//No ressources to load.
|
||||
#if defined(GDE)
|
||||
edittimeIconImage.LoadFromFile("Extensions/primitivedrawingicon.png");
|
||||
edittimeIcon.SetImage(edittimeIconImage);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update animation and direction from the inital position
|
||||
*/
|
||||
bool DrawerObject::InitializeFromInitialPosition(const InitialPosition & position)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render object at runtime
|
||||
*/
|
||||
bool DrawerObject::Draw( sf::RenderWindow& window )
|
||||
{
|
||||
//Don't draw anything if hidden
|
||||
if ( hidden )
|
||||
{
|
||||
shapesToDraw.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0;i<shapesToDraw.size();++i)
|
||||
window.Draw(shapesToDraw[i]);
|
||||
|
||||
shapesToDraw.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef GDE
|
||||
/**
|
||||
* Render object at edittime
|
||||
*/
|
||||
bool DrawerObject::DrawEdittime(sf::RenderWindow& renderWindow)
|
||||
{
|
||||
edittimeIcon.SetPosition(GetX(), GetY());
|
||||
renderWindow.Draw(edittimeIcon);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DrawerObject::GenerateThumbnail(const Game & game, wxBitmap & thumbnail)
|
||||
{
|
||||
thumbnail = wxBitmap("Extensions/primitivedrawingicon.png", wxBITMAP_TYPE_ANY);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DrawerObject::EditObject( wxWindow* parent, Game & game, MainEditorCommand & mainEditorCommand )
|
||||
{
|
||||
DrawerObjectEditor dialog(parent, game, *this, mainEditorCommand);
|
||||
dialog.ShowModal();
|
||||
}
|
||||
|
||||
wxPanel * DrawerObject::CreateInitialPositionPanel( wxWindow* parent, const Game & game_, const Scene & scene_, const InitialPosition & position )
|
||||
{
|
||||
//TODO
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void DrawerObject::UpdateInitialPositionFromPanel(wxPanel * panel, InitialPosition & position)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
void DrawerObject::GetPropertyForDebugger(unsigned int propertyNb, string & name, string & value) const
|
||||
{
|
||||
if ( propertyNb == 0 ) {name = _("Couleur de remplissage"); value = toString(fillColorR)+";"+toString(fillColorG)+";"+toString(fillColorB);}
|
||||
else if ( propertyNb == 1 ) {name = _("Opacit<EFBFBD> du remplissage"); value = toString(fillOpacity);}
|
||||
else if ( propertyNb == 2 ) {name = _("Taille du contour"); value = toString(outlineSize);}
|
||||
else if ( propertyNb == 3 ) {name = _("Couleur du contour"); value = toString(outlineColorR)+";"+toString(outlineColorG)+";"+toString(outlineColorB);}
|
||||
else if ( propertyNb == 4 ) {name = _("Opacit<EFBFBD> du contour"); value = toString(outlineOpacity);}
|
||||
}
|
||||
|
||||
bool DrawerObject::ChangeProperty(unsigned int propertyNb, string newValue)
|
||||
{
|
||||
if ( propertyNb == 0 )
|
||||
{
|
||||
string r, gb, g, b;
|
||||
{
|
||||
size_t separationPos = newValue.find(";");
|
||||
|
||||
if ( separationPos > newValue.length())
|
||||
return false;
|
||||
|
||||
r = newValue.substr(0, separationPos);
|
||||
gb = newValue.substr(separationPos+1, newValue.length());
|
||||
}
|
||||
|
||||
{
|
||||
size_t separationPos = gb.find(";");
|
||||
|
||||
if ( separationPos > gb.length())
|
||||
return false;
|
||||
|
||||
g = gb.substr(0, separationPos);
|
||||
b = gb.substr(separationPos+1, gb.length());
|
||||
}
|
||||
|
||||
SetFillColor(toInt(r), toInt(g), toInt(b));
|
||||
}
|
||||
else if ( propertyNb == 1 ) { SetFillOpacity(toInt(newValue)); }
|
||||
else if ( propertyNb == 2 ) { SetOutlineSize(toInt(newValue)); }
|
||||
else if ( propertyNb == 3 )
|
||||
{
|
||||
string r, gb, g, b;
|
||||
{
|
||||
size_t separationPos = newValue.find(";");
|
||||
|
||||
if ( separationPos > newValue.length())
|
||||
return false;
|
||||
|
||||
r = newValue.substr(0, separationPos);
|
||||
gb = newValue.substr(separationPos+1, newValue.length());
|
||||
}
|
||||
|
||||
{
|
||||
size_t separationPos = gb.find(";");
|
||||
|
||||
if ( separationPos > gb.length())
|
||||
return false;
|
||||
|
||||
g = gb.substr(0, separationPos);
|
||||
b = gb.substr(separationPos+1, gb.length());
|
||||
}
|
||||
|
||||
SetOutlineColor(toInt(r), toInt(g), toInt(b));
|
||||
}
|
||||
else if ( propertyNb == 4 ) { SetOutlineOpacity(toInt(newValue)); }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int DrawerObject::GetNumberOfProperties() const
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get the real X position of the sprite
|
||||
*/
|
||||
float DrawerObject::GetDrawableX() const
|
||||
{
|
||||
return GetX();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the real Y position of the text
|
||||
*/
|
||||
float DrawerObject::GetDrawableY() const
|
||||
{
|
||||
return GetY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Width
|
||||
*/
|
||||
float DrawerObject::GetWidth() const
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
/**
|
||||
* Height
|
||||
*/
|
||||
float DrawerObject::GetHeight() const
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
/**
|
||||
* X center is computed with text rectangle
|
||||
*/
|
||||
float DrawerObject::GetCenterX() const
|
||||
{
|
||||
return 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* Y center is computed with text rectangle
|
||||
*/
|
||||
float DrawerObject::GetCenterY() const
|
||||
{
|
||||
return 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* Nothing to do when updating time
|
||||
*/
|
||||
void DrawerObject::UpdateTime(float)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the color filter of the sprite object
|
||||
*/
|
||||
void DrawerObject::SetFillColor( unsigned int r, unsigned int g, unsigned int b )
|
||||
{
|
||||
fillColorR = r;
|
||||
fillColorG = g;
|
||||
fillColorB = b;
|
||||
}
|
||||
|
||||
void DrawerObject::SetFillOpacity(int val)
|
||||
{
|
||||
if ( val > 255 )
|
||||
val = 255;
|
||||
else if ( val < 0 )
|
||||
val = 0;
|
||||
|
||||
fillOpacity = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the color filter of the sprite object
|
||||
*/
|
||||
void DrawerObject::SetOutlineColor( unsigned int r, unsigned int g, unsigned int b )
|
||||
{
|
||||
outlineColorR = r;
|
||||
outlineColorG = g;
|
||||
outlineColorB = b;
|
||||
}
|
||||
|
||||
void DrawerObject::SetOutlineOpacity(int val)
|
||||
{
|
||||
if ( val > 255 )
|
||||
val = 255;
|
||||
else if ( val < 0 )
|
||||
val = 0;
|
||||
|
||||
outlineOpacity = val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function destroying an extension Object.
|
||||
* Game Develop does not delete directly extension object
|
||||
* to avoid overloaded new/delete conflicts.
|
||||
*/
|
||||
void DestroyDrawerObject(Object * object)
|
||||
{
|
||||
delete object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function creating an extension Object.
|
||||
* Game Develop can not directly create an extension object
|
||||
*/
|
||||
Object * CreateDrawerObject(std::string name)
|
||||
{
|
||||
return new DrawerObject(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function creating an extension Object from another.
|
||||
* Game Develop can not directly create an extension object.
|
||||
*
|
||||
* Note that it is safe to do the static cast, as this function
|
||||
* is called owing to the typeId of the object to copy.
|
||||
*/
|
||||
Object * CreateDrawerObjectByCopy(Object * object)
|
||||
{
|
||||
return new DrawerObject(*static_cast<DrawerObject *>(object));
|
||||
}
|
144
Extensions/PrimitiveDrawing/DrawerObject.h
Normal file
144
Extensions/PrimitiveDrawing/DrawerObject.h
Normal file
@@ -0,0 +1,144 @@
|
||||
#ifndef DRAWEROBJECT_H
|
||||
#define DRAWEROBJECT_H
|
||||
|
||||
#include "GDL/Object.h"
|
||||
#include <SFML/Graphics.hpp>
|
||||
class Evaluateur;
|
||||
class ImageManager;
|
||||
class RuntimeScene;
|
||||
class Object;
|
||||
class ExpressionInstruction;
|
||||
class ObjectsConcerned;
|
||||
class ImageManager;
|
||||
class InitialPosition;
|
||||
#ifdef GDE
|
||||
class wxBitmap;
|
||||
class Game;
|
||||
class wxWindow;
|
||||
class MainEditorCommand;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Drawer object can draw primitive shapes
|
||||
*/
|
||||
class DrawerObject : public Object
|
||||
{
|
||||
public :
|
||||
|
||||
DrawerObject(std::string name_);
|
||||
virtual ~DrawerObject() {};
|
||||
|
||||
virtual bool LoadResources(const ImageManager & imageMgr );
|
||||
virtual bool InitializeFromInitialPosition(const InitialPosition & position);
|
||||
|
||||
virtual bool Draw(sf::RenderWindow& main_window);
|
||||
|
||||
#ifdef GDE
|
||||
virtual bool DrawEdittime(sf::RenderWindow& main_window);
|
||||
virtual bool GenerateThumbnail(const Game & game, wxBitmap & thumbnail);
|
||||
|
||||
virtual void EditObject( wxWindow* parent, Game & game_, MainEditorCommand & mainEditorCommand_ );
|
||||
virtual wxPanel * CreateInitialPositionPanel( wxWindow* parent, const Game & game_, const Scene & scene_, const InitialPosition & position );
|
||||
virtual void UpdateInitialPositionFromPanel(wxPanel * panel, InitialPosition & position);
|
||||
|
||||
virtual void GetPropertyForDebugger (unsigned int propertyNb, string & name, string & value) const;
|
||||
virtual bool ChangeProperty(unsigned int propertyNb, string newValue);
|
||||
virtual unsigned int GetNumberOfProperties() const;
|
||||
#endif
|
||||
|
||||
virtual void LoadFromXml(const TiXmlElement * elemScene);
|
||||
virtual void SaveToXml(TiXmlElement * elemScene);
|
||||
|
||||
virtual void UpdateTime(float timeElapsed);
|
||||
|
||||
virtual void OnPositionChanged() {};
|
||||
|
||||
virtual float GetWidth() const;
|
||||
virtual float GetHeight() const;
|
||||
|
||||
virtual float GetDrawableX() const;
|
||||
virtual float GetDrawableY() const;
|
||||
|
||||
virtual float GetCenterX() const;
|
||||
virtual float GetCenterY() const;
|
||||
|
||||
virtual void SetAngle(float newAngle) {};
|
||||
virtual float GetAngle() const {return 0;};
|
||||
|
||||
virtual void SetWidth(float ) {};
|
||||
virtual void SetHeight(float ) {};
|
||||
|
||||
inline void SetOutlineSize(float size) { outlineSize = size; };
|
||||
inline float GetOutlineSize() const { return outlineSize; };
|
||||
|
||||
void SetOutlineOpacity(int val);
|
||||
inline int GetOutlineOpacity() const {return outlineOpacity;};
|
||||
|
||||
void SetOutlineColor(unsigned int r,unsigned int v,unsigned int b);
|
||||
inline unsigned int GetOutlineColorR() const { return outlineColorR; };
|
||||
inline unsigned int GetOutlineColorG() const { return outlineColorG; };
|
||||
inline unsigned int GetOutlineColorB() const { return outlineColorB; };
|
||||
|
||||
void SetFillOpacity(int val);
|
||||
inline int GetFillOpacity() const {return fillOpacity;};
|
||||
|
||||
void SetFillColor(unsigned int r,unsigned int v,unsigned int b);
|
||||
inline unsigned int GetFillColorR() const { return fillColorR; };
|
||||
inline unsigned int GetFillColorG() const { return fillColorG; };
|
||||
inline unsigned int GetFillColorB() const { return fillColorB; };
|
||||
|
||||
inline void SetCoordinatesAbsolute() { absoluteCoordinates = true; }
|
||||
inline void SetCoordinatesRelative() { absoluteCoordinates = false; }
|
||||
inline bool AreCoordinatesAbsolute() { return absoluteCoordinates; }
|
||||
|
||||
//Setup
|
||||
bool ActFillColor( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool ActFillOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool ActOutlineColor( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool ActOutlineOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool ActOutlineSize( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
|
||||
bool CondFillOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool CondOutlineOpacity( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool CondOutlineSize( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
|
||||
//Shapes
|
||||
bool ActRectangle( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool ActLine( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
bool ActCircle( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
|
||||
double ExpFillOpacity( const RuntimeScene * scene, ObjectsConcerned * objectsConcerned, ObjSPtr obj1, ObjSPtr obj2, const ExpressionInstruction & exprInstruction );
|
||||
double ExpOutlineOpacity( const RuntimeScene * scene, ObjectsConcerned * objectsConcerned, ObjSPtr obj1, ObjSPtr obj2, const ExpressionInstruction & exprInstruction );
|
||||
private:
|
||||
|
||||
vector < sf::Shape > shapesToDraw;
|
||||
|
||||
//Fill color
|
||||
unsigned int fillColorR;
|
||||
unsigned int fillColorG;
|
||||
unsigned int fillColorB;
|
||||
int fillOpacity;
|
||||
|
||||
//Outline
|
||||
int outlineSize;
|
||||
unsigned int outlineColorR;
|
||||
unsigned int outlineColorG;
|
||||
unsigned int outlineColorB;
|
||||
int outlineOpacity;
|
||||
|
||||
bool absoluteCoordinates;
|
||||
|
||||
#if defined(GDE)
|
||||
sf::Image edittimeIconImage;
|
||||
sf::Sprite edittimeIcon;
|
||||
#endif
|
||||
};
|
||||
|
||||
bool ActCopyImageOnAnother( RuntimeScene * scene, ObjectsConcerned & objectsConcerned, const Instruction & action, const Evaluateur & eval );
|
||||
|
||||
void DestroyDrawerObject(Object * object);
|
||||
Object * CreateDrawerObject(std::string name);
|
||||
Object * CreateDrawerObjectByCopy(Object * object);
|
||||
|
||||
|
||||
#endif // DRAWEROBJECT_H
|
179
Extensions/PrimitiveDrawing/DrawerObjectEditor.cpp
Normal file
179
Extensions/PrimitiveDrawing/DrawerObjectEditor.cpp
Normal file
@@ -0,0 +1,179 @@
|
||||
#if defined(GDE)
|
||||
|
||||
#include "GDL/DrawerObjectEditor.h"
|
||||
|
||||
//(*InternalHeaders(DrawerObjectEditor)
|
||||
#include <wx/intl.h>
|
||||
#include <wx/string.h>
|
||||
//*)
|
||||
#include <wx/colordlg.h>
|
||||
|
||||
#include "GDL/Game.h"
|
||||
#include "DrawerObject.h"
|
||||
#include "GDL/MainEditorCommand.h"
|
||||
|
||||
//(*IdInit(DrawerObjectEditor)
|
||||
const long DrawerObjectEditor::ID_STATICTEXT3 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_BUTTON1 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_STATICTEXT5 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_SPINCTRL3 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_STATICTEXT1 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_BUTTON3 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_STATICTEXT2 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_SPINCTRL2 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_STATICTEXT4 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_SPINCTRL1 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_RADIOBOX1 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_STATICLINE1 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_BUTTON2 = wxNewId();
|
||||
const long DrawerObjectEditor::ID_BUTTON4 = wxNewId();
|
||||
//*)
|
||||
|
||||
BEGIN_EVENT_TABLE(DrawerObjectEditor,wxDialog)
|
||||
//(*EventTable(DrawerObjectEditor)
|
||||
//*)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
DrawerObjectEditor::DrawerObjectEditor( wxWindow* parent, Game & game_, DrawerObject & object_, MainEditorCommand & mainEditorCommand_ ) :
|
||||
game(game_),
|
||||
mainEditorCommand(mainEditorCommand_),
|
||||
object(object_)
|
||||
{
|
||||
//(*Initialize(DrawerObjectEditor)
|
||||
wxStaticBoxSizer* StaticBoxSizer2;
|
||||
wxFlexGridSizer* FlexGridSizer4;
|
||||
wxFlexGridSizer* FlexGridSizer3;
|
||||
wxFlexGridSizer* FlexGridSizer5;
|
||||
wxFlexGridSizer* FlexGridSizer2;
|
||||
wxFlexGridSizer* FlexGridSizer6;
|
||||
wxStaticBoxSizer* StaticBoxSizer1;
|
||||
wxFlexGridSizer* FlexGridSizer1;
|
||||
|
||||
Create(parent, wxID_ANY, _("Edition de l\'objet Dessinateur manuel"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
|
||||
FlexGridSizer1 = new wxFlexGridSizer(0, 1, 0, 0);
|
||||
FlexGridSizer1->AddGrowableCol(0);
|
||||
FlexGridSizer4 = new wxFlexGridSizer(0, 3, 0, 0);
|
||||
StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Remplissage"));
|
||||
FlexGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0);
|
||||
FlexGridSizer2->AddGrowableCol(1);
|
||||
StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Couleur :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
|
||||
FlexGridSizer2->Add(StaticText3, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
fillColorBt = new wxButton(this, ID_BUTTON1, _("Choisir la couleur"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
|
||||
FlexGridSizer2->Add(fillColorBt, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("Opacit<EFBFBD> :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5"));
|
||||
FlexGridSizer2->Add(StaticText5, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
fillOpacityEdit = new wxSpinCtrl(this, ID_SPINCTRL3, _T("255"), wxDefaultPosition, wxDefaultSize, 0, 0, 255, 255, _T("ID_SPINCTRL3"));
|
||||
fillOpacityEdit->SetValue(_T("255"));
|
||||
FlexGridSizer2->Add(fillOpacityEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticBoxSizer1->Add(FlexGridSizer2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer4->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Contour"));
|
||||
FlexGridSizer3 = new wxFlexGridSizer(0, 2, 0, 0);
|
||||
FlexGridSizer3->AddGrowableCol(1);
|
||||
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Couleur :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
|
||||
FlexGridSizer3->Add(StaticText1, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
outlineColorBt = new wxButton(this, ID_BUTTON3, _("Choisir la couleur"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
|
||||
FlexGridSizer3->Add(outlineColorBt, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Opacit<EFBFBD> :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
|
||||
FlexGridSizer3->Add(StaticText2, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
outlineOpacityEdit = new wxSpinCtrl(this, ID_SPINCTRL2, _T("255"), wxDefaultPosition, wxDefaultSize, 0, 0, 255, 255, _T("ID_SPINCTRL2"));
|
||||
outlineOpacityEdit->SetValue(_T("255"));
|
||||
FlexGridSizer3->Add(outlineOpacityEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("Taille :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
|
||||
FlexGridSizer3->Add(StaticText4, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
|
||||
outlineSizeEdit = new wxSpinCtrl(this, ID_SPINCTRL1, _T("1"), wxDefaultPosition, wxDefaultSize, 0, 0, 10000, 1, _T("ID_SPINCTRL1"));
|
||||
outlineSizeEdit->SetValue(_T("1"));
|
||||
FlexGridSizer3->Add(outlineSizeEdit, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
StaticBoxSizer2->Add(FlexGridSizer3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer4->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer1->Add(FlexGridSizer4, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer6 = new wxFlexGridSizer(0, 3, 0, 0);
|
||||
FlexGridSizer6->AddGrowableCol(0);
|
||||
wxString __wxRadioBoxChoices_1[2] =
|
||||
{
|
||||
_("Absolues"),
|
||||
_("Relatives <20> la position de l\'objet Dessinateur")
|
||||
};
|
||||
coordinatesRadio = new wxRadioBox(this, ID_RADIOBOX1, _("Coordonn<EFBFBD>es de dessin"), wxDefaultPosition, wxDefaultSize, 2, __wxRadioBoxChoices_1, 1, 0, wxDefaultValidator, _T("ID_RADIOBOX1"));
|
||||
FlexGridSizer6->Add(coordinatesRadio, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer1->Add(FlexGridSizer6, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
|
||||
FlexGridSizer1->Add(StaticLine1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
|
||||
FlexGridSizer5 = new wxFlexGridSizer(0, 3, 0, 0);
|
||||
okBt = new wxButton(this, ID_BUTTON2, _("Ok"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
|
||||
FlexGridSizer5->Add(okBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
cancelBt = new wxButton(this, ID_BUTTON4, _("Annuler"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
|
||||
FlexGridSizer5->Add(cancelBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
|
||||
FlexGridSizer1->Add(FlexGridSizer5, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0);
|
||||
SetSizer(FlexGridSizer1);
|
||||
FlexGridSizer1->Fit(this);
|
||||
FlexGridSizer1->SetSizeHints(this);
|
||||
|
||||
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DrawerObjectEditor::OnfillColorBtClick);
|
||||
Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DrawerObjectEditor::OnoutlineColorBtClick);
|
||||
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DrawerObjectEditor::OnokBtClick);
|
||||
Connect(ID_BUTTON4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DrawerObjectEditor::OncancelBtClick);
|
||||
//*)
|
||||
|
||||
fillOpacityEdit->SetValue(object.GetFillOpacity());
|
||||
fillColorBt->SetBackgroundColour(wxColour(object.GetFillColorR(), object.GetFillColorG(), object.GetFillColorB()));
|
||||
|
||||
outlineSizeEdit->SetValue(object.GetOutlineSize());
|
||||
outlineOpacityEdit->SetValue(object.GetOutlineOpacity());
|
||||
outlineColorBt->SetBackgroundColour(wxColour(object.GetOutlineColorR(), object.GetOutlineColorG(), object.GetOutlineColorB()));
|
||||
|
||||
if ( !object.AreCoordinatesAbsolute() )
|
||||
coordinatesRadio->SetSelection(1);
|
||||
}
|
||||
|
||||
DrawerObjectEditor::~DrawerObjectEditor()
|
||||
{
|
||||
//(*Destroy(DrawerObjectEditor)
|
||||
//*)
|
||||
}
|
||||
|
||||
|
||||
void DrawerObjectEditor::OnokBtClick(wxCommandEvent& event)
|
||||
{
|
||||
object.SetFillOpacity(fillOpacityEdit->GetValue());
|
||||
object.SetFillColor(static_cast<int>(fillColorBt->GetBackgroundColour().Red()),
|
||||
static_cast<int>(fillColorBt->GetBackgroundColour().Green()),
|
||||
static_cast<int>(fillColorBt->GetBackgroundColour().Blue()));
|
||||
|
||||
object.SetOutlineOpacity(outlineOpacityEdit->GetValue());
|
||||
object.SetOutlineSize(outlineSizeEdit->GetValue());
|
||||
object.SetOutlineColor(static_cast<int>(outlineColorBt->GetBackgroundColour().Red()),
|
||||
static_cast<int>(outlineColorBt->GetBackgroundColour().Green()),
|
||||
static_cast<int>(outlineColorBt->GetBackgroundColour().Blue()));
|
||||
|
||||
object.SetCoordinatesAbsolute();
|
||||
if ( coordinatesRadio->GetSelection() == 1 )
|
||||
object.SetCoordinatesRelative();
|
||||
|
||||
EndModal(1);
|
||||
}
|
||||
|
||||
void DrawerObjectEditor::OncancelBtClick(wxCommandEvent& event)
|
||||
{
|
||||
EndModal(0);
|
||||
}
|
||||
|
||||
void DrawerObjectEditor::OnfillColorBtClick(wxCommandEvent& event)
|
||||
{
|
||||
wxColour color = wxGetColourFromUser(this, fillColorBt->GetBackgroundColour());
|
||||
if ( color.IsOk() )
|
||||
{
|
||||
fillColorBt->SetBackgroundColour(color);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawerObjectEditor::OnoutlineColorBtClick(wxCommandEvent& event)
|
||||
{
|
||||
wxColour color = wxGetColourFromUser(this, outlineColorBt->GetBackgroundColour());
|
||||
if ( color.IsOk() )
|
||||
{
|
||||
outlineColorBt->SetBackgroundColour(color);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
80
Extensions/PrimitiveDrawing/DrawerObjectEditor.h
Normal file
80
Extensions/PrimitiveDrawing/DrawerObjectEditor.h
Normal file
@@ -0,0 +1,80 @@
|
||||
#if defined(GDE)
|
||||
|
||||
#ifndef DRAWEROBJECTEDITOR_H
|
||||
#define DRAWEROBJECTEDITOR_H
|
||||
|
||||
//(*Headers(DrawerObjectEditor)
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
//*)
|
||||
class Game;
|
||||
class DrawerObject;
|
||||
class MainEditorCommand;
|
||||
|
||||
class DrawerObjectEditor: public wxDialog
|
||||
{
|
||||
public:
|
||||
|
||||
DrawerObjectEditor( wxWindow* parent, Game & game_, DrawerObject & object_, MainEditorCommand & mainEditorCommand_ );
|
||||
virtual ~DrawerObjectEditor();
|
||||
|
||||
//(*Declarations(DrawerObjectEditor)
|
||||
wxStaticText* StaticText2;
|
||||
wxRadioBox* coordinatesRadio;
|
||||
wxSpinCtrl* outlineSizeEdit;
|
||||
wxSpinCtrl* fillOpacityEdit;
|
||||
wxStaticText* StaticText1;
|
||||
wxStaticText* StaticText3;
|
||||
wxButton* cancelBt;
|
||||
wxButton* fillColorBt;
|
||||
wxButton* outlineColorBt;
|
||||
wxStaticText* StaticText5;
|
||||
wxStaticLine* StaticLine1;
|
||||
wxSpinCtrl* outlineOpacityEdit;
|
||||
wxStaticText* StaticText4;
|
||||
wxButton* okBt;
|
||||
//*)
|
||||
|
||||
protected:
|
||||
|
||||
//(*Identifiers(DrawerObjectEditor)
|
||||
static const long ID_STATICTEXT3;
|
||||
static const long ID_BUTTON1;
|
||||
static const long ID_STATICTEXT5;
|
||||
static const long ID_SPINCTRL3;
|
||||
static const long ID_STATICTEXT1;
|
||||
static const long ID_BUTTON3;
|
||||
static const long ID_STATICTEXT2;
|
||||
static const long ID_SPINCTRL2;
|
||||
static const long ID_STATICTEXT4;
|
||||
static const long ID_SPINCTRL1;
|
||||
static const long ID_RADIOBOX1;
|
||||
static const long ID_STATICLINE1;
|
||||
static const long ID_BUTTON2;
|
||||
static const long ID_BUTTON4;
|
||||
//*)
|
||||
|
||||
private:
|
||||
|
||||
//(*Handlers(DrawerObjectEditor)
|
||||
void OnokBtClick(wxCommandEvent& event);
|
||||
void OncancelBtClick(wxCommandEvent& event);
|
||||
void OnfillColorBtClick(wxCommandEvent& event);
|
||||
void OnoutlineColorBtClick(wxCommandEvent& event);
|
||||
//*)
|
||||
|
||||
Game & game;
|
||||
MainEditorCommand & mainEditorCommand;
|
||||
DrawerObject & object;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
268
Extensions/PrimitiveDrawing/Extension.cpp
Normal file
268
Extensions/PrimitiveDrawing/Extension.cpp
Normal file
@@ -0,0 +1,268 @@
|
||||
#include "GDL/ExtensionBase.h"
|
||||
#include "GDL/Version.h"
|
||||
#include "DrawerObject.h"
|
||||
#include <boost/version.hpp>
|
||||
|
||||
class Extension : public ExtensionBase
|
||||
{
|
||||
public:
|
||||
Extension()
|
||||
{
|
||||
DECLARE_THE_EXTENSION("PrimitiveDrawing",
|
||||
_("Dessin primitif"),
|
||||
_("Extension permettant de dessiner directement des formes et de manipuler des images."),
|
||||
"Compil Games",
|
||||
"Freeware")
|
||||
|
||||
//Declaration of all objects available
|
||||
DECLARE_OBJECT("Drawer",
|
||||
_("Dessinateur manuel"),
|
||||
_("Objet permettant de dessiner <20> l'<27>cran"),
|
||||
"Extensions/primitivedrawingicon.png",
|
||||
&CreateDrawerObject,
|
||||
&CreateDrawerObjectByCopy,
|
||||
&DestroyDrawerObject);
|
||||
|
||||
DECLARE_OBJECT_ACTION("Rectangle",
|
||||
_("Rectangle"),
|
||||
_("Dessine un rectangle <20> l'<27>cran"),
|
||||
_("Dessiner de _PARAM1_;_PARAM2_ <20> _PARAM3_;_PARAM4_ un rectangle avec _PARAM0_"),
|
||||
_("Dessin"),
|
||||
"res/actions/rectangle24.png",
|
||||
"res/actions/rectangle.png",
|
||||
&DrawerObject::ActRectangle);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet dessinateur"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Position X du point haut gauche"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position Y du point haut gauche"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position X du point bas droit"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position Y du point bas droit"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_ACTION("Circle",
|
||||
_("Cercle"),
|
||||
_("Dessine un cercle <20> l'<27>cran"),
|
||||
_("Dessiner en _PARAM1_;_PARAM2_ un cercle de rayon _PARAM3_ avec _PARAM0_"),
|
||||
_("Dessin"),
|
||||
"res/actions/circle24.png",
|
||||
"res/actions/circle.png",
|
||||
&DrawerObject::ActCircle);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet dessinateur"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Position X du point haut gauche"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position Y du point haut gauche"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Rayon en pixels"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_ACTION("Line",
|
||||
_("Ligne"),
|
||||
_("Dessine une ligne <20> l'<27>cran"),
|
||||
_("Dessiner de _PARAM1_;_PARAM2_ <20> _PARAM3_;_PARAM4_ une ligne ( <20>paisseur : _PARAM5_) avec _PARAM0_"),
|
||||
_("Dessin"),
|
||||
"res/actions/line24.png",
|
||||
"res/actions/line.png",
|
||||
&DrawerObject::ActLine);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet dessinateur"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Position X du point de d<>part"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position Y du point de d<>part"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position X du point d'arriv<69>e"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position Y du point d'arriv<69>e"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Epaisseur en pixels"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_ACTION("FillColor",
|
||||
_("Couleur de remplissage"),
|
||||
_("Change la couleur de remplissage pour le dessin."),
|
||||
_("Changer la couleur de remplissage de _PARAM0_ en _PARAM1_ ( opacit<69> : _PARAM2_ )"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/actions/text24.png",
|
||||
"res/actions/text.png",
|
||||
&DrawerObject::ActFillColor);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet dessinateur"), true, "Drawer")
|
||||
DECLARE_PARAMETER("color", _("Couleur de remplissage"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_ACTION("OutlineColor",
|
||||
_("Couleur du contour"),
|
||||
_("Change la couleur du contour des futurs dessins."),
|
||||
_("Changer la couleur du contour de _PARAM0_ en _PARAM1_"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/actions/color24.png",
|
||||
"res/actions/color.png",
|
||||
&DrawerObject::ActOutlineColor);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet"), true, "Drawer")
|
||||
DECLARE_PARAMETER("color", _("Couleur"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_ACTION("OutlineSize",
|
||||
_("Taille du contour"),
|
||||
_("Modifie la taille du contour des futurs dessins."),
|
||||
_("Faire _PARAM2__PARAM1_ <20> la taille du contour de _PARAM0_"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/actions/outlineSize24.png",
|
||||
"res/actions/outlineSize.png",
|
||||
&DrawerObject::ActOutlineSize);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Taille en pixels"), false, "")
|
||||
DECLARE_PARAMETER("signe", _("Signe de la modification"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_CONDITION("OutlineSize",
|
||||
_("Taille du contour"),
|
||||
_("Teste la taille du contour."),
|
||||
_("La taille du contour de _PARAM0_ est _PARAM2_ <20> _PARAM1_"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/conditions/outlineSize24.png",
|
||||
"res/conditions/outlineSize.png",
|
||||
&DrawerObject::CondOutlineSize);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Taille <20> tester"), false, "")
|
||||
DECLARE_PARAMETER("signe", _("Signe du test"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_CONDITION()
|
||||
|
||||
DECLARE_OBJECT_ACTION("FillOpacity",
|
||||
_("Opacit<EFBFBD> du remplissage"),
|
||||
_("Modifie la transparence du remplissage des futurs dessins."),
|
||||
_("Faire _PARAM2__PARAM1_ <20> l'opacit<69> du remplissage de _PARAM0_"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/actions/opacity24.png",
|
||||
"res/actions/opacity.png",
|
||||
&DrawerObject::ActFillOpacity);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Valeur"), false, "")
|
||||
DECLARE_PARAMETER("signe", _("Signe de la modification"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_CONDITION("FillOpacity",
|
||||
_("Opacit<EFBFBD> du remplissage"),
|
||||
_("Teste la valeur de l'opacit<69> du remplissage."),
|
||||
_("L'opacit<69> du remplissage de _PARAM0_ est _PARAM2_ <20> _PARAM1_"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/conditions/opacity24.png",
|
||||
"res/conditions/opacity.png",
|
||||
&DrawerObject::CondFillOpacity);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Valeur <20> tester"), false, "")
|
||||
DECLARE_PARAMETER("signe", _("Signe du test"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_CONDITION()
|
||||
|
||||
DECLARE_OBJECT_ACTION("OutlineOpacity",
|
||||
_("Opacit<EFBFBD> du contour"),
|
||||
_("Modifie l'opacit<69> du contour des futurs dessins."),
|
||||
_("Faire _PARAM2__PARAM1_ <20> l'opacit<69> du contour de _PARAM0_"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/actions/opacity24.png",
|
||||
"res/actions/opacity.png",
|
||||
&DrawerObject::ActOutlineOpacity);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Valeur"), false, "")
|
||||
DECLARE_PARAMETER("signe", _("Signe de la modification"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_ACTION()
|
||||
|
||||
DECLARE_OBJECT_CONDITION("OutlineOpacity",
|
||||
_("Opacit<EFBFBD> du contour"),
|
||||
_("Teste la valeur de l'opacit<69> du contour."),
|
||||
_("L'opacit<69> du contour de _PARAM0_ est _PARAM2_ <20> _PARAM1_"),
|
||||
_("Param<EFBFBD>trage"),
|
||||
"res/conditions/opacity24.png",
|
||||
"res/conditions/opacity.png",
|
||||
&DrawerObject::CondOutlineOpacity);
|
||||
|
||||
DECLARE_PARAMETER("objet", _("Objet"), true, "Drawer")
|
||||
DECLARE_PARAMETER("expression", _("Valeur <20> tester"), false, "")
|
||||
DECLARE_PARAMETER("signe", _("Signe du test"), false, "")
|
||||
MAIN_OBJECTS_IN_PARAMETER(0)
|
||||
|
||||
DECLARE_END_OBJECT_CONDITION()
|
||||
|
||||
DECLARE_END_OBJECT()
|
||||
|
||||
DECLARE_ACTION("CopyImageOnAnother",
|
||||
_("Copier une image sur une autre"),
|
||||
_("Copie une image sur une autre."),
|
||||
_("Copier l'image _PARAM1_ sur _PARAM0_ <20> l'emplacement _PARAM2_;_PARAM3_"),
|
||||
_("Images"),
|
||||
"res/actions/opacity24.png",
|
||||
"res/actions/opacity.png",
|
||||
&ActCopyImageOnAnother);
|
||||
|
||||
DECLARE_PARAMETER("texte", _("Nom de l'image <20> modifier"), false, "")
|
||||
DECLARE_PARAMETER("texte", _("Nom de l'image source"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position X"), false, "")
|
||||
DECLARE_PARAMETER("expression", _("Position Y"), false, "")
|
||||
|
||||
DECLARE_END_ACTION()
|
||||
|
||||
CompleteCompilationInformation();
|
||||
};
|
||||
virtual ~Extension() {};
|
||||
|
||||
protected:
|
||||
private:
|
||||
void CompleteCompilationInformation()
|
||||
{
|
||||
#if defined(GDE)
|
||||
compilationInfo.runtimeOnly = false;
|
||||
#else
|
||||
compilationInfo.runtimeOnly = true;
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
compilationInfo.gccMajorVersion = __GNUC__;
|
||||
compilationInfo.gccMinorVersion = __GNUC_MINOR__;
|
||||
compilationInfo.gccPatchLevel = __GNUC_PATCHLEVEL__;
|
||||
#endif
|
||||
|
||||
compilationInfo.boostVersion = BOOST_VERSION;
|
||||
|
||||
compilationInfo.sfmlMajorVersion = 2;
|
||||
compilationInfo.sfmlMinorVersion = 0;
|
||||
|
||||
#if defined(GDE)
|
||||
compilationInfo.wxWidgetsMajorVersion = wxMAJOR_VERSION;
|
||||
compilationInfo.wxWidgetsMinorVersion = wxMINOR_VERSION;
|
||||
compilationInfo.wxWidgetsReleaseNumber = wxRELEASE_NUMBER;
|
||||
compilationInfo.wxWidgetsSubReleaseNumber = wxSUBRELEASE_NUMBER;
|
||||
#endif
|
||||
|
||||
compilationInfo.gdlVersion = RC_FILEVERSION_STRING;
|
||||
|
||||
compilationInfo.informationCompleted = true;
|
||||
}
|
||||
};
|
||||
|
||||
extern "C" ExtensionBase * CreateGDExtension() {
|
||||
return new Extension;
|
||||
}
|
||||
|
||||
extern "C" void DestroyGDExtension(ExtensionBase * p) {
|
||||
delete p;
|
||||
}
|
364
Extensions/PrimitiveDrawing/PrimitiveDrawing.cbp
Normal file
364
Extensions/PrimitiveDrawing/PrimitiveDrawing.cbp
Normal file
@@ -0,0 +1,364 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="PrimitiveDrawing" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="..\..\Runtime\bin\debug\PrimitiveDrawing.xgdw" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\Debug\" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-pg" />
|
||||
<Add option="-g" />
|
||||
<Add option="-DGDP" />
|
||||
<Add option="-DGD_API=__declspec(dllimport)" />
|
||||
<Add option="-DDEBUG" />
|
||||
<Add option="-DWINDOWS" />
|
||||
<Add option="-DSFML_DYNAMIC" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add option="-lgdl.dll" />
|
||||
<Add option="-lsfml-audio-d.dll" />
|
||||
<Add option="-lsfml-graphics-d.dll" />
|
||||
<Add option="-lsfml-network-d.dll" />
|
||||
<Add option="-lsfml-window-d.dll" />
|
||||
<Add option="-lsfml-system-d.dll" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
<Add directory="..\..\Runtime\bin\debug" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Debug - Edittime">
|
||||
<Option output="..\..\IDE\bin\debug\Extensions\PrimitiveDrawing.xgdwe" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\Debug Edittime\" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-pg" />
|
||||
<Add option="-g" />
|
||||
<Add option="-DGDE" />
|
||||
<Add option="-DGD_API=__declspec(dllimport)" />
|
||||
<Add option="-DDEBUG" />
|
||||
<Add option="-DWINDOWS" />
|
||||
<Add option="-DPYSUPPORT" />
|
||||
<Add option="-DSFML_DYNAMIC" />
|
||||
<Add option="-DwxUSE_UNICODE=0" />
|
||||
<Add option="-D__WXDEBUG__" />
|
||||
<Add option="-DWXUSINGDLL" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\mswd" />
|
||||
<Add directory="C:\Libs\wxwidgets\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add option="-lgdl.dll" />
|
||||
<Add option="-lwxmsw29d_xrc" />
|
||||
<Add option="-lwxmsw29d_richtext" />
|
||||
<Add option="-lwxmsw29d_ribbon" />
|
||||
<Add option="-lwxmsw29d_aui" />
|
||||
<Add option="-lwxmsw29d_adv" />
|
||||
<Add option="-lwxmsw29d_html" />
|
||||
<Add option="-lwxmsw29d_core" />
|
||||
<Add option="-lwxbase29d_xml" />
|
||||
<Add option="-lwxbase29d_net" />
|
||||
<Add option="-lwxexpatd" />
|
||||
<Add option="-lwxbase29d" />
|
||||
<Add option="-lwxpngd" />
|
||||
<Add option="-lwxjpegd" />
|
||||
<Add option="-lwxzlibd" />
|
||||
<Add option="-lwxtiffd" />
|
||||
<Add option="-lsfml-audio-d.dll" />
|
||||
<Add option="-lsfml-graphics-d.dll" />
|
||||
<Add option="-lsfml-network-d.dll" />
|
||||
<Add option="-lsfml-window-d.dll" />
|
||||
<Add option="-lsfml-system-d.dll" />
|
||||
<Add option="-lkernel32" />
|
||||
<Add option="-luser32" />
|
||||
<Add option="-lopengl32" />
|
||||
<Add option="-limm32" />
|
||||
<Add option="-lcomctl32" />
|
||||
<Add option="-lglu32" />
|
||||
<Add option="-lws2_32" />
|
||||
<Add option="-lgdi32" />
|
||||
<Add option="-lwinmm" />
|
||||
<Add option="-luuid" />
|
||||
<Add option="-lshell32" />
|
||||
<Add option="-lole32" />
|
||||
<Add option="-lwinspool" />
|
||||
<Add option="-ladvapi32" />
|
||||
<Add option="-lcomdlg32" />
|
||||
<Add option="-loleaut32" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
<Add directory="..\..\IDE\bin\debug" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\mswd" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="..\..\Runtime\bin\release\PrimitiveDrawing.xgdw" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\Release\" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DGDP" />
|
||||
<Add option="-DGD_API=__declspec(dllimport)" />
|
||||
<Add option="-DRELEASE" />
|
||||
<Add option="-DWINDOWS" />
|
||||
<Add option="-DSFML_DYNAMIC" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
<Add option="-lgdl.dll" />
|
||||
<Add option="-lsfml-audio.dll" />
|
||||
<Add option="-lsfml-graphics.dll" />
|
||||
<Add option="-lsfml-network.dll" />
|
||||
<Add option="-lsfml-window.dll" />
|
||||
<Add option="-lsfml-system.dll" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
<Add directory="..\..\Runtime\bin\release" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release - Edittime">
|
||||
<Option output="..\..\IDE\bin\release\Extensions\PrimitiveDrawing.xgdwe" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\Release Edittime\" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DGDE" />
|
||||
<Add option="-DGD_API=__declspec(dllimport)" />
|
||||
<Add option="-DRELEASE" />
|
||||
<Add option="-DWINDOWS" />
|
||||
<Add option="-DPYSUPPORT" />
|
||||
<Add option="-DSFML_DYNAMIC" />
|
||||
<Add option="-DwxUSE_UNICODE=0" />
|
||||
<Add option="-DWXUSINGDLL" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\msw" />
|
||||
<Add directory="C:\Libs\wxwidgets\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
<Add option="-lgdl.dll" />
|
||||
<Add option="-lwxmsw29_xrc" />
|
||||
<Add option="-lwxmsw29_richtext" />
|
||||
<Add option="-lwxmsw29_ribbon" />
|
||||
<Add option="-lwxmsw29_aui" />
|
||||
<Add option="-lwxmsw29_adv" />
|
||||
<Add option="-lwxmsw29_html" />
|
||||
<Add option="-lwxmsw29_core" />
|
||||
<Add option="-lwxbase29_xml" />
|
||||
<Add option="-lwxbase29_net" />
|
||||
<Add option="-lwxexpat" />
|
||||
<Add option="-lwxbase29" />
|
||||
<Add option="-lwxpng" />
|
||||
<Add option="-lwxjpeg" />
|
||||
<Add option="-lwxzlib" />
|
||||
<Add option="-lwxtiff" />
|
||||
<Add option="-lsfml-audio.dll" />
|
||||
<Add option="-lsfml-graphics.dll" />
|
||||
<Add option="-lsfml-network.dll" />
|
||||
<Add option="-lsfml-window.dll" />
|
||||
<Add option="-lsfml-system.dll" />
|
||||
<Add option="-lkernel32" />
|
||||
<Add option="-luser32" />
|
||||
<Add option="-lopengl32" />
|
||||
<Add option="-limm32" />
|
||||
<Add option="-lcomctl32" />
|
||||
<Add option="-lglu32" />
|
||||
<Add option="-lws2_32" />
|
||||
<Add option="-lgdi32" />
|
||||
<Add option="-lwinmm" />
|
||||
<Add option="-luuid" />
|
||||
<Add option="-lshell32" />
|
||||
<Add option="-lole32" />
|
||||
<Add option="-lwinspool" />
|
||||
<Add option="-ladvapi32" />
|
||||
<Add option="-lcomdlg32" />
|
||||
<Add option="-loleaut32" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
<Add directory="..\..\IDE\bin\release" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\msw" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Development">
|
||||
<Option output="..\..\Runtime\bin\dev\PrimitiveDrawing.xgdw" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\Dev\" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DGDP" />
|
||||
<Add option="-DGD_API=__declspec(dllimport)" />
|
||||
<Add option="-DDEV" />
|
||||
<Add option="-DWINDOWS" />
|
||||
<Add option="-DSFML_DYNAMIC" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
<Add option="-lgdl.dll" />
|
||||
<Add option="-lsfml-audio.dll" />
|
||||
<Add option="-lsfml-graphics.dll" />
|
||||
<Add option="-lsfml-network.dll" />
|
||||
<Add option="-lsfml-window.dll" />
|
||||
<Add option="-lsfml-system.dll" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
<Add directory="..\..\Runtime\bin\dev" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Development - Edittime">
|
||||
<Option output="..\..\IDE\bin\dev\Extensions\PrimitiveDrawing.xgdwe" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\Dev Edittime\" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DGDE" />
|
||||
<Add option="-DGD_API=__declspec(dllimport)" />
|
||||
<Add option="-DDEV" />
|
||||
<Add option="-DWINDOWS" />
|
||||
<Add option="-DPYSUPPORT" />
|
||||
<Add option="-DSFML_DYNAMIC" />
|
||||
<Add option="-DwxUSE_UNICODE=0" />
|
||||
<Add option="-DWXUSINGDLL" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\msw" />
|
||||
<Add directory="C:\Libs\wxwidgets\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
<Add option="-lgdl.dll" />
|
||||
<Add option="-lwxmsw29_xrc" />
|
||||
<Add option="-lwxmsw29_richtext" />
|
||||
<Add option="-lwxmsw29_ribbon" />
|
||||
<Add option="-lwxmsw29_aui" />
|
||||
<Add option="-lwxmsw29_adv" />
|
||||
<Add option="-lwxmsw29_html" />
|
||||
<Add option="-lwxmsw29_core" />
|
||||
<Add option="-lwxbase29_xml" />
|
||||
<Add option="-lwxbase29_net" />
|
||||
<Add option="-lwxexpat" />
|
||||
<Add option="-lwxbase29" />
|
||||
<Add option="-lwxpng" />
|
||||
<Add option="-lwxjpeg" />
|
||||
<Add option="-lwxzlib" />
|
||||
<Add option="-lwxtiff" />
|
||||
<Add option="-lsfml-audio.dll" />
|
||||
<Add option="-lsfml-graphics.dll" />
|
||||
<Add option="-lsfml-network.dll" />
|
||||
<Add option="-lsfml-window.dll" />
|
||||
<Add option="-lsfml-system.dll" />
|
||||
<Add option="-lkernel32" />
|
||||
<Add option="-luser32" />
|
||||
<Add option="-lopengl32" />
|
||||
<Add option="-limm32" />
|
||||
<Add option="-lcomctl32" />
|
||||
<Add option="-lglu32" />
|
||||
<Add option="-lws2_32" />
|
||||
<Add option="-lgdi32" />
|
||||
<Add option="-lwinmm" />
|
||||
<Add option="-luuid" />
|
||||
<Add option="-lshell32" />
|
||||
<Add option="-lole32" />
|
||||
<Add option="-lwinspool" />
|
||||
<Add option="-ladvapi32" />
|
||||
<Add option="-lcomdlg32" />
|
||||
<Add option="-loleaut32" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
<Add directory="..\..\IDE\bin\dev" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\msw" />
|
||||
<Add directory="C:\Libs\wxwidgets\lib\gcc_dll\" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Linux - Release">
|
||||
<Option output="..\..\Runtime\bin\release\PrimitiveDrawing.xgdl" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\Release\" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-fno-stack-protector" />
|
||||
<Add option="-DGDP" />
|
||||
<Add option='-DGD_API=""' />
|
||||
<Add option="-DRELEASE" />
|
||||
<Add option="-DLINUX" />
|
||||
<Add option="-DSFML_DYNAMIC" />
|
||||
<Add directory="\home\florian\Programmation\libs\dlib-17.12\" />
|
||||
<Add directory="\home\florian\Programmation\libs\nwidgets\" />
|
||||
<Add directory="\home\florian\Programmation\libs\fparser\" />
|
||||
<Add directory="\home\florian\Programmation\libs\boost_1_38_0" />
|
||||
<Add directory="\home\florian\Programmation\libs\sfml\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
<Add option="-lgdl" />
|
||||
<Add option="-lsfml-audio" />
|
||||
<Add option="-lsfml-graphics" />
|
||||
<Add option="-lsfml-window" />
|
||||
<Add option="-lsfml-system" />
|
||||
<Add option="-lsndfile" />
|
||||
<Add option="-lopenal" />
|
||||
<Add option="-lfreetype" />
|
||||
<Add option="-lX11" />
|
||||
<Add option="-lXrandr" />
|
||||
<Add option="-lXrender" />
|
||||
<Add option="-lFLAC" />
|
||||
<Add option="-lGL" />
|
||||
<Add option="-lpthread" />
|
||||
<Add directory="..\..\Runtime\bin\release" />
|
||||
<Add directory="\home\florian\Programmation\libs\sfml\lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\GDL" />
|
||||
<Add directory="C:\Libs\SFML\include" />
|
||||
<Add directory="C:\Libs\boost_1_38_0" />
|
||||
<Add directory="C:\Libs\fparser" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add directory="C:\Libs\SFML\lib\mingw" />
|
||||
</Linker>
|
||||
<Unit filename="DrawerActions.cpp" />
|
||||
<Unit filename="DrawerConditions.cpp" />
|
||||
<Unit filename="DrawerExpressions.cpp" />
|
||||
<Unit filename="DrawerObject.cpp" />
|
||||
<Unit filename="DrawerObject.h" />
|
||||
<Unit filename="DrawerObjectEditor.cpp" />
|
||||
<Unit filename="DrawerObjectEditor.h" />
|
||||
<Unit filename="Extension.cpp" />
|
||||
<Unit filename="..\..\GDL\GDL\tinystr.cpp" />
|
||||
<Unit filename="..\..\GDL\GDL\tinystr.h" />
|
||||
<Unit filename="..\..\GDL\GDL\tinyxml.cpp" />
|
||||
<Unit filename="..\..\GDL\GDL\tinyxml.h" />
|
||||
<Unit filename="..\..\GDL\GDL\tinyxmlerror.cpp" />
|
||||
<Unit filename="..\..\GDL\GDL\tinyxmlparser.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<envvars />
|
||||
<debugger />
|
||||
<lib_finder disable_auto="1" />
|
||||
<wxsmith version="1">
|
||||
<resources>
|
||||
<wxDialog wxs="wxsmith/DrawerObjectEditor.wxs" src="DrawerObjectEditor.cpp" hdr="DrawerObjectEditor.h" name="DrawerObjectEditor" language="CPP" />
|
||||
</resources>
|
||||
</wxsmith>
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
5023
Extensions/PrimitiveDrawing/PrimitiveDrawing.depend
Normal file
5023
Extensions/PrimitiveDrawing/PrimitiveDrawing.depend
Normal file
File diff suppressed because it is too large
Load Diff
28
Extensions/PrimitiveDrawing/PrimitiveDrawing.layout
Normal file
28
Extensions/PrimitiveDrawing/PrimitiveDrawing.layout
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_layout_file>
|
||||
<ActiveTarget name="Release" />
|
||||
<File name="DrawerActions.cpp" open="1" top="0" tabpos="3">
|
||||
<Cursor position="751" topLine="0" />
|
||||
</File>
|
||||
<File name="DrawerConditions.cpp" open="1" top="0" tabpos="2">
|
||||
<Cursor position="4342" topLine="35" />
|
||||
</File>
|
||||
<File name="DrawerExpressions.cpp" open="1" top="0" tabpos="4">
|
||||
<Cursor position="588" topLine="0" />
|
||||
</File>
|
||||
<File name="DrawerObject.cpp" open="1" top="0" tabpos="1">
|
||||
<Cursor position="11359" topLine="386" />
|
||||
</File>
|
||||
<File name="DrawerObject.h" open="1" top="0" tabpos="6">
|
||||
<Cursor position="5909" topLine="116" />
|
||||
</File>
|
||||
<File name="DrawerObjectEditor.cpp" open="0" top="0" tabpos="0">
|
||||
<Cursor position="206" topLine="0" />
|
||||
</File>
|
||||
<File name="DrawerObjectEditor.h" open="0" top="0" tabpos="0">
|
||||
<Cursor position="315" topLine="0" />
|
||||
</File>
|
||||
<File name="Extension.cpp" open="1" top="0" tabpos="5">
|
||||
<Cursor position="158" topLine="0" />
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
188
Extensions/PrimitiveDrawing/wxsmith/DrawerObjectEditor.wxs
Normal file
188
Extensions/PrimitiveDrawing/wxsmith/DrawerObjectEditor.wxs
Normal file
@@ -0,0 +1,188 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<wxsmith>
|
||||
<object class="wxDialog" name="DrawerObjectEditor">
|
||||
<title>Edition de l'objet Dessinateur manuel</title>
|
||||
<id_arg>0</id_arg>
|
||||
<object class="wxFlexGridSizer" variable="FlexGridSizer1" member="no">
|
||||
<cols>1</cols>
|
||||
<growablecols>0</growablecols>
|
||||
<object class="sizeritem">
|
||||
<object class="wxFlexGridSizer" variable="FlexGridSizer4" member="no">
|
||||
<cols>3</cols>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticBoxSizer" variable="StaticBoxSizer1" member="no">
|
||||
<label>Remplissage</label>
|
||||
<object class="sizeritem">
|
||||
<object class="wxFlexGridSizer" variable="FlexGridSizer2" member="no">
|
||||
<cols>2</cols>
|
||||
<growablecols>1</growablecols>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="ID_STATICTEXT3" variable="StaticText3" member="yes">
|
||||
<label>Couleur :</label>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxButton" name="ID_BUTTON1" variable="fillColorBt" member="yes">
|
||||
<label>Choisir la couleur</label>
|
||||
<handler function="OnfillColorBtClick" entry="EVT_BUTTON" />
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="ID_STATICTEXT5" variable="StaticText5" member="yes">
|
||||
<label>Opacité :</label>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxSpinCtrl" name="ID_SPINCTRL3" variable="fillOpacityEdit" member="yes">
|
||||
<value>255</value>
|
||||
<max>255</max>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticBoxSizer" variable="StaticBoxSizer2" member="no">
|
||||
<label>Contour</label>
|
||||
<object class="sizeritem">
|
||||
<object class="wxFlexGridSizer" variable="FlexGridSizer3" member="no">
|
||||
<cols>2</cols>
|
||||
<growablecols>1</growablecols>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="ID_STATICTEXT1" variable="StaticText1" member="yes">
|
||||
<label>Couleur :</label>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxButton" name="ID_BUTTON3" variable="outlineColorBt" member="yes">
|
||||
<label>Choisir la couleur</label>
|
||||
<handler function="OnoutlineColorBtClick" entry="EVT_BUTTON" />
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="ID_STATICTEXT2" variable="StaticText2" member="yes">
|
||||
<label>Opacité :</label>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxSpinCtrl" name="ID_SPINCTRL2" variable="outlineOpacityEdit" member="yes">
|
||||
<value>255</value>
|
||||
<max>255</max>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="ID_STATICTEXT4" variable="StaticText4" member="yes">
|
||||
<label>Taille :</label>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxSpinCtrl" name="ID_SPINCTRL1" variable="outlineSizeEdit" member="yes">
|
||||
<value>1</value>
|
||||
<max>10000</max>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxFlexGridSizer" variable="FlexGridSizer6" member="no">
|
||||
<cols>3</cols>
|
||||
<growablecols>0</growablecols>
|
||||
<object class="sizeritem">
|
||||
<object class="wxRadioBox" name="ID_RADIOBOX1" variable="coordinatesRadio" member="yes">
|
||||
<label>Coordonnées de dessin</label>
|
||||
<content>
|
||||
<item>Absolues</item>
|
||||
<item>Relatives à la position de l'objet Dessinateur</item>
|
||||
</content>
|
||||
<default>-1</default>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticLine" name="ID_STATICLINE1" variable="StaticLine1" member="yes">
|
||||
<size>10,-1</size>
|
||||
</object>
|
||||
<flag>wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxFlexGridSizer" variable="FlexGridSizer5" member="no">
|
||||
<cols>3</cols>
|
||||
<object class="sizeritem">
|
||||
<object class="wxButton" name="ID_BUTTON2" variable="okBt" member="yes">
|
||||
<label>Ok</label>
|
||||
<handler function="OnokBtClick" entry="EVT_BUTTON" />
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxButton" name="ID_BUTTON4" variable="cancelBt" member="yes">
|
||||
<label>Annuler</label>
|
||||
<handler function="OncancelBtClick" entry="EVT_BUTTON" />
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<border>5</border>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
|
||||
<option>1</option>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxsmith>
|
Reference in New Issue
Block a user