From e66c8234164e9a7aab616e8f05439633b08cd9a8 Mon Sep 17 00:00:00 2001 From: arif Date: Thu, 6 Nov 2008 22:08:16 +0000 Subject: [PATCH] Quick find fixed invisible dots new try on fit to screen --- cmd/smyrna/glexpose.c | 1 + cmd/smyrna/gui/menucallbacks.c | 29 + cmd/smyrna/gui/menucallbacks.h | 1 + cmd/smyrna/topview.c | 20 + share/gui/smyrna.glade | 1341 +++++++++++++++++--------------- 5 files changed, 749 insertions(+), 643 deletions(-) diff --git a/cmd/smyrna/glexpose.c b/cmd/smyrna/glexpose.c index 15887016c..0d52f6dd5 100644 --- a/cmd/smyrna/glexpose.c +++ b/cmd/smyrna/glexpose.c @@ -90,6 +90,7 @@ int glexpose_main(ViewInfo * view) { doonce=1; btnToolZoomFit_clicked(NULL,NULL); + btnToolZoomFit_clicked(NULL,NULL); } } diff --git a/cmd/smyrna/gui/menucallbacks.c b/cmd/smyrna/gui/menucallbacks.c index 35fcdb916..ce0249a1f 100755 --- a/cmd/smyrna/gui/menucallbacks.c +++ b/cmd/smyrna/gui/menucallbacks.c @@ -207,6 +207,35 @@ void mGraphPropertiesSlot(GtkWidget * widget, gpointer user_data) gtk_widget_hide(glade_xml_get_widget(xml, "dlgOpenGraph")); } } + +void mNodeFindSlot(GtkWidget * widget, gpointer user_data) +{ + if((view->activeGraph !=-1) && (GD_TopView(view->g[view->activeGraph]))) + { + gtk_dialog_set_response_sensitive((GtkDialog *) + glade_xml_get_widget(xml, + "findDialog"), + 1, 1); + gtk_dialog_set_response_sensitive((GtkDialog *) + glade_xml_get_widget(xml, + "findDialog"), + 2, 1); + + + respond = + gtk_dialog_run((GtkDialog *) + glade_xml_get_widget(xml, "findDialog")); + + gtk_widget_hide(glade_xml_get_widget(xml, "findDialog")); + if (respond ==1) + select_with_regex( + gtk_entry_get_text((GtkEntry*) glade_xml_get_widget(xml,"findText")) + ); + } + +} + + static void mPropertiesSlot(int count, gve_element element) { if (count > 0) { diff --git a/cmd/smyrna/gui/menucallbacks.h b/cmd/smyrna/gui/menucallbacks.h index 283c096de..769ab4941 100755 --- a/cmd/smyrna/gui/menucallbacks.h +++ b/cmd/smyrna/gui/menucallbacks.h @@ -34,6 +34,7 @@ _BB void mCopySlot(GtkWidget * widget, gpointer user_data); _BB void mPasteSlot(GtkWidget * widget, gpointer user_data); _BB void mDeleteSlot(GtkWidget * widget, gpointer user_data); _BB void mTopviewSettingsSlot(GtkWidget * widget, gpointer user_data); +_BB void mNodeFindSlot(GtkWidget * widget, gpointer user_data); //view _BB void mShowToolBoxSlot(GtkWidget * widget, gpointer user_data); diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 1a3a3eb44..182f5b89b 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -1681,6 +1681,26 @@ element2s (gve_element el) return s; } +void select_with_regex(char* exp) +{ + topview_node *v; + int ind=0; + for (ind = 0; ind < view->Topview->Nodecount; ind++) + { + v = &view->Topview->Nodes[ind]; + if (node_visible(v->Node)) + { + if(node_regex(v,exp)) + { + OD_Selected(v->Node) = 1; + select_object(view->g[view->activeGraph], v->Node); + } + } + } + + +} + static int node_regex(topview_node * n,char* exp) { diff --git a/share/gui/smyrna.glade b/share/gui/smyrna.glade index d20ac54c6..fdc582213 100755 --- a/share/gui/smyrna.glade +++ b/share/gui/smyrna.glade @@ -1,6 +1,6 @@ - + 470 @@ -660,6 +660,15 @@ topview + + + True + gtk-find + True + True + + + True @@ -1329,30 +1338,6 @@ topview 2 - - - True - - - - - - - - - True - - - False - 2 - - - - - False - 3 - - @@ -2232,40 +2217,39 @@ topview 3 2 - + True - + 15 True All - 0 0 True - + 75 True - Highlighted + Selected 0 0 True - rbTVFilterHigh1 + rbTVFilterSel1 1 - + 100 True - Not Highlighted + Non-selected 0 True - rbTVFilterHigh1 + rbTVFilterSel1 2 @@ -2275,6 +2259,33 @@ topview 1 2 + + + + + True + 0 + Selection + + + + + True + 0 + Visible + + + 1 + 2 + + + + + True + 0 + Highlighted + + 2 3 @@ -2327,68 +2338,40 @@ topview - - True - 0 - Highlighted - - - 2 - 3 - - - - - True - 0 - Visible - - - 1 - 2 - - - - - True - 0 - Selection - - - - + True - + 15 True All + 0 0 True - + 75 True - Selected + Highlighted 0 0 True - rbTVFilterSel1 + rbTVFilterHigh1 1 - + 100 True - Non-selected + Not Highlighted 0 True - rbTVFilterSel1 + rbTVFilterHigh1 2 @@ -2398,6 +2381,8 @@ topview 1 2 + 2 + 3 @@ -2433,48 +2418,54 @@ topview 2 5 - + + 2 True >= - 3 - 4 - 1 - 2 + 1 + 2 + GTK_FILL - + True - DATA 2 + >= - 2 - 3 + 1 + 2 1 2 - + + 180 + True + + + + + 180 True 4 5 - 1 - 2 - - 180 + + 63 True + DATA 1 - 1 - 2 + 2 + 3 @@ -2488,54 +2479,48 @@ topview - - 63 + + 180 True - DATA 1 - 2 - 3 + 1 + 2 - - 180 + True 4 5 + 1 + 2 - - 180 - True - - - - + True - >= + DATA 2 - 1 - 2 + 2 + 3 1 2 - - 2 + True >= - 1 - 2 - GTK_FILL + 3 + 4 + 1 + 2 @@ -2791,67 +2776,67 @@ topview 3 2 - + + 56 True - 0 - Num. of fine Nodes + + 1 + 2 + 2 + 3 + - + + 56 True - 0 - Coersening factor + 1 + 2 1 2 - + + 56 True - 0 - Distortion factor - 2 - 3 + 1 + 2 - - 56 + True + 0 + Distortion factor - 1 - 2 + 2 + 3 - - 56 + True + 0 + Coersening factor - 1 - 2 1 2 - - 56 + True + 0 + Num. of fine Nodes - - 1 - 2 - 2 - 3 - @@ -3077,7 +3062,7 @@ topview - + True 0 True @@ -3085,59 +3070,25 @@ topview 2 3 - 10 - 11 + 11 + 12 GTK_EXPAND - - True - 0 - True - - - 2 - 3 - 9 - 10 - GTK_EXPAND - - - - - True - 0 - 5 - Draw Edges - - - 10 - 11 - - - - + True 0 5 - Draw Nodes + Draw Labels - 9 - 10 + 11 + 12 - - True - 0 - 5 - Background Color - - - - + True 0 #000000000000 @@ -3145,94 +3096,106 @@ topview 1 2 + 8 + 9 - + True 0 5 - Border Color + Selected Edge Color - 1 - 2 + 8 + 9 - + True - 0 - 5 - Grid Color + 0 + True - 2 - 3 + 2 + 3 + 4 + 5 + GTK_EXPAND - + True - 0 - 5 - Randomize Node Colors + 0 + True + 2 + 3 3 4 + GTK_EXPAND - + True - 0 - 5 - Randomize Edge Colors + 0 + True - 4 - 5 + 2 + 3 + 2 + 3 + GTK_EXPAND - + True - 0 - 5 - Highlighted Node Color + 0 + True - 5 - 6 + 2 + 3 + 1 + 2 + GTK_EXPAND - + True - 0 - 5 - Highlighted Edge Color + 0 + #000000000000 - 6 - 7 + 1 + 2 + 7 + 8 - + True - 0 - 5 - Selected Node Color + 0 + #000000000000 - 7 - 8 + 1 + 2 + 6 + 7 - + True 0 #000000000000 @@ -3240,8 +3203,8 @@ topview 1 2 - 1 - 2 + 5 + 6 @@ -3258,7 +3221,7 @@ topview - + True 0 #000000000000 @@ -3266,106 +3229,96 @@ topview 1 2 - 5 - 6 + 1 + 2 - + True - 0 - #000000000000 + 0 + 5 + Selected Node Color - 1 - 2 - 6 - 7 + 7 + 8 - + True - 0 - #000000000000 + 0 + 5 + Highlighted Edge Color - 1 - 2 - 7 - 8 + 6 + 7 - + True - 0 - True + 0 + 5 + Highlighted Node Color - 2 - 3 - 1 - 2 - GTK_EXPAND + 5 + 6 - + True - 0 - True + 0 + 5 + Randomize Edge Colors - 2 - 3 - 2 - 3 - GTK_EXPAND + 4 + 5 - + True - 0 - True + 0 + 5 + Randomize Node Colors - 2 - 3 3 4 - GTK_EXPAND - + True - 0 - True + 0 + 5 + Grid Color - 2 - 3 - 4 - 5 - GTK_EXPAND + 2 + 3 - + True 0 5 - Selected Edge Color + Border Color - 8 - 9 + 1 + 2 - + True 0 #000000000000 @@ -3373,24 +3326,42 @@ topview 1 2 - 8 - 9 - + True 0 5 - Draw Labels + Background Color + + + + + True + 0 + 5 + Draw Nodes - 11 - 12 + 9 + 10 - + + True + 0 + 5 + Draw Edges + + + 10 + 11 + + + + True 0 True @@ -3398,8 +3369,22 @@ topview 2 3 - 11 - 12 + 9 + 10 + GTK_EXPAND + + + + + True + 0 + True + + + 2 + 3 + 10 + 11 GTK_EXPAND @@ -3545,70 +3530,51 @@ topview 6 2 - - True - 0 - OpenGL dots -Spherical -Custom - - - 1 - 2 - 1 - 2 - - - - + True - 1 0 1 0.01 0 0 + 0 + 5 + Advanced Mode - - 1 - 2 - 5 - 6 - - + True - 1 0 1 0.01 0 0 + 0 + 5 + Node Shape - 1 - 2 - 4 - 5 + 1 + 2 - + True 0 5 - Edge Alpha + Node Size with Degree - 5 - 6 + 2 + 3 - + True 0 5 - Node Alpha + Anti-aliasing - 4 - 5 + 3 + 4 - + True 0 True @@ -3616,8 +3582,6 @@ Custom 1 2 - 3 - 4 GTK_FILL GTK_EXPAND @@ -3638,7 +3602,7 @@ Custom - + True 0 True @@ -3646,53 +3610,74 @@ Custom 1 2 + 3 + 4 GTK_FILL GTK_EXPAND - + True 0 5 - Anti-aliasing + Node Alpha - 3 - 4 + 4 + 5 - + True 0 5 - Node Size with Degree + Edge Alpha - 2 - 3 + 5 + 6 - + True - 0 - 5 - Node Shape + 1 0 1 0.01 0 0 - 1 - 2 + 1 + 2 + 4 + 5 - + True - 0 - 5 - Advanced Mode + 1 0 1 0.01 0 0 + + + 1 + 2 + 5 + 6 + + + + + True + 0 + OpenGL dots +Spherical +Custom + + 1 + 2 + 1 + 2 + @@ -3729,60 +3714,29 @@ Custom 2 2 - - True - True - 2 2 20 1 50 10 - 2 - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - 84 - True - 0 - Zoom X - PANGO_WRAP_WORD_CHAR - - - 2 - 3 - GTK_EXPAND - - - - + 84 True 0 - Height + Width PANGO_WRAP_WORD_CHAR - 1 - 2 GTK_EXPAND - + True - 0 - 5 - Height + True + 3 0 5000 1 50 10 1 2 1 2 + GTK_FILL @@ -3798,31 +3752,62 @@ Custom - + True - True - 3 0 5000 1 50 10 + 0 + 5 + Height 1 2 1 2 - GTK_FILL - + 84 True 0 - Width + Height + PANGO_WRAP_WORD_CHAR + + + 1 + 2 + GTK_EXPAND + + + + + 84 + True + 0 + Zoom X PANGO_WRAP_WORD_CHAR + 2 + 3 GTK_EXPAND + + + True + True + 2 2 20 1 50 10 + 2 + + + 1 + 2 + 2 + 3 + GTK_FILL + + 37 @@ -3888,54 +3873,54 @@ Custom 2 2 - + 84 True 0 - Radius + Distortion PANGO_WRAP_WORD_CHAR + 1 + 2 GTK_EXPAND - + + 128 True True - 4 0 5000 1 50 10 + 5 0 5000 1 50 10 1 2 - 1 - 2 - GTK_FILL - - 128 + True True - 5 0 5000 1 50 10 + 4 0 5000 1 50 10 1 2 + 1 + 2 + GTK_FILL - + 84 True 0 - Distortion + Radius PANGO_WRAP_WORD_CHAR - 1 - 2 GTK_EXPAND @@ -3985,82 +3970,82 @@ Custom - + + 1 True - True - 0 0 9999999 0.10000000000000001 10 10 - 4 + 0 + 5 + # of fine nodes - 1 - 2 - 2 - 3 + GTK_FILL - + True True - 0 0 9999999 0.10000000000000001 10 10 - 4 + 0 0 9999999 1 10 10 1 2 - 1 - 2 - - 122 + + 1 True 0 5 - Distortion factor + Coarsening factor - 2 - 3 + 1 + 2 GTK_FILL - - 1 + + 122 True 0 5 - Coarsening factor + Distortion factor - 1 - 2 + 2 + 3 GTK_FILL - + True True - 0 0 9999999 1 10 10 + 0 0 9999999 0.10000000000000001 10 10 + 4 1 2 + 1 + 2 - - 1 + True - 0 - 5 - # of fine nodes + True + 0 0 9999999 0.10000000000000001 10 10 + 4 - GTK_FILL + 1 + 2 + 2 + 3 @@ -4085,76 +4070,76 @@ Custom 2 3 - + True - Label focus + Dist 2 limit 0 True - - 2 - 3 - 1 - 2 - - + True - Color edges + Animate 0 True 1 2 - 1 - 2 - + True - Color nodes + Label fine nodes 0 True - 1 - 2 + 2 + 3 - + True - Label fine nodes + Color nodes 0 True - 2 - 3 + 1 + 2 - + True - Animate + Color edges 0 True 1 2 + 1 + 2 - + True - Dist 2 limit + Label focus 0 True + + 2 + 3 + 1 + 2 + @@ -4193,19 +4178,7 @@ Custom - - 47 - True - 0 - #000000000000 - - - 4 - 5 - - - - + 122 32 True @@ -4214,8 +4187,6 @@ Custom Finest: - 3 - 4 GTK_FILL @@ -4232,7 +4203,7 @@ Custom - + 122 32 True @@ -4241,10 +4212,24 @@ Custom Finest: + 3 + 4 GTK_FILL + + + 47 + True + 0 + #000000000000 + + + 4 + 5 + + False @@ -4358,14 +4343,6 @@ Custom - - - True - 0 - 5 - Selection Method - - True @@ -4381,6 +4358,14 @@ Intersection 2 + + + True + 0 + 5 + Selection Method + + 6 @@ -4479,151 +4464,31 @@ Intersection True - 100 - 20 - True - Camera #1 - PANGO_ELLIPSIZE_MIDDLE - - - 4 - 3 - - - - - 177 - 177 - True - 9 - 1 - - - True - 0 - 0.89999997615814209 - 5 - Position - - - - - 8 - True - - - 1 - 2 - GTK_FILL - - - - - True - 3 - 2 - - - 50 - True - 0 - 5 - X - - - GTK_FILL - - - - - 7 - True - 0 - 5 - Y - - - 1 - 2 - GTK_FILL - - - - - 8 - True - 0 - 5 - Z - - - 2 - 3 - GTK_FILL - - - - - True - True - 0 -500000 50000 1 10 10 - - - 1 - 2 - - - - - True - True - 100 -500000 500000 1 10 10 - - - 1 - 2 - 1 - 2 - - - - - True - True - -50000 -50000 50000 1 10 10 - - - 1 - 2 - 2 - 3 - - - - - 2 - 3 - - - - - True - 0 - 5 - Target - - - 3 - 4 - - + 100 + 20 + True + Camera #1 + PANGO_ELLIPSIZE_MIDDLE + + + 4 + 3 + + + + + 177 + 177 + True + 9 + 1 - + True 3 2 - + 8 True 0 @@ -4637,7 +4502,7 @@ Intersection - + 7 True 0 @@ -4651,7 +4516,7 @@ Intersection - + 50 True 0 @@ -4663,10 +4528,10 @@ Intersection - + True True - 100 -500000 500000 1 10 10 + 100 -360 360 1 10 10 1 @@ -4674,10 +4539,10 @@ Intersection - + True True - 1 -500000 500000 1 10 10 + 1 -360 360 1 10 10 1 @@ -4687,10 +4552,10 @@ Intersection - + True True - 100 -500000 5000000 1 10 10 + 100 -360 360 1 10 10 1 @@ -4701,18 +4566,18 @@ Intersection - 5 - 6 + 8 + 9 - + 8 True - 4 - 5 + 7 + 8 GTK_FILL @@ -4730,26 +4595,26 @@ Intersection - + 8 True - 7 - 8 + 4 + 5 GTK_FILL - + True 3 2 - + True True - 100 -360 360 1 10 10 + 100 -500000 5000000 1 10 10 1 @@ -4759,10 +4624,10 @@ Intersection - + True True - 1 -360 360 1 10 10 + 1 -500000 500000 1 10 10 1 @@ -4772,10 +4637,10 @@ Intersection - + True True - 100 -360 360 1 10 10 + 100 -500000 500000 1 10 10 1 @@ -4783,7 +4648,7 @@ Intersection - + 50 True 0 @@ -4795,7 +4660,7 @@ Intersection - + 7 True 0 @@ -4809,7 +4674,7 @@ Intersection - + 8 True 0 @@ -4824,10 +4689,130 @@ Intersection - 8 - 9 + 5 + 6 + + + + + True + 0 + 5 + Target + + + 3 + 4 + + + + + True + 3 + 2 + + + True + True + -50000 -50000 50000 1 10 10 + + + 1 + 2 + 2 + 3 + + + + + True + True + 100 -500000 500000 1 10 10 + + + 1 + 2 + 1 + 2 + + + + + True + True + 0 -500000 50000 1 10 10 + + + 1 + 2 + + + + + 8 + True + 0 + 5 + Z + + + 2 + 3 + GTK_FILL + + + + + 7 + True + 0 + 5 + Y + + + 1 + 2 + GTK_FILL + + + + + 50 + True + 0 + 5 + X + + + GTK_FILL + + + + + 2 + 3 + + + + + 8 + True + + + 1 + 2 + GTK_FILL + + + True + 0 + 0.89999997615814209 + 5 + Position + + 9 @@ -4911,4 +4896,74 @@ Intersection + + 5 + GTK_WIN_POS_CENTER_ON_PARENT + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + 2 + + + True + + + True + FIND NODES + + + False + + + + + True + True + + + False + 1 + + + + + 1 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + Cancel + 2 + + + + + True + True + True + OK + 1 + + + 1 + + + + + False + GTK_PACK_END + + + + + -- 2.40.0