]> granicus.if.org Git - graphviz/commitdiff
GLgui layout changes, all buttons are on the left side
authorarif <devnull@localhost>
Fri, 6 Nov 2009 18:02:13 +0000 (18:02 +0000)
committerarif <devnull@localhost>
Fri, 6 Nov 2009 18:02:13 +0000 (18:02 +0000)
cmd/smyrna/glexpose.c
cmd/smyrna/gui/appmouse.c
cmd/smyrna/gui/appmouse.h
cmd/smyrna/gui/glcompui.c
cmd/smyrna/main.c
cmd/smyrna/smyrna.vcproj
cmd/smyrna/smyrnadefs.h
cmd/smyrna/topview.c

index 7add58af7cea27224bda69f754d90fd3923d0c8c..8dcd0389189fe93349aefdad7a2a4e5e6c194be5 100644 (file)
@@ -163,6 +163,8 @@ int glexpose_main(ViewInfo * view)
            btnToolZoomFit_clicked(NULL, NULL);
        }
     }
+    else
+       return;
 
     glexpose_grid(view);
     draw_fisheye_magnifier(view);
index 06ff992d243bfdfa6c2924835b287844171f4a3c..6326f78eb034558d1404e58e421fc6de4690e9f7 100644 (file)
@@ -63,36 +63,62 @@ static void appmouse_down(ViewInfo* v,int x,int y)
 }
 static void appmouse_up(ViewInfo* v,int x,int y)
 {
-       v->mouse.down=0;
-       v->mouse.finalPos.x=x;
-       v->mouse.finalPos.y=y;
-        view->mouse.dragX = 0;
-       view->mouse.dragY = 0;
 
-       GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLfinalPos.x,&v->mouse.GLfinalPos.y,&v->mouse.GLfinalPos.z);
-       if(singleclick(v))
-       {
-          if (v->mouse.t==glMouseLeftButton)
-              appmouse_left_click(v,x,y);
-          if (v->mouse.t==glMouseRightButton)
-              appmouse_right_click(v,x,y);
-       }
+    int a;
+    v->mouse.down=0;
+    v->mouse.finalPos.x=x;
+    v->mouse.finalPos.y=y;
+    view->mouse.dragX = 0;
+    view->mouse.dragY = 0;
+    a=get_mode(v);
+    GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLfinalPos.x,&v->mouse.GLfinalPos.y,&v->mouse.GLfinalPos.z);
+    if(singleclick(v))
+    {
+       if (v->mouse.t==glMouseLeftButton)
+           appmouse_left_click(v,x,y);
+       if (v->mouse.t==glMouseRightButton)
+           appmouse_right_click(v,x,y);
+    }
+    if ((a== MM_FISHEYE_MAGNIFIER) || (a == MM_MAGNIFIER))     //fisheye mag mouse release, stop distortion
+        originate_distorded_coordinates(v->Topview);
+
+
 
 }
 static void appmouse_drag(ViewInfo* v,int x,int y)
 {
     static float x2,y2;
+    int a=get_mode(v);
     v->mouse.pos.x=x;
     v->mouse.pos.y=y;
     GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
     x2=v->mouse.GLpos.x;
     y2=v->mouse.GLpos.y;
-//    v->mouse.dragX=x2-prevX;
-//    v->mouse.dragY=y2-prevY;
 
     prevX=x2;
     prevY=y2;
-//    printf ("(%f,%f)->(%f,%f) : %f  %f \n",v->mouse.pos.x,v->mouse.GLinitPos.y,v->mouse.GLfinalPos.x,v->mouse.GLfinalPos.y,v->mouse.dragX,v->mouse.dragY);
+    if (a==MM_ROTATE)
+
+    {
+       view->arcball->MousePt.s.X = (GLfloat) x;
+       view->arcball->MousePt.s.Y = (GLfloat) y;
+       if (!view->arcball->isDragging) {
+           arcmouseClick(view);
+        view->arcball->isDragging = 1;
+       } else 
+                   arcmouseDrag(view);
+       return;
+    }
+    if (a==MM_PAN)
+       glmotion_pan(v);
+    if (a==MM_MOVE)
+        move_TVnodes();
+
+    if(a==MM_RECTANGULAR_SELECT)
+    {
+
+    }
+
 
 }
 
