| 286 | // ---------------------------------------------------------------------------------------- |
| 287 | |
| 288 | void button_style_arrow:: |
| 289 | draw_button ( |
| 290 | const canvas& c, |
| 291 | const rectangle& rect, |
| 292 | const bool enabled, |
| 293 | const font& , |
| 294 | const long , |
| 295 | const long , |
| 296 | const ustring& , |
| 297 | const bool is_depressed |
| 298 | ) const |
| 299 | { |
| 300 | rectangle area = rect.intersect(c); |
| 301 | if (area.is_empty()) |
| 302 | return; |
| 303 | |
| 304 | fill_rect(c,rect,rgb_pixel(212,208,200)); |
| 305 | |
| 306 | const long height = rect.height(); |
| 307 | const long width = rect.width(); |
| 308 | |
| 309 | const long smallest = (width < height) ? width : height; |
| 310 | |
| 311 | const long rows = (smallest+3)/4; |
| 312 | const long start = rows + rows/2-1; |
| 313 | long dep; |
| 314 | |
| 315 | long tip_x = 0; |
| 316 | long tip_y = 0; |
| 317 | long wy = 0; |
| 318 | long hy = 0; |
| 319 | long wx = 0; |
| 320 | long hx = 0; |
| 321 | |
| 322 | if (is_depressed) |
| 323 | { |
| 324 | dep = 0; |
| 325 | |
| 326 | // draw the button's border |
| 327 | draw_button_down(c,rect); |
| 328 | } |
| 329 | else |
| 330 | { |
| 331 | dep = -1; |
| 332 | |
| 333 | // draw the button's border |
| 334 | draw_button_up(c,rect); |
| 335 | } |
| 336 | |
| 337 | |
| 338 | switch (dir) |
| 339 | { |
| 340 | case UP: |
| 341 | tip_x = width/2 + rect.left() + dep; |
| 342 | tip_y = (height - start)/2 + rect.top() + dep + 1; |
| 343 | wy = 0; |
| 344 | hy = 1; |
| 345 | wx = 1; |
nothing calls this directly
no test coverage detected