I think i found the reason why %`bg does not work in my case. It is because of the use of %sy[3d_raised]
This feature allows us to place nice %wp texture backgrounds everywhere under %ob/cb. We almost never use plain boring default windows without texture. So when texture is used then %`bg[red] for example does not change the background under the text to red! Can it be done somehow?
Here is almost the same example as in other thread https://forums.silverfrost.com/Forum/Topic/2161&postdays=0&postorder=asc&start=0
demonstrating that adding %`bg[red] does not change background if %sy[3d_raised] is used. Please take any texture file or one from the mentioned thread and ignore irrelevant callback functions. Two needed lines of text are marked with the !!!<=====
Please also look at sub/superscripts. Just lowering both few pixels down would solve the problem
integer cbMouse, cbRun
external cbMouse, cbRun
real*8 Variab1, Variab2, Variab3
Variab1=1; Variab2=2; Variab3=3
ix=400; iy =300
ia=1;ib=0;ic=0;id=0
i=winio@('%ww[no_border,casts_shadow]&')
i=winio@('%sy[3d_raised]&') !!!<=====
I=WINIO@('%wp[moon0]&')
i=winio@('%mn[&File[E&xit]]&','EXIT')
i=winio@('%ac[esc]&','EXIT')
i=winio@('%nr%nd&')
i=winio@('%1.3ob&')
i=winio@('%rb[1]%rb[2]%rb[3]%rb[4]%ff&', ia,ib,ic,id)
i=winio@('%cb&')
i=winio@('%sf%`bg[red]Var1 T%sdhot%`sd [eV] %ta%`bg[white]%10rf%ff&', Variab1) !!!<=====
i=winio@('%cb&')
i=WINIO@('%cn%^tt[&Run]%ff&', cbRun)
i=winio@('Var2%su(-Var1)%`su, [cm%su-3%`su]%ta%`bg[white]%10rf%ff&',Variab2)
i=winio@('%cb &')
i=winio@('%ob&')
i=winio@('%pv%`^gr[full_mouse_input,box_selection,user_resize,rgb_colours,black]&',ix, iy, ihw, cbMouse)
i=winio@('%cb')
END
integer function cbMouse()
use clrwin
character*20 text20
real*8 FontSize1
common iwin_width_, iwin_DEPTH_
text20 = 'ClearWin+'
FontSize1 = 14
LL = len_trim(text20)
call get_graphical_resolution@(iwin_width_, iwin_DEPTH_ )
call clear_screen@()
111 call SELECT_FONT@('Courier New')
call scale_font@(FontSize1)
call BOLD_FONT@( 1 )
call get_text_size@ (text20(1:ll), i_leng, ifontHight)
if(i_leng.gt.iwin_width_)then
FontSize1=FontSize1-0.1
if(FontSize1.le.0.1) goto 100
goto 111
endif
if(ifontHight.gt.iwin_DEPTH_)then
FontSize1=FontSize1-0.1
if(FontSize1.le.0.1) goto 100
goto 111
endif
100 iPosX = (iwin_width_ - i_leng)/2
if(iPosX.lt.0) iPosX = 0
iPosY = (iwin_DEPTH_ + ifontHight)/2
if(iPosY.lt.0) iPosY = 0
icolorSh = rgb@(255,255,255)
ix0 = iPosX+1
iy0 = iPosY+1
call draw_text@ (text20(1:LL), ix0, iy0, icolorSh)
icolorSh = rgb@(255,55,55)
ix0 = iPosX
iy0 = iPosY
call draw_text@ (text20(1:LL), ix0, iy0, icolorSh)
cbMouse=1
end
integer function cbRun()
use clrwin
common iwin_width_, iwin_DEPTH_
call draw_text@('Good job,',20,iwin_DEPTH_/3, rgb@(255,55,55))
cbRun=1
end
resources
moon0 BITMAP moon0.bmp