Index: src_plugins/gui/layersel.c =================================================================== --- src_plugins/gui/layersel.c (revision 736) +++ src_plugins/gui/layersel.c (revision 737) @@ -43,6 +43,11 @@ #include "layersel.h" +/* Enable this to make sublayers and layer indices visible */ +#if 0 +#define LAYERSEL_DEBUG +#endif + static const char *xpm_up[] = { "10 10 3 1", " c None", @@ -333,8 +338,11 @@ dst->xpm[n] = dst->buf[n]; } -static void layersel_create_layer(layersel_ctx_t *ls, ls_layer_t *lys, const char *short_name, const char *name, const rnd_color_t *color, int brd, int hatch) +static void layersel_create_layer(layersel_ctx_t *ls, ls_layer_t *lys, int lidx, const char *short_name, const char *name, const rnd_color_t *color, int brd, int hatch) { + if (name == NULL) + name = ""; + if (short_name == NULL) { short_name = strrchr(name, '/'); if (short_name == NULL) @@ -355,6 +363,13 @@ lys->wvis_off = RND_DAD_CURRENT(ls->sub.dlg); RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); RND_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); +#ifdef LAYERSEL_DEBUG + { + char idx[32]; + sprintf(idx, "{%d}", lidx); + RND_DAD_LABEL(ls->sub.dlg, idx); + } +#endif RND_DAD_LABEL(ls->sub.dlg, short_name); lys->wlab = RND_DAD_CURRENT(ls->sub.dlg); RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); @@ -376,7 +391,9 @@ camv_layer_t *ly = camv->layers.array[n]; ls_layer_t *lys, **lysp; +#ifndef LAYERSEL_DEBUG if (ly->sub) continue; +#endif lysp = (ls_layer_t **)vtp0_get(&ls->layers, n, 1); if (*lysp == NULL) *lysp = calloc(sizeof(ls_layer_t), 1); @@ -383,7 +400,7 @@ lys = *lysp; lys->lid = n; lys->ls = ls; - layersel_create_layer(ls, lys, ly->short_name, ly->name, &ly->color, 1, 0); + layersel_create_layer(ls, lys, n, ly->short_name, ly->name, &ly->color, 1, 0); i++; }