MCPcopy
hub / github.com/qax-os/excelize / TestFormControl

Function TestFormControl

vml_test.go:163–409  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

161}
162
163func TestFormControl(t *testing.T) {
164 f := NewFile()
165 formControls := []FormControl{
166 {
167 Cell: "D1", Type: FormControlButton, Macro: "Button1_Click",
168 },
169 {
170 Cell: "A1", Type: FormControlButton, Macro: "Button1_Click",
171 Width: 140, Height: 60, Text: "Button 1\n",
172 Paragraph: []RichTextRun{
173 {
174 Font: &Font{
175 Bold: true,
176 Italic: true,
177 Underline: "single",
178 Family: "Times New Roman",
179 Size: 14,
180 Color: "777777",
181 },
182 Text: "C1=A1+B1",
183 },
184 },
185 Format: GraphicOptions{PrintObject: boolPtr(true), Positioning: "absolute"},
186 },
187 {
188 Cell: "A5", Type: FormControlCheckBox, Text: "Check Box 1",
189 Checked: true, Format: GraphicOptions{
190 PrintObject: boolPtr(false), Positioning: "oneCell",
191 },
192 },
193 {
194 Cell: "A6", Type: FormControlCheckBox, Text: "Check Box 2",
195 CellLink: "C5", Format: GraphicOptions{Positioning: "twoCell"},
196 },
197 {
198 Cell: "A7", Type: FormControlOptionButton, Text: "Option Button 1", Checked: true,
199 },
200 {
201 Cell: "A8", Type: FormControlOptionButton, Text: "Option Button 2",
202 },
203 {
204 Cell: "D3", Type: FormControlGroupBox, Text: "Group Box 1",
205 Width: 140, Height: 60,
206 },
207 {
208 Cell: "A9", Type: FormControlLabel, Text: "Label 1", Width: 140,
209 },
210 {
211 Cell: "C5", Type: FormControlSpinButton, Width: 40, Height: 60,
212 CurrentVal: 7, MinVal: 5, MaxVal: 10, IncChange: 1, CellLink: "C2",
213 },
214 {
215 Cell: "D7", Type: FormControlScrollBar, Width: 140, Height: 20,
216 CurrentVal: 50, MinVal: 10, MaxVal: 100, IncChange: 1, PageChange: 1, Horizontally: true, CellLink: "C3",
217 },
218 {
219 Cell: "G1", Type: FormControlScrollBar, Width: 20, Height: 140,
220 CurrentVal: 50, MinVal: 1000, MaxVal: 100, IncChange: 1, PageChange: 1, CellLink: "C4",

Callers

nothing calls this directly

Calls 15

AddFormControlMethod · 0.95
GetFormControlsMethod · 0.95
SetSheetPropsMethod · 0.95
AddVBAProjectMethod · 0.95
SaveAsMethod · 0.95
CloseMethod · 0.95
DeleteFormControlMethod · 0.95
NewFileFunction · 0.85
boolPtrFunction · 0.85
stringPtrFunction · 0.85
OpenFileFunction · 0.85
newInvalidOptionalValueFunction · 0.85

Tested by

no test coverage detected