Skip to content

Commit 24ea132

Browse files
chore: autopublish 2023-02-22T12:42:29Z
1 parent 1213dc0 commit 24ea132

2 files changed

Lines changed: 271 additions & 4 deletions

File tree

docs/library/mixin_helper.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ A library of helper functions to improve code reuse in mixins.
88
- [create_standard_control_event(name)](#create_standard_control_event)
99
- [create_custom_control_change_event()](#create_custom_control_change_event)
1010
- [create_custom_window_change_event()](#create_custom_window_change_event)
11+
- [to_fcstring(value, fcstr)](#to_fcstring)
12+
- [boolean_to_error(object, method)](#boolean_to_error)
1113

1214
### disable_methods
1315

1416
```lua
1517
mixin_helper.disable_methods(props)
1618
```
1719

18-
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L24)
20+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L25)
1921

2022
Disables mixin methods by setting an empty function that throws an error.
2123

@@ -31,7 +33,7 @@ Disables mixin methods by setting an empty function that throws an error.
3133
mixin_helper.create_standard_control_event(name)
3234
```
3335

34-
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L39)
36+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L40)
3537

3638
A helper function for creating a standard control event. standard refers to the `Handle*` methods from `FCCustomLuaWindow` (not including `HandleControlEvent`).
3739
For example usage, refer to the source for the `FCMControl` mixin.
@@ -50,7 +52,7 @@ For example usage, refer to the source for the `FCMControl` mixin.
5052
mixin_helper.create_custom_control_change_event()
5153
```
5254

53-
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L232)
55+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L233)
5456

5557
Helper function for creating a custom event for a control.
5658
Custom events are bootstrapped to InitWindow and HandleCommand, in addition be being able to be triggered manually.
@@ -76,8 +78,45 @@ This function returns 4 values which are all functions:
7678
mixin_helper.create_custom_window_change_event()
7779
```
7880

79-
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L322)
81+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L323)
8082

8183
Creates a custom change event for a window class. For details, see the documentation for `create_custom_control_change_event`, which works in exactly the same way as this function except for controls.
8284

8385
@ ... (table)
86+
87+
### to_fcstring
88+
89+
```lua
90+
mixin_helper.to_fcstring(value, fcstr)
91+
```
92+
93+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L388)
94+
95+
Casts a value to an `FCString` object. If the value is already an `FCString`, it will be returned.
96+
97+
| Input | Type | Description |
98+
| ----- | ---- | ----------- |
99+
| `value` | `any` | |
100+
| `fcstr` (optional) | `FCString` | An optional `FCString` object to populate to skip creating a new object. |
101+
102+
| Return type | Description |
103+
| ----------- | ----------- |
104+
| `FCString` | |
105+
106+
### boolean_to_error
107+
108+
```lua
109+
mixin_helper.boolean_to_error(object, method)
110+
```
111+
112+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/mixin_helper.lua#L409)
113+
114+
There are many PDK methods that return a boolean value to indicate success / failure instead of throwing an error.
115+
This function captures that result and throws an error in case of failure.
116+
117+
@ [...] (any) Any arguments to pass to the method.
118+
119+
| Input | Type | Description |
120+
| ----- | ---- | ----------- |
121+
| `object` | `__FCMBase` | Any `FCM` or `FCX` object. |
122+
| `method` | `string` | The name of the method to call (no trailing underscore, it will be added automatically). |

docs/mixin/FCMTextExpressionDef.md

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
# FCMTextExpressionDef
2+
3+
## Summary of Modifications
4+
- Setters that accept `FCString` also accept a Lua string.
5+
- `FCString` parameter in getters is optional and if omitted, the result will be returned as a Lua `string`.
6+
- Methods that returned a boolean to indicate success/failure now throw an error instead.
7+
8+
## Functions
9+
10+
- [SaveNewTextBlock(self, str)](#savenewtextblock)
11+
- [AssignToCategory(self, cat_def)](#assigntocategory)
12+
- [SetUseCategoryPos(self, enable)](#setusecategorypos)
13+
- [SetUseCategoryFont(self, enable)](#setusecategoryfont)
14+
- [MakeRehearsalMark(self, str, measure)](#makerehearsalmark)
15+
- [SaveTextString(self, str)](#savetextstring)
16+
- [DeleteTextBlock(self)](#deletetextblock)
17+
- [SetDescription(self, str)](#setdescription)
18+
- [GetDescription(self, str)](#getdescription)
19+
- [DeepSaveAs(self, item_num)](#deepsaveas)
20+
- [DeepDeleteData(self)](#deepdeletedata)
21+
22+
### SaveNewTextBlock
23+
24+
```lua
25+
fcmtextexpressiondef.SaveNewTextBlock(self, str)
26+
```
27+
28+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L36)
29+
30+
**[Breaking Change] [Fluid] [Override]**
31+
32+
Override Changes:
33+
- Throws an error instead of returning a boolean for success/failure.
34+
- Accepts Lua `string` in addition to `FCString`.
35+
36+
| Input | Type | Description |
37+
| ----- | ---- | ----------- |
38+
| `self` | `FCMTextExpressionDef` | |
39+
| `str` | `string \| FCString` | The initializing string |
40+
41+
### AssignToCategory
42+
43+
```lua
44+
fcmtextexpressiondef.AssignToCategory(self, cat_def)
45+
```
46+
47+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L55)
48+
49+
**[Breaking Change] [Fluid] [Override]**
50+
51+
Override Changes:
52+
- Throws an error instead of returning a boolean for success/failure.
53+
54+
| Input | Type | Description |
55+
| ----- | ---- | ----------- |
56+
| `self` | `FCMTextExpressionDef` | |
57+
| `cat_def` | `FCCategoryDef` | the parent Category Definition |
58+
59+
### SetUseCategoryPos
60+
61+
```lua
62+
fcmtextexpressiondef.SetUseCategoryPos(self, enable)
63+
```
64+
65+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L73)
66+
67+
**[Breaking Change] [Fluid] [Override]**
68+
69+
Override Changes:
70+
- Throws an error instead of returning a boolean for success/failure.
71+
72+
| Input | Type | Description |
73+
| ----- | ---- | ----------- |
74+
| `self` | `FCMTextExpressionDef` | |
75+
| `enable` | `boolean` | |
76+
77+
### SetUseCategoryFont
78+
79+
```lua
80+
fcmtextexpressiondef.SetUseCategoryFont(self, enable)
81+
```
82+
83+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L91)
84+
85+
**[Breaking Change] [Fluid] [Override]**
86+
87+
Override Changes:
88+
- Throws an error instead of returning a boolean for success/failure.
89+
90+
| Input | Type | Description |
91+
| ----- | ---- | ----------- |
92+
| `self` | `FCMTextExpressionDef` | |
93+
| `enable` | `boolean` | |
94+
95+
### MakeRehearsalMark
96+
97+
```lua
98+
fcmtextexpressiondef.MakeRehearsalMark(self, str, measure)
99+
```
100+
101+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L112)
102+
103+
**[Breaking Change] [Fluid] [Override]**
104+
105+
Override Changes:
106+
- Throws an error instead of returning a boolean for success/failure.
107+
- Passing an `FCString` is optional. If omitted, the result is returned as a Lua `string`. If passed, nothing is returned and the method is fluid.
108+
109+
| Input | Type | Description |
110+
| ----- | ---- | ----------- |
111+
| `self` | `FCMTextExpressionDef` | |
112+
| `str` (optional) | `FCString` | |
113+
| `measure` | `integer` | |
114+
115+
| Return type | Description |
116+
| ----------- | ----------- |
117+
| `string` | If `FCString` is omitted. |
118+
119+
### SaveTextString
120+
121+
```lua
122+
fcmtextexpressiondef.SaveTextString(self, str)
123+
```
124+
125+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L146)
126+
127+
**[Breaking Change] [Fluid] [Override]**
128+
129+
Override Changes:
130+
- Throws an error instead of returning a boolean for success/failure.
131+
- Accepts Lua `string` in addition to `FCString`.
132+
133+
| Input | Type | Description |
134+
| ----- | ---- | ----------- |
135+
| `self` | `FCMTextExpressionDef` | |
136+
| `str` | `string \| FCString` | The initializing string |
137+
138+
### DeleteTextBlock
139+
140+
```lua
141+
fcmtextexpressiondef.DeleteTextBlock(self)
142+
```
143+
144+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L165)
145+
146+
**[Breaking Change] [Fluid] [Override]**
147+
148+
Override Changes:
149+
- Throws an error instead of returning a boolean for success/failure.
150+
151+
| Input | Type | Description |
152+
| ----- | ---- | ----------- |
153+
| `self` | `FCMTextExpressionDef` | |
154+
155+
### SetDescription
156+
157+
```lua
158+
fcmtextexpressiondef.SetDescription(self, str)
159+
```
160+
161+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L182)
162+
163+
**[Breaking Change] [Fluid] [Override]**
164+
165+
Override Changes:
166+
- Accepts Lua `string` in addition to `FCString`.
167+
168+
| Input | Type | Description |
169+
| ----- | ---- | ----------- |
170+
| `self` | `FCMTextExpressionDef` | |
171+
| `str` | `string \| FCString` | The initializing string |
172+
173+
### GetDescription
174+
175+
```lua
176+
fcmtextexpressiondef.GetDescription(self, str)
177+
```
178+
179+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L202)
180+
181+
**[Breaking Change] [Fluid] [Override]**
182+
183+
Override Changes:
184+
- Passing an `FCString` is optional. If omitted, the result is returned as a Lua `string`. If passed, nothing is returned and the method is fluid.
185+
186+
| Input | Type | Description |
187+
| ----- | ---- | ----------- |
188+
| `self` | `FCMTextExpressionDef` | |
189+
| `str` (optional) | `FCString` | |
190+
191+
| Return type | Description |
192+
| ----------- | ----------- |
193+
| `string` | If `FCString` is omitted. |
194+
195+
### DeepSaveAs
196+
197+
```lua
198+
fcmtextexpressiondef.DeepSaveAs(self, item_num)
199+
```
200+
201+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L226)
202+
203+
**[Breaking Change] [Fluid] [Override]**
204+
205+
Override Changes:
206+
- Throws an error instead of returning a boolean for success/failure.
207+
208+
| Input | Type | Description |
209+
| ----- | ---- | ----------- |
210+
| `self` | `FCMTextExpressionDef` | |
211+
| `item_num` | `integer` | |
212+
213+
### DeepDeleteData
214+
215+
```lua
216+
fcmtextexpressiondef.DeepDeleteData(self)
217+
```
218+
219+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/mixin/FCMTextExpressionDef.lua#L243)
220+
221+
**[Breaking Change] [Fluid] [Override]**
222+
223+
Override Changes:
224+
- Throws an error instead of returning a boolean for success/failure.
225+
226+
| Input | Type | Description |
227+
| ----- | ---- | ----------- |
228+
| `self` | `FCMTextExpressionDef` | |

0 commit comments

Comments
 (0)