OBJ += renderers/widget/spacer.o
OBJ += renderers/widget/subwin.o
+PNGIMAGES := toolbar_new.png
+
LDFLAGS += -limage_sif -luri -lnet -lunicode
+IMG2SIF = ../../../../Tools/img2sif
+
-include ../../Makefile.tpl
+.PHONY: install_resources
+
+install: install_resources
+
#all: resources/LogoSmall.sif.res.h
%.res.h: % Makefile
echo "#define RESOURCE_$(notdir $<) \\"| sed -e 's/\./_/g' > $@
base64 $< | sed -e 's/.*/"&"\\/' >> $@
echo "" >> $@
+
+$(IMG2SIF):
+ $(MAKE) -C $(dir $(IMG2SIF)) img2sif
+
+install_%.sif: resources/%.png
+ @echo img2sif resources/$*.png
+ @$(IMG2SIF) resources/$*.png resources/.$*.sif
+ @$(xCP) resources/.$*.sif $(DISTROOT)/$(DIR)/$*.sif
+
+install_resources: $(IMG2SIF) $(addprefix install_,$(PNGIMAGES:%.png=%.sif))
void Renderer_RichText_Destroy(tWindow *Window)
{
- tRichText_Window *info = ret->RendererInfo;
+ tRichText_Window *info = Window->RendererInfo;
// TODO: Is locking needed? WM_Destroy should have taken us off the render tree
while( info->FirstLine )
void add_toolbar_button(tAxWin3_Widget *Toolbar, const char *Ident, tAxWin3_Widget_FireCb Callback)
{
tAxWin3_Widget *btn = AxWin3_Widget_AddWidget(Toolbar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, Ident);
- tAxWin3_Widget *txt = AxWin3_Widget_AddWidget(btn, ELETYPE_TEXT, 0, Ident);
- // TODO: Get image / text using `Ident` as a lookup key
- AxWin3_Widget_SetText(txt, getstr(Ident));
+ const char *img = getimg(Ident);
+ if( img )
+ {
+ tAxWin3_Widget *txt = AxWin3_Widget_AddWidget(btn, ELETYPE_IMAGE, 0, Ident);
+ AxWin3_Widget_SetText(txt, img);
+ // TODO: tooltip?
+ }
+ else
+ {
+ tAxWin3_Widget *txt = AxWin3_Widget_AddWidget(btn, ELETYPE_TEXT, 0, Ident);
+ AxWin3_Widget_SetText(txt, getstr(Ident));
+ }
AxWin3_Widget_SetFireHandler(btn, Callback);
}
{"BtnReplace", "Replace"},
};
const int ciNumDisplayStrings = sizeof(gaDisplayStrings)/sizeof(gaDisplayStrings[0]);
+const struct keyval_str gaImageStrings[] = {
+ {"BtnNew", "file:///Acess/Apps/AxWin/3.0/toolbar_new.sif"}
+ };
+const int ciNumImageStrings = sizeof(gaImageStrings)/sizeof(gaImageStrings[0]);
const char *getstr(const char *key)
{
const char *getimg(const char *key)
{
- return "";
+ int i;
+ for(i = 0; i < ciNumImageStrings; i ++)
+ {
+ if( strcmp(key, gaImageStrings[i].key) == 0 )
+ return gaImageStrings[i].val;
+ }
+ return NULL;
}