MCPcopy Create free account
hub / github.com/davisking/dlib / initialize

Method initialize

dlib/gui_widgets/widgets.cpp:2628–2649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

set_posMethod · 0.45
set_textMethod · 0.45
get_rectMethod · 0.45
set_sizeMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45
leftMethod · 0.45
bottomMethod · 0.45
set_click_handlerMethod · 0.45
rightMethod · 0.45

Tested by

no test coverage detected