DebugAppDev

description: 搴旂敤绋嬪簭寮€鍙戣€咃紝鐢ㄦ潵璋冭瘯NPL绋嬪簭鐨勫伐鍏烽泦

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);

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/app_main.lua");

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 ConnectMode.

syntax

function Map3DSystem.App.Debug.OnConnection(app, connectMode)

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

function Map3DSystem.App.Debug.OnDisconnection(app, disconnectMode)

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 CommandStatusWanted
  • return __ : returns according to statusWanted. it may return an integer by adding values in CommandStatus.

syntax

function Map3DSystem.App.Debug.OnQueryStatus(app, commandName, statusWanted)

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 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

function Map3DSystem.App.Debug.OnExec(app, commandName, params)

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

function Map3DSystem.App.Debug.OnRenderBox(mcmlData)

parameters

mcmlData  

Map3DSystem.App.Debug.Navigate

called when the user wants to nagivate to the 3D world location relavent to this application

syntax

function Map3DSystem.App.Debug.Navigate()

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

function Map3DSystem.App.Debug.GotoHomepage()

Map3DSystem.App.Debug.DoQuickAction

called when user clicks the quick action for this application.

syntax

function Map3DSystem.App.Debug.DoQuickAction()

Map3DSystem.App.Debug.OnKeyDownProc


client world database function helpers.


all related messages

key down callback. Hook for F11 key

syntax

function Map3DSystem.App.Debug.OnKeyDownProc(nCode, appName, msg)

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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/DebugWnd.lua");
Map3DSystem.App.Debug.ShowDebugWnd(app);

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

function Map3DSystem.App.Debug.ShowDebugWnd(_app)

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

function Map3DSystem.App.Debug.DebugWnd.Show(bShow, _parent, parentWindow)

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

function Map3DSystem.App.Debug.DebugWnd.UpdateHistoryDoCodeFiles()

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

function Map3DSystem.App.Debug.DebugWnd.OnClickSaveCode(filename)

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

function Map3DSystem.App.Debug.DebugWnd.OnClickDoCodeHistoryTreeNode(treeNode)

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

function Map3DSystem.App.Debug.DebugWnd.OnOpenCodeFile(filepath, NoMessage)

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

function Map3DSystem.App.Debug.DebugWnd.OnClickRunCode()

Map3DSystem.App.Debug.DebugWnd.OnDeleteDoCodeFileNode

delete the do code file node as well as its file.

syntax

function Map3DSystem.App.Debug.DebugWnd.OnDeleteDoCodeFileNode(sCtrlName, nodePath)

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

function Map3DSystem.App.Debug.DebugWnd.DrawDoCodeFilesNodeHandler(_parent,treeNode)

parameters

parent  
treeNode  

Map3DSystem.App.Debug.DebugWnd.OnClickViewVariable


watcher related

syntax

function Map3DSystem.App.Debug.DebugWnd.OnClickViewVariable()

Debug app readme file

Title Debug app readme file
Author(s) LiXizhi
Date 2008/3/9
File script/kids/3DMapSystemApp/DebugApp/readme.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/readme.lua");

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

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
-- some description
CallActualCode();
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.

Warning: Can't find topic Main.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

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/DebugApp/TestConsoleWnd.lua");

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

function Map3DSystem.App.Debug.ShowTestConsoleWnd(_app)

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

function Map3DSystem.App.Debug.TestConsoleWnd.Show(bShow, _parent, parentWindow)

parameters

bShow boolean to show or hide. if nil, it will toggle current setting.
parent  
parentWindow  
Topic revision: r1 - 2008-02-29 - LiXizhi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 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