Re: Ugh! I am having trouble visualizing sizers.
- Posted by vmars Jul 04, 2009
- 1213 views
OOPS! forgot eucode
-- eucode --[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, 400, 500} ), panl = create( wxPanel, main ), panltop = create( wxPanel, panl ), topbutton01 = create( wxButton, {panltop, new_id(), "Push Me", -1, -1, 40, 60} ), topbutton02 = create( wxButton, {panltop, new_id(), "Push Me", -1, -1, 40, 60} ), scrollwin = create( wxScrolledWindow, {panl, new_id(), -1, -1, -1, -1, 0} ), panlmid = create( wxPanel, panl ), midbutton01 = create( wxButton, {panlmid, new_id(), "Push Me", -1, -1, 40, 60} ), midbutton02 = create( wxButton, {panlmid, new_id(), "Push Me", -1, -1, 40, 60} ), txted = create( wxRichTextCtrl, {panl, -1, "Enter Text Here", -1, -1, 399, 250} ), 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, scrollwin, 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