+int BC_PopupMenu::calculate_w(int margin, int text_width, int use_title)
+{
+ BC_Resources *resources = get_resources();
+ int l = margin >= 0 ? margin : resources->popupmenu_margin;
+ int r = use_title < 0 ? l : l + resources->popupmenu_triangle_margin;
+ return l + text_width + r;
+}
+
+int BC_PopupMenu::calculate_w(int text_width)