---++!! !DesktopWnd %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Desktop window for 3d map system | *Title* | Desktop window for 3d map system | | *Author(s)* | WangTian, | | *Date* | 2008/1/23 | | *File* | script/kids/3DMapSystemUI/Desktop/DesktopWnd.lua | ---+++ Description ---++ Add desktop icons One can add commands icons to Startup, Online, Offline command groups. Each commands may contain a url or UICallback function. However, most desktop icons are advised to be mcml url only. *example* <verbatim> Map3DSystem.UI.Desktop.AddDesktopItem({ButtonText="iconText", icon = "icon path", url="Some URL here"}, "Startup.Credits"); Map3DSystem.UI.Desktop.AddDesktopItem({ButtonText="iconText", icon = "icon path", url="Some URL here"}, "Online.MyProfile"); Map3DSystem.UI.Desktop.AddDesktopItem({ButtonText="iconText", icon = "icon path", url="Some URL here"}, "Offline.Tutorial"); </verbatim> ---++ Desktop Front page goto a url page on the desktop front page. call below <verbatim> Map3DSystem.UI.Desktop.GotoDesktopPage(url) </verbatim> change the desktop images <verbatim> Map3DSystem.UI.Desktop.SetBackgroundImage(filename) </verbatim> %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Desktop/DesktopWnd.lua"); Map3DSystem.UI.Desktop.Show(); -- to add desktop icon that has a showUI callback at startup Map3DSystem.UI.Desktop.AddDesktopItem({ButtonText="iconText", icon = "icon path", OnShowUICallback}, "Startup.Credits"); -- to add desktop icon that opens an url page. Map3DSystem.UI.Desktop.AddDesktopItem({ButtonText="iconText", icon = "icon path", url}, "Startup.Credits"); </verbatim> ---+++ Member Functions ---++++ !Desktop.AddDesktopItem <verbatim> common control library NPL.load("(gl)script/kids/3DMapSystem_Data.lua"); local L = CommonCtrl.Locale("ParaWorld"); if(not Map3DSystem.UI.Desktop) then Map3DSystem.UI.Desktop = {}; end local Desktop = Map3DSystem.UI.Desktop; Desktop.LoginBarMCML = "script/kids/3DMapSystemUI/Desktop/LoginPage.html" Desktop.NewAccountUrl = "http://www.minixyz.com/cn_01/register.aspx"; Themes and Images Desktop.DesktopBG = "Texture/3DMapSystem/Desktop/BG.png";--"Texture/3DMapSystem/Desktop/DesktopBG.png"; Desktop.HeaderBG = ""; --"Texture/3DMapSystem/Desktop/TopFrameBG.png: 10 200 10 0" Desktop.ParaWorldLogo = "Texture/3DMapSystem/brand/paraworld_text_256X128.png"; -- "Texture/3DMapSystem/Desktop/Logo_cn.png; 0 0 192 192"; -- TODO: locale Desktop.ParaWorldLogo128 = "Texture/3DMapSystem/Desktop/Logo_cn_128.png"; -- TODO: locale Desktop.ParaWorldSlogen = ""; -- "Texture/3DMapSystem/Desktop/ParaEngineTenet.png" Desktop.StartupBarBG = ""; -- "Texture/3DMapSystem/Desktop/StartupBarBG.png"; Desktop.LoginBarBG = ""; -- "Texture/3DMapSystem/Desktop/LoginBarBG.png"; Desktop.LoginButton_Norm = "Texture/3DMapSystem/Desktop/LoginButton_Norm.png: 15 15 15 15"; Desktop.LoginButton_HL = "Texture/3DMapSystem/Desktop/LoginButton_HL.png: 15 15 15 15"; Desktop.LoginButton_Norm = "Texture/3DMapSystem/Desktop/LoginPageButton3.png: 15 15 15 16"; Desktop.LoginButton_HL = "Texture/3DMapSystem/Desktop/LoginPageButton_HL3.png: 15 15 15 16"; Fonts Desktop.LoginBarFont = "System;12;norm"; Desktop.LoginBarFontBold = "Verdana;12;bold"; Desktop.LastShowGridViewName = nil; Desktop.LastShowGridRow = nil; Desktop.LastShowGridColumn = nil; Desktop.LastUrl = nil; preinstalled desktop icons. other applications may add to this icon list at startup time. Desktop.icons = { name = "Desktop", text = "Desktop", Nodes={ { -- "Startup" contains panel or command icons that are shown at startup. name = "Startup", text = "Startup", -- child objects Nodes = {}, }, { -- "Online" contains icons that are only shown when user is signed in. name = "Online", text = "Online", -- child objects Nodes = {}, }, { -- "Offline" contains icons that are only shown when user is signed in as offline. name = "Offline", text = "Offline", -- child objects Nodes = {}, }, }</verbatim>}; Edited LXZ 2008.1.28. Add a desk top command at given position. This function is usually called during an application's startup connection event (not UISetup) * _param_ __command__ :; type of Map3DSystem.App.Command, or a new table that contains {ButtonText="iconText", icon = "icon path", OnShowUICallback = nil or function (bShow, _parent,parentWindow) .. end} * _param_ __position__ : this is a tree path string of folder names separated by dot. The desktop has a predefined folder structure, which is "Startup.anyname": "Startup" contains panel or command icons that are shown at startup. "Online.anyname": "Online" contains icons that are only shown when user is signed in. "Offline.anyname", "Offline" contains icons that are only shown when user is signed in as offline. * _param_ __posIndex__ : if position is a item in another folder, this is the index at which to add the item. if nil, it is added to end, if 1 it is the beginning. __syntax__ <verbatim>function Desktop.AddDesktopItem(command, position, posIndex)</verbatim> __parameters__ | *command* | ; type of Map3DSystem.App.Command, or a new table that contains {ButtonText="iconText", icon = "icon path", OnShowUICallback = nil or function (bShow, _parent,parentWindow) .. end} | | *position* | | | *posIndex* | if position is a item in another folder, this is the index at which to add the item. if nil, it is added to end, if 1 it is the beginning. | ---++++ !Desktop.GetItemIndex return a desktop icon index by its position. This function is mosted called before AddDesktopItem to determine where to insert a new command. * _param_ __position__ : this is a tree path string of folder names separated by dot e.g. "Startup.anyname" * _return_ __nil__ : if not found, other the item index integer is returned. please note that the index may change when new items are added later on. __syntax__ <verbatim>function Desktop.GetItemIndex(position)</verbatim> __parameters__ | *position* | this is a tree path string of folder names separated by dot e.g. "Startup.anyname" | ---++++ !Desktop.AddStartupBarApplication obsoleted: no longer used __syntax__ <verbatim>function Desktop.AddStartupBarApplication(appTable)</verbatim> __parameters__ | *appTable* | | ---++++ !Desktop.SetBackgroundImage public: set the background image: 1020*700 * _param_ __filename__ : nil or a file path __syntax__ <verbatim>function Desktop.SetBackgroundImage(filename)</verbatim> __parameters__ | *filename* | nil or a file path | ---++++ !Desktop.ShowStartupPanel always show the first cell as the startup panel. * _param_ __bForceUpdate__ : if true, it will rebuilt the UI for the cell at row, column even it is the same as last click. __syntax__ <verbatim>function Desktop.ShowStartupPanel(bForceUpdate)</verbatim> __parameters__ | *bForceUpdate* | if true, it will rebuilt the UI for the cell at row, column even it is the same as last click. | ---++++ !Desktop.GetAppCanvas the middle application canvas __syntax__ <verbatim>function Desktop.GetAppCanvas()</verbatim> ---++++ !Desktop.OnClickGridCell show the current app display and hide the last app display if the same current and last app display, hide current * _param_ __bShow__ : true or nil to show, false to hide, * _param_ __bForceUpdate__ : if true, it will rebuilt the UI for the cell at row, column even it is the same as last click. __syntax__ <verbatim>function Desktop.OnClickGridCell(gridviewName, row, column, bShow, bForceUpdate)</verbatim> __parameters__ | *gridviewName* | | | *row* | | | *column* | | | *bShow* | true or nil to show, false to hide, | | *bForceUpdate* | | ---++++ !Desktop.ShowOnline switch to login page. __syntax__ <verbatim>function Desktop.ShowOnline()</verbatim> ---++++ !Desktop.OnClickCallback_ExitApp Exit app button. __syntax__ <verbatim>function Desktop.OnClickCallback_ExitApp()</verbatim> ---++++ !Desktop.LoadEmptyScene switch to in-game empty scene for testing. TODO: remove this. __syntax__ <verbatim>function Desktop.LoadEmptyScene()</verbatim> ---++++ !Desktop.LoadDemoScene switch to in-game demo scene for testing. TODO: remove this. __syntax__ <verbatim>function Desktop.LoadDemoScene()</verbatim> ---++++ !Desktop.OnLoginOfflineMode to offline mode. __syntax__ <verbatim>function Desktop.OnLoginOfflineMode()</verbatim> ---++++ !Desktop.OnClickNewAccount click to create new account __syntax__ <verbatim>function Desktop.OnClickNewAccount(ctrlName, values)</verbatim> __parameters__ | *ctrlName* | | | *values* | | ---++++ !Desktop.OnClickConnect Authenticate user and check client version. __syntax__ <verbatim>function Desktop.OnClickConnect(ctrlName, values)</verbatim> __parameters__ | *ctrlName* | | | *values* | | ---++++ !Desktop.GotoDesktopPage goto a url page on the desktop front page. * _param_ __url__ : url of the page * _param_ __cachePolicy__ : nil or a cache policy. if nil, it defaults to 1 day. __syntax__ <verbatim>function Desktop.GotoDesktopPage(url, cachepolicy)</verbatim> __parameters__ | *url* | url of the page | | *cachepolicy* | | %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