From: arif Date: Tue, 26 Feb 2008 20:30:18 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: LAST_LIBGRAPH~32^2~4671 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9db3ee481cabdc2bb41532b449d34479cf79dcee;p=graphviz *** empty log message *** --- diff --git a/cmd/smyrna/draw.c b/cmd/smyrna/draw.c index 2df967b5d..93e838c50 100755 --- a/cmd/smyrna/draw.c +++ b/cmd/smyrna/draw.c @@ -551,7 +551,7 @@ void drawBorders(ViewInfo* view) if(view->bdVisible) { glColor4f(0.8,0.1,0.1,1); - glLineWidth(3); + glLineWidth(2); glBegin(GL_LINE_STRIP); glVertex2d(view->bdxLeft,view->bdyBottom); glVertex2d(view->bdxRight,view->bdyBottom); diff --git a/cmd/smyrna/gltemplate.c b/cmd/smyrna/gltemplate.c index ed415cc85..38155fa20 100755 --- a/cmd/smyrna/gltemplate.c +++ b/cmd/smyrna/gltemplate.c @@ -19,11 +19,12 @@ #include "gui.h" #include "viewport.h" #include "topview.h" -#include "gltemplate.h" +#include "glTemplate.h" #include "glutils.h" #include "glexpose.h" #include "glmenu.h" #include "selection.h" +#include "glcompset.h" static float begin_x = 0.0; static float begin_y = 0.0; static float dx = 0.0; @@ -117,12 +118,12 @@ static void realize (GtkWidget *widget,gpointer data) #ifdef WIN32 -#define SMYRNA_FONT "c:/arial.tga" +#define SMYRNA_OPENGL_FONT "c:/arial.tga" // #else -// using -DSMYRNA_FONT from Makefile.am and configure.ac +// using -DGTKTOPVIEW_FONT from Makefile.am and configure.ac #endif - g_print("loading font....%i\n",fontLoad(SMYRNA_FONT)); + g_print("loading font....%i\n",fontLoad(SMYRNA_OPENGL_FONT)); /*** OpenGL BEGIN ***/ if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext)) @@ -320,6 +321,8 @@ static gboolean motion_notify_event (GtkWidget* widget,GdkEventMotion *event,gpo float h = widget->allocation.height; float x = event->x; float y = event->y; + char buf[50]; + gboolean redraw = FALSE; dx = x - begin_x; @@ -345,11 +348,16 @@ static gboolean motion_notify_event (GtkWidget* widget,GdkEventMotion *event,gpo /*zooming*/ if ((event->state & GDK_BUTTON1_MASK) && (view->mouse.mouse_mode==MM_ZOOM)) { + float x; view->zoom=view->zoom+dx/10*(view->zoom*-1/20); if(view->zoom > MAX_ZOOM) view->zoom=MAX_ZOOM; if(view->zoom < MIN_ZOOM) view->zoom=MIN_ZOOM; + /*set label to new zoom value*/ + x=(100.0-1.0)*(view->zoom-MIN_ZOOM)/(MAX_ZOOM-MIN_ZOOM)+1; + sprintf(buf,"%i",(int)x); + glCompLabelSetText((glCompLabel*)view->Topview->customptr,buf); redraw = TRUE; } diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index e1f9d3281..fad9e828c 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -985,6 +985,7 @@ glCompSet* glcreate_gl_topview_menu() b->callbackfunc=menu_click_data; glCompSetAddButton(s,b); + b=glCompButtonNew(165,7,75,25,"HIDE",'\0',0,0); b->color.R=1; b->customptr=view; @@ -1056,6 +1057,7 @@ glCompSet* glcreate_gl_topview_menu() l->panel=p; l->fontsizefactor=0.4; glCompSetAddLabel(s,l); + view->Topview->customptr=l; l=glCompLabelNew(93,65,20,"zoom"); l->panel=p; l->fontsizefactor=0.4; diff --git a/lib/glcomp/glcompset.c b/lib/glcomp/glcompset.c index 6dc90db25..b69fb0609 100644 --- a/lib/glcomp/glcompset.c +++ b/lib/glcomp/glcompset.c @@ -33,7 +33,7 @@ int glCompDrawPanel(glCompPanel* p) { if(!p->visible) return 0; - glColor4f(p->color.R,p->color.B,p->color.G,p->color.A); + glColor4f(p->color.R,p->color.G,p->color.B,p->color.A); glBegin(GL_POLYGON); glVertex3f(p->pos.x,p->pos.y,p->bevel); glVertex3f(p->pos.x+p->width,p->pos.y,p->bevel); @@ -42,7 +42,7 @@ int glCompDrawPanel(glCompPanel* p) glVertex3f(p->pos.x,p->pos.y,p->bevel); glEnd(); glBegin(GL_LINE_STRIP); - glColor4f(p->shadowcolor.R,p->shadowcolor.B,p->shadowcolor.G,p->color.A); + glColor4f(p->shadowcolor.R,p->shadowcolor.G,p->shadowcolor.B,p->color.A); glVertex3f(p->pos.x,p->pos.y,p->bevel + GLCOMPSET_BEVEL_DIFF); glVertex3f(p->pos.x+p->width,p->pos.y,p->bevel+GLCOMPSET_BEVEL_DIFF); glVertex3f(p->pos.x+p->width,p->pos.y+p->height,p->bevel+GLCOMPSET_BEVEL_DIFF); @@ -51,7 +51,7 @@ int glCompDrawPanel(glCompPanel* p) glEnd(); glLineWidth(p->shadowwidth); glBegin(GL_LINE_STRIP); - glColor4f(p->shadowcolor.R,p->shadowcolor.B,p->shadowcolor.G,p->shadowcolor.A); + glColor4f(p->shadowcolor.R,p->shadowcolor.G,p->shadowcolor.B,p->shadowcolor.A); glVertex3f(p->pos.x+ p->shadowwidth/2.0,p->pos.y-p->shadowwidth/2.0,p->bevel); glVertex3f(p->pos.x+ p->shadowwidth/2.0+p->width,p->pos.y-p->shadowwidth/2.0,p->bevel); glVertex3f(p->pos.x+ p->shadowwidth/2.0+p->width,p->pos.y-p->shadowwidth/2.0+p->height,p->bevel); @@ -147,7 +147,7 @@ int glCompDrawLabel(glCompLabel* p) } fontSize (p->size); - fontColorA (p->color.R,p->color.B,p->color.G,p->color.A); + fontColorA (p->color.R,p->color.G,p->color.B,p->color.A); fontDrawString ( p->pos.x,p->pos.y,p->text,p->size*p->fontsizefactor*strlen(p->text)); if (p->panel) @@ -337,7 +337,7 @@ int glCompDrawButton(glCompButton* p) glVertex3f(p->pos.x+p->thickness,p->pos.y+p->thickness,p->bevel); glEnd(); //buttom thickness - glColor4f(p->color.R*color_fac,p->color.B*color_fac,p->color.G*color_fac,p->color.A); + glColor4f(p->color.R*color_fac,p->color.G*color_fac,p->color.B*color_fac,p->color.A); glBegin(GL_POLYGON); glVertex3f(p->pos.x+p->thickness,p->pos.y+p->thickness,p->bevel); glVertex3f(p->pos.x+p->width-p->thickness,p->pos.y+p->thickness,p->bevel); @@ -354,7 +354,7 @@ int glCompDrawButton(glCompButton* p) glVertex3f(p->pos.x+p->width,p->pos.y+p->height,p->bevel); glEnd(); - glColor4f(p->color.R/color_fac,p->color.B/color_fac,p->color.G/color_fac,p->color.A); + glColor4f(p->color.R/color_fac,p->color.G/color_fac,p->color.B/color_fac,p->color.A); glBegin(GL_POLYGON); glVertex3f(p->pos.x+p->thickness,p->pos.y+p->thickness,p->bevel); glVertex3f(p->pos.x+p->thickness,p->pos.y+p->height-p->thickness,p->bevel); @@ -398,7 +398,7 @@ int glCompDrawButton(glCompButton* p) glDisable( GL_TEXTURE_2D ); if(p->status==1) { - glColor4f(p->color.R*color_fac,p->color.B*color_fac,p->color.G*color_fac,p->color.A/2); + glColor4f(p->color.R*color_fac,p->color.G*color_fac,p->color.B*color_fac,p->color.A/2); glBegin(GL_POLYGON); glVertex3d(fontx-p->thickness,fonty-p->thickness,p->bevel+GLCOMPSET_BEVEL_DIFF*2); glVertex3d(fontx+p->glyph->w+p->thickness,fonty-p->thickness,p->bevel+GLCOMPSET_BEVEL_DIFF*2); diff --git a/lib/glcomp/glcompset.h b/lib/glcomp/glcompset.h index c2421a709..4859ff5c5 100644 --- a/lib/glcomp/glcompset.h +++ b/lib/glcomp/glcompset.h @@ -140,7 +140,7 @@ void glCompDrawBegin(); //pushes a gl stack void glCompDrawEnd(); //pops the gl stack int glCompDrawPanel(glCompPanel* p); int glCompSetClick(glCompSet* s,int x,int y); -int glCompSetRelease(glCompSet* s, int x, int y); +int glCompSetRelease(glCompSet* s); void glCompSetGetPos(int x, int y,float* X,float* Y,float* Z); int glCompPointInButton(glCompButton* p,float x,float y); void glCompButtonClick(glCompButton* p); @@ -154,4 +154,4 @@ int glCompPanelHide(glCompPanel* p); int glCompPanelShow(glCompPanel* p); -#endif +#endif \ No newline at end of file