#include #include "framework.h" #include "framework.m" struct aboutbox_private { DIALOG dia; }; void _F_aboutbox::see_also(const char *, const char *) { } void _F_aboutbox::printf (const char *ctl, ...) { va_list list; va_start (list,ctl); char tmp[10000]; vsnprintf (tmp,sizeof(tmp)-1,ctl,list); va_end (list); char *pt = tmp; while (*pt != '\0'){ const char *start = pt; while (*pt != '\0' && *pt != '\n') pt++; if (*pt == '\n') *pt++ = '\0'; priv->dia.newf_info (NULL,start); } } void _F_aboutbox::setgpl () { printf (MSG_U(I_GPL ,"This program is licensed under the GNU General Public License\n" "\n" "Disclaimer:\n" "\n" "This program comes with no waranty of merchantability ir fitness\n" "for a particular purpose.\n")); } void aboutbox ( _F_aboutbox &c, const char *name, // Program or package name const char *version) { aboutbox_private priv; c.priv = &priv; priv.dia.settype (DIATYPE_POPUP); priv.dia.auto_newline(true); { const char *font = guiid_setfont (24,GFONT_ID_MODERN,GFONT_STYLE_DEFAULT,GFONT_WEIGHT_BOLD,false); const char *pen = guiid_setpen ("blue"); const char *brush = guiid_setbrush ("blue"); const char *dc = guiid_setdc (font,pen,brush); priv.dia.gui_label ("\"%s %s\" $dc=%s",name,version,dc); } priv.dia.gui_dispolast (GUI_H_CENTER,1,GUI_V_CENTER,1); priv.dia.newf_title (MSG_U(I_ABOUT,"About"),1,"",MSG_R(I_ABOUT)); c.intro(name,version); priv.dia.newf_title (MSG_U(I_AUTHORS,"Author(s)"),1,"",MSG_R(I_AUTHORS)); c.authors (name,version); priv.dia.newf_title (MSG_U(I_LICENSE,"License"),1,"",MSG_R(I_LICENSE)); c.license (name,version); priv.dia.newf_title (MSG_U(I_SEEALSO,"See also"),1,"",MSG_R(I_SEEALSO)); c.see_also (name,version); int nof = 0; SSTRING title; title.setfromf ("%s %s",name,version); priv.dia.edit (title.get(),"",help_nil,nof,MENUBUT_CANCEL); } void aboutbox ( _F_aboutbox &c, const char *name, // Program or package name int version, int release) { char tmp[20]; snprintf (tmp,sizeof(tmp)-1,"%d.%d",version,release); aboutbox (c,name,tmp); }