一个关于Open Tools API的问题?是否可自定义代码编辑窗体?(200分)

  • 主题发起人 主题发起人 流云
  • 开始时间 开始时间

流云

Unregistered / Unconfirmed
GUEST, unregistred user!
我想替换掉BCB原有的代码编辑窗体,加入类似于VS那种代码折叠的功能。不知道如何入手?
似乎Open Tools API不提供这样的接口,而且加入以后如何得到VCL的符号列表,调用弹出的
菜单来选择成员
 
你自己看吧:

How can I force the code editor to show a specific file tab?
You can either use IOTASourceEditor.Show or call IOTAActionServices.OpenFile and pass in the full path and filename of the file tab to activate.

Known bugs in the Delphi 7 Open Tools API (some apply to Delphi/BCB 6):
IOTAComponent.GetParent always returns nil.
Calling IOTAEditView.SetTempMsg makes the code editor's Diagram tab disappear when clicking back in the source code editor.
Several of the IOTAProjectOptions do not work such as IncludeVersionInfo. Also, many options are missing such as BreakOnException. Some options such as LibraryPath are not persisted across sessions.
The HowMany parameter of IOTAEditPosition.Delete is ignored. As a result, the method always deletes one character.
IOTASourceEditor.SetSyntaxHighlighter is deprecated and can no longer be used
Setting IOTAEditView.CursorPos doesn't update the edit window's cursor position in the status bar.
The IDE does not remove instances of IOTACustomMessage from the message view before unloading an expert. This can result in crashes as the IDE calls back into an unloaded library. The workaround is to call ClearToolMessages before your expert unloads, if it added custom messages.
IOTAToDoManager.ProjectChanged is never called.
You can't add a keyboard binding for keys like Ctrl+/ and Ctrl+K.
IOTAResourceEntry.DataSize must be divisible by 4 (aligned to a 4-byte boundary), or you will get an RLINK32 error when compiling.
Known bugs in the Delphi 6 Open Tools API (some apply to Delphi/BCB 5):
TIModuleInterface.GetFormInterface is deprecated and always returns nil. You must use IOTAFormEditor instead.
The Open Tools keybinding interfaces sometimes raise AVs when using IOTAKeyBoardServices.AddKeyboardBinding.
IOTAEditView.PosToCharPos raises an AV in dfwedit.dll every time it is used.
IOTAEditorServices.TopView raises an AV in the coride package if called with no files open.
Known bugs in the C++Builder 5.01 Open Tools API:
Given a regular unit without an associated form, calling IOTAModule.GetModuleFileCount returns 2 but IOTAModule.GetModuleFileEditor called with index 1 results in an AV and index 2 returns the .H file.
Setting the LibDir project option using IOTAProjectOptions.Values results in an AV.
Known bugs in the Delphi 5.01 Open Tools API:
Calling IOTAModuleServices.OpenProject on a BPG file will crash the IDE. Instead, use IOTAModuleServices.OpenFile.
When querying IOTAProjectGroup.FileName, you won't get a full pathname. Instead query the IOTAModule that implements IOTAProjectGroup for its FileName, and it will contain a full path.
The project options MajorVersion, MinorVersion, Release, and Build don't update the project options dialog when set.
You can not use the keybinding interfaces to bind actions to keystrokes such as Ctrl+Enter, Shift+Enter, and non-shifted alpha-numeric characters.
When opening a BPG file, IOTAIDENotifier will send a blank filename parameter along with ofnFileOpened into the FileNotification method.
The IDE AVs or produces an I/O Error when specifying a file name without a complete path when implementing IOTAProjectCreator.GetFileName.

 
现有的OTA不可能实现。
以我所知的来看,就算用NTA也几乎没法实现,因为“折叠”改变了Editor本身的内容。
“换掉BCB原有的代码编辑窗体”非常难,我们连TEditControl的接口都不知道,更不用说实现了。
Invoke code complete:
((BorlandIDEServices as IOTAEditorServices).TopView as IOTAEditActions).CodeCompletion(csCodelist);
 
NTA是什么?
对我目前来说,如果我用一个自己的窗体来是实现,那么就希望能够实现VCL那些符号表的读取和查询,这样就可以解决编码的方便性问题,一种办法是事先预生成一次,然后再解析
一种方式就是利用OTA已经具有的功能来完成。不知道tinyfish如何看?
希望再继续讨论一下。
 
NTA-Native Tools API。在OTA之前。直接操纵IDE的控件。更强大,更危险,与IDE版本相关。
我的意思是:“用一个自己的窗体来来实现”很难。至少我没见过。既然这个前提都没通过,那其它的就先别讨论了。
不用自己的窗口,就只能间接实现。例如用comment来替换代码,不过compile时又要恢复,挺麻烦。(随便想的方法,未经考虑)
OTA有诸多限制,许多功能不可能完成,或者效率极低。所以有些功能就别勉强。
学OTA最好是找open source的expert来看。如果没有一个expert能做到的,基本上就做不到了。
 
NTA的文档哪里可以查到呢?

我看过把Tab改成多行的例子,但是也没有找到如何修改编辑窗体的例子。

有时候想用一些别的技术来拦截一些请求,但是没有调试很麻烦,常常让IDE死的挺挺的
 
……NTA的帮助就在Delphi中。不过最好还是看别人的例子。

多行tab不一样,不需要替换窗口。

调试方法见http://www.gexperts.org/opentools。
此外,可以用EurekaLog来记录出错信息。输出调试信息的库有很多可用(自己写也行)。

你写过expert吗?如果没有,还是先看看别人的,写几个简单的再说。
 
后退
顶部