2007年09月06日 星期四 17:51
project home page: http://code.google.com/p/meide/ tests and examples in svn tests subdirectory License GPLv3 What is meide ============ meide is a ui interface creation library. You can use it to create wxPython based user interface. It can deal with several sizer class, for example: BoxSizer, GridBagSizer, StaticBoxSizer, and it also provide an easy way to create widgets, like: StaticText, TextCtrl, CheckBox, etc. You know create ui interface manually is a hard work, and that's why meide comes out. What is the goals of meide 1. Supports easily sizer creation 2. Supports easily widgets creation 3. Supports easily frame creation, like: Dialog, Panel, etc 4. Supports SetValue? and GetValue? to value-field 5. Supports event binding 6. Supports validate 7. Makes above as easy as I can meide is still in heavy developpint, so please keep touch with it, maybe you can find something very useful or helpful. How to use it =========== The step is easy: 1. Creatint a layout 2. Add widgets or sub-layout 3. Binding event 4. invoke the create method Examples ========== There are some testing examples you can find in tests subdirectroy. Example 1 - The simplest example =========================== This example comes from test/test_simple.py, you can run all the examples in the tests directory. And below is just the main code snippet: import meide as ui self.box = box = ui.VBox() box.add(ui.Button('Hello'), flag=wx.ALIGN_CENTER|wx.ALL).bind('click', self.OnClickHello) ui.create(self, box, fit=2) first, you shuld import meide module, you can rename it a new name ui. `ui.VBox()' will create a layout. So you can guess there should be a HBox, yes, you are right. box.add will add widgets or sub-layout to current layout. For the most simplest case, you can only add widgets or sub-layout instance or even class name. For example: box.add(ui.Button) this code is also right. The full add method signature is:: def add(element, name='', proportion=None, flag=None, border=None) So the first parameter should be a class name or instance of a widget or a layout. Other parameters could be skipped. Every element could has a name, and you can get this element back in the later via this name. If you don't give a name, meide will automatically create one name for you, the name format will be like 'id%d', here the %d will automatically increase. proportion just like the proportion parameter of add method in any sizer class. and the flag and border are also the same. For more detail you can read the document of wx.Sizer Add method. So the above example uses a flag parameter, and it means that the Hello button should be aligned center and four direction will have a border. The next .bind will bind a click event to a function. meide will define some easily remembered event name, for example: click for EVT_BUTTON, check for EVT_CHECKBOX. So you can use these simple event name or just use EVT_CHECKBOX, meide will still deal with them. So bind('click', self.OnClickHello) means that when you click on the Hello button, it'll raise a click event, and invoke self.OnClickHello function. ui.create(self, box, fit=2) will initialize the layout. The first parameter is the parent window object. the second parameter is the layout object. And the third one is used to fit the window to the best size. If the fit is 0, don't change the window size, if the fit is 1, then changes the height to the best size, if the fit is 2, then changes the width and height to the best size. Hope you enjoy it. -- I like python! UliPad <>: http://code.google.com/p/ulipad/ My Blog: http://www.donews.net/limodou
2007年09月07日 星期五 07:56
ÀÏÐÖÖÕÓÚ¾ö¶¨Òª°Ñ wxGlade ˦ÔÚÉíºóÁË¡£Ç¿ÁÒÖ§³Ö£¡ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070907/0beee90b/attachment.html
2007年09月07日 星期五 08:36
On 9/7/07, Ben Luo <benluo在gmail.com> wrote: > 老兄终于决定要把 wxGlade 甩在身后了。强烈支持! > 倒也不是甩在后面,因为我不用wxGlade,而是手写代码,自然希望是越方便越好.首先是自已会用,然后是看大家有没有兴趣. -- I like python! UliPad <>: http://code.google.com/p/ulipad/ My Blog: http://www.donews.net/limodou
2007年09月07日 星期五 08:48
On 9/7/07, limodou <limodou在gmail.com> wrote: > > µ¹Ò²²»ÊÇ˦ÔÚºóÃæ,ÒòΪÎÒ²»ÓÃwxGlade,¶øÊÇÊÖд´úÂë,×ÔȻϣÍûÊÇÔ½·½±ãÔ½ºÃ.Ê×ÏÈÊÇ×ÔÒÑ»áÓÃ,È»ºóÊÇ¿´´ó¼ÒÓÐûÓÐÐËȤ. Óмƻ® plug-in µ½ulipadÖУ¿ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070907/324bee51/attachment.html
2007年09月07日 星期五 08:54
On 9/7/07, Ben Luo <benluo在gmail.com> wrote: > On 9/7/07, limodou <limodou在gmail.com> wrote: > > 倒也不是甩在后面,因为我不用wxGlade,而是手写代码,自然希望是越方便越好.首先是自已会用,然后是看大家有没有兴趣. > > 有计划 plug-in 到ulipad中? > 是的,等再完善一些,就会慢慢将以前的一些界面生成进行替换.只不过它不是一个plugin只是一个库而已. -- I like python! UliPad <>: http://code.google.com/p/ulipad/ My Blog: http://www.donews.net/limodou
Zeuux © 2025
京ICP备05028076号