Inheritance diagram for Drawing::Canvas:
Public Methods | |
Canvas (std::string title, float width, float height, Drawing *) | |
virtual int | MouseClickEvent (const Position &) |
Calls the function associated with mouse clicks. | |
virtual int | RefreshEvent () |
Calls the function assoicated with the window being exposed. | |
virtual int | TimerEvent () |
Calls the function associated with the timer expiring. | |
Private Attributes | |
Drawing *const | drawing |
|
00200 : SimpleWindow(title,width,height), drawing(d) 00201 { 00202 Open(); 00203 // the callback is unused, but if we don't set it 00204 // we don't get any events: 00205 SetMouseClickCallback(bogus1); 00206 SetRefreshCallback(bogus2); 00207 SetTimerCallback(bogus2); 00208 00209 RefreshEvent(); 00210 } |
|
Calls the function associated with mouse clicks.
Reimplemented from SimpleWindow.
00213 { 00214 Tool* tool = drawing->tool_window->current_tool(); 00215 int result = 0; 00216 if (tool) { 00217 result = tool->mouseClick(p); 00218 } 00219 drawing->refresh_if_needed(); 00220 return result; 00221 } |
|
Calls the function assoicated with the window being exposed.
Reimplemented from SimpleWindow.
|
|
Calls the function associated with the timer expiring.
Reimplemented from SimpleWindow.
00232 { 00233 if (drawing->canned_input == 0) return 0; 00234 if (!drawing->canned_input->execute_one_event(drawing)) { 00235 drawing->canned_input = 0; 00236 StopTimer(); 00237 } 00238 return 1; 00239 } |
|
|