Re: Ugh! I am having trouble visualizing sizers.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ok, I got it somewhat (see below), but I can't seem to get row-1 and row-3 to be the size I want it. So I'll mess with set_size. Ideally, What I want is
row-1 height = 50
row-2 height = 200
row-3 hekght = 50
row-4 height = 200

Any tips will be greatly app...

Thanks! ...V

--[include statements]   
include wxeud.e      
without warning      
   
--[constants]    
constant Red = create( wxColour, {#FF,#00,#00} )    
   
--[create the controls]      
constant       
    main             = create( wxFrame, {0, -1, "TXTool", -1, -1, 500, 500} ),    
      panl              = create( wxPanel, main ),    
        panltop         = create( wxPanel, panl ),  --{ panl, -1, "topPanll", -1, -1, -1, 30} ),    
          topbutton01 = create( wxButton, {panltop, new_id(), "Push Me", -1, -1, -1, -1} ), 
          topbutton02 = create( wxButton, {panltop, new_id(), "Push Me", -1, -1, -1, -1} ), 
        scrollwin       = create( wxScrolledWindow, {panl, new_id(), -1, -1, -1, 399, 150} ),   
        panlmid         = create( wxPanel, panl ),     
          midbutton01 = create( wxButton, {panlmid, new_id(), "Push Me", -1, -1, 90, 10} ), 
          midbutton02 = create( wxButton, {panlmid, new_id(), "Push Me", -1, -1, 90, 30} ), 
       txted             = create( wxRichTextCtrl, {panl, -1, "Enter Text Here", -1, -1, 399, 150} ),    
 
    panlbox         = create( wxBoxSizer, {wxVERTICAL} ),    
    panlboxt       = create( wxBoxSizer, {wxHORIZONTAL} ),    
    panlboxm      = create( wxBoxSizer, {wxHORIZONTAL} ),    
    scrollbox       = create( wxBoxSizer, {wxVERTICAL} ),  
    button_grid  = create( wxFlexGridSizer, { 6, 8, 5, 5 })  
      
--[event handlers and other code]    
add_window_to_sizer( panlboxt, topbutton01, 0, wxGROW, 0 )    
add_window_to_sizer( panlboxt, topbutton02, 0, wxGROW, 0 )   
add_window_to_sizer( panlbox, panltop, 1, wxGROW, 0 )     
add_window_to_sizer( panlbox, scrollwin, 1, wxGROW, 0 )    
add_window_to_sizer( panlbox, panlmid, 1, wxGROW, 0 )     
add_window_to_sizer( panlboxm, midbutton01, 0, wxGROW, 0 )    
add_window_to_sizer( panlboxm, midbutton02, 0, wxGROW, 0 )    
add_window_to_sizer( panlbox, txted, 0, wxGROW, 0 )    
 
add_sizer_to_sizer( scrollbox, button_grid, 1, wxGROW, 0 )  
add_sizer_to_sizer( panlbox, panlboxt, 1, wxGROW, 0 )  
add_sizer_to_sizer( panlbox, panlboxm, 1, wxGROW, 0 )  
  
--http://wxeuphoria.sourceforge.net/sfdocs/CONTROL.html#SET_SIZE 
--set_size ( atom win, integer cx, integer cy ) 
--move ( atom win, integer x, integer y ) 
 
set_scrollbars( scrollwin, 20, 20, 50, 50, 0, 0, 0 )   
set_back_color( scrollwin, Red )     
  
atom tempbtn      
for i = 1 to 6 do      
	for j = 1 to 8 do   
	    tempbtn = create( wxButton, {scrollwin, -1, sprintf("Button %dx%d", i & j), 0, 0, 90, 60} )      
	    add_window_to_sizer( button_grid, tempbtn, 1, wxGROW, 0 )     
	end for --j    
end for --i     
 
set_sizer( panl, panlbox )  
set_sizer( panltop, panlboxt )  
set_sizer( panlmid, panlboxm )  
set_sizer( scrollwin, scrollbox )     
      
wxMain( main )    
--Geg, Matt 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu