This commit is contained in:
cuu
2018-10-06 21:48:08 +08:00
parent d793dc93ab
commit a409bc6200
3 changed files with 229 additions and 7 deletions

View File

@@ -1,6 +1,9 @@
package UI
import (
"github.com/cuu/gogame/draw"
"github.com/cuu/gogame/surface"
"github.com/cuu/gogame/color"
)
//sysgo/UI/keyboard_keys.layout
@@ -19,6 +22,15 @@ func NewKeyboardIcon() *KeyboardIcon {
return p
}
func (self *KeyboardIcon) Draw() {
rect_ := draw.MidRect(self.PosX,self.PosY,self.Width,self.Height,Width,Height)
surface.Blit(self.Parent.GetCanvasHWND(),self.ImgSurf,rect_,nil)
}
type KeyboardSelector struct {
PageSelector
Parent *Keyboard
@@ -35,14 +47,51 @@ func (self *KeyboardSelector) Draw() {
}
type Keyboard {
type Keyboard struct {
Page
SectionNumbers int
SectionIndex int
Icons map[string]UI.IconItemInterface
Icons map[string]IconItemInterface
KeyboardLayoutFile string ///sysgo/UI/keyboard_keys.layout
LeftOrRight int
RowIndex int
Textarea *Textarea
Selector *KeyboardSelector
}
func NewKeyboard() *Keyboard {
p := &Keyboard{}
p.SectionNumbers = 3
p.SectionIndex = 1
p.Icons = make( map[string]IconItemInterface )
p.LeftOrRight = 1
p.RowIndex = 0
p.FootMsg = [5]string{"Nav.","ABC","Done","Backspace","Enter"}
return p
}
func (self *Keyboard) ReadLayoutFile( fname string) {
/*
LayoutIndex := 0
content ,err := ReadLines(fname)
*/
}