| 1485 | class menu_item_submenu : public menu_item |
| 1486 | { |
| 1487 | void initialize ( |
| 1488 | unichar hk |
| 1489 | ) |
| 1490 | { |
| 1491 | const dlib::ustring &str = text; |
| 1492 | if (hk != 0) |
| 1493 | { |
| 1494 | std::string::size_type pos = str.find_first_of(hk); |
| 1495 | if (pos != std::string::npos) |
| 1496 | { |
| 1497 | // now compute the location of the underline bar |
| 1498 | rectangle r1 = f->compute_cursor_rect( rectangle(100000,100000), str, pos); |
| 1499 | rectangle r2 = f->compute_cursor_rect( rectangle(100000,100000), str, pos+1); |
| 1500 | |
| 1501 | underline_p1.x() = r1.left()+1; |
| 1502 | underline_p2.x() = r2.left()-1; |
| 1503 | underline_p1.y() = r1.bottom()-f->height()+f->ascender()+2; |
| 1504 | underline_p2.y() = r2.bottom()-f->height()+f->ascender()+2; |
| 1505 | } |
| 1506 | } |
| 1507 | } |
| 1508 | public: |
| 1509 | menu_item_submenu ( |
| 1510 | const std::string& str, |