Just starting out? Need help? Post your questions and find answers here.
			
		
		
			- 
				
																			 es_91
- Enthusiast
  
- Posts: 298
- Joined: Thu Jan 27, 2011 12:00 pm
- Location: DE
						
						
													
							
						
									
						Post
					
								by es_91 » 
			
			
			
			
			Try this window with a container that shall have spacing='0' but has spacing='5' (default) instead.
Code: Select all
; Trying to fill the window with this gray container, but spacing shall be 0.
define  *xml
define  *dialog
define  xmlScript$
xmlScript$  =  "<window  id='#pb_any'  name=''  x='0'  y='0'  width='320'  height='200'  text='fill-out container?'  flags='#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget'>"  +  
               "<hbox spacing='0' expand='yes'>"  +  
               "<vbox spacing='0' expand='yes'>"  +  
               "<container spacing='0' id='#pb_any' name='cont' />"  +  
               "</vbox>"  +  
               "</hbox>"  +  
               "</window>"
*xml  =  catchXml  (  #pb_any,  
                      @  xmlScript$,  
                      stringByteLength  (  xmlScript$  )  )
*dialog  =  createDialog  (  #pb_any  )
if  (  (  *xml  )  and  
       (  isXml  (  *xml  )  )  and  
       (  xmlStatus  (  *xml  )  =  #pb_xml_success  )  and  
       (  *dialog  )  and  
       (  isDialog  (  *dialog  )  )  and  
       (  openXmlDialog  (  *dialog,  
                            *xml,  
                            "",  
                            #pb_ignore,  
                            #pb_ignore  )  )  )
	
	
	setGadgetColor  (  dialogGadget  (  *dialog,  
	                                    "cont"  ),  
	                   #pb_gadget_backColor,  
	                   rGB  (  191,  
	                           191,  
	                           191  )  )
	repeat
		if  (  waitWindowEvent  (  )  =  #pb_event_closeWindow  )
			end
		endIf
	forEver
endIf
; es_91 - 2025
What to do? Something wrong?  


 
		 
				
		
		 
	 
				
			
		
		
			- 
				
																			 wombats
- Enthusiast
  
- Posts: 720
- Joined: Thu Dec 29, 2011 5:03 pm
						
						
													
							
						
									
						Post
					
								by wombats » 
			
			
			
			
			Use a <singlebox> with a negative margin. I haven't tested this, so I'm not sure if -5 is enough.
Code: Select all
<singlebox margin='-5'> ... </singlebox>
 
		 
				
		
		 
	 
	
						
		
		
			- 
				
																			 es_91
- Enthusiast
  
- Posts: 298
- Joined: Thu Jan 27, 2011 12:00 pm
- Location: DE
						
						
													
							
						
									
						Post
					
								by es_91 » 
			
			
			
			
			Yep! It works.  
 
 
For some reason '-8' is the exact value needed (at my system).
Code: Select all
xmlScript$  =  "<window  id='#pb_any'  name=''  x='0'  y='0'  width='320'  height='200'  text='fill-out container?'  flags='#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget'>"  +  
               "<singlebox expand='yes' margin='-8'>"  +  
               "<container id='#pb_any' name='cont' />"  +  
               "</singlebox>"  +  
               "</window>"
Thank you!  

 
		 
				
		
		 
	 
	
						
		
		
			- 
				
								HeX0R							
- Addict
  
- Posts: 1219
- Joined: Mon Sep 20, 2004 7:12 am
- Location: Hell
						
						
													
							
						
									
						Post
					
								by HeX0R » 
			
			
			
			
			Margin=0 for the window should be enough
Code: Select all
xmlScript$ = "<window width='320' height='200' text='fill-out container?' flags='#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget' margin='0'><hbox spacing='0' expand='yes'><vbox spacing='0' expand='yes'><container spacing='0' id='#pb_any' name='cont' /></vbox></hbox></window>"
*xml=CatchXML(#PB_Any,@xmlScript$,StringByteLength(xmlScript$)):*dialog=CreateDialog(#PB_Any)
If(*xml And(IsXML(*xml))And(XMLStatus(*xml)=#PB_XML_Success)And(*dialog)And(IsDialog(*dialog))And(OpenXMLDialog(*dialog,*xml,"",#PB_Ignore,#PB_Ignore)))
SetGadgetColor(DialogGadget(*dialog,"cont" ),#PB_Gadget_BackColor,RGB(191,191,191)):Repeat:If(WaitWindowEvent()=#PB_Event_CloseWindow):End:EndIf:ForEver:EndIf
(©Inverse coding-style of es_91)
 
		 
				
		
		 
	 
	
						
		
		
			- 
				
																			 es_91
- Enthusiast
  
- Posts: 298
- Joined: Thu Jan 27, 2011 12:00 pm
- Location: DE
						
						
													
							
						
									
						Post
					
								by es_91 » 
			
			
			
			
			@HeXOR:
Nice!  
 
 
I never knew the window would have an 8 px margin, it's propably because of the 8 px thick borders introduced with Windows 8.
Here your code in Fred's style:
Code: Select all
xmlScript$  +  "<window width='320' height='200' text='fill-out container!' flags='#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget' margin='0'>" + 
               "<hbox spacing='0' expand='yes'>" + 
               "<vbox spacing='0' expand='yes'>" + 
               "<container spacing='0' id='#pb_any' name='cont' />"  + 
               "</vbox>" + 
               "</hbox>" + 
               "</window>"
*xml = CatchXML (#PB_Any, @xmlScript$, StringByteLength (xmlScript$))
*dialog = CreateDialog (#PB_Any)
If *xml And IsXML (*xml) And XMLStatus (*xml) = #PB_XML_Success And *dialog And IsDialog (*dialog) And OpenXMLDialog (*dialog, *xml, "", #PB_Ignore, #PB_Ignore)
	SetGadgetColor (DialogGadget (*dialog, "cont"), #PB_Gadget_BackColor, RGB (127, 127, 127))
	
	Repeat
		
		If WaitWindowEvent () = #PB_Event_CloseWindow
			
			End
			
		EndIf
		
	ForEver
	
EndIf