2007年12月23日

新版的Snippet功能要比老版的功能好太多了。

首先从编辑上,老版的分类与内容是分别录入的,而且需要进入专门的界面进行编辑,很不方便。而新版的是可以一边使用,一边编辑,分类与内容可以一起编辑。老版在使用和编辑上不能同时使用,而新版可以,而且可以支持拖拽,拷贝,粘贴和一些快捷键,如删除使用Del。

其次从处理方式上,老版是将分类存为一个文件,分个分类下的内容存为一个文件。而新版可以是多个文件,每个文件包含完整的分类和内容。因此共享起来会更方便。并且你可以同时打开多个snippet文件,并且可以在多个文件之间拖动文件夹(分类)和结点(片段),非常方便。

再有支持一些简捷操作,如从文本编辑器中选中文本,然后拖拽到snippet窗口中的某个结点上,可以是文件夹或内容结点,这样会自动创建新的内容结点。同时在进行结点和文本拖拽时,如果按下了象Ctrl, Shift键还会插入不同的位置。

如果目标结点是文件夹,则什么都不按时,拖动的结点会追加到目标文件夹子结点的最后。如果按下了Ctrl,则加到目标文件夹的后面,而不是作为子结点,如果按下了Shift则加到目标文件夹的前面,而不是作为子结点。

如果目标结点是内容,则按下Ctrl或什么都不按都是加到目标的后面。如果按下了Shift,则加到目标的前面。

当你作出修改后,顶层文件夹结点会有一个带叹号的图标显示,你需要保存你所做的修改。可以在右键弹出菜单选择保存或全部保存,也可以在工具条上选择相应的保存按钮。

你可以点击结点的标签进行标题的修改,也可以在弹出菜单中选择编辑标题的菜单。

你可以在弹出菜单中添加文件夹和内容。

当点中内容结点时,在底部面板会显示一个编辑器,显示它的内容,并且你可以随时进行修改。修改的内容会自动缓存,如果想在下次启动时生效,请保存它。当点击非内容结点时,编辑器将自动关闭。

你可以设置内容结点的语法高亮属性。选中一个内容结点,点右键,在弹出菜单中选择[Preferences...],将可以让你修改语法高亮的设置。缺省为Python。

一些截屏我放在了好看簿上 http://www.haokanbu.com/story/4755/

2007年12月18日

I’v finished a plugin, called Canvas Test, and the functionality is simple now, and the mainly idea is that I want to learn graphic drawing, and want to test some API easily, so I developed this plugin, and you can write graphic drawing code directly, and then see the result.

You can see the screen shots at http://www.haokanbu.com/story/4522/

The steps are:

  1. Update the lastest code from svn
  2. Check casvas_test_plugin and restart UliPad
  3. Run [Tool]->[Canvas Test]
  4. In Canvas Test window, write down graphic API. You’ll see there already has two lines:

    import wx
    dc = wx.PaintDC(self)

    these lines are used to enable code completion support.

  5. Write down your code after dc = wx.PaintDC(self)
  6. Then click the refresh button

Hope you like it.

2007年12月15日

这几天看到Cody Precord(他是editra编辑器的作者)在wxPython邮件列表发布了一个PlatButton的控件。我下载看了一下,还是挺不错的。结果引来不少人的评论,其中Robin Dunn发现了不少建议,其中谈到如何写一个wxPython的控件,其中谈到了几个需要遵守的原则:

1. Derive from wx.PyControl. This enables reflection of some pertinent C++ virtual methods to Python methods in the derived class.(从wx.PyControl派生)

2. Call SetInitialSize from the __init__ method, passing the size passed to __init__. This helps set things up properly for sizers, and also sets the size of the control appropriately (using either the size given or the best size.)(在__init__方法中调用SetInitialSize方法)

3. Call InheritAttributes from the __init__ method. If the parent has non-standard font or colors then it will set them for your control.(在__init__方法中调用InheritAttributes)

4. Implement a DoGetBestSize method, returning the wx.Size that would best fit your control based on current font, label or other content, etc.(实现DoGetBestSize方法)

5. Implement an AcceptsFocus method, returning True if the control is meant to receive the keyboard focus.(实现AcceptsFocus方法)

特别是Robin Dunn还给出了他在2004年的PyCon大会上的一个发言。挺不错的,可以看一看。

其实在UliPad中我也实现过一个类似的控件,可以有弹出菜单等功能,有兴趣可以看一看,不过功能可能没有这个丰富。

2007年12月12日

It’s a bug fix version:

  1. Remove profile invoke(big mistake)
  2. Fix svn plugin checkout bug

UliPad has been ported to code.google.com, so you can visit the new project site at: http://code.google.com/p/ulipad, and also visit the new svn address. Recommends using source version.

Source Code: http://ulipad.googlecode.com/files/ulipad.3.8.1.zip
Win Execute Code: http://ulipad.googlecode.com/files/ulipad.3.8.1.exe

If you have any suggestion or question, please subscribe the ulipad
mailling list: http://groups.google.com/group/UliPad

2007年12月06日

What’s new in 3.8

New Features and Changes:

  1. Add mako template syntax highlight support
  2. Add new option in preference, [Python]->Automatically save modified file when running Python program, if it’s checked, it’ll automatically save the modified file.
  3. Add Shift+Delete => Cut, Shift+Insert => Paste
  4. Upgrade winpdb to lastest version
  5. Now you can set pythonpath option in config.ini/[default], and UliPad will insert it into the sys.path. pythonpath can be a string or a string list of directory.
  6. Svn support, you should install pysvn first, and also support proxy.
  7. Change long line indicator default is true.
  8. Add doctest support, you can run the doctest of current document in UliPad
  9. Add time stamp info in debug and error file
  10. Replace the shell window popup menu, and add Copy Without Prompts and Paste and Run menu items. And if the result cann’t be convert to unicode, then display the result as repr().
  11. Script Manager can find menu name from the script content, you can define it as a comment line, format is: #s*name:(.*)$
  12. Add Run in Shell menu item in Editor context menu
  13. Add script and shell key binding. Change Shell to External Tool
  14. Change Find in Files dialog to panel
  15. Using meide module to create Preference dialog
  16. Add an option to control if show the docstring in class browser window.
  17. Don’t create a tmp file again, directly save the file
  18. Improve Find in Files process with thread
  19. Add some config.ini options support in Preference Dialog
  20. Refactor Find & Replace with pane, but not dialog
  21. Made Open Command Here work in Linux
  22. Add dropfile plugin. thanks Tyberius Prime. Now you can drop files on toolbar, then UliPad will open it. Just like drop files on Directory Browser window.
  23. Add new custom lexer class and refactor related lexer process
  24. Upgrade FlatNotebook.py to lastest version, thanks to swordsp
  25. Improve default identifiers process, add type judgement
  26. Add pylint plugin

Bug fix:

  1. Fix print bug, add print line number functionality
  2. Fix snippet template indent bug(when using tab mode, the ‘t’ in template will be replaced with spaces). And you can press Alt+Q to cancel current snippet.
  3. Fix press Ctrl+B jump position is not correct bug.
  4. Fix that when you change the file type, the icon in directory and dynamic menu don’t change bug
  5. Fix line number margin width, and find back End-of-line Marker menu
  6. Fix adding empty directory error
  7. Fix open un-exists file will popup two message dialog bug
  8. Fix line end mix checking bug also including twice prompt dialog bug
  9. Fix webbrowser bug. Thanks Tom Eubank
  10. Fix message console postion bug, thanks for swordsp

UliPad has been ported to code.google.com, so you can visit the new project site at: http://code.google.com/p/ulipad, and also visit the new svn address. Recommends using source version.

Source Code: http://ulipad.googlecode.com/files/ulipad.3.8.zip
Win Execute Code: http://ulipad.googlecode.com/files/ulipad.3.8.exe

If you have any suggestion or question, please subscribe the ulipad

mailling list: http://groups.google.com/group/UliPad

Update: 2007/12/12 Please use 3.8.1 version