示例#1
0
        public static bool ContextualItemText(this NuklearContext ctx, StringSegment text, nk_text_align alignment)
        {
            nk_window win;
            nk_input  _in_;
            nk_style  style;
            var       bounds = new RectangleF();
            int       state;

            if (ctx == null || ctx.current == null || ctx.current.Layout == null)
            {
                return(false);
            }
            win   = ctx.current;
            style = ctx.style;
            state = ctx.WidgetFitting(ref bounds, style.contextual_button.padding);
            if (state == 0)
            {
                return(false);
            }
            _in_ = state == NK_WIDGET_ROM || (win.Layout.Flags & NK_WINDOW_ROM) != 0 ? null : ctx.input;
            if (
                DoButtonText(ref ctx.last_widget_state, win.Buffer, bounds, text, alignment,
                             NK_BUTTON_DEFAULT, style.contextual_button, _in_, style.font))
            {
                ctx.ContextualClose();
                return(true);
            }

            return(false);
        }
示例#2
0
 public static void ComboClose(this NuklearContext ctx)
 {
     ctx.ContextualClose();
 }