From: Dominique <do...@vi...> - 2002-04-18 09:19:20
|
Thank you very much for a prompt answer. I did the following: struct my_tab : public vgui_easy2D{ my_tab(char const *f) : vgui_easy2D(f) {} ~my_tab() {} bool my_tab::handle(vgui_event const &e){ __HANDLE_EVENT__ return vgui_easy2D::handle(e); } }; where __HANDLE_EVENT__= if (e.type == vgui_BUTTON_DOWN && e.button == vgui_LEFT && e.modifier == 0){ cout << "selecting at " << e.wx << " " << e.wy << endl; return true; // event has been used } (taken from some examples) just doesnt do anything, and if (e.type == vgui_MOTION){ vgui_soview* my_so = get_highlighted_soview(); if (my_so->type_name == "vgui_soview2D_lineseg"){ vgui_soview2D_lineseg* my_line = (vgui_soview2D_lineseg*)my_so; // Do stuff to this... like couting its start point cout << my_line->x0 << "," << my_line->y0 << endl; } } complains during compiling the 3rd line: invalid operands `{unknown type}' and `const char[22]' to binary `operator ==' when I try strcmp instead of == I get: cannot resolve overloaded function `type_name' based on conversion to type `const char *' Please help and forgive my apparent c++ ignorance Dominique > Hi Dominique, > I think you could do this as follows: > - Make your own tableau derived from vgui_easy2D and > use it like you are using your easy2D at the moment. > - Add a handle function to pick up mouse movement > events and which also passes events on to the easy2D > handle function: |