00001
00020 #include "mfcpch.h"
00021 #include "drawedg.h"
00022 #include "evnts.h"
00023
00025 #define IMAGE_WIN_NAME "Edges"
00026 #define IMAGE_XPOS 250
00027 #define IMAGE_YPOS 0 //default position
00028 #define CTRLD '\004' //control D
00029
00030 #define EXTERN
00031
00035 WINDOW create_edges_window(
00036 ICOORD page_tr
00037 ) {
00038 WINDOW image_win;
00039
00040
00041 image_win = create_window (IMAGE_WIN_NAME, SCROLLINGWIN,
00042 IMAGE_XPOS, IMAGE_YPOS, 0, 0, (float) 0.0, page_tr.x (),
00043 (float) 0.0, page_tr.y (), TRUE, FALSE, FALSE, FALSE);
00044 #ifdef __MSW32__
00045 set_selection_handler(image_win, win_selection_handler);
00046 #endif
00047 overlap_picture_ops(TRUE);
00048 return image_win;
00049 }
00050
00051
00055 void draw_raw_edge(
00056 WINDOW fd,
00057 CRACKEDGE *start,
00058 COLOUR colour
00059 ) {
00060 CRACKEDGE *edgept;
00061
00062 line_color_index(fd, colour);
00063 edgept = start;
00064 move2d (fd, edgept->pos.x (), edgept->pos.y ());
00065 do {
00066 do
00067 edgept = edgept->next;
00068
00069 while (edgept != start && edgept->prev->stepx == edgept->stepx
00070 && edgept->prev->stepy == edgept->stepy);
00071
00072
00073 draw2d (fd, edgept->pos.x (), edgept->pos.y ());
00074 }
00075 while (edgept != start);
00076 }
00077
00078