Example descriptions
Content
- Example descriptions
- 1C:Enterprise add-in examples for desktop computer
- Properties
- Methods
- 1C:Enterprise add-in example for mobile platform
- Events
- Development tools
Example descriptions
This delivery includes examples of add-in implementations developed using Native API and COM technologies, as well as extensions for Mozilla Firefox and Internet Explorer. A template that you can use for writing add-ins from scratch is also included.
Add-in implementations were made as much similar as possible (same identifiers, names, and so on) to simplify learning and analysis.
The example for a mobile platform is different due to mobile platform specifics, it is a simple pedometer. It is available in the \example\NativeAPIMobile directory.
The following sections describe the properties and methods implemented in the examples.
1C:Enterprise add-in examples for desktop computer
Properties
IsEnabled
Usage: Read and write.
Description: Type: Boolean. Stores the add-in status.
IsTimerPresent
Usage: Read.
Description: Type: Boolean. Defines whether the add-in has a timer.
Methods
Enable
Description:
Enables the add-in object.
Syntax:
Enable()
Disable
Description:
Disables the add-in object.
Syntax:
Disable()
ShowInStatusLine
Description:
Displays the specified text in the status bar for 5 seconds.
Syntax:
ShowInStatusLine(<Text>)
Parameters:
Text
Type: String. Text displayed in the status bar.
StartTimer
Description:
Starts the add-in timer. Every second the add-in sends a message with Component and Timer parameters and the system clock counter string.
Syntax:
StartTimer()
StopTimer
Description:
Stops the add-in timer.
Syntax:
StopTimer()
The component implemented using Native API also implements the LoadPicture() method.
LoadPicture
Description:
Loads a picture from the specified file and sends it to 1C:Enterprise as binary data.
Syntax:
LoadPicture(<FileName>)
Parameters:
FileName
Type: String. Picture file name.
ShowMessage
Displays the platform version.
Syntax:
ShowMessage()
1C:Enterprise add-in example for mobile platform
Properties
IsEnabled
Usage: Read.
Description: Type: Boolean. Stores the add-in status.
Methods
Enable
Description:
Enables the add-in object, starts a pedometer, and starts the tracking of movement type using accelerometers.
Every time the step count changes, the add-in generates a 1C:Enterprise event with "StepCounter", "OnChange", and "_" parameters.
Syntax:
Enable()
Disable
Description:
Disables the add-in object, resets the step count, and stops the tracking of movement type using accelerometers.
Syntax:
Disable()
GetStepCount
Description: Returns the step count accumulated since the call of the Enable() mentod.
Syntax:
GetStepCount()
Type: Integer.
GetMovementType
Description:
Returns the movement type index, one of the following:
0 - undefined
1 - no movement
2 - walk
3 - run
4 - car
5 - bike
Syntax:
GetMovementType()
Type: Integer.
GetDeviceOrientation
Description: Returns the angular orientation of the device in the earth-fixed coordinate system, in radians.
Syntax:
GetDeviceOrientation(<Plane>)
Parameters:
Plane - Cartesian plane whose data is requested (0 - XOY plane, 1 - XOZ plane, 2 - YOZ plane).
Type: Real.
ShowDeviceOrientation
Description: Shows a message with angular orientations of the device in the earth-fixed coordinate system, in radians.
Syntax:
ShowDeviceOrientation()
Events
ExternEventProcessing
Description:
Occurs when an add-in sends a step count message.
Syntax:
Procedure ExternEventProcessing (Source, Event, Data) If Source = "StepCounter" And Event = "OnChange" Then ... EndIf EndProcedure
Note. In this example <Data> = "_".
Development tools
You can use the following development tools:
- Microsoft Visual C++,
Delphi,
C++ Builder,
gcc