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

Method set_sizes

dlib/gui_widgets/widgets.cpp:2936–2976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2934 // ------------------------------------------------------------------------------------
2935
2936 void box_win::
2937 set_sizes(
2938 )
2939 {
2940 unsigned long width, height;
2941 get_size(width,height);
2942
2943
2944 if (lbl_file_name.is_hidden())
2945 {
2946 lbl_dirs.set_pos(0,btn_root.bottom()+5);
2947 lb_dirs.set_pos(0,lbl_dirs.bottom());
2948 lb_dirs.set_size(width/2,height-lb_dirs.top()-btn_cancel.height()-10);
2949
2950 lbl_files.set_pos(lb_dirs.right(),btn_root.bottom()+5);
2951 lb_files.set_pos(lb_dirs.right(),lbl_files.bottom());
2952 lb_files.set_size(width-lb_files.left(),height-lb_files.top()-btn_cancel.height()-10);
2953
2954 btn_ok.set_pos(width - btn_ok.width()-25,lb_files.bottom()+5);
2955 btn_cancel.set_pos(btn_ok.left() - btn_cancel.width()-5,lb_files.bottom()+5);
2956 }
2957 else
2958 {
2959
2960 lbl_dirs.set_pos(0,btn_root.bottom()+5);
2961 lb_dirs.set_pos(0,lbl_dirs.bottom());
2962 lb_dirs.set_size(width/2,height-lb_dirs.top()-btn_cancel.height()-10-tf_file_name.height());
2963
2964 lbl_files.set_pos(lb_dirs.right(),btn_root.bottom()+5);
2965 lb_files.set_pos(lb_dirs.right(),lbl_files.bottom());
2966 lb_files.set_size(width-lb_files.left(),height-lb_files.top()-btn_cancel.height()-10-tf_file_name.height());
2967
2968 lbl_file_name.set_pos(lb_files.left(), lb_files.bottom()+8);
2969 tf_file_name.set_pos(lbl_file_name.right(), lb_files.bottom()+5);
2970 tf_file_name.set_width(width-tf_file_name.left()-5);
2971
2972 btn_ok.set_pos(width - btn_ok.width()-25,tf_file_name.bottom()+5);
2973 btn_cancel.set_pos(btn_ok.left() - btn_cancel.width()-5,tf_file_name.bottom()+5);
2974 }
2975
2976 }
2977
2978 // ------------------------------------------------------------------------------------
2979

Callers

nothing calls this directly

Calls 9

is_hiddenMethod · 0.80
set_posMethod · 0.45
bottomMethod · 0.45
set_sizeMethod · 0.45
topMethod · 0.45
heightMethod · 0.45
rightMethod · 0.45
leftMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected