Esempio n. 1
0
 public static int nk_group_begin_titled(this NuklearContext ctx, string id, string title,
                                         uint flags)
 {
     if (ctx == null || ctx.current == null || ctx.current.Layout == null || id == null)
     {
         return(0);
     }
     return(ctx.nk_group_scrolled_offset_begin(ctx.current.GroupPanelOffset, title, flags));
 }
Esempio n. 2
0
        public static int nk_list_view_begin(this NuklearContext ctx, nk_list_view view, string title,
                                             uint flags, int row_height, int row_count)
        {
            int      result;
            nk_panel layout;
            nk_style style;
            var      item_spacing = new Vector2();

            if (ctx == null || view == null || title == null)
            {
                return(0);
            }
            var win = ctx.current;

            style        = ctx.style;
            item_spacing = style.window.spacing;
            row_height  += 0 < (int)item_spacing.Y ? (int)item_spacing.Y : 0;

            var offset = win.GroupPanelOffset;

            view.scroll_value   = offset.Y;
            view.scroll_pointer = offset;

            offset.Y          = 0;
            result            = ctx.nk_group_scrolled_offset_begin(offset, title, flags);
            win               = ctx.current;
            layout            = win.Layout;
            view.total_height = row_height * (row_count < 1 ? 1 : row_count);
            view.begin        =
                (int)
                ((float)view.scroll_value / (float)row_height < 0.0f
                                        ? 0.0f
                                        : (float)view.scroll_value / (float)row_height);
            view.count =
                (int)Math.Ceiling(layout.Clip.Height / row_height) < 0
                                        ? 0
                                        : (int)Math.Ceiling(layout.Clip.Height / row_height);
            view.end = view.begin + view.count;
            view.ctx = ctx;
            return(result);
        }
Esempio n. 3
0
 public static int nk_group_scrolled_begin(this NuklearContext ctx, Offset scroll, string title,
                                           uint flags)
 {
     return(ctx.nk_group_scrolled_offset_begin(scroll, title, flags));
 }