It is currently Fri May 29, 2020 11:14 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Dialog gridbox spacing
PostPosted: Thu May 09, 2019 11:33 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 576
Hi,

On macOS, the ImageGadget is bigger than desired.

Image

Code:
Runtime Enumeration
  #Dialog
  #XML
  #Image
EndEnumeration

Procedure.s GetDialogXML()
  Protected xml$
  xml$ + "<window id='#Dialog' name='Test' text='' minwidth='350' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_WindowCentered | #PB_Window_SizeGadget'>"
  xml$ + "  <vbox expand='item:1'>"
  xml$ + "    <gridbox columns='3' colexpand='item:2' rowexpand='equal'>"
  xml$ + "      <text text='One:'/>"
  xml$ + "      <string height='22' text='...'/>"
  xml$ + "      <image name='img' width='16' height='16' maxwidth='16' maxheight='16'/>"
  xml$ + "    </gridbox>"
  xml$ + "  </vbox>"
  xml$ + "</window>"
  ProcedureReturn xml$
EndProcedure

If ParseXML(#XML, GetDialogXML()) And XMLStatus(#Xml) = #PB_XML_Success
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #XML, "Test")
    CreateImage(#Image, 16, 16, 32, RGB(0, 0, 255))
    SetGadgetState(DialogGadget(#Dialog, "img"), ImageID(#Image))
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
EndIf


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog gridbox spacing
PostPosted: Mon Mar 09, 2020 4:59 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 576
Sorry to bump this, but is there any chance of a fix?

The problem doesn't occur if the Image gadget is changed to Button, String, etc. I'd use a Canvas, but I can't seem to get them to be 16, 16 on a dialog.


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog gridbox spacing
PostPosted: Sun Apr 26, 2020 8:38 am 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2990
Location: Planet Earth
The created ImageGadget is 16x16 here, using PB 5.72 LTS x64:
Code:
Runtime Enumeration
  #Dialog
  #XML
  #Image
EndEnumeration

Procedure.s GetDialogXML()
  Protected xml$
  xml$ + "<window id='#Dialog' name='Test' text='' minwidth='350' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_WindowCentered | #PB_Window_SizeGadget'>"
  xml$ + "  <vbox expand='item:1'>"
  xml$ + "    <gridbox columns='3' colexpand='item:2' rowexpand='equal'>"
  xml$ + "      <text text='One:'/>"
  xml$ + "      <string height='22' text='...'/>"
  xml$ + "      <image name='img' width='16' height='16' maxwidth='16' maxheight='16'/>"
  xml$ + "    </gridbox>"
  xml$ + "  </vbox>"
  xml$ + "</window>"
  ProcedureReturn xml$
EndProcedure

If ParseXML(#XML, GetDialogXML()) And XMLStatus(#Xml) = #PB_XML_Success
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #XML, "Test")
    CreateImage(#Image, 16, 16, 32, RGB(0, 0, 255))
    SetGadgetState(DialogGadget(#Dialog, "img"), ImageID(#Image))
    img_gadget = DialogGadget(#Dialog, "img")
    Debug GadgetWidth(img_gadget)
    Debug GadgetHeight(img_gadget)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
EndIf


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye