However, the same code run on a MacPro with Mavericks, PureBasic 5.21 LTS, does not. The ScrollBar Gadget is always vertical.
Can any one confirm, please.
Code: Select all
; As we embedded xml directly in the source, the encoding of special characters will vary if we are in unicode mode or not.
; So ensure to use the correct one. This is not needed if the XML is read from an external file or directly included
; with IncludeBinary.
;
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
Runtime Enumeration
#Sc
EndEnumeration
Runtime Procedure OnScEvent()
Debug GetGadgetState(#Sc)
EndProcedure
#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'>" +
"<vbox>" +
"<button width='100' height='30' />" +
"<scrollbar id='#SC' width='40' height='200' max='200' min='30' onevent='OnScEvent()' flags=''/>" +
"</vbox>" +
"</window>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf

