Re: [Boa Constr] absolute sizes
Status: Beta
Brought to you by:
riaan
From: Werner F. B. <wer...@fr...> - 2007-05-01 10:44:40
|
Hi Ianaré, Attached ZIP file are blocked by SourceForge, so only sent it to Ianaré. ianaré sévi wrote: > hey Werner, > >> Enclosed is a version using sizers (created with the Frame Designer), >> does this look o.k. on your machine? On Vista it looks fine for English >> and French. > > Sorry I couldn't respond sooner. No problem. > I didn't run this since my email > simply put the file as text in the body rather than as an attachement. > Can you resend it as a zip file? Here it is. > > However just by looking at it I can tell it will not work properly: > The sizes are absolute. Yeap, but that should not matter, the sizers will over ride them. If I understand all this correctly the sizes given to a constructor of a control are used as it's minimum size, so what I do now a days is normally leave them whatever the default is and then use sizers to control their growth. BTW, the recent GUI's I did I don't use my work around method anymore and they still work fine for me (also only on Windows 2000, XP and Vista, as I don't work on other platforms - at least not yet, still plan to get a Mac one of these days). > >> I don't want to discurage you doing patches for Boa, however I thought >> the tool should be used to create layouts - at least whenever possible >> (as some MS chap said "one should eat ones own dog food" to his NT >> development stuff when they still wanted to use OS/2 to do their >> development :-) ). > > I totally agree, and actually the sizers should be done in boa. When I > get your version as zip file I will use the way you did it for the > sizers. However at present time boa will not allow non-absolute sizes > for elements, therefore that needs to be done by hand, and opening it > up with the inspector will mess everything up. I believe the way it works currently in Boa has to do that Boa generates source code for the GUI and not e.g. XML (xrced) or some other format, so when it does introspection of the source the minimal size is returned by wxPython and not wx.DEFAULTSIZE. However this is way to technical for me and Riaan or someone else might want to correct me on this. > Also I don't see > support for wx.ID_CANCEL and other stock buttons in Boa, this would > have to be done by hand as well. That can be easily fixed, in boa\companions\ButtonCompanions.py at line 38 change it from: self.windowStyles = ['wx.BU_LEFT', 'wx.BU_TOP', 'wx.BU_RIGHT', 'wx.BU_BOTTOM', 'wx.BU_EXACTFIT'] + self.windowStyles to this (Riaan is this the right place or should one create a separate stock button widget?): self.windowStyles = ['wx.BU_LEFT', 'wx.BU_TOP', 'wx.BU_RIGHT', 'wx.BU_BOTTOM', 'wx.BU_EXACTFIT', 'wx.ID_ADD', 'wx.ID_APPLY', 'wx.ID_BOLD', 'wx.ID_CANCEL', 'wx.ID_CLEAR', 'wx.ID_CLOSE', 'wx.ID_COPY', 'wx.ID_CUT', 'wx.ID_DELETE', 'wx.ID_FIND', 'wx.ID_REPLACE', 'wx.ID_BACKWARD', 'wx.ID_DOWN', 'wx.ID_FORWARD', 'wx.ID_UP', 'wx.ID_HELP', 'wx.ID_HOME', 'wx.ID_INDENT', 'wx.ID_INDEX', 'wx.ID_ITALIC', 'wx.ID_JUSTIFY_CENTER', 'wx.ID_JUSTIFY_FILL', 'wx.ID_JUSTIFY_LEFT', 'wx.ID_JUSTIFY_RIGHT', 'wx.ID_NEW', 'wx.ID_NO', 'wx.ID_OK', 'wx.ID_OPEN', 'wx.ID_PASTE', 'wx.ID_PREFERENCES', 'wx.ID_PRINT', 'wx.ID_PREVIEW', 'wx.ID_PROPERTIES', 'wx.ID_EXIT', 'wx.ID_REDO', 'wx.ID_REFRESH', 'wx.ID_REMOVE', 'wx.ID_REVERT_TO_SAVED', 'wx.ID_SAVE', 'wx.ID_SAVEAS', 'wx.ID_STOP', 'wx.ID_UNDELETE', 'wx.ID_UNDERLINE', 'wx.ID_UNDO', 'wx.ID_UNINDENT', 'wx.ID_YES', 'wx.ID_ZOOM_100', 'wx.ID_ZOOM_FIT', 'wx.ID_ZOOM_IN', 'wx.ID_ZOOM_OUT'] + self.windowStyles > > I tried looking into the inspector code to allow relative sizes, but > it is a little over my head. If Ryaan can tell me where to look for > the sizing stuff then it would make things MUCH easier. As explained above with the current design using "standard" wxPython source code to store the design I am not sure if this is possible. I am pretty sure that Riaan had looked into this some time ago and did not find a solution. Maybe an alternative would be to look into supporting e.g. XRCED as an optional GUI designer from within Boa. It seems that there are more and more people using this and it looks like a lot of work is being done on it to support all the new widgets coming into wxPython. If this would be possible then Boa could support the existing Boa code base with the existing Designer and start using XRCED as the new GUI Designer, with the advantage of others doing work to support all the new widgets being constantly added to wxPython. Best regards Werner |