public static float nk_panel_get_border(NkStyle style, PanelFlags flags, NkPanelType type) { if ((flags & PanelFlags.BORDER) != 0) { switch (type) { default: case NkPanelType.WINDOW: return((float)(style.Window.border)); case NkPanelType.GROUP: return((float)(style.Window.group_border)); case NkPanelType.POPUP: return((float)(style.Window.popup_border)); case NkPanelType.CONTEXTUAL: return((float)(style.Window.contextual_border)); case NkPanelType.COMBO: return((float)(style.Window.combo_border)); case NkPanelType.MENU: return((float)(style.Window.menu_border)); case NkPanelType.TOOLTIP: return((float)(style.Window.menu_border)); } } else { return((float)(0)); } }
public static NkColor nk_panel_get_border_color(NkStyle style, NkPanelType type) { switch (type) { default: case NkPanelType.WINDOW: return((NkColor)(style.Window.border_color)); case NkPanelType.GROUP: return((NkColor)(style.Window.group_border_color)); case NkPanelType.POPUP: return((NkColor)(style.Window.popup_border_color)); case NkPanelType.CONTEXTUAL: return((NkColor)(style.Window.contextual_border_color)); case NkPanelType.COMBO: return((NkColor)(style.Window.combo_border_color)); case NkPanelType.MENU: return((NkColor)(style.Window.menu_border_color)); case NkPanelType.TOOLTIP: return((NkColor)(style.Window.menu_border_color)); } }
public static NkVec2 nk_panel_get_padding(NkStyle style, NkPanelType type) { switch (type) { default: case NkPanelType.WINDOW: return((NkVec2)(style.Window.padding)); case NkPanelType.GROUP: return((NkVec2)(style.Window.group_padding)); case NkPanelType.POPUP: return((NkVec2)(style.Window.popup_padding)); case NkPanelType.CONTEXTUAL: return((NkVec2)(style.Window.contextual_padding)); case NkPanelType.COMBO: return((NkVec2)(style.Window.combo_padding)); case NkPanelType.MENU: return((NkVec2)(style.Window.menu_padding)); case NkPanelType.TOOLTIP: return((NkVec2)(style.Window.menu_padding)); } }
public static float nk_layout_row_calculate_usable_space(NkStyle style, NkPanelType type, float total_space, int columns) { float panel_padding; float panel_spacing; float panel_space; NkVec2 spacing = new NkVec2(); NkVec2 padding = new NkVec2(); spacing = (NkVec2)(style.Window.spacing); padding = (NkVec2)(nk_panel_get_padding(style, (type))); panel_padding = (float)(2 * padding.x); panel_spacing = (float)((float)((columns - 1) < (0) ? (0) : (columns - 1)) * spacing.x); panel_space = (float)(total_space - panel_padding - panel_spacing); return((float)(panel_space)); }