Possible bug in Dialog with ScrollBar Gadget

Mac OSX specific forum
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Possible bug in Dialog with ScrollBar Gadget

Post by davido »

The code below works properly in Windows 7-64bit with PureBasic 5.22 beta 2.

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
DE AA EB
Fred
Administrator
Administrator
Posts: 18499
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Possible bug in Dialog with ScrollBar Gadget

Post by Fred »

It's a Cocoa limitation, the vertical/horizontal setting depends of the width/height ratio.
Post Reply