This seems to work a little bit, but i don‘t know why:
Code: Select all
; modify the theme by code
;
; https://forums.spiderbasic.com/viewtopic.php?f=6&t=1405
Procedure SetNewStyle()
! var elHead = document.getElementsByTagName('head')[0];
! var elStyle = document.createElement('style');
! elStyle.type= 'text/css';
! elHead.appendChild( elStyle );
! elStyle.innerHTML = '' +
! '' +
;! ' body {' +
;! ' font: 30px time; ' +
;! ' color: #f00; ' +
;! ' }' +
;! '' +
;! ' .spiderwindow { ' +
;! ' background-color: #aaf;' +
;! ' border-radius: 8px;' +
;! ' border: 0px;' +
;! ' box-shadow: 4px 4px 16px 0px #000;' +
;! ' }' +
;! '' +
;! ' .spiderwindow-content { ' +
;! ' background-color: #88f;' +
;! ' border-radius: 0 0 8px 8px;' +
;! ' }' +
;! '' +
! ' .dijitButtonNode { ' +
;! ' box-shadow: 4px 4px 16px 0px #000 !important;' +
! ' line-height: 50px;'
;! ' background: #8f8 !important;' +
! ' }';
;! '' +
; , .dijitTreeExpando, .dijitTreeExpando
;! ' .dijitTreeRow, .dijitTreeContent, .dijitTreeNode { ' +
;! ' line-height: 50px;'
;! ' }';
EndProcedure
;
; set the gadget theme to „Claro“ in compiler options.
;
OpenWindow(0, 0, 0, 600, 400, "Treegadget Font Problem", #PB_Window_ScreenCentered)
TreeGadget(0, 10, 10, 280, 380)
AddGadgetItem(0, -1, "Treegadget")
AddGadgetItem(0, -1, "with default font")
TreeGadget(1, 310, 10, 280, 380)
AddGadgetItem(1, -1, "Treegadget")
AddGadgetItem(1, -1, "with custom font")
LoadFont(0, "Arial", 30)
SetGadgetFont(1, FontID(0))
SetNewStyle()
;SetActiveGadget(0)
You need to set the gadget theme to „Claro“ in compiler options.