just fill up the pages code,not test yet

This commit is contained in:
cuu
2018-06-13 19:56:24 +08:00
parent f8aaab26fa
commit 39732c6221
4 changed files with 669 additions and 1 deletions

View File

@@ -11,13 +11,27 @@ import (
type IconItemInterface interface {
Init(x,y,w,h,at int)
GetCmdPath() string
SetCmdPath( path string)
SetMyType( thetype int )
GetMyType() int
GetIndex() int
SetIndex(i int)
SetParent( p interface{} )
SetLabelColor(col *color.Color)
Coord() (int,int)
NewCoord(x,y int)
Size() (int,int)
AddLabel(text string, fontobj *ttf.Font)
GetLinkPage() PageInterface
AdjustLinkPage()
GetImageSurf() *sdl.Surface
SetImageSurf(newsurf *sdl.Surface)
@@ -36,7 +50,8 @@ type IconItem struct {
Parent PageInterface
Index int
MyType int
CmdPath interface{}
CmdPath string
CmdInvoke PluginInterface
LinkPage PageInterface
Label LabelInterface
Align int
@@ -66,6 +81,26 @@ func (self *IconItem) Init(x,y,w,h,at int) {
self.AnimationTime = at
}
func (self *IconItem) GetCmdPath() string {
return self.CmdPath
}
func (self *IconItem) SetCmdPath( path string) {
self.CmdPath = path
}
func (self *IconItem) SetMyType( thetype int ) {
self.MyType = thetype
}
func (self *IconItem) GetMyType() int {
return self.MyType
}
func (self *IconItem) GetIndex() int {
return self.Index
}
func (self *IconItem) SetIndex(i int) {
self.Index = i
}
@@ -100,6 +135,10 @@ func (self *IconItem) AddLabel(text string, fontobj *ttf.Font) {
}
}
func (self *IconItem) GetLinkPage() PageInterface {
return self.LinkPage
}
func (self *IconItem) AdjustLinkPage() {
if self.MyType == ICON_TYPES["DIR"] && self.LinkPage != nil {
self.LinkPage.SetIndex(0)