glVertex3f(selPoly->pts[i].x,selPoly->pts[i].y,selPoly->pts[i].z);
}
glEnd();
+ if(selPoly->cnt >0)
+ {
+ glBegin(GL_LINE_STRIP);
+ glVertex3f(selPoly->pts[selPoly->cnt-1].x,selPoly->pts[selPoly->cnt-1].y,selPoly->pts[selPoly->cnt-1].z);
+ glVertex3f(view->mouse.GLpos.x,view->mouse.GLpos.y,0);
+ glEnd();
+ }
glEnable(GL_DEPTH_TEST);
+
}
#ifdef UNUSED
}
static gboolean key_press_event(GtkWidget * widget, GdkEventKey * event, gpointer data)
{
- view->keymap.down=1;
- view->keymap.keyVal=event->keyval;
- return FALSE;
+ appmouse_key_press(view,event->keyval);
+ return FALSE;
+
}
static gboolean key_release_event(GtkWidget * widget, GdkEventKey * event, gpointer data)
{
- // printf ("key is released:%d\n",event->keyval);
- view->keymap.down=0;
- view->keymap.keyVal=0;
- return FALSE;
-
+ appmouse_key_release(view,event->keyval);
+ return FALSE;
}
dy = y - begin_y;
view->mouse.dragX = dx;
view->mouse.dragY = dy;
+ appmouse_move(view,(int)event->x,(int)event->y);
+
if((view->mouse.t==glMouseLeftButton) && (view->mouse.down) )
{
appmouse_left_drag(view,(int)event->x,(int)event->y);
appmouse_middle_drag(view,(int)event->x,(int)event->y);
redraw = TRUE;
}
+ if(view->Topview->selPoly.cnt > 0)
+ redraw=TRUE;
static float prevX=0;
static float prevY=0;
+ static int lastAction;
static void apply_actions(ViewInfo* v,int x,int y)
{
int a;
}
}
+ lastAction=a;
appmouse_drag(v,x,y);
}
+void appmouse_move(ViewInfo* v,int x,int y)
+{
+ to3D( x,y, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
+}
+void appmouse_key_release(ViewInfo* v,int key)
+{
+ int action=get_key_action(v,key);
+ if(lastAction==MM_POLYGON_SELECT)
+ {
+ clear_selpoly(&view->Topview->selPoly);
+ glexpose();
+ }
+ v->keymap.down=0;
+ v->keymap.keyVal=0;
+}
+void appmouse_key_press(ViewInfo* v,int key)
+{
+ v->keymap.down=1;
+ v->keymap.keyVal=key;
+}
+
extern void appmouse_middle_click_down(ViewInfo* v,int x,int y);
extern void appmouse_middle_click_up(ViewInfo* v,int x,int y);
extern void appmouse_middle_drag(ViewInfo* v,int x,int y);
+extern void appmouse_move(ViewInfo* v,int x,int y);
+extern void appmouse_key_release(ViewInfo* v,int key);
+extern void appmouse_key_press(ViewInfo* v,int key);
+
#endif
*/
}
+int get_key_action(ViewInfo* v,int key)
+{
+ int ind=0;
+ for (;ind < v->mouse_action_count ; ind ++)
+ {
+
+ if (v->mouse_actions[ind].hotkey==key)
+ return v->mouse_actions[ind].action;
+ }
+ return -1;
+}
+
int get_mode(ViewInfo* v)
{
extern void load_mouse_actions (char* modefile,ViewInfo* v);
extern int get_mode(ViewInfo* v);
+extern int get_key_action(ViewInfo* v,int key);
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory="C:\graphviz-ms\bin"
- CommandArguments=""
+ CommandArguments="c:/4elt.dot"
Attach="false"
DebuggerType="3"
Remote="1"
} glCompPointI;
typedef struct {
int cnt;
+ int hotKey;
glCompPoint* pts;
}glCompPoly;