glVertex3f(x2,y2,z2);
- /*blue font color*/
- glprintfglut (GLUT_BITMAP_HELVETICA_12, dx,dy,dz,"[");
- glprintfglut (GLUT_BITMAP_HELVETICA_12, dx,(dy+fs+fs/(GLfloat)5.0),dz,lbl);
}
glEnd();
glLineWidth(0);
agxbinit (&xbuf, SMALLBUF, xbuffer);
/*file name should be returned in xbuf*/
- if (openfiledlg(0,NULL,&xbuf)) {
- input_file = fopen(agxbuse (&xbuf), "r");
- if (input_file) {
- while (fgets(buf, BUFSIZ, input_file)) {
- agxbput (&xbuf, buf);
- }
- gtkbuf = gtk_text_view_get_buffer((GtkTextView*) glade_xml_get_widget(xml,"gvprtextinput"));
- str=agxbuse (&xbuf);
- if(g_utf8_validate(str,-1,NULL)) {
- gtk_text_buffer_set_text (gtkbuf, str, -1);
- }
- else {
- show_gui_warning ("File format is not UTF8!");
- }
- fclose (input_file);
+ if (openfiledlg(0,NULL,&xbuf))
+ {
+ input_file = fopen(agxbuse (&xbuf), "r");
+ if (input_file)
+ {
+ while (fgets(buf, BUFSIZ, input_file))
+ agxbput (&xbuf, buf);
+ gtkbuf = gtk_text_view_get_buffer((GtkTextView*) glade_xml_get_widget(xml,"gvprtextinput"));
+ str=agxbuse (&xbuf);
+ if(g_utf8_validate(str,-1,NULL))
+ {
+ gtk_text_buffer_set_text (gtkbuf, str, -1);
+ }
+ else
+ {
+ show_gui_warning ("File format is not UTF8!");
+ }
+ fclose (input_file);
}
- else {
+ else
+ {
show_gui_warning ("file couldn't be opened\n");
}
}
#include "memory.h"
void on_settingsOKBtn_clicked(GtkWidget * widget, gpointer user_data)
+{
+ on_settingsApplyBtn_clicked (widget,user_data);
+ gtk_widget_hide(glade_xml_get_widget(xml, "dlgSettings"));
+}
+void on_settingsApplyBtn_clicked(GtkWidget * widget, gpointer user_data)
+
{
update_graph_from_settings(view->g[view->activeGraph]);
set_viewport_settings_from_template(view, view->g[view->activeGraph]);
settvcolorinfo(view->g[view->activeGraph],view->Topview);
- gtk_widget_hide(glade_xml_get_widget(xml, "dlgSettings"));
}
+
void on_settingsCancelBtn_clicked(GtkWidget * widget, gpointer user_data)
{
gtk_widget_hide(glade_xml_get_widget(xml, "dlgSettings"));
#include "smyrnadefs.h"
_BB void on_settingsOKBtn_clicked(GtkWidget * widget, gpointer user_data);
-_BB void on_settingsCancelBtn_clicked(GtkWidget * widget,
- gpointer user_data);
+_BB void on_settingsCancelBtn_clicked(GtkWidget * widget,gpointer user_data);
+_BB void on_settingsApplyBtn_clicked(GtkWidget * widget, gpointer user_data);
+
extern int load_settings_from_graph(Agraph_t * g);
extern int update_graph_from_settings(Agraph_t * g);
extern int show_settings_form();
#include <stdlib.h>
#include <assert.h>
#include <glade/glade.h>
+#include <gtk/gtk.h>
+#include "draw.h"
//#include <viewport.h>
//#include <gltemplate.h>
#include <gvpr.h>
-
+extern GladeXML *xml; //global libglade vars
static ssize_t outfn (void* sp, const char *buf, size_t nbyte, void* dp)
{
- return write (1, buf, nbyte);
+ GtkTextIter endit;
+ GtkTextBuffer * gtkbuf;
+ /*get text view buffer*/
+ gtkbuf = gtk_text_view_get_buffer((GtkTextView*) glade_xml_get_widget(xml,"gvprtextoutput"));
+ /*set iterator to the end of the buffer*/
+ gtk_text_buffer_get_end_iter (gtkbuf,&endit);
+ /*insert buf to the end*/
+ gtk_text_buffer_insert(gtkbuf,&endit,buf,nbyte);
+ return nbyte;
}
static ssize_t errfn (void* sp, const char *buf, size_t nbyte, void* dp)
return write (2, buf, nbyte);
}
+
+
+
int run_gvpr (Agraph_t* srcGraph, int argc, char* argv[])
{
int i, rv = 1;
opts.out = outfn;
opts.err = errfn;
opts.flags = GV_USE_OUTGRAPH;
-
+
rv = gvpr (argc, argv, &opts);
if (rv) { /* error */
- fprintf (stderr, "Error in gvpr\n");
+ fprintf (stderr, "Error in gvpr\n");
}
- else if (opts.n_outgraphs) {
- refreshViewport (0);
- sprintf (buf, "<%d>", ++count);
- add_graph_to_viewport(opts.outgraphs[0], buf);
+ else if (opts.n_outgraphs)
+ {
+ refreshViewport (0);
+ sprintf (buf, "<%d>", ++count);
+ if (opts.outgraphs[0] != view->g[view->activeGraph])
+ add_graph_to_viewport(opts.outgraphs[0], buf);
if (opts.n_outgraphs > 1)
fprintf (stderr, "Warning: multiple output graphs-discarded\n");
for (i = 1; i < opts.n_outgraphs; i++) {
drawtopviewedges(g);
drawtopviewedgelabels(g);
enddrawcycle(g);
- draw_xdot_set(view->Topview->xdot_list);
+// draw_xdot_set(view->Topview->xdot_list);
draw_node_hint_boxes();
if ((view->Selection.Active > 0) && (!view->SignalBlock)) {
view->Selection.Active = 0;
</child>
<child>
- <widget class="GtkButton" id="settingsOKBtn">
+ <widget class="GtkButton" id="button12">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Apply</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="on_settingsApplyBtn_clicked" last_modification_time="Mon, 20 Jul 2009 16:39:55 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button11">
<property name="visible">True</property>
<property name="label" translatable="yes">OK</property>
<property name="use_underline">True</property>
</packing>
</child>
- <child>
- <widget class="GtkEntry" id="gvprargs">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
+ <child>
+ <widget class="GtkEntry" id="gvprargs">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">*</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
- </packing>
- </child>
+ </packing>
+ </child>
<child>
<widget class="GtkLabel" id="label114">