summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2246da)
raw | patch | inline | side by side (parent: f2246da)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 29 Nov 2007 22:42:44 +0000 (22:42 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 29 Nov 2007 22:42:44 +0000 (22:42 +0000) |
src/display/canvas-axonomgrid.cpp | patch | blob | history | |
src/display/canvas-grid.cpp | patch | blob | history | |
src/display/canvas-grid.h | patch | blob | history |
index cb83900bbd8838fd813dd72774b2100df0f03bc9..654dcf903ce1ac836e14f2f8cf7bf6a72bc44ea5 100644 (file)
@@ -191,7 +191,7 @@ attach_all(Gtk::Table &table, Gtk::Widget const *const arr[], unsigned size, int
}
CanvasAxonomGrid::CanvasAxonomGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc)
- : CanvasGrid(nv, in_repr, in_doc), table(1, 1)
+ : CanvasGrid(nv, in_repr, in_doc, GRID_AXONOMETRIC), table(1, 1)
{
origin[NR::X] = origin[NR::Y] = 0.0;
color = 0xff3f3f20;
index b58a53297ecf30be8a6a08e76e61535d0df172ee..92e0c509634f510aafd2074fe9c933dca96fb8bc 100644 (file)
@@ -150,7 +150,8 @@ grid_canvasitem_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i
NULL /* order_changed */
};
-CanvasGrid::CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument *in_doc)
+CanvasGrid::CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument *in_doc, GridType type)
+ : namelabel("", Gtk::ALIGN_LEFT), gridtype(type)
{
repr = in_repr;
doc = in_doc;
@@ -160,6 +161,12 @@ CanvasGrid::CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocume
namedview = nv;
canvasitems = NULL;
+
+ Glib::ustring str("<b>");
+ str += getName();
+ str += "</b>";
+ namelabel.set_markup(str);
+ vbox.pack_start(namelabel,true,true);
}
CanvasGrid::~CanvasGrid()
}
}
+const char *
+CanvasGrid::getName()
+{
+ return _(grid_name[gridtype]);
+}
+
+const char *
+CanvasGrid::getSVGName()
+{
+ return grid_svgname[gridtype];
+}
+
+GridType
+CanvasGrid::getGridType()
+{
+ return gridtype;
+}
char const *
@@ -342,7 +366,7 @@ attach_all(Gtk::Table &table, Gtk::Widget const *const arr[], unsigned size, int
}
CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc)
- : CanvasGrid(nv, in_repr, in_doc), table(1, 1)
+ : CanvasGrid(nv, in_repr, in_doc, GRID_RECTANGULAR), table(1, 1)
{
origin[NR::X] = origin[NR::Y] = 0.0;
color = DEFAULTGRIDCOLOR;
index 3c19d39d8d3a482e2d6c7026b6b1b2ea160fd147..f05d3b5cb0c2eb37132247aaa6911f7c74f20219 100644 (file)
*
* Generic (and quite unintelligent) grid item for gnome canvas
*
- * Copyright (C) Johan Engelen 2006 <johan@shouraizou.nl>
+ * Copyright (C) Johan Engelen 2006-2007 <johan@shouraizou.nl>
* Copyright (C) Lauris Kaplinski 2000
*
*/
class CanvasGrid {
public:
- CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument *in_doc);
virtual ~CanvasGrid();
+ // TODO: see effect.h and effect.cpp from live_effects how to link enums to SVGname to typename properly. (johan)
+ const char * getName();
+ const char * getSVGName();
+ GridType getGridType();
static const char * getName(GridType type);
static const char * getSVGName(GridType type);
static GridType getGridTypeFromSVGName(const char * typestr);
static void on_repr_attr_changed (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive, void * data);
protected:
+ CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument *in_doc, GridType type);
+
GSList * canvasitems; // list of created canvasitems
SPNamedView * namedview;
Gtk::VBox vbox;
+ Gtk::Label namelabel;
+
+ GridType gridtype;
private:
CanvasGrid(const CanvasGrid&);
CanvasGrid& operator=(const CanvasGrid&);
-
};