Index: trunk/src_plugins/lib_hid_pcbui/layersel.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/layersel.c (revision 33096) +++ trunk/src_plugins/lib_hid_pcbui/layersel.c (revision 33097) @@ -127,7 +127,39 @@ " ", }; +static const char *all_vis_xpm[] = { +"12 9 3 1", +" c None", +"@ c #6EA5D7", +"+ c #000000", +" ", +" ++++ ", +" ++@@@@++ ", +" +@@@++@@@+ ", +"+@@@++++@@@+", +" +@@@++@@@+ ", +" ++@@@@++ ", +" ++++ ", +" ", +}; +static const char *all_invis_xpm[] = { +"12 9 3 1", +" c None", +"@ c #6EA5D7", +"+ c #000000", +" @+@ ", +" @+@+++ ", +" +@+@@@++ ", +" +@@@+@@@@+ ", +"+@@@+@+@@@@+", +" +@@@+@+@@+ ", +" ++@@@@+@ ", +" ++++@+@ ", +" @+@", +}; + + typedef struct { char buf[32][20]; const char *xpm[32]; @@ -340,6 +372,16 @@ all_open_close(0); } +static void all_vis_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) +{ + rnd_actionva(rnd_gui->get_dad_hidlib(hid_ctx), "ToggleView", "all", "vis", "set", NULL); +} + +static void all_invis_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) +{ + rnd_actionva(rnd_gui->get_dad_hidlib(hid_ctx), "ToggleView", "all", "vis", "clear", NULL); +} + /* Select the first visible layer (physically) below the one turned off or reenable the original if all are off; this how we ensure the current layer is visible and avoid drawing on inivisible layers */ @@ -766,6 +808,12 @@ RND_DAD_PICBUTTON(ls->sub.dlg, all_closed_xpm); RND_DAD_HELP(ls->sub.dlg, "collapse/close all layer groups\nso that layer names are\nnot displayed,\neach row is a layer group"); RND_DAD_CHANGE_CB(ls->sub.dlg, all_close_cb); + RND_DAD_PICBUTTON(ls->sub.dlg, all_vis_xpm); + RND_DAD_HELP(ls->sub.dlg, "all layers visible"); + RND_DAD_CHANGE_CB(ls->sub.dlg, all_vis_cb); + RND_DAD_PICBUTTON(ls->sub.dlg, all_invis_xpm); + RND_DAD_HELP(ls->sub.dlg, "all layers invisible\nexcept for the current layer group"); + RND_DAD_CHANGE_CB(ls->sub.dlg, all_invis_cb); RND_DAD_BEGIN_HBOX(ls->sub.dlg); RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_EXPFILL); RND_DAD_END(ls->sub.dlg);