summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7b2d0e)
raw | patch | inline | side by side (parent: a7b2d0e)
author | JucaBlues <JucaBlues@users.sourceforge.net> | |
Fri, 11 Jul 2008 07:28:13 +0000 (07:28 +0000) | ||
committer | JucaBlues <JucaBlues@users.sourceforge.net> | |
Fri, 11 Jul 2008 07:28:13 +0000 (07:28 +0000) |
src/ui/dialog/svg-fonts-dialog.cpp | patch | blob | history | |
src/ui/dialog/svg-fonts-dialog.h | patch | blob | history |
index 38639a20d189b3bdb3d51ec41f087658db3c4a00..5fa90966ccfe0b7849298a09942b293849efc55b 100644 (file)
#include "svg-fonts-dialog.h"
SvgFontDrawingArea::SvgFontDrawingArea(){
- this->text = (gchar*) "A@!A!@A";
+ this->text = "Sample Text";
this->svgfont = NULL;
((Gtk::Widget*) this)->set_size_request(150, 50);
}
this->svgfont = svgfont;
}
-void SvgFontDrawingArea::set_text(gchar* text){
+void SvgFontDrawingArea::set_text(Glib::ustring text){
this->text = text;
}
cr->set_font_face( Cairo::RefPtr<Cairo::FontFace>(new Cairo::FontFace(this->svgfont->get_font_face(), false /* does not have reference */)) );
cr->set_font_size (20);
cr->move_to (20, 20);
- cr->show_text (this->text);
+ cr->show_text (this->text.c_str());
}
return TRUE;
}
}
}
+void SvgFontsDialog::on_preview_text_changed(){
+// _font_da.set_text((gchar*) _preview_entry.get_text().c_str());
+ _font_da.set_text(_preview_entry.get_text());
+ _font_da.redraw();
+}
+
void SvgFontsDialog::on_font_selection_changed(){
_font_da.set_svgfont(this->get_selected_svgfont());
_font_da.redraw();
this->update_fonts();
+ _preview_entry.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_preview_text_changed));
+
_getContents()->add((Gtk::Widget&) _font_da);
+ _getContents()->add(_preview_entry);
+
+/* Gtk::HBox* preview_box = Gtk::manage(new Gtk::HBox());
+ _preview_entry.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_preview_text_changed));
+ preview_box->add(_preview_entry);
+ preview_box->add((Gtk::Widget&) _font_da);
+
+ _getContents()->add(*preview_box);*/
_getContents()->show_all();
//Settings for the selected SVGFont:
index 044ce5d44eae6d6337a9d6360dc0a8189448701f..789ccafcf53c0aeb5f1510e9f5f16fd625dc6bcf 100644 (file)
class SvgFontDrawingArea : Gtk::DrawingArea{
public:
SvgFontDrawingArea();
- void set_text(gchar*);
+ void set_text(Glib::ustring);
void set_svgfont(SvgFont*);
void redraw();
private:
SvgFont* svgfont;
- gchar* text;
+ Glib::ustring text;
bool on_expose_event (GdkEventExpose *event);
};
void update_fonts();
SvgFont* get_selected_svgfont();
void on_font_selection_changed();
+ void on_preview_text_changed();
private:
class Columns : public Gtk::TreeModel::ColumnRecord
{
Columns _columns;
Gtk::TreeView _font_list;
Gtk::VBox _font_settings;
+ Gtk::Entry _preview_entry;
SvgFontDrawingArea _font_da;
+
class EntryWidget : public Gtk::HBox
{
public: