Merged the C++ port of the GUI Tabs / OptionGroup / Option classes

by @YuSanka, thanks @lordofhyphens for the initial port
of the OptionGroup / Option.
This commit is contained in:
bubnikv 2018-02-15 18:13:37 +01:00
commit f1840a52db
41 changed files with 11765 additions and 699 deletions

View file

@ -24,6 +24,12 @@ public:
explicit Polygon(const Points &points): MultiPoint(points) {}
Polygon(const Polygon &other) : MultiPoint(other.points) {}
Polygon(Polygon &&other) : MultiPoint(std::move(other.points)) {}
static Polygon new_scale(std::vector<Pointf> points) {
Points int_points;
for (auto pt : points)
int_points.push_back(Point::new_scale(pt.x, pt.y));
return Polygon(int_points);
}
Polygon& operator=(const Polygon &other) { points = other.points; return *this; }
Polygon& operator=(Polygon &&other) { points = std::move(other.points); return *this; }

View file

@ -21,6 +21,14 @@ public:
Polyline(Polyline &&other) : MultiPoint(std::move(other.points)) {}
Polyline& operator=(const Polyline &other) { points = other.points; return *this; }
Polyline& operator=(Polyline &&other) { points = std::move(other.points); return *this; }
static Polyline new_scale(std::vector<Pointf> points) {
Polyline pl;
Points int_points;
for (auto pt : points)
int_points.push_back(Point::new_scale(pt.x, pt.y));
pl.append(int_points);
return pl;
}
void append(const Point &point) { this->points.push_back(point); }
void append(const Points &src) { this->append(src.begin(), src.end()); }

File diff suppressed because it is too large Load diff

View file

@ -20,6 +20,11 @@ void set_resources_dir(const std::string &path);
// Return a full path to the resources directory.
const std::string& resources_dir();
// Set a path with GUI localization files.
void set_local_dir(const std::string &path);
// Return a full path to the localization directory.
const std::string& localization_dir();
// Set a path with preset files.
void set_data_dir(const std::string &path);
// Return a full path to the GUI resource files.

View file

@ -103,6 +103,18 @@ const std::string& resources_dir()
return g_resources_dir;
}
static std::string g_local_dir;
void set_local_dir(const std::string &dir)
{
g_local_dir = dir;
}
const std::string& localization_dir()
{
return g_local_dir;
}
static std::string g_data_dir;
void set_data_dir(const std::string &dir)