| 2626 | namespace message_box_helper |
| 2627 | { |
| 2628 | void box_win:: |
| 2629 | initialize ( |
| 2630 | ) |
| 2631 | { |
| 2632 | msg.set_pos(20,20); |
| 2633 | msg.set_text(message); |
| 2634 | rectangle msg_rect = msg.get_rect(); |
| 2635 | btn_ok.set_name("OK"); |
| 2636 | btn_ok.set_size(60,btn_ok.height()); |
| 2637 | if (msg_rect.width() >= 60) |
| 2638 | btn_ok.set_pos(msg_rect.width()/2+msg_rect.left()-btn_ok.width()/2,msg_rect.bottom()+15); |
| 2639 | else |
| 2640 | btn_ok.set_pos(20,msg_rect.bottom()+15); |
| 2641 | btn_ok.set_click_handler(*this,&box_win::on_click); |
| 2642 | |
| 2643 | rectangle size = btn_ok.get_rect() + msg_rect; |
| 2644 | set_size(size.right()+20,size.bottom()+20); |
| 2645 | |
| 2646 | |
| 2647 | show(); |
| 2648 | set_title(title); |
| 2649 | } |
| 2650 | |
| 2651 | // ------------------------------------------------------------------------------------ |
| 2652 | |