1Prima::VB::CfgMaint(3)User Contributed Perl DocumentationPrima::VB::CfgMaint(3)
2
3
4

NAME

6       Prima::VB::CfgMaint - maintains visual builder widget palette
7       configuration.
8

DESCRIPTION

10       The module is used by the Visual Builder and "prima-cfgmaint" programs,
11       to maintain the Visual Builder widget palette. The installed widgets
12       are displayed in main panel of the Visual Builder, and can be
13       maintained by "prima-cfgmaint".
14

USAGE

16       The Visual Builder widget palette configuration is contained in two
17       files - the system-wide "Prima::VB::Config" and the user
18       "~/.prima/vbconfig". The user config file take the precedence when
19       loaded by the Visual Builder. The module can select either
20       configuration by assigning $systemWide boolean property.
21
22       The widgets are grouped in pages, which are accessible by names.
23
24       New widgets can be added to the palette by calling "add_module" method,
25       which accepts a perl module file as its first parameter. The module
26       must conform to the VB-loadable format.
27

FORMAT

29       This section describes format of a module with VB-loadable widgets.
30
31       The module must define a package with same name as the module.  In the
32       package, "class" sub must be declared, that returns an array or paired
33       scalars, where each first item in a pair corresponds to the widget
34       class and the second to a hash, that contains the class loading
35       information, and must contain the following keys:
36
37       class STRING
38           Name of the VB-representation class, which represents the original
39           widget class in the Visual Builder. This is usually a lightweight
40           class, which does not contain all functionality of the original
41           class, but is capable of visually reflecting changes to the class
42           properties.
43
44       icon PATH
45           Sets an image file, where the class icon is contained.  PATH
46           provides an extended syntax for indicating a frame index, if the
47           image file is multiframed: the frame index is appended to the path
48           name with ":" character prefix, for example:
49           "NewWidget::icons.gif:2".
50
51       module STRING
52           Sets the module name, that contains "class".
53
54       page STRING
55           Sets the default palette page where the widget is to be put.  The
56           current implementation of the Visual Builder provides four pages:
57           "General,Additional,Sliders,Abstract". If the page is not present,
58           new page is automatically created when the widget class is
59           registered.
60
61       RTModule STRING
62           Sets the module name, that contains the original class.
63
64       The reader is urged to explore Prima::VB::examples::Widgety file, which
65       contains an example class "Prima::SampleWidget", its VB-representation,
66       and a property "lineRoundStyle" definition example.
67

API

69   Methods
70       add_module FILE
71           Reads FILE module and loads all VB-loadable widgets from it.
72
73       classes
74           Returns string declaration of all registered classes in format of
75           "classes" registration procedure ( see "FORMAT" ).
76
77       open_cfg
78           Loads class and pages information from either a system-wide or a
79           user configuration file.  If succeeds, the information is stored in
80           @pages and %classes variables ( the old information is lost ) and
81           returns 1. If fails, returns 0 and string with the error
82           explanation; @pages and %classes content is undefined.
83
84       pages
85           Returns array of page names
86
87       read_cfg
88           Reads information from both system-wide and user configuration
89           files, and merges the information. If succeeds, returns 1. If
90           fails, returns 0 and string with the error explanation.
91
92       reset_cfg
93           Erases all information about pages and classes.
94
95       write_cfg
96           Writes either the system-wide or the user configuration file.  If
97           $backup flag is set to 1, the old file renamed with ".bak"
98           extension.  If succeeds, returns 1. If fails, returns 0 and string
99           with the error explanation.
100

FILES

102       Prima::VB::Config.pm, "~/.prima/vbconfig".
103

AUTHOR

105       Dmitry Karasik, <dmitry@karasik.eu.org>.
106

SEE ALSO

108       VB, prima-cfgmaint, Prima::VB::examples::Widgety.
109
110
111
112perl v5.36.0                      2023-03-20            Prima::VB::CfgMaint(3)
Impressum