go_sdl_widget

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

go_sdl_widget

Buttons Lables and Input for go sdl

Documentation

Index

Constants

View Source
const (
	FILE_LIST_CLOSE_CANCEL = iota
	FILE_LIST_FILE_SELECT
	FILE_LIST_PATH_UP
	FILE_LIST_PATH_SELECT
)
View Source
const (
	LOG_LEVEL_ERROR LOG_LEVEL = iota
	LOG_LEVEL_WARN
	LOG_LEVEL_OK

	ALIGN_CENTER ALIGN_TEXT = iota
	ALIGN_LEFT
	ALIGN_RIGHT
	ALIGN_FIT

	ROTATE_0 ROTATE_SHAPE_90 = iota
	ROTATE_90
	ROTATE_180
	ROTATE_270

	ENTRY_EVENT_INSERT ENTRY_EVENT_TYPE = iota
	ENTRY_EVENT_DELETE
	ENTRY_EVENT_BS
	ENTRY_EVENT_FINISH
	ENTRY_EVENT_NONE
	ENTRY_EVENT_FOCUS
	ENTRY_EVENT_UN_FOCUS

	WIDGET_STYLE_NONE               STATE_BITS = 0b0000000000000001
	WIDGET_STYLE_DRAW_BORDER        STATE_BITS = 0b0000000000000010
	WIDGET_STYLE_DRAW_BG            STATE_BITS = 0b0000000000001000
	WIDGET_STYLE_DRAW_BORDER_AND_BG STATE_BITS = WIDGET_STYLE_DRAW_BORDER | WIDGET_STYLE_DRAW_BG
	WIDGET_STATE_ENABLED            STATE_BITS = 0b0000000000010000
	WIDGET_STATE_VISIBLE            STATE_BITS = 0b0000000000100000
	WIDGET_STATE_NOT_FOCUSED        STATE_BITS = 0b0000000001000000
	WIDGET_STATE_NOT_ERROR          STATE_BITS = 0b0000000010000000
	WIDGET_STATE_NOT_CLICKED        STATE_BITS = 0b0000000100000000
	WIDGET_STATE_STA_BITS           STATE_BITS = 0b0000000111110000 // Clear state AND mask. Retains style.
	WIDGET_STATE_ENA_SET            STATE_BITS = 0b0000000100110000 // Enabled visible and not-clicked

	WIDGET_COLOR_FG     STYLE_COLOUR = 0 // Section indexes
	WIDGET_COLOR_BG     STYLE_COLOUR = 1
	WIDGET_COLOR_BORDER STYLE_COLOUR = 2
	WIDGET_COLOR_ENTRY  STYLE_COLOUR = 3
	WIDGET_COLOR_MAX    STYLE_COLOUR = 4

	WIDGET_COLOUR_ENABLED STATE_COLOUR = 0
	WIDGET_COLOUR_DISABLE STATE_COLOUR = 1
	WIDGET_COLOUR_FOCUS   STATE_COLOUR = 2
	WIDGET_COLOUR_ERROR   STATE_COLOUR = 3

	DEG_TO_RAD float64 = (math.Pi / 180)
)

Variables

View Source
var TEXTURE_CACHE_TEXT_PREF = "TxCaPr987"

Functions

func GetColourId

func GetColourId(c *sdl.Color) uint32

func GetResourceInstance

func GetResourceInstance() *sdl_Resources

Types

type ALIGN_TEXT

type ALIGN_TEXT int

type ENTRY_EVENT_TYPE

type ENTRY_EVENT_TYPE int

type FILE_LIST_RESPONSE_CODE

type FILE_LIST_RESPONSE_CODE int

type KBD_KEY_MODE

type KBD_KEY_MODE int

type LOG_LEVEL

type LOG_LEVEL int

type ROTATE_SHAPE_90

type ROTATE_SHAPE_90 int

type SDL_Button

type SDL_Button struct {
	SDL_WidgetBase
	// contains filtered or unexported fields
}

*************************************************************************************** * SDL_Button code * Implements SDL_Widget cos it is one! * Implements SDL_TextWidget because it has text and uses the texture cache *

func NewSDLButton

func NewSDLButton(x, y, w, h, id int32, text string, style STATE_BITS, deBounce int, onClick func(string, int32, int32, int32) bool) *SDL_Button

func (*SDL_Button) Draw

func (b *SDL_Button) Draw(renderer *sdl.Renderer, font *ttf.Font) error

func (*SDL_Button) GetText

func (b *SDL_Button) GetText() string

func (*SDL_Button) SetText

func (b *SDL_Button) SetText(text string)

type SDL_CanSelectText

type SDL_CanSelectText interface {
	ClearSelection()
	GetSelectedText() string
}

type SDL_Container

type SDL_Container interface {
	Add(SDL_Widget) SDL_Widget
	ListWidgets() []SDL_Widget
	GetWidgetWithId(int32) SDL_Widget
	SetFocusedId(int32)
	GetFocusedWidget() SDL_Widget
	ClearFocus()
	Inside(int32, int32) (SDL_Widget, bool)
	NextFrame()
}

type SDL_Entry

type SDL_Entry struct {
	SDL_WidgetBase
	// contains filtered or unexported fields
}

*************************************************************************************** * SDL_Label code * Implements SDL_Widget cos it is one! * Implements SDL_TextWidget because it has text and uses the texture cache *

func NewSDLEntry

func NewSDLEntry(x, y, w, h, id int32, text string, style STATE_BITS, onChange func(string, string, ENTRY_EVENT_TYPE) (string, error)) *SDL_Entry

func (*SDL_Entry) ClearSelection

func (b *SDL_Entry) ClearSelection()

func (*SDL_Entry) Click

func (b *SDL_Entry) Click(md *SDL_MouseData) bool

func (*SDL_Entry) Destroy

func (b *SDL_Entry) Destroy()

func (*SDL_Entry) Draw

func (b *SDL_Entry) Draw(renderer *sdl.Renderer, font *ttf.Font) error

func (*SDL_Entry) GetSelecteCharsFwd

func (b *SDL_Entry) GetSelecteCharsFwd() string

func (*SDL_Entry) GetSelecteCharsRev

func (b *SDL_Entry) GetSelecteCharsRev() string

func (*SDL_Entry) GetSelectedText

func (b *SDL_Entry) GetSelectedText() string

func (*SDL_Entry) GetText

func (b *SDL_Entry) GetText() string

func (*SDL_Entry) Invalid

func (b *SDL_Entry) Invalid(yes bool)

func (*SDL_Entry) KeyPress

func (b *SDL_Entry) KeyPress(c int, ctrl bool, down bool) bool

func (*SDL_Entry) MoveCursor

func (b *SDL_Entry) MoveCursor(i int)

func (*SDL_Entry) SetCursor

func (b *SDL_Entry) SetCursor(i int)

func (*SDL_Entry) SetFocused

func (b *SDL_Entry) SetFocused(focus bool)

func (*SDL_Entry) SetSelecteCharsFwd

func (b *SDL_Entry) SetSelecteCharsFwd(s string)

func (*SDL_Entry) SetSelecteCharsRev

func (b *SDL_Entry) SetSelecteCharsRev(s string)

func (*SDL_Entry) SetSelectedTextBounds

func (b *SDL_Entry) SetSelectedTextBounds(from, too uint) error

func (*SDL_Entry) SetText

func (b *SDL_Entry) SetText(text string)

func (*SDL_Entry) String

func (b *SDL_Entry) String() string

type SDL_FileList

type SDL_FileList struct {
	SDL_WidgetSubGroup
	// contains filtered or unexported fields
}

func NewFileList

func NewFileList(x, y, rh, id int32, currentPath string, font *ttf.Font, style STATE_BITS, onSelect func(string, FILE_LIST_RESPONSE_CODE, int32) bool, filter func(bool, string) bool) (*SDL_FileList, error)

func (*SDL_FileList) Close

func (*SDL_FileList) Reload

func (fl *SDL_FileList) Reload(currentPath string)

func (*SDL_FileList) Show

func (fl *SDL_FileList) Show(viewPort sdl.Rect)

type SDL_Image

type SDL_Image struct {
	SDL_WidgetBase
	// contains filtered or unexported fields
}

*************************************************************************************** * SDL_Image code * Implements SDL_Widget cos it is one! * Implements SDL_TextWidget because it has text and uses the texture cache *

func NewSDLImage

func NewSDLImage(x, y, w, h, id int32, textureName string, frame, frameCount int32, style STATE_BITS, deBounce int, onClick func(string, int32, int32, int32) bool) *SDL_Image

func (*SDL_Image) Draw

func (b *SDL_Image) Draw(renderer *sdl.Renderer, font *ttf.Font) error

func (*SDL_Image) GetFrame

func (b *SDL_Image) GetFrame() int32

func (*SDL_Image) GetFrameCount

func (b *SDL_Image) GetFrameCount() int32

func (*SDL_Image) NextFrame

func (b *SDL_Image) NextFrame() int32

func (*SDL_Image) SetFrame

func (b *SDL_Image) SetFrame(tf int32)

func (*SDL_Image) String

func (b *SDL_Image) String() string

type SDL_ImageWidget

type SDL_ImageWidget interface {
	SetFrame(tf int32)
	GetFrame() int32
	NextFrame() int32
	GetFrameCount() int32
}

type SDL_Label

type SDL_Label struct {
	SDL_WidgetBase
	// contains filtered or unexported fields
}

*************************************************************************************** * SDL_Label code * Implements SDL_Widget cos it is one! * Implements SDL_TextWidget because it has text and uses the texture cache *

func NewSDLLabel

func NewSDLLabel(x, y, w, h, id int32, text string, align ALIGN_TEXT, style STATE_BITS) *SDL_Label

func (*SDL_Label) Draw

func (b *SDL_Label) Draw(renderer *sdl.Renderer, font *ttf.Font) error

func (*SDL_Label) GetText

func (b *SDL_Label) GetText() string

func (*SDL_Label) SetText

func (b *SDL_Label) SetText(text string)

type SDL_LinkedWidget

type SDL_LinkedWidget struct {
	// contains filtered or unexported fields
}

type SDL_MouseData

type SDL_MouseData struct {
	// contains filtered or unexported fields
}

*************************************************************************************** * SDL_MouseData * Used to pass mouse activity to the widgets * *

func (*SDL_MouseData) ActionMouseDown

func (md *SDL_MouseData) ActionMouseDown(me *sdl.MouseButtonEvent, id int32) *SDL_MouseData

func (*SDL_MouseData) ActionNotDragging

func (md *SDL_MouseData) ActionNotDragging(me *sdl.MouseMotionEvent) *SDL_MouseData

func (*SDL_MouseData) ActionReset

func (md *SDL_MouseData) ActionReset(me *sdl.MouseButtonEvent) *SDL_MouseData

func (*SDL_MouseData) ActionStartDragging

func (md *SDL_MouseData) ActionStartDragging(me *sdl.MouseMotionEvent) *SDL_MouseData

func (*SDL_MouseData) ActionStopDragging

func (md *SDL_MouseData) ActionStopDragging(me *sdl.MouseButtonEvent) *SDL_MouseData

func (*SDL_MouseData) GetButtons

func (md *SDL_MouseData) GetButtons() uint8

func (*SDL_MouseData) GetClickCount

func (md *SDL_MouseData) GetClickCount() int

func (*SDL_MouseData) GetDraggingX

func (md *SDL_MouseData) GetDraggingX() int32

func (*SDL_MouseData) GetDraggingY

func (md *SDL_MouseData) GetDraggingY() int32

func (*SDL_MouseData) GetWidgetId

func (md *SDL_MouseData) GetWidgetId() int32

func (*SDL_MouseData) GetX

func (md *SDL_MouseData) GetX() int32

func (*SDL_MouseData) GetY

func (md *SDL_MouseData) GetY() int32

func (*SDL_MouseData) IsDown

func (md *SDL_MouseData) IsDown() bool

func (*SDL_MouseData) IsDragged

func (md *SDL_MouseData) IsDragged() bool

func (*SDL_MouseData) IsDragging

func (md *SDL_MouseData) IsDragging() bool

func (*SDL_MouseData) String

func (md *SDL_MouseData) String() string

type SDL_Separator

type SDL_Separator struct {
	SDL_WidgetBase
}

*************************************************************************************** * SDL_Image code * Implements SDL_Widget cos it is one! * Implements SDL_TextWidget because it has text and uses the texture cache *

func NewSDLSeparator

func NewSDLSeparator(x, y, w, h, id int32, style STATE_BITS) *SDL_Separator

func (*SDL_Separator) Draw

func (b *SDL_Separator) Draw(renderer *sdl.Renderer, font *ttf.Font) error

type SDL_Shape

type SDL_Shape struct {
	SDL_WidgetBase
	// contains filtered or unexported fields
}

*************************************************************************************** * SDL_Shape code. * Implements SDL_Widget cos it is one! *

func NewSDLShape

func NewSDLShape(x, y, w, h, id int32, style STATE_BITS, onClick func(string, int32, int32, int32) bool) *SDL_Shape

func NewSDLShapeArrowRight

func NewSDLShapeArrowRight(x, y, w, h, id int32, style STATE_BITS, onClick func(string, int32, int32, int32) bool) *SDL_Shape

func (*SDL_Shape) Add

func (s *SDL_Shape) Add(x, y int32)

func (*SDL_Shape) Draw

func (s *SDL_Shape) Draw(renderer *sdl.Renderer, font *ttf.Font) error

func (*SDL_Shape) GetRect

func (s *SDL_Shape) GetRect() *sdl.Rect

func (*SDL_Shape) Rotate

func (s *SDL_Shape) Rotate(angle int)

func (*SDL_Shape) Scale

func (s *SDL_Shape) Scale(sc float32)

func (*SDL_Shape) SetPosition

func (s *SDL_Shape) SetPosition(x, y int32) bool

func (*SDL_Shape) SetSize

func (s *SDL_Shape) SetSize(w, h int32) bool

type SDL_TextWidget

type SDL_TextWidget interface {
	SetText(text string)
	GetText() string
}

type SDL_TextureCache

type SDL_TextureCache struct {
	// contains filtered or unexported fields
}

*************************************************************************************** * Texture cache for widgets that have textures to display. * Textures are sdl resources and need to be Destroyed. * SDL_WidgetList destroys all textures via the SDL_Widgets Destroy() function. * SDL_WidgetGroup destroys all textures via SDL_WidgetsGroup Destroy() function * USE: widgetGroup := NewWidgetGroup() * defer widgetGroup.Destroy() *

func NewTextureCache

func NewTextureCache() *SDL_TextureCache

func (*SDL_TextureCache) Add

func (tc *SDL_TextureCache) Add(name string, tceIn *SDL_TextureCacheEntry)

func (*SDL_TextureCache) Destroy

func (tc *SDL_TextureCache) Destroy()

func (*SDL_TextureCache) Peek

func (tc *SDL_TextureCache) Peek(name string) bool

func (*SDL_TextureCache) Remove

func (tc *SDL_TextureCache) Remove(name string, tceIn *SDL_TextureCacheEntry)

func (*SDL_TextureCache) String

func (tc *SDL_TextureCache) String() string

type SDL_TextureCacheEntry

type SDL_TextureCacheEntry struct {
	Texture *sdl.Texture

	W, H int32
	// contains filtered or unexported fields
}

*************************************************************************************** * Texture cache Entry used to hold ALL textures in the SDL_TextureCache *

func (*SDL_TextureCacheEntry) Destroy

func (tce *SDL_TextureCacheEntry) Destroy() int

func (*SDL_TextureCacheEntry) ScaledWidthHeight

func (tce *SDL_TextureCacheEntry) ScaledWidthHeight(txtH, clientW int32) (int32, int32, int32)

type SDL_Widget

type SDL_Widget interface {
	Draw(*sdl.Renderer, *ttf.Font) error
	Scale(float32)
	Click(*SDL_MouseData) bool
	SetOnClick(func(string, int32, int32, int32) bool) // Base
	Inside(int32, int32) (SDL_Widget, bool)            // Base
	GetRect() *sdl.Rect                                // Base
	SetRect(*sdl.Rect)                                 // Base
	SetWidgetId(int32)                                 // Base
	GetWidgetId() int32                                // Base
	SetVisible(bool)                                   // Base
	IsVisible() bool                                   // Base
	SetClicked(bool)                                   // Base
	IsClicked() bool                                   // Base
	SetEnabled(bool)                                   // Base
	IsEnabled() bool                                   // Base
	SetError(bool)                                     // Base
	IsError() bool                                     // Base
	SetPosition(int32, int32) bool                     // Base
	SetPositionRel(int32, int32) bool                  // Base
	GetPosition() (int32, int32)                       // Base
	SetSize(int32, int32) bool                         // Base
	GetSize() (int32, int32)                           // Base
	GetForeground() *sdl.Color                         // Base
	GetBackground() *sdl.Color                         // Base
	GetBorderColour() *sdl.Color                       // Base
	SetForeground(*sdl.Color)                          // Base
	SetBackground(*sdl.Color)                          // Base
	SetBorderColour(*sdl.Color)                        // Base
	SetDrawBackground(bool)                            // Base
	ShouldDrawBackground() bool                        // Base
	SetDrawBorder(bool)                                // Base
	ShouldDrawBorder() bool                            // Base
	Destroy()                                          // Base
	SetLog(func(LOG_LEVEL, string))
	Log(LOG_LEVEL, string)
	CanLog() bool
	CanFocus() bool
	KeyPress(c int, ctrl, down bool) bool
	SetFocused(bool)            // Base
	IsFocused() bool            // Base
	GetFocusColour() *sdl.Color // Base
	SetFocusColour(*sdl.Color)  // Base
	String() string
}

type SDL_WidgetBase

type SDL_WidgetBase struct {
	// contains filtered or unexported fields
}

func (*SDL_WidgetBase) CanFocus

func (b *SDL_WidgetBase) CanFocus() bool

func (*SDL_WidgetBase) CanLog

func (b *SDL_WidgetBase) CanLog() bool

func (*SDL_WidgetBase) Click

func (b *SDL_WidgetBase) Click(md *SDL_MouseData) bool

func (*SDL_WidgetBase) Destroy

func (b *SDL_WidgetBase) Destroy()

func (*SDL_WidgetBase) GetBackground

func (b *SDL_WidgetBase) GetBackground() *sdl.Color

func (*SDL_WidgetBase) GetBorderColour

func (b *SDL_WidgetBase) GetBorderColour() *sdl.Color

func (*SDL_WidgetBase) GetDebounce

func (b *SDL_WidgetBase) GetDebounce() int

func (*SDL_WidgetBase) GetFocusColour

func (b *SDL_WidgetBase) GetFocusColour() *sdl.Color

func (*SDL_WidgetBase) GetForeground

func (b *SDL_WidgetBase) GetForeground() *sdl.Color

func (*SDL_WidgetBase) GetPosition

func (b *SDL_WidgetBase) GetPosition() (int32, int32)

func (*SDL_WidgetBase) GetRect

func (b *SDL_WidgetBase) GetRect() *sdl.Rect

func (*SDL_WidgetBase) GetSize

func (b *SDL_WidgetBase) GetSize() (int32, int32)

func (*SDL_WidgetBase) GetWidgetId

func (b *SDL_WidgetBase) GetWidgetId() int32

func (*SDL_WidgetBase) Inside

func (b *SDL_WidgetBase) Inside(x, y int32) (SDL_Widget, bool)

func (*SDL_WidgetBase) IsClicked

func (b *SDL_WidgetBase) IsClicked() bool

func (*SDL_WidgetBase) IsEnabled

func (b *SDL_WidgetBase) IsEnabled() bool

func (*SDL_WidgetBase) IsError

func (b *SDL_WidgetBase) IsError() bool

func (*SDL_WidgetBase) IsFocused

func (b *SDL_WidgetBase) IsFocused() bool

func (*SDL_WidgetBase) IsVisible

func (b *SDL_WidgetBase) IsVisible() bool

func (*SDL_WidgetBase) KeyPress

func (b *SDL_WidgetBase) KeyPress(c int, ctrl bool, down bool) bool

func (*SDL_WidgetBase) Log

func (b *SDL_WidgetBase) Log(id LOG_LEVEL, s string)

func (*SDL_WidgetBase) Scale

func (b *SDL_WidgetBase) Scale(s float32)

func (*SDL_WidgetBase) SetBackground

func (b *SDL_WidgetBase) SetBackground(c *sdl.Color)

func (*SDL_WidgetBase) SetBorderColour

func (b *SDL_WidgetBase) SetBorderColour(c *sdl.Color)

func (*SDL_WidgetBase) SetClicked

func (b *SDL_WidgetBase) SetClicked(v bool)

func (*SDL_WidgetBase) SetDeBounce

func (b *SDL_WidgetBase) SetDeBounce(db int)

func (*SDL_WidgetBase) SetDrawBackground

func (b *SDL_WidgetBase) SetDrawBackground(e bool)

func (*SDL_WidgetBase) SetDrawBorder

func (b *SDL_WidgetBase) SetDrawBorder(e bool)

func (*SDL_WidgetBase) SetEnabled

func (b *SDL_WidgetBase) SetEnabled(e bool)

func (*SDL_WidgetBase) SetError

func (b *SDL_WidgetBase) SetError(v bool)

func (*SDL_WidgetBase) SetFocusColour

func (b *SDL_WidgetBase) SetFocusColour(c *sdl.Color)

func (*SDL_WidgetBase) SetFocused

func (b *SDL_WidgetBase) SetFocused(v bool)

func (*SDL_WidgetBase) SetForeground

func (b *SDL_WidgetBase) SetForeground(c *sdl.Color)

func (*SDL_WidgetBase) SetLog

func (b *SDL_WidgetBase) SetLog(f func(LOG_LEVEL, string))

func (*SDL_WidgetBase) SetOnClick

func (b *SDL_WidgetBase) SetOnClick(f func(string, int32, int32, int32) bool)

func (*SDL_WidgetBase) SetPosition

func (b *SDL_WidgetBase) SetPosition(x, y int32) bool

func (*SDL_WidgetBase) SetPositionRel

func (b *SDL_WidgetBase) SetPositionRel(x, y int32) bool

func (*SDL_WidgetBase) SetRect

func (b *SDL_WidgetBase) SetRect(r *sdl.Rect)

func (*SDL_WidgetBase) SetSize

func (b *SDL_WidgetBase) SetSize(w, h int32) bool

func (*SDL_WidgetBase) SetVisible

func (b *SDL_WidgetBase) SetVisible(v bool)

func (*SDL_WidgetBase) SetWidgetId

func (b *SDL_WidgetBase) SetWidgetId(widgetId int32)

func (*SDL_WidgetBase) ShouldDrawBackground

func (b *SDL_WidgetBase) ShouldDrawBackground() bool

func (*SDL_WidgetBase) ShouldDrawBorder

func (b *SDL_WidgetBase) ShouldDrawBorder() bool

func (*SDL_WidgetBase) String

func (b *SDL_WidgetBase) String() string

type SDL_WidgetGroup

type SDL_WidgetGroup struct {
	// contains filtered or unexported fields
}

*************************************************************************************** * Container for SDL_Widgets. A list of lists *

func NewWidgetGroup

func NewWidgetGroup(font *ttf.Font) *SDL_WidgetGroup

func (*SDL_WidgetGroup) AllSubGroups

func (wg *SDL_WidgetGroup) AllSubGroups() []*SDL_WidgetSubGroup

func (*SDL_WidgetGroup) AllWidgets

func (wg *SDL_WidgetGroup) AllWidgets() []SDL_Widget

func (*SDL_WidgetGroup) ClearFocus

func (wg *SDL_WidgetGroup) ClearFocus()

func (*SDL_WidgetGroup) ClearSelection

func (wg *SDL_WidgetGroup) ClearSelection()

func (*SDL_WidgetGroup) Destroy

func (wg *SDL_WidgetGroup) Destroy()

func (*SDL_WidgetGroup) Draw

func (wg *SDL_WidgetGroup) Draw(renderer *sdl.Renderer)

func (*SDL_WidgetGroup) GetFocusedWidget

func (wg *SDL_WidgetGroup) GetFocusedWidget() SDL_Widget

func (*SDL_WidgetGroup) GetWidgetSubGroup

func (wl *SDL_WidgetGroup) GetWidgetSubGroup(id int32) *SDL_WidgetSubGroup

func (*SDL_WidgetGroup) GetWidgetWithId

func (wl *SDL_WidgetGroup) GetWidgetWithId(id int32) SDL_Widget

func (*SDL_WidgetGroup) InsideWidget

func (wg *SDL_WidgetGroup) InsideWidget(x, y int32) SDL_Widget

func (*SDL_WidgetGroup) KeyPress

func (wg *SDL_WidgetGroup) KeyPress(c int, ctrl, down bool) bool

func (*SDL_WidgetGroup) NewWidgetSubGroup

func (wg *SDL_WidgetGroup) NewWidgetSubGroup(x, y, w, h, id int32, style STATE_BITS) *SDL_WidgetSubGroup

func (*SDL_WidgetGroup) NextFrame

func (wg *SDL_WidgetGroup) NextFrame()

func (*SDL_WidgetGroup) Scale

func (wg *SDL_WidgetGroup) Scale(s float32)

func (*SDL_WidgetGroup) SetFocusedId

func (wg *SDL_WidgetGroup) SetFocusedId(id int32)

type SDL_WidgetSubGroup

type SDL_WidgetSubGroup struct {
	SDL_WidgetBase
	// contains filtered or unexported fields
}

*************************************************************************************** * Container for SDL_Widget instances. *

func NewWidgetSubGroup

func NewWidgetSubGroup(x, y, w, h, id int32, font *ttf.Font, style STATE_BITS) *SDL_WidgetSubGroup

func (*SDL_WidgetSubGroup) Add

func (wl *SDL_WidgetSubGroup) Add(widget SDL_Widget) SDL_Widget

func (*SDL_WidgetSubGroup) ArrangeGrid

func (wl *SDL_WidgetSubGroup) ArrangeGrid(rect *sdl.Rect, padding, rowHeight int32, colsW []int32) (int32, int32)

func (*SDL_WidgetSubGroup) ArrangeLR

func (wl *SDL_WidgetSubGroup) ArrangeLR(xx, yy, padding int32) (int32, int32)

func (*SDL_WidgetSubGroup) ArrangeRL

func (wl *SDL_WidgetSubGroup) ArrangeRL(xx, yy, padding int32) (int32, int32)

func (*SDL_WidgetSubGroup) ClearFocus

func (wl *SDL_WidgetSubGroup) ClearFocus()

func (*SDL_WidgetSubGroup) ClearSelection

func (wl *SDL_WidgetSubGroup) ClearSelection()

func (*SDL_WidgetSubGroup) Click

func (wl *SDL_WidgetSubGroup) Click(md *SDL_MouseData) bool

func (*SDL_WidgetSubGroup) Destroy

func (wl *SDL_WidgetSubGroup) Destroy()

func (*SDL_WidgetSubGroup) Draw

func (wl *SDL_WidgetSubGroup) Draw(renderer *sdl.Renderer, f *ttf.Font) error

func (*SDL_WidgetSubGroup) GetFocusedWidget

func (wl *SDL_WidgetSubGroup) GetFocusedWidget() SDL_Widget

func (*SDL_WidgetSubGroup) GetFont

func (wl *SDL_WidgetSubGroup) GetFont() *ttf.Font

func (*SDL_WidgetSubGroup) GetSmallestRect

func (wl *SDL_WidgetSubGroup) GetSmallestRect(within *sdl.Rect) *sdl.Rect

func (*SDL_WidgetSubGroup) GetWidgetWithId

func (wl *SDL_WidgetSubGroup) GetWidgetWithId(id int32) SDL_Widget

func (*SDL_WidgetSubGroup) Inside

func (wl *SDL_WidgetSubGroup) Inside(x, y int32) (SDL_Widget, bool)

func (*SDL_WidgetSubGroup) KeyPress

func (wl *SDL_WidgetSubGroup) KeyPress(c int, ctrl, down bool) bool

func (*SDL_WidgetSubGroup) ListWidgets

func (wl *SDL_WidgetSubGroup) ListWidgets() []SDL_Widget

func (*SDL_WidgetSubGroup) NextFrame

func (wl *SDL_WidgetSubGroup) NextFrame()

func (*SDL_WidgetSubGroup) Scale

func (wl *SDL_WidgetSubGroup) Scale(s float32)

func (*SDL_WidgetSubGroup) SetFocusedId

func (wl *SDL_WidgetSubGroup) SetFocusedId(id int32)

func (*SDL_WidgetSubGroup) SetFont

func (wl *SDL_WidgetSubGroup) SetFont(font *ttf.Font)

------------------------------------------------------------ Sub Group Specific (not part of SDL_Widget interface) ------------------------------------------------------------

func (*SDL_WidgetSubGroup) SetPosition

func (wl *SDL_WidgetSubGroup) SetPosition(x, y int32) bool

func (*SDL_WidgetSubGroup) SetPositionRel

func (wl *SDL_WidgetSubGroup) SetPositionRel(x, y int32) bool

type STATE_BITS

type STATE_BITS uint16

type STATE_COLOUR

type STATE_COLOUR int

type STYLE_COLOUR

type STYLE_COLOUR int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL