You are on page 1of 29

Camfrog Bot 6.

0 for Windows
Developer’s Guide
Camfrog Bot 6.0 for Windows Developer's Guide

Table of Contents
Introduction ................................................................................................................................................... 3
“Low-level” development .............................................................................................................................. 3
Plug-in module SDK ....................................................................................................................................... 3
Plug-In Module Architecture ......................................................................................................................... 4
Functions Description .................................................................................................................................... 5
Callback functions exported by the bot: ................................................................................................... 5
Callback functions exported by the plug-in: .............................................................................................. 8
Structures Description ................................................................................................................................. 12
Events Description ....................................................................................................................................... 15
Chat Room Connection Events ................................................................................................................ 15
Central Server Instant Message Effects ................................................................................................... 15
Chatroom text/talk/users Events ............................................................................................................ 16
Bot to Bot Events ..................................................................................................................................... 18
Service Channel Events ............................................................................................................................ 18
Plug-in to Bot Events ............................................................................................................................... 19
Settings Events ........................................................................................................................................ 21
Window XML Description ............................................................................................................................ 22
Examples .................................................................................................................................................. 28

© 2012 Camshare Inc. Page 2


Camfrog Bot 6.0 for Windows Developer's Guide

Introduction

Welcome to the Camfrog Bot Developer's Guide. If you are a new Camfrog Bot user please start by
reading Camfrog Bot User Guide. This manual describes the Camfrog Bot plug-in modules
architecture and the process of custom plug-in modules creation.

Camfrog Bot is a plug-in oriented application which allows users to increase the default
functionality of application by developing and using their own plug-in modules.

There are two basic ways of plug-in modules development, which Camfrog Bot application
performs: “low-level” development and plug-in SDK.

“Low-level” development

This way performs the very basic, but flexible development tools which could be useful for Delphi
or Visual Basic developers or for those who want to implement their own SDK according to their
purposes, because much high-level implementation routine is required.

Here is the list of features this way provides:

- Camfrog Bot application callbacks;


- Plug-in module callbacks;
- Headers of the packets for application-module (and vice versa) communication;
- XML description of UI elements (buttons, lists, group boxes etc).

This manual describes “low-level” way of implementation.

Plug-in module SDK

In addition to the “low-level” tools for modules development, Camfrog Bot provides easy-to-use
object-oriented SDK where most of the routines are already implemented. Here is the list of features
performed by this SDK:

- Configuration file parser;


- Camfrog Bot packets handlers which could be overridden by the developer;
- UI engine which provides methods for constructing interface elements (no need to parse
XML).

This way of implementation makes the code more clear and compact. It is strongly recommended
for C++ developers to use this SDK.

© 2012 Camshare Inc. Page 3


Camfrog Bot 6.0 for Windows Developer's Guide

Camfrog Bot SDK depends on the ‘boost’ libraries which can be downloaded from:
http://www.boost.org/

See ‘${CFBOT_INSTALL_DIR}\Help\Camfrog Bot SDK.chm’ for more information.

Plug-In Module Architecture

This article describes plug-in modules architecture for developers to write their own plug-ins. See
also the sources of the sample “Version” plug-in we supply with Camfrog Bot.

All the events that Camfrog Bot 5.0 provides to the modules are divided into several types (see the
Events Description section for more details).

Every plug-in module subscribes on a group (groups) of events and receives events from these
groups only. Every module has its own unique 8-byte id. For example, the Trivia game plug-in has a
CSLLCTRV id. Invent your own id for your plug-in.

The communication between the plug-in modules and the bot is implemented via several callback
functions (see the Functions Description section for more details).

To build the module's settings window we use xml (see the Window XML Description for more
details). There are three types of xml we use:

 the first one contains a list of the bot's controls and is loaded once on the first plugin starts
up;

 the second one contains the form with the list of controls and their parameters;

 the third one contains the current state of the window – it is a communication protocol
between the plugin and the bot used to notify the plugin about settings changes and get an
appropriate response.

© 2012 Camshare Inc. Page 4


Camfrog Bot 6.0 for Windows Developer's Guide

Functions Description

Exported by the bot:

cfbot_subscribe

cfbot_unsubscribe

cfbot_pushevent

cfbot_init_settings

Exported by the plug-in:

cfbot_initialize

cfbot_finalize

cfbot_add_client

cfbot_remove_client

cfbot_plugininformation

cfbot_pushevent

Callback functions exported by the bot:

cfbot_subscribe
The cfbot_subscribe function subscribes the plug-in on a group(s) of events.
Syntax

void callback cfbot_subscribe(

__in void *CONTEXT,

__in char *PLUGIN_ID,

__in u_long EVENTS_TYPE

);

Parameters

© 2012 Camshare Inc. Page 5


Camfrog Bot 6.0 for Windows Developer's Guide

context [in]

a pointer to the plug-in interface

plugin_id [in]

unique module ID. 8 chars + '\0'

events_type [in]

The group(s) of events to be subscribed on.

cfbot_unsubscribe
The cfbot_unsubscribe function unsubscribes the plug-in from a group(s) of events.
Syntax

void callback cfbot_unsubscribe(

__in void *CONTEXT,

__in char *PLUGIN_ID,

__in u_long EVENTS_TYPE

);

Parameters

context [in]

a pointer to the plug-in interface

plugin_id [in]

unique module ID. 8 chars + '\0'

events_type [in]

The group(s) of events to be subscribed on.

cfbot_pushevent
The cfbot_pushevent function is called by the plug-in to make the bot process data.

© 2012 Camshare Inc. Page 6


Camfrog Bot 6.0 for Windows Developer's Guide

Syntax

void callback cfbot_pushevent(

__in void *CONTEXT,

__in char *PLUGIN_ID,

__in char* BOT_NAME,

__in char *EVENT_DATA,

__in int EVENT_SIZE

);

Parameters

context [in]

a pointer to the plug-in interface

plugin_id [in]

unique module ID. 8 chars + '\0'

bot_name [in]

bot name

event_data [in]

data to be processed by the bot

event_size [in]

data size (in bytes)

cfbot_init_settings
The cfbot_init_settings function is called by the plug-in to initialize the GUI engine for this
module (windows specific).
Syntax

© 2012 Camshare Inc. Page 7


Camfrog Bot 6.0 for Windows Developer's Guide

void callback cfbot_init_settings(

__in void *CONTEXT,

__in char *PLUGIN_ID,

__in char *EVENT_DATA,

__in int *EVENT_SIZE

);

Parameters

context [in]

a pointer to the plug-in interface

plugin_id [in]

unique module ID. 8 chars + '\0'

event_data [in]

initial XML data

event_size [in]

data size (in bytes)

Callback functions exported by the plug-in:

cfbot_initialize
The cfbot_initialize function is called by the bot on plug-in loading to initialize it.

Syntax

int callback cfbot_initialize(

__in CFBOT_CALLBACKS *callbacks,

__in void *context

);

© 2012 Camshare Inc. Page 8


Camfrog Bot 6.0 for Windows Developer's Guide

Parameters

callbacks [in]

A pointer to the CFBOT_CALLBACKS structure which contains the list of functions


exported by the bot

context [in]

A pointer to plug-in interface

Return value

Zero if an error has occurred, non-zero if successful.

cfbot_finalize
The cfbot_finalize function is called by the bot on plug-in unloading from memory.

Syntax

void callback cfbot_finalize (

);

cfbot_add_client
The cfbot_add_client function is called when the plug-in is turned on to add bots that are going to
use it.

Syntax

int callback cfbot_add_client (

__in char* bot_name,

__in char* work_dir

);

Parameters

© 2012 Camshare Inc. Page 9


Camfrog Bot 6.0 for Windows Developer's Guide

bot_name [in]

Name of a bot that will be using the plug-in

work_dir [in]

Path to the bot profile directory

Return value

Zero if an error has occurred, non-zero if successful.

cfbot_remove_client
The cfbot_remove_client function is called when the plug-in is turned off or removed.

Syntax

void callback cfbot_remove_client (

__in char* bot_name,

);

Parameters

bot_name [in]

Name of a bot that will no longer be using the plug-in

cfbot_plugininformation
The cfbot_plugininformation function is called by the bot on plug-in loading to get plug-in
information (unique ID, version, author, author's e-mail and web-page).

Syntax

void callback cfbot_plugininformation (

__in CFBOT_PLUGININFORMATION *info,

);

© 2012 Camshare Inc. Page 10


Camfrog Bot 6.0 for Windows Developer's Guide

Parameters

info [in]

A pointer to the CFBOT_PLUGININFORMATION structure which contains the plug-in


information

cfbot_pushevent
The cfbot_pushevent function is called by the bot to make the plug-in process data.

Syntax

void callback cfbot_pushevent (

__in char* bot_name,

__in char *event_data,

__in int event_size

);

Parameters

bot_name [in]

Name of the bot the data “belongs” to

event_data [in]

Data to be processed by the bot

event_size [in]

data size (in bytes)

© 2012 Camshare Inc. Page 11


Camfrog Bot 6.0 for Windows Developer's Guide

Structures Description

CFBOT_PLUGININFORMATION

CFBOT_CALLBACKS

CFBOT_PLUGIN_CALLBACKS

CFBOT_PLUGININFORMATION

The CFBOT_PLUGININFORMATION structure contains the plug-in module information.

Syntax

typedef struct CFBOT_PLUGININFORMATION {

short pluginversion;

short desired_botversion;

char uniqid[9];

char plugindescription[512];

char authors[512];

char email[512];

char http[512];

} CFBOT_PLUGININFORMATION

Members

pluginversion
plug-in module version
desired_botversion
required bot version
uniqid
unique module ID. 8 chars + '\0'
plugindescription
module information
authors

© 2012 Camshare Inc. Page 12


Camfrog Bot 6.0 for Windows Developer's Guide

module’s authors
email
module’s authors’ e-mail address
http
module’s authors’ web page

CFBOT_CALLBACKS

The CFBOT_CALLBACKS structure contains the callback functions exported by the bot.

Syntax

typedef struct CFBOT_CALLBACKS {

void cfbot_subscribe;

void cfbot_unsubscribe;

void cfbot_pushevent;

void cfbot_init_settings;

} CFBOT_CALLBACKS;

Members
cfbot_subscribe
cfbot_subscribe function
cfbot_unsubscribe
cfbot_unsubscribe function
cfbot_pushevent
cfbot_pushevent function
cfbot_init_settings

cfbot_init_settings function

CFBOT_PLUGIN_CALLBACKS

The CFBOT_PLUGIN_CALLBACKS structure contains the list of functions exported by the


plug-in.

© 2012 Camshare Inc. Page 13


Camfrog Bot 6.0 for Windows Developer's Guide

Syntax

typedef struct CFBOT_PLUGIN_CALLBACKS {

int cfbot_initialize;

void cfbot_finalize;

int cfbot_add_client;

void cfbot_remove_client;

void cfbot_plugininformation;

void cfbot_pushevent;

} CFBOT_PLUGIN_CALLBACKS;

Members
cfbot_initialize
the cfbot_initialize function
cfbot_finalize
the cfbot_finalize function
cfbot_add_client
the cfbot_add_client function
cfbot_remove_client
the cfbot_remove_client function
cfbot_plugininformation
the cfbot_plugininformation function
cfbot_pushevent
the cfbot_pushevent function

© 2012 Camshare Inc. Page 14


Camfrog Bot 6.0 for Windows Developer's Guide

Events Description

Chat room connection events

Central server instant message events

Chat room text/talk/users events

Bot to bot events

Service channel events

Plug-in to bot events

Settings events

Chat Room Connection Events

Event Fields Field type Description

BOT_EVENT_ROOM_CONNECTED An empty packet meaning that the bot is connected to a chat room.
(0x0101) This packet is also delivered if the module is turned off and then
on.

BOT_EVENT_ROOM_DENIED An event that means the bot has been denied entry to a chat room.
(0x0102)
deny reason (0x01) std::string Reason for the denial.

BOT_EVENT_ROOM_KILLED An event that means the bot has been kicked from the chat room.
(0x0103)
kick reason (0x01) std::string Reason for the kick.

BOT_EVENT_ROOM_DISCONNECTED An empty packet meaning that the bot has disconnected from the
(0x0104) chat room.

Central Server Instant Message Effects

Event Fields Field type Description

BOT_EVENT_IM The bot has received an instant message.


(0x0201)
nickname from (0x01) std::string Nickname of the message sender.

feedback (0x02) int User's feedback value.

age (0x03) unsigned Age of the message sender.


char

© 2012 Camshare Inc. Page 15


Camfrog Bot 6.0 for Windows Developer's Guide

text (0x04) std::string Message text.

attributes (0x05) unsigned This value can be set to "0"; in this case the following parameters
char are absent and the text has the default font and size

size (0x06) unsigned Message text size.


char

color (0x07) unsigned Message text color.


long

effects (0x08) unsigned This value can contain the following flags: CFE_BOLD |
long CFE_ITALIC | CFE_UNDERLINE meaning bold, italic and
underlined text respectively.

charset (0x09) unsigned Message text charset.


char

pitch and family unsigned Message text style and font family.
(0x0A) char

font name (0x0B) std::string Message text font.

Chatroom text/talk/users Events

Event Fields Field type Description

BOT_EVENT_ROOM_IN A packet that is delivered every time the bot connects to a room, a
(0x0401) new user connects to a room or a user's flags change. This packet is
also delivered if the plug-in is turned off and then on. When the bot
enters a room this event repeats for every user in that room.

nickname (0x01) std::string User's nickname.

flags (0x02) unsigned Flags description:


long audio 1
video 2
female user 4
OP or OPPLUS 8
FRIEND 16
OWNER 32
punished user 64
BOT 128
privacy mode 256
ignored user 512
audio blocked 1024
PRO user 2048

age (0x03) unsigned User's age.


char

© 2012 Camshare Inc. Page 16


Camfrog Bot 6.0 for Windows Developer's Guide

count (0x04) int In case of the bot logging on to a chat room this field will be set to
a value corresponding to the number of users in that room. In other
cases it will be "1".

BOT_EVENT_ROOM_TALK A room talk event.


(0x0403)
state (0x01) unsigned A state value of 1 means start talk, 0 - stop talk
char

nickname (0x02) std::string Nickname is available only if state is set to "1"

BOT_EVENT_ROOM_MOTD The room's Message of the day.


(0x0404)
MOTD text (0x01) std::string Message of the day text.

BOT_EVENT_ROOM_TOPIC The room topic.


(0x0405)
state (0x01) unsigned A state value of 1 means topic on, 0 - topic off
char

topic text (0x02) std::string Topic text. Available only if state is set to "1"

BOT_EVENT_ROOM_TEXT Room text.


(0x0406)
nickname (0x01) std::string Nickname of the massage's author. An empty nickname field means
a server message.

text (0x02) std::string Message text.

attributes (0x03) unsigned The attributes value can be set to "0". In this case the following
char parameters are absent and the text has the default font and size.

size (0x04) unsigned Message text size.


char

color (0x05) unsigned Message text color.


long

effects (0x06) unsigned This value can contain the following flags: CFE_BOLD |
long CFE_ITALIC | CFE_UNDERLINE meaning bold, italic and
underlined text respectively.

charset (0x07) unsigned Message text charset.


char

pitch and family (0x08) unsigned Message text style and font family.
char

font name (0x09) std::string Message text font.

BOT_EVENT_ROOM_NAME room name (0x01) std::string Current room name (on room connection). This packet will also be
(0x0407) delivered if the module is turned off and then on.

© 2012 Camshare Inc. Page 17


Camfrog Bot 6.0 for Windows Developer's Guide

Bot to Bot Events

Event Fields Field type Description

BOT_EVENT_BOT_2_BOT A plug-in to plug-in message.


(0x0801)
UNIQID (0x01) std::string Unique ID of the recipient plug-in.

SENDER UNIQID std::string Unique ID of the sender plug-in.


(0xFFFF)

BOT_EVENT_MODULES A plug-in can request the list of other modules.


(0x0802)
COUNT (0x01) int The number of installed modules.

UNIQID (0x02 + I) std::string Installed modules' unique IDs. I = count.

BOT_EVENT_ROOM_TIMER An empty message that is received every 100 msec if the bot is
(0x1001) connected to a chat room

BOT_SIGNAL_EVENT An empty message meaning that a signal has been sent to the bot
(0x2201) (linux specific)

Service Channel Events

Event Fields Field type Description

BOT_EVENT_ROOM_KICK A user has been kicked from the chat room.


(0x4001)
nickname to (0x00) std::string Nickname of the kicked user.

nickname from (0x01) std::string Nickname of the user who has issued the kick.

reason (0x02) std::string Kick reason (if stated).

BOT_EVENT_ROOM_SETOPT Room options have been set.


(0x4002)
option (0x00) std::string The option that has been changed.

nickname from (0x01) std::string The user who has changed the option.

option value (0x02) std::string New value for the changed option.

BOT_EVENT_ROOM_PUNISH A user has been punished.


(0x4003)
nickname to (0x00) std::string Nickname of the punished user.

nickname from (0x01) std::string Nickname of the user who has issued the punishment.

reason (0x02) std::string Reason for the punishment. This message consists of two parts, e.g.
"ExpireTime ReasonMessage". The expire time is separated from
the reason message by a space

expire time time_t

BOT_EVENT_ROOM_UNPUNISH A user has been unpunished.

© 2012 Camshare Inc. Page 18


Camfrog Bot 6.0 for Windows Developer's Guide

(0x4004) nickname to (0x00) std::string Nickname of the unpunished user.

nickname from (0x01) std::string Nickname of the user who has lifted the punishment.

BOT_EVENT_ROOM_BAN_ADD A user has been banned.


(0x4005)
ban list record (0x00) std::string Ban list entry for the user in question. Ban list entry format:
deny|allow nick|ip|nick_ip [nickname] [ip mask] no-expire|expire
interval

nickname from (0x01) std::string The user who has issued the ban.

BOT_EVENT_ROOM_BAN_REMOVE A user has been unbanned.


(0x4006)
ban list record (0x00) std::string Ban list entry for the user in question. Ban list entry format:
deny|allow nick|ip|nick_ip [nickname] [ip mask] no-expire|expire
interval

nickname from (0x01) std::string The user who has lifted the ban.

BOT_EVENT_ROOM_BLOCKMIC A user's microphone has been blocked.


(0x4007)
nickname to (0x00) std::string Nickname of the user in question.

nickname from (0x01) std::string Nickname of the user who has issued the block.

BOT_EVENT_ROOM_UNBLOCKMIC A user's microphone has been unblocked.


(0x4008)
nickname to (0x00) std::string Nickname of the user in question.

nickname from (0x01) std::string Nickname of the user who has lifted the block.

BOT_EVENT_ROOM_MAKEOP A user has got a new role (operator, owner, friend).


(0x4009)
nickname to (0x00) std::string Nickname of the promoted user.

nickname from (0x01) std::string Nickname of the user who has issued the promotion.

new role (0x02) std::string User's new role.

BOT_EVENT_ROOM_DEOP A user's operator (owner, friend) status has been revoked.


(0x4010)
nickname to (0x00) std::string Nickname of the demoted user.

nickname from (0x01) std::string Nickname of the user who has revoked the status in question.

last role (0x02) std::string The status that has been revoked.

Plug-in to Bot Events

Event Fields Field type Description

PLUGIN_EVENT_DISCONNECT A command from the plug-in to the bot to disconnect from the
(0x0151) active room and central server. An empty packet.

PLUGIN_EVENT_RESUME A command from the plug-in to the bot to connect to the last active
(0x0152) room. An empty packet.

© 2012 Camshare Inc. Page 19


Camfrog Bot 6.0 for Windows Developer's Guide

PLUGIN_EVENT_PAUSE A command from the plug-in to the bot to disconnect from the last
(0x0153) active room. An empty packet.

PLUGIN_EVENT_IM A command from the plug-in to the bot to send an instant message.
(0x0251)
nickname to (0x01) std::string Instant message recipient.

text (0x02) std::string Message text.

attributes (0x03) unsigned The attributes value can be set to "0". In this case the following
char parameters are absent and the text has the default font and size.

size (0x04) unsigned Message text size.


char

color (0x05) unsigned Message text color.


long

effects (0x06) unsigned This value can contain the following flags: CFE_BOLD |
long CFE_ITALIC | CFE_UNDERLINE meaning bold, italic and
underlined text respectively.

charset (0x07) unsigned Message text charset.


char

pitch and family (0x8) unsigned Message text style and font family.
char

font name (0x09) std::string Message text font.

PLUGIN_EVENT_ROOM_TEXT A command from the plug-in to the bot to send a message to the
(0x0451) room.

text (0x01) std::string Message text.

attributes (0x02) unsigned The attributes value can be set to "0". In this case the following
char parameters are absent and the text has the default font and size.

size (0x03) unsigned Message text size.


char

color (0x04) unsigned Message text color.


long

effects (0x05) unsigned This value can contain the following flags: CFE_BOLD |
long CFE_ITALIC | CFE_UNDERLINE meaning bold, italic and
underlined text respectively.

charset (0x06) unsigned Message text charset.


char

pitch and family (0x07) unsigned Message text style and font family.
char

font name (0x08) std::string Message text font.

PLUGIN_BOT_2_BOT A command from the plug-in to the bot to send a message to

© 2012 Camshare Inc. Page 20


Camfrog Bot 6.0 for Windows Developer's Guide

(0x0851) another plug-in.

UNIQID (0x01) std::string Recipient plug-in.

Settings Events

Event Fields Field type Description

BOT_EVENT_SETTINGS_GET An empty packet requesting the current state XML from the plug-
(0x8001) in.

BOT_EVENT_SETTINGS_PROCESS xml (0x01) std::string An XML with the interface state after a user's action.
(0x8002)

BOT_EVENT_SETTINGS_APPLY interface state (0x01) std::string An XML with the interface state after the “Apply” button has been
(0x8003) pressed.

BOT_EVENT_SETTINGS_CANCEL An empty packet meaning that the “Cancel” button has been
(0x8004) pressed.

PLUGIN_SETTINGS_GET_REPLY xml (0x01) std::string The plug-in module's current state xml in reply to a
(0x8051) BOT_EVENT_SETTINGS_GET request.

PLUGIN_SETTINGS_STATE_REPLY xml (0x01) std::string The plug-in module's current state xml with the interface reaction
(0x8052) on user's action (reply to a
BOT_EVENT_SETTINGS_PROCESS request).

© 2012 Camshare Inc. Page 21


Camfrog Bot 6.0 for Windows Developer's Guide

Window XML Description

Form

Button

Checkbox

Radio group and radio buttons

Edit

Label

Combo box

List view

Spin edit

Group box

Folder dialog

File dialog

Examples

Form

<Form Id = "FormId" // unique id


Width = "width"
Height = "height"
Title = "title"
Default=”Some Widget”> // widget with default focus
</Form>

© 2012 Camshare Inc. Page 22


Camfrog Bot 6.0 for Windows Developer's Guide

Button

<Button Id = "ButtonId1"
X = "x" // coordinate X
Y = "y" // coordinate Y
Width = "width"
Height = "height"
IsEnabled = "isEnabled" // clickable or not
> Text // button text
</Button>

Checkbox

<CheckBox Id = "CheckId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
IsEnabled = "isEnabled"
IsChecked = "isChecked" // checked or not
>Text // checkbox text
</CheckBox>

© 2012 Camshare Inc. Page 23


Camfrog Bot 6.0 for Windows Developer's Guide

Radio group and radio buttons

<RadioGroup>
<RadioButton Id = "RadioId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
IsEnabled = "isEnabled"
IsChecked = "isChecked"
>Text
</RadioButton>
<RadioButton Id = "RadioId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
IsEnabled = "isEnabled"
IsChecked = "isChecked"
>Text
</RadioButton>
</RadioGroup>

Edit

<Edit Id = "EditId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
IsEnabled = "isEnabled"
>Text
</Edit>

© 2012 Camshare Inc. Page 24


Camfrog Bot 6.0 for Windows Developer's Guide

Label

<Lable Id = "StaticId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
>Text
</Lable>

Combo Box

<ComboBox Id = "ComboBoxId"
X = "x"
Y = "y"
Width = "width"
Height = "height"
IsEnabled = "isEnabled"
SelectedIndex = "selectedIndex">

<ComboBoxItem Index = "index1"


>ItemText1
</ComboBoxItem>

<ComboBoxItem Index = "index2"


>ItemText2
</ComboBoxItem>
</ComboBox>

© 2012 Camshare Inc. Page 25


Camfrog Bot 6.0 for Windows Developer's Guide

List View
<ListView Id = "ListViewId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
IsEnabled = "isEnabled"
SelectedIndex = "selectedIndex">

<ListViewItem Index = "index1"


>ItemText1
</ListViewItem>

<ListViewItem Index = "index2"


>ItemText2
</ListViewItem>
</ListView>

Spin edit

<SpinEdit Id = "SpingEditId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
isEnabled = "isEnabled"
MinValue = "minValue" // minimal value
MaxValue = "maxValue" // maximal value
Step = "step" // step
>CurrentValue
</SpinEdit>

Group Box
<GroupBox Id = "GroupBoxId1"
X = "x"
Y = "y"
Width = "width"
Height = "height"
>Text
</GroupBox>

© 2012 Camshare Inc. Page 26


Camfrog Bot 6.0 for Windows Developer's Guide

FormState = {new,update,close}
isEnabled = {true,false}
isChecked = {true,false}
selectedIndex = {-1, 0, 1, 2, 3,...}
index = { 0, 1, 2, 3,...}
x,y – widget coordinates
width, height – widget size
Text – widget text
ItemText – item text

Folder Dialog

<Form Id = 'FolderDialog' // reserved Id for folder dialog


RootFolder = "rootfolder" // default folder
>
</From>

File Dialog

<Form Id = 'FileDialog'
Filename = "begin.file">
<Filter Mask = "FilesMask">
<FilenameExtension>Extension</FilenameExtension>
<FilenameExtension>Extension</FilenameExtension>
<FilenameExtension>Extension</FilenameExtension>
</Filter>
<Filter Mask = "OtherMask">
<FilenameExtension>Extension</FilenameExtension>
<FilenameExtension>Extension</FilenameExtension>
<FilenameExtension>Extension</FilenameExtension>
</Filter>
</Form>

begin.file - default file


FileMask - discription that will be before list of filename extension
Extension - filename extension of files in this FileMask

© 2012 Camshare Inc. Page 27


Camfrog Bot 6.0 for Windows Developer's Guide

Examples

Window current state xml template


<Form Id="Form1">
<CheckBox Id="Checkid">true</CheckBox>
<ComboBox Id="ComboBox1">0</ComboBox>
<Edit Id="Edit1">InnerText</Edit>
<Button>true</Button>
<ListView Id="ListView1" SelectedIndex="1">
<ListViewItem Index="0">Item1</ListViewItem>
<ListViewItem Index="1">Item2</ListViewItem>
</ListView>
<RadioButton Id="Radioid1">true</RadioButton>
<RadioButton Id="Radioid2">false</RadioButton>
<RadioButton Id="Radioid3">false</RadioButton>
<SpinEdit Id = "SpinEditId1">Value</SpinEdit>
</Form>

Folder and file dialog state xml template

<Form Id = "FolderDialog">
<FolderPath>folderpath</FolderPath>
<DialogState>state</DialogState>
</Form>

folderpath - path of selected folder


state - {true/false} - Ok or Cancel user click

<Form Id = "FileDialog">
<FilePath>filepath</FilePath>
<DialogState>state</DialogState>
</Form>

filepath - path of selected file


state - {true/false} - Ok or Cancel user click

© 2012 Camshare Inc. Page 28


Camfrog Bot 6.0 for Windows Developer's Guide

Please note: Widget IDs FolderDialog and FileDialog are reserved and you cannot assign them.

© 2012 Camshare Inc. Page 29

You might also like