summaryrefslogtreecommitdiff
path: root/BBB_GOFILES/form.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2018-08-26 13:33:54 -0400
committerPietro Gagliardi <[email protected]>2018-08-26 13:33:54 -0400
commit1095719d84a6ac5f90eefe8e23913f3e09ad692d (patch)
treeca7352bf6922e3f0bcf1ee4d5007c8515b681729 /BBB_GOFILES/form.go
parent2bc76219286dfe39949772ceee4dbd9560ec2c1f (diff)
Migrated more controls.
Diffstat (limited to 'BBB_GOFILES/form.go')
-rw-r--r--BBB_GOFILES/form.go71
1 files changed, 0 insertions, 71 deletions
diff --git a/BBB_GOFILES/form.go b/BBB_GOFILES/form.go
deleted file mode 100644
index 6f8a282..0000000
--- a/BBB_GOFILES/form.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// 12 december 2015
-
-package ui
-
-import (
- "unsafe"
-)
-
-// #include "ui.h"
-import "C"
-
-// Form is a Control that holds a group of Controls vertically
-// with labels next to each. By default, each control has its
-// preferred height; if a control is marked "stretchy", it will take
-// whatever space is left over. If multiple controls are marked
-// stretchy, they will be given equal shares of the leftover space.
-// There can also be space between each control ("padding").
-type Form struct {
- ControlBase
- f *C.uiForm
- children []Control
-}
-
-// NewForm creates a new horizontal Form.
-func NewForm() *Form {
- f := new(Form)
-
- f.f = C.uiNewForm()
-
- f.ControlBase = NewControlBase(f, uintptr(unsafe.Pointer(f.f)))
- return f
-}
-
-// Destroy destroys the Form. If the Form has children,
-// Destroy calls Destroy on those Controls as well.
-func (f *Form) Destroy() {
- for len(f.children) != 0 {
- c := f.children[0]
- f.Delete(0)
- c.Destroy()
- }
- f.ControlBase.Destroy()
-}
-
-// Append adds the given control to the end of the Form.
-func (f *Form) Append(label string, child Control, stretchy bool) {
- clabel := C.CString(label)
- defer freestr(clabel)
- c := touiControl(child.LibuiControl())
- C.uiFormAppend(f.f, clabel, c, frombool(stretchy))
- f.children = append(f.children, child)
-}
-
-// Delete deletes the nth control of the Form.
-func (f *Form) Delete(n int) {
- f.children = append(f.children[:n], f.children[n + 1:]...)
- C.uiFormDelete(f.f, C.int(n))
-}
-
-// Padded returns whether there is space between each control
-// of the Form.
-func (f *Form) Padded() bool {
- return tobool(C.uiFormPadded(f.f))
-}
-
-// SetPadded controls whether there is space between each control
-// of the Form. The size of the padding is determined by the OS and
-// its best practices.
-func (f *Form) SetPadded(padded bool) {
- C.uiFormSetPadded(f.f, frombool(padded))
-}