Page 1 of 1

[BUG?] Can't lower width of spin gadget (XML Dialog, PB5.41)

Posted: Sun Jan 03, 2016 12:52 am
by Korolev Michael
As you can see below, there is problem with spin gadget, it's too wide.
In case of classic manual window/control operating, I can reduce its width.

Code: Select all

CompilerIf #PB_Compiler_Unicode
    #XmlEncoding = #PB_UTF8
  CompilerElse 
    #XmlEncoding = #PB_Ascii
  CompilerEndIf

  #Dialog = 0
  #Xml = 0

  XML$ = ""+
         "<window id='#PB_Any' name='Window_Main' text='Window_Main' minwidth='5' minheight='5' flags='#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget'>"+
         "<vbox spacing='0' expand='no' width='10'>"+
         "<singlebox width='30' expand='no' margin='0'><spin width='30'/></singlebox>"+
         "<singlebox width='30' expand='no' margin='0'><combobox width='30'/></singlebox>"+
         "</vbox>"+
         "</window>"
		
  If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
    
    If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "Window_Main")
      
      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

Re: Can't lower width of spin gadget (XML Dialog, PB 5.41)

Posted: Sun Jan 03, 2016 1:31 am
by Korolev Michael
Also, spin gadget cannot be switched by up/down arrows. No numeric mode?
Looks like a bug.

Re: Can't lower width of spin gadget (XML Dialog, PB 5.41)

Posted: Tue Jan 05, 2016 1:12 am
by Andre
I slightly modified your example regarding the SpinGadget (added the needed 'Numeric' flag + tried another 'width') and extended it with adding Combobox items...

Code: Select all

CompilerIf #PB_Compiler_Unicode
  #XmlEncoding = #PB_UTF8
CompilerElse
  #XmlEncoding = #PB_Ascii
CompilerEndIf

#Dialog = 0
#Xml = 0

XML$ = ""+
       "<window id='#PB_Any' name='Window_Main' text='Window_Main' minwidth='5' minheight='5' flags='#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget'>"+
       "<vbox spacing='0' expand='no' width='10'>"+
       "<singlebox expand='no' margin='0'><spin width='20' flags='#PB_Spin_Numeric'/></singlebox>"+
       "<singlebox width='30' expand='no' margin='0'><combobox name='combo1' width='100'/></singlebox>"+   ; the Singlebox width is here ignored, because the Combobox is created with a bigger width!
       "</vbox>"+
       "</window>"
    
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
 
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "Window_Main")
    
    combo1 = DialogGadget(#Dialog, "combo1")
    If combo1
      For a = 1 To 10
        AddGadgetItem(combo1, -1, "Combox item " + Str(a))
      Next
    EndIf
    
    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
Here on my test with PB5.40 LTS on WinXP all seems to work well, the SpinGadget (with added flag) is numeric and has arrows. But it has a fixed (automatic set?) minimum size, but I wouldn't it call too width.

Maybe it's a problem with another OS version?
Such informations and in this case a screenshot would be good, for further investigation by the team.

Re: Can't lower width of spin gadget (XML Dialog, PB 5.41)

Posted: Tue Jan 05, 2016 5:21 am
by Korolev Michael
Thanks, very good :)

But about spin gadget: I want to make it more 'narrow'. Like this (it works, when I draw windows\gadgets manually):
Image

At now, I can only make this (too wide):
Image

Re: Can't lower width of spin gadget (XML Dialog, PB 5.41)

Posted: Thu Jan 14, 2016 4:40 am
by Korolev Michael
Still interested in this.
Fred, is it possible bug?