@@ -102,32 +128,6 @@ void appmouse_left_click_down(ViewInfo* v,int x,int y)
        appmouse_down(v,x,y);
 
 
-}
-int get_mode(ViewInfo* v)
-{
-/*#define MM_PAN                                       0
-#define MM_ZOOM                                        1
-#define MM_ROTATE                              2
-#define MM_SINGLE_SELECT               3
-#define MM_RECTANGULAR_SELECT  4
-#define MM_RECTANGULAR_X_SELECT        5
-#define MM_MOVE                                        10
-#define MM_MAGNIFIER                   20
-#define MM_FISHEYE_MAGNIFIER   21*/
-
-
-    if ((view->mouse.t==glMouseLeftButton)&&(view->keymap.down) && (view->keymap.keyVal == B_LSHIFT/*left shift*/) && (view->active_camera==-1))
-       return MM_FISHEYE_MAGNIFIER;
-    if ((view->mouse.t==glMouseLeftButton)&&(view->keymap.down) && (view->keymap.keyVal == B_LSHIFT/*left shift*/) && (view->active_camera>-1))
-       return MM_ROTATE;
-    if ((view->mouse.t==glMouseLeftButton)&&(view->keymap.down) && (view->keymap.keyVal == B_LCTRL/*left CTRL*/)) 
-       return MM_MOVE;
-    if ((view->mouse.t==glMouseLeftButton)&&(view->mouse.down) ) 
-       return MM_PAN;
-
-
-
-
 }
 void appmouse_left_click_up(ViewInfo* v,int x,int y)
 {
@@ -135,32 +135,11 @@ void appmouse_left_click_up(ViewInfo* v,int x,int y)
     appmouse_up(v,x,y);
 /*     if (v->mouse.mouse_mode == MM_MOVE)
            move_TVnodes();*/
-       if ((a== MM_FISHEYE_MAGNIFIER) || (a == MM_MAGNIFIER))  //fisheye mag mouse release, stop distortion
-           originate_distorded_coordinates(v->Topview);
-
-
 }
 void appmouse_left_drag(ViewInfo* v,int x,int y)
 {
-    int a=get_mode(v);
     appmouse_drag(v,x,y);
 
-    if (a==MM_ROTATE)
-
-    {
-       view->arcball->MousePt.s.X = (GLfloat) x;
-       view->arcball->MousePt.s.Y = (GLfloat) y;
-       if (!view->arcball->isDragging) {
-           arcmouseClick(view);
-        view->arcball->isDragging = 1;
-       } else 
-                   arcmouseDrag(view);
-       return;
-    }
-    if (a==MM_PAN)
-       glmotion_pan(v);
-    if (a==MM_MOVE)
-        move_TVnodes();
 
 
 }
index acfda104f53eabc924d4ada49551d617b36f0425..0d6490f79543604d978bb5aba0b2d73fcad4ae5d 100644 (file)
@@ -24,6 +24,4 @@ extern void appmouse_left_drag(ViewInfo* v,int x,int y);
 extern void appmouse_right_click_down(ViewInfo* v,int x,int y);
 extern void appmouse_right_click_up(ViewInfo* v,int x,int y);
 extern void appmouse_right_drag(ViewInfo* v,int x,int y);
-extern int get_mode(ViewInfo* v);
-
 #endif
index 6981c679193a4f2309ef3c260e9f6ecd7a18eb8f..9ab4935a36716a9d07b0283c6d01a614a525df5b 100644 (file)
@@ -198,7 +198,7 @@ glCompSet *glcreate_gl_topview_menu(void)
     glCompColor c;
     s->common.callbacks.click = CBglCompMouseRightClick;
 
-    p = glCompPanelNew((glCompObj *) s, 25, 25, 53, 47);
+    p = glCompPanelNew((glCompObj *) s, 25, 25, 51, 47);
     p->common.align = glAlignLeft;
     p->common.data = 0;
 
@@ -210,12 +210,37 @@ glCompSet *glcreate_gl_topview_menu(void)
 
     y = y + off;
 
+    /*switch to fisheye */
+    b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+    glCompButtonAddPngGlyph(b, smyrnaPath("fisheye.png"));
+    b->common.callbacks.click = menu_switch_to_fisheye;
+    toFisheye = b;
+
+
+    /*switch to normal mode */
+    b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+    glCompButtonAddPngGlyph(b, smyrnaPath("no_fisheye.png"));
+    b->common.callbacks.click = menu_switch_to_fisheye;
+    b->common.visible = 0;
+    toNormal = b;
+
+    y=y+off;
+    b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+    glCompButtonAddPngGlyph(b, smyrnaPath("3D.png"));
+    b->common.callbacks.click = switch2D3D;
+    to3DBtn = b;
+
+
+    b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
+    glCompButtonAddPngGlyph(b, smyrnaPath("2D.png"));
+    b->common.callbacks.click = switch2D3D;
+    glCompButtonHide(b);
+    to2DBtn = b;
 
-    y = y + off;
 
 
 
-    p = glCompPanelNew((glCompObj *) p, 1, 25, 80, 255);
+    p = glCompPanelNew((glCompObj *) p, 1, 325, 80, 180);
     p->common.align = glAlignTop;
     p->common.data = 0;
     p->common.borderWidth = 1;
@@ -240,7 +265,6 @@ glCompSet *glcreate_gl_topview_menu(void)
     glCompButtonAddPngGlyph(b, smyrnaPath("zoomin.png"));
     b->groupid = 0;
     b->common.callbacks.click = menu_click_zoom_plus;
-
     copy_glcomp_color(&c, &b->common.color);
     y = y + off;
 
@@ -248,12 +272,6 @@ glCompSet *glcreate_gl_topview_menu(void)
     b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
     glCompButtonAddPngGlyph(b, smyrnaPath("zoomout.png"));
     b->common.callbacks.click = menu_click_zoom_minus;
-
-    y = y + off;
-    copy_glcomp_color(&c, &b->common.color);
-
-    b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
-    glCompButtonAddPngGlyph(b, smyrnaPath("fit.png"));
     copy_glcomp_color(&c, &b->common.color);
 
     y = y + off;
@@ -268,22 +286,7 @@ glCompSet *glcreate_gl_topview_menu(void)
 
        
        
-       y = y + off;
-
-
-    b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
-    glCompButtonAddPngGlyph(b, smyrnaPath("3D.png"));
-    b->common.callbacks.click = switch2D3D;
-    copy_glcomp_color(&c, &b->common.color);
-    to3DBtn = b;
-
 
-    b = glCompButtonNew((glCompObj *) p, 1, y, 42, 42, "");
-    glCompButtonAddPngGlyph(b, smyrnaPath("2D.png"));
-    b->common.callbacks.click = switch2D3D;
-    glCompButtonHide(b);
-    copy_glcomp_color(&c, &b->common.color);
-    to2DBtn = b;
 
 
 
@@ -308,19 +311,6 @@ glCompSet *glcreate_gl_topview_menu(void)
     p->common.data = 0;
     p->common.color.A = 0;
 
-    /*switch to fisheye */
-    b = glCompButtonNew((glCompObj *) p, 2, 1, 42, 42, "");
-    glCompButtonAddPngGlyph(b, smyrnaPath("fisheye.png"));
-    b->common.callbacks.click = menu_switch_to_fisheye;
-    toFisheye = b;
-
-
-    /*switch to normal mode */
-    b = glCompButtonNew((glCompObj *) p, 2, 1, 42, 42, "");
-    glCompButtonAddPngGlyph(b, smyrnaPath("no_fisheye.png"));
-    b->common.callbacks.click = menu_switch_to_fisheye;
-    b->common.visible = 0;
-    toNormal = b;
 
 
 
index 052f27d07cba9dd413438b4daed306d43dae83fc..e0c58bea57e2c0825cba9e810adf1d12a4908534 100755 (executable)
@@ -218,6 +218,10 @@ int main(int argc, char *argv[])
 //      gladewidget = glade_xml_get_widget(xml, "vbox2");
     gladewidget = glade_xml_get_widget(xml, "hbox11");
 
+    gtk_widget_hide(glade_xml_get_widget(xml, "vbox13"));
+    gtk_widget_hide(glade_xml_get_widget(xml, "hbox7"));
+
+
     create_window(glconfig, gladewidget);
 
     change_cursor(GDK_TOP_LEFT_ARROW);
index 5f436ac1fabf7165de8f082f3a65ddb03b3396a6..bc7604d2960023691e64a001001d87466e106372 100644 (file)
                                RelativePath=".\hier.h"
                                >
                        </File>
+                       <File
+                               RelativePath=".\hotkeymap.h"
+                               >
+                       </File>
                        <File
                                RelativePath=".\materials.h"
                                >
                                RelativePath=".\hier.c"
                                >
                        </File>
+                       <File
+                               RelativePath=".\hotkeymap.c"
+                               >
+                       </File>
                        <File
                                RelativePath=".\main.c"
                                >
index 75d8c6844554129cb7706d2d461ade9c0c91c438..7f74814ccc7445b06b32fef0312763d8d1cb7121 100644 (file)
@@ -70,10 +70,6 @@ typedef struct _ArcBall_t ArcBall_t;
 #define MM_MAGNIFIER                   20
 #define MM_FISHEYE_MAGNIFIER   21
 
-#define B_LSHIFT           65505
-#define B_RSHIFT           65506
-#define B_LCTRL                    65507
-#define B_RCTRL                    65508
 
 
 #define GLOBAL_Z_OFFSET                        0.001
index 3f2b100869785adc4f69734b40f4dff83a486178..3edbe7b1cdd89829fbd80d69137ccdf5d4a686ee 100755 (executable)
@@ -476,9 +476,6 @@ void preparetopview(Agraph_t * g, topview * t)
     t->picked_edge_count = 0;
     t->picked_edges = '\0';
 
-    /*hide stupid console window */
-    gtk_widget_hide(glade_xml_get_widget(xml, "vbox13"));
-    gtk_widget_hide(glade_xml_get_widget(xml, "hbox7"));
        /*create attribute list*/
        t->attributes=load_attr_list(view->g[view->activeGraph]);
        t->filtered_attr_list=NULL;
@@ -663,17 +660,17 @@ static int drawtopviewnodes(Agraph_t * g)
                zdepth = (float) Z_BACK_PLANE;
 
            if ((view->defaultnodeshape == 0)) {
-               glVertex3f(v->distorted_x - ddx,
-                          v->distorted_y - ddy, v->distorted_z - ddz);
+               glVertex3f(v->distorted_x,
+                          v->distorted_y, v->distorted_z);
            } else if (view->defaultnodeshape == 1) {
                if (v->size > 0)
-                   drawCircle(v->distorted_x - ddx, v->distorted_y - ddy,
+                   drawCircle(v->distorted_x , v->distorted_y ,
                               v->size * view->Topview->init_node_size,
-                              v->distorted_z - ddz);
+                              v->distorted_z );
                else
-                   drawCircle(v->distorted_x - ddx, v->distorted_y - ddy,
+                   drawCircle(v->distorted_x , v->distorted_y,
                               view->Topview->init_node_size,
-                              v->distorted_z - ddz);
+                              v->distorted_z);
            }
        } else {
            /* int a=1; */
@@ -823,7 +820,7 @@ void drawTopViewGraph(Agraph_t * g)
     drawtopviewedges(g);
     drawtopviewedgelabels(g);
     enddrawcycle(g);
-       draw_tv_xdot(view->Topview);
+    draw_tv_xdot(view->Topview);
     draw_node_hint_boxes();
     if ((view->Selection.Active > 0) && (!view->SignalBlock)) {
        view->Selection.Active = 0;
@@ -1318,7 +1315,7 @@ static void draw_xdot(xdot* x,float base_z)
 static void draw_tv_xdot(topview* t)
 {
     int j;
-       float basez=0;
+    float basez=0;
        draw_xdot(t->xDot,basez);
        basez= basez+0.01;
        for (j=0; j < t->Nodecount; j++)