gofmt files

This commit is contained in:
polypmer 2016-09-07 07:52:52 -04:00
parent 2dde2a79e7
commit 1ec8f6b01c
22 changed files with 226 additions and 215 deletions

View File

@ -198,7 +198,7 @@ type AreaMouseEvent struct {
func appendBits(out []uint, held C.uint64_t) []uint {
n := uint(1)
for i := 0; i < 64; i++ {
if held & 1 != 0 {
if held&1 != 0 {
out = append(out, n)
}
held >>= 1
@ -267,6 +267,7 @@ func doAreaHandlerKeyEvent(uah *C.uiAreaHandler, ua *C.uiArea, uke *C.uiAreaKeyE
//
// Note: these must be numerically identical to their libui equivalents.
type Modifiers uint
const (
Ctrl Modifiers = 1 << iota
Alt
@ -278,6 +279,7 @@ const (
//
// Note: these must be numerically identical to their libui equivalents.
type ExtKey int
const (
Escape ExtKey = iota + 1
Insert // equivalent to "Help" on Apple keyboards

2
box.go
View File

@ -102,7 +102,7 @@ func (b *Box) Append(child Control, stretchy bool) {
// Delete deletes the nth control of the Box.
func (b *Box) Delete(n int) {
b.children = append(b.children[:n], b.children[n + 1:]...)
b.children = append(b.children[:n], b.children[n+1:]...)
// TODO why is this uintmax_t instead of intmax_t
C.uiBoxDelete(b.b, C.uintmax_t(n))
}

View File

@ -41,6 +41,7 @@ func NewCombobox() *Combobox {
return c
}
/*TODO
// NewEditableCombobox creates a new editable Combobox.
func NewEditableCombobox() *Combobox {

View File

@ -166,6 +166,7 @@ type Path struct {
//
// TODO disclaimer
type FillMode uint
const (
Winding FillMode = iota
Alternate
@ -277,6 +278,7 @@ type DrawContext struct {
//
// TODO disclaimer
type BrushType int
const (
Solid BrushType = iota
LinearGradient
@ -289,6 +291,7 @@ const (
// TODO disclaimer
// TODO rename these to put LineCap at the beginning? or just Cap?
type LineCap int
const (
FlatCap LineCap = iota
RoundCap
@ -299,6 +302,7 @@ const (
//
// TODO disclaimer
type LineJoin int
const (
MiterJoin LineJoin = iota
RoundJoin
@ -609,6 +613,7 @@ func (f *FontFamilies) Family(n int) string {
//
// TODO disclaimer
type TextWeight int
const (
TextWeightThin TextWeight = iota
TextWeightUltraLight
@ -627,6 +632,7 @@ const (
//
// TODO disclaimer
type TextItalic int
const (
TextItalicNormal TextItalic = iota
TextItalicOblique // merely slanted text
@ -644,6 +650,7 @@ const (
//
// TODO disclaimer
type TextStretch int
const (
TextStretchUltraCondensed TextStretch = iota
TextStretchExtraCondensed

View File

@ -3,8 +3,8 @@
package ui
import (
"runtime"
"errors"
"runtime"
"sync"
"unsafe"
)

6
tab.go
View File

@ -94,17 +94,17 @@ func (t *Tab) InsertAt(name string, n int, child Control) {
// TODO why is this uintmax_t and not intmax_t
C.uiTabInsertAt(t.t, cname, C.uintmax_t(n), c)
freestr(cname)
ch := make([]Control, len(t.children) + 1)
ch := make([]Control, len(t.children)+1)
// and insert into t.children at the right place
copy(ch[:n], t.children[:n])
ch[n] = child
copy(ch[n + 1:], t.children[n:])
copy(ch[n+1:], t.children[n:])
t.children = ch
}
// Delete deletes the nth page of the Tab.
func (t *Tab) Delete(n int) {
t.children = append(t.children[:n], t.children[n + 1:]...)
t.children = append(t.children[:n], t.children[n+1:]...)
C.uiTabDelete(t.t, C.uintmax_t(n))
}

View File

@ -22,6 +22,7 @@ func moveLabel(*Button) {
}
var moveBack bool
const (
moveOutText = "Move Page 1 Out"
moveBackText = "Move Page 1 Back"
@ -92,7 +93,7 @@ func makePage2() *Box {
button = NewButton("Open Menuless Window")
button.OnClicked(func(*Button) {
w := NewWindow("Another Window", 100, 100, true)
//TODO w.SetChild(makePage6())
//TODO w.SetChild(makePage6())
w.SetMargined(true)
w.Show()
})
@ -154,8 +155,8 @@ func makePage2() *Box {
page2.Append(hbox, false)
disabledTab := newTab()
disabledTab.Append("Disabled", NewButton("Button"));
disabledTab.Append("Tab", NewLabel("Label"));
disabledTab.Append("Disabled", NewButton("Button"))
disabledTab.Append("Tab", NewLabel("Label"))
disabledTab.Disable()
page2.Append(disabledTab, true)