Chataretemplate2

From Vendetta Lua
Jump to: navigation, search

chatareatemplate creates a control for the general chat log

Functions

OnShow

Definition:
OnShow(userdata self) -> nil

Description:
Update the controt and point the general chat log to it

Arguments:
self this box

OnHide

Definition:
OnHide(userdata self) -> nil

Description:
stub

Arguments:
self this box

OnMaximize

Definition:
OnMaximize(userdata self) -> nil

Description:
called after pressing the maximize button.

Arguments:
self this box

set_chatmode

Definition:
set_chatmode(userdata self, int mode) -> nil

Description:
change the chatmode

Arguments:
self this box
mode 1 = channel, 2 = sector, 3 = group, 4 = guild, 5 = system

update_channeltitle

Definition:
update_channeltitle(userdata self) -> nil

Description:
update the channel title..

Arguments:
self this box

Example

-- minimal dialog with a chatarea
-- Note: after running this code the stations or huds chatarea won't update anymore. toggeling them should restore them
 
-- create chatare
local c = chatareatemplate2()
-- put it into a conveniently sized dialog
local d = iup.dialog{c, size="x200"}
 
-- use the dialogs show_cb callback to update the chatarea whenever the dialog is shown
-- this will initially point the general chatlog to this chatarea and restore it after coming back from the maximized state
function d:show_cb()
    c:OnShow()
end
 
-- show the dialog
-- Note: with d:show() the dialog will not hide after clicking maximize button
ShowDialog(d)