Re: [Boa Constr] Sizers and Layout with Boa
Status: Beta
Brought to you by:
riaan
From: Riaan B. <riaan@e.co.za> - 2001-02-10 16:19:59
|
Hi Enrique, you've prompted me to add a page about window layout to Boa's documentation, guess you'll have to proof read it now ;) I've also attached 3 files showing the same window layout in three flavours, Constraints, Anchors and Sizers. This is the new help page (excuse formatting, copy pasted) Note that this help and examples really apply to my current version of Boa and wxPython 2.2.5 but it should still be useful. -- wxPython offers various flavours of window layout. The two main systems are Constraints and Sizers. Constraints allow layout relationships to be setup between controls and edges. A constraint must define 4 valid individual layout constraints or chaos will ensue. Boa offers support but not complete integration of constraints currently. They can be set up in the Collection Editor accessible from the Constraints property of controls. One problem is currently is that the relative offsets (margin and value) are not kept in sync when controls are moved and sized. There are two more modules to help with this somewhat tedious to setup, but powerful layout mechanism. They can be found in wxPython.lib as layoutf and anchors. With layoutf constraints can be specified in concise printf like format. There is no built-in support for layoutf in Boa but they can be added by hand. See the layoutf's source for documentation The LayoutAnchors class in anchors derives from wxLayoutConstraint and can be used in it's place. They offer a simple subset of normal constraints where the sides of a control may be 'anchored' on it's parent. Anchors are completely integrated into the Designer and available by right clicking on a selection tag in the Designer or from the Anchors property of controls. See LayoutAnchors for detailed info. Sizers allow controls and other sizers to be packed horizontally and vertically in window. They can grow, align to sides, proportionally resize or be centered. Boa has no built-in support for sizers currently. I have trouble integrating them into Boa's current design time framework. They also need special visual support in the Designer , and the 'packing' of controls goes against the current placing and sizing methodology. Support is planned at a later stage. Remember that you can always add Sizers by hand (to __init__) if you really need them. Please note that a window's AutoLayout property should be set to true for the window to automatically apply layout for sizers and constraints. If this is not set you'll have to call Layout() yourself in the OnSize event of the window, but constraints will not be applied for that window at design-time. -- Enrique Castro wrote: > > Hi, > I have used Boa for very simple GUIs fo far. Now I want to go further > exploiting wxWindows features. I do not see how to introduce sizers (e.g > wxBoxSizer) or Layout management into dialogs using Boa > > I have read the new Guide, but there is nothing there about this topic > > Thanks a lot in advance > Enrique Castro > > #################################################### > > Enrique Castro > Dept. Bioquímica, Biología Molecular y Fisioloía > Universidad de Las Palmas de Gran Canaria (ULPGC) > Facultad de Ciencias de la Salud > c/ Doctor Pasteur s/n > 35016 Las Palmas, Spain > > Tel: (34) 928 45 87 90 > Fax: (34) 928 45 14 41 > e-mail: ec...@ci... > ##################################################### > > _______________________________________________ > Boa-constructor-users mailing list > Boa...@li... > http://lists.sourceforge.net/lists/listinfo/boa-constructor-users -- Riaan Booysen ___________________________________________________ Boa Constructor - RAD GUI building IDE for wxPython http://boa-constructor.sourceforge.net |