---++!! !DebugAppDev __description__: 搴旂敤绋嬪簭寮€鍙戣€咃紝鐢ㄦ潵璋冭瘯NPL绋嬪簭鐨勫伐鍏烽泦 %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Debug app for Paraworld | *Title* | Debug app for Paraworld | | *Author(s)* | LiXizhi | | *Date* | 2008/1/21 | | *File* | script/kids/3DMapSystemApp/DebugApp/app_main.lua | ---+++ Description db registration insert script INSERT INTO apps VALUES (NULL, 'Debug_GUID', 'Debug', '1.0.0', 'http://www.paraengine.com/apps/Debug_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemApp/DebugApp/IP.xml', '', 'script/kids/3DMapSystemApp/DebugApp/app_main.lua', 'Map3DSystem.App.Debug.MSGProc', 1); %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/app_main.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Debug.OnConnection requires create class commonlib.setfield("Map3DSystem.App.Debug", {}); ------------------------------------------- event handlers ------------------------------------------- OnConnection method is the obvious point to place your UI (menus, mainbars, tool buttons) through which the user will communicate to the app. This method is also the place to put your validation code if you are licensing the add-in. You would normally do this before putting up the UI. If the user is not a valid user, you would not want to put the UI into the IDE. * _param_ __app__ : the object representing the current application in the IDE. * _param_ __connectMode__ : type of Map3DSystem.App.ConnectMode. __syntax__ <verbatim>function Map3DSystem.App.Debug.OnConnection(app, connectMode)</verbatim> __parameters__ | *app* | the object representing the current application in the IDE. | | *connectMode* | | ---++++ !Map3DSystem.App.Debug.OnDisconnection Receives notification that the Add-in is being unloaded. __syntax__ <verbatim>function Map3DSystem.App.Debug.OnDisconnection(app, disconnectMode)</verbatim> __parameters__ | *app* | | | *disconnectMode* | | ---++++ !Map3DSystem.App.Debug.OnQueryStatus This is called when the command's availability is updated When the user clicks a command (menu or mainbar button), the QueryStatus event is fired. The QueryStatus event returns the current status of the specified named command, whether it is enabled, disabled, or hidden in the CommandStatus parameter, which is passed to the msg by reference (or returned in the event handler). * _param_ __commandName__ : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". * _param_ __statusWanted__ : what status of the command is queried. it is of type Map3DSystem.App.CommandStatusWanted * _return_ ____ : returns according to statusWanted. it may return an integer by adding values in Map3DSystem.App.CommandStatus. __syntax__ <verbatim>function Map3DSystem.App.Debug.OnQueryStatus(app, commandName, statusWanted)</verbatim> __parameters__ | *app* | | | *commandName* | The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". | | *statusWanted* | | | *return* | returns according to statusWanted. it may return an integer by adding values in Map3DSystem.App.CommandStatus. | ---++++ !Map3DSystem.App.Debug.OnExec This is called when the command is invoked.The Exec is fired after the QueryStatus event is fired, assuming that the return to the statusOption parameter of QueryStatus is supported and enabled. This is the event where you place the actual code for handling the response to the user click on the command. * _param_ __commandName__ : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". __syntax__ <verbatim>function Map3DSystem.App.Debug.OnExec(app, commandName, params)</verbatim> __parameters__ | *app* | | | *commandName* | The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". | | *params* | | ---++++ !Map3DSystem.App.Debug.OnRenderBox Change and render the 3D world with mcml data that is usually retrieved from the current user's profile page for this application. __syntax__ <verbatim>function Map3DSystem.App.Debug.OnRenderBox(mcmlData)</verbatim> __parameters__ | *mcmlData* | | ---++++ !Map3DSystem.App.Debug.Navigate called when the user wants to nagivate to the 3D world location relavent to this application __syntax__ <verbatim>function Map3DSystem.App.Debug.Navigate()</verbatim> ---++++ !Map3DSystem.App.Debug.GotoHomepage called when user clicks to check out the homepage of this application. Homepage usually includes: developer info, support, developer worlds information, app global news, app updates, all community user rating, active users, trade, currency transfer, etc. __syntax__ <verbatim>function Map3DSystem.App.Debug.GotoHomepage()</verbatim> ---++++ !Map3DSystem.App.Debug.DoQuickAction called when user clicks the quick action for this application. __syntax__ <verbatim>function Map3DSystem.App.Debug.DoQuickAction()</verbatim> ---++++ !Map3DSystem.App.Debug.OnKeyDownProc ------------------------------------------- client world database function helpers. ------------------------------------------- ------------------------------------------ all related messages ------------------------------------------ key down callback. Hook for F11 key __syntax__ <verbatim>function Map3DSystem.App.Debug.OnKeyDownProc(nCode, appName, msg)</verbatim> __parameters__ | *nCode* | | | *appName* | | | *msg* | | ---++ Debug window of a given user | *Title* | Debug window of a given user | | *Author(s)* | LiXizhi | | *Date* | 2008/1/21 | | *File* | script/kids/3DMapSystemApp/DebugApp/DebugWnd.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/DebugWnd.lua"); Map3DSystem.App.Debug.ShowDebugWnd(app); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Debug.ShowDebugWnd common control library NPL.load("(gl)script/ide/common_control.lua"); commonlib.setfield("Map3DSystem.App.Debug.DebugWnd", {}); display the main Debug window for the current user. __syntax__ <verbatim>function Map3DSystem.App.Debug.ShowDebugWnd(_app)</verbatim> __parameters__ | *app* | | ---++++ !Map3DSystem.App.Debug.DebugWnd.Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. * _param_ ____ :_parent: parent window inside which the content is displayed. it can be nil. __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.Show(bShow, _parent, parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | | ---++++ !Map3DSystem.App.Debug.DebugWnd.UpdateHistoryDoCodeFiles ---------------------------------------------------------- do code related ---------------------------------------------------------- load all history do code files under the current file __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.UpdateHistoryDoCodeFiles()</verbatim> ---++++ !Map3DSystem.App.Debug.DebugWnd.OnClickSaveCode save code to file. * _param_ __filename__ : nil or file name to save as. If nil, the first 20 letters from the code is used as file name __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.OnClickSaveCode(filename)</verbatim> __parameters__ | *filename* | nil or file name to save as. If nil, the first 20 letters from the code is used as file name | ---++++ !Map3DSystem.App.Debug.DebugWnd.OnClickDoCodeHistoryTreeNode click the file node to open the file in the do code text window __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.OnClickDoCodeHistoryTreeNode(treeNode)</verbatim> __parameters__ | *treeNode* | | ---++++ !Map3DSystem.App.Debug.DebugWnd.OnOpenCodeFile open file in code view. * _param_ __NoMessage__ : usually nil. if true, no message is displayed for failed open file. __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.OnOpenCodeFile(filepath, NoMessage)</verbatim> __parameters__ | *filepath* | | | *NoMessage* | usually nil. if true, no message is displayed for failed open file. | ---++++ !Map3DSystem.App.Debug.DebugWnd.OnClickRunCode execute the code in the code window __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.OnClickRunCode()</verbatim> ---++++ !Map3DSystem.App.Debug.DebugWnd.OnDeleteDoCodeFileNode delete the do code file node as well as its file. __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.OnDeleteDoCodeFileNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DSystem.App.Debug.DebugWnd.DrawDoCodeFilesNodeHandler default node renderer: it display a clickable check box for expandable node, followed by node text __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.DrawDoCodeFilesNodeHandler(_parent,treeNode)</verbatim> __parameters__ | *parent* | | | *treeNode* | | ---++++ !Map3DSystem.App.Debug.DebugWnd.OnClickViewVariable ---------------------------------------------------------- watcher related ---------------------------------------------------------- __syntax__ <verbatim>function Map3DSystem.App.Debug.DebugWnd.OnClickViewVariable()</verbatim> ---++ Debug app readme file | *Title* | Debug app readme file | | *Author(s)* | LiXizhi | | *Date* | 2008/3/9 | | *File* | script/kids/3DMapSystemApp/DebugApp/readme.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/readme.lua"); </verbatim> ---+!! Debug Application When this application is installed, press F12 key to bring the debug window at any time. The debug applications have two modules: * Debug window: one can write and run any code snippet directory in the debug window. * Press F12 key to open it. Or one can open it from the help menu. * Test Console Window: one can write and run unit test files from a GUI interface. * Please see UnitTest for more information. One can open the test console from the help menu %TOC% ---++ Summary of Contents ---+++ Debug Window Copy and paste NPL script code to the debug window and click run. Each time a script code runs, it will be saved to a file so that the debugger will automatically reload the last script code. One can also save script code to files, the first line of the script code is used as the file name. So it is letter to write debug code as this <verbatim> -- some description CallActualCode(); </verbatim> Debug Window is useful for casual unit testing as well. For serious unit testing with automatic result and wiki documentation generation, please use the Test Console window ---+++ Test Console Window Test Console Window is a GUI front end for the unit test framework in NPL. %INCLUDE{"UnitTest"}% ---++ Screenshots & User Guide ]] ---++ Test console window | *Title* | Test console window | | *Author(s)* | LiXizhi | | *Date* | 2008/3/5 | | *File* | script/kids/3DMapSystemApp/DebugApp/TestConsoleWnd.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/TestConsoleWnd.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Debug.ShowTestConsoleWnd common control library NPL.load("(gl)script/ide/common_control.lua"); commonlib.setfield("Map3DSystem.App.Debug.TestConsoleWnd", {}); display the main Debug window for the current user. __syntax__ <verbatim>function Map3DSystem.App.Debug.ShowTestConsoleWnd(_app)</verbatim> __parameters__ | *app* | | ---++++ !Map3DSystem.App.Debug.TestConsoleWnd.Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. * _param_ ____ :_parent: parent window inside which the content is displayed. it can be nil. __syntax__ <verbatim>function Map3DSystem.App.Debug.TestConsoleWnd.Show(bShow, _parent, parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback