Dialog et Fonts
Publié : ven. 18/oct./2013 16:58
J'ai l'impression qu'on ne peut pas changer de font dans un Dialog, me trompe-je ?
Mesa
Code : Tout sélectionner
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
#Dialog = 0
#Xml = 0
XML$ = "<window id='#PB_Any' name='test' text='test' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <panel>" +
" <tab text='Premier Onglet'>" +
" <vbox expand='item:2'>" +
" <hbox>" +
" <button name='but1' text='Bouton 1'/>" +
" <checkbox name='check1' text='Case à cocher 1'/>" +
" <button name='but2' text='Bouton 2'/>" +
" </hbox>" +
" <editor text='Contenu...' height='150'/>" +
" </vbox>" +
" </tab>" +
" </panel>" +
"</window>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
If LoadFont(1, "Arial", 24, #PB_Font_HighQuality)
SetGadgetFont(DialogGadget(#Dialog, "but1"), FontID(1))
;SetGadgetText(DialogGadget(#Dialog, "but1"), "azerty")
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
Debug "Erreur de la bibliothèque -Dialog- : " + DialogError(#Dialog)
EndIf
Else
Debug "Erreur XML : " + XMLError(#Xml) + " (Ligne: " + XMLErrorLine(#Xml) + ")"
EndIf