summaryrefslogtreecommitdiff
path: root/widget.go
diff options
context:
space:
mode:
Diffstat (limited to 'widget.go')
-rw-r--r--widget.go106
1 files changed, 1 insertions, 105 deletions
diff --git a/widget.go b/widget.go
index 0a0e5de..2ff7773 100644
--- a/widget.go
+++ b/widget.go
@@ -5,7 +5,7 @@ package widget
// This is the only thing that is passed between the toolkit plugin
//
// what names should be used? This is not part of [[Graphical Widget]]
-// Event() seems like a good name.
+// Event() seems like a good name.
// Event is used too much: web dev, cloud, etc
// I'm using "Action". Maybe it should really be
// "Interaction" as per wikipedia [[User interface]]
@@ -14,42 +14,6 @@ package widget
//
type WidgetType int // Button, Menu, Checkbox, etc.
-type ActionType int // Add, SetText, Click, Hide, Append, Delete, etc
-
-type Action struct {
- ActionType ActionType
- WidgetType WidgetType
-
- WidgetId int
- ParentId int
-
- Text string // what is visable to the user
- Name string // a name useful for programming
-
- // This is how the values are passed back and forth
- // values from things like checkboxes & dropdown's
- B bool
- I int
- S string
- A any // switch to this or deprecate this? pros/cons?
-
- // This is used for things like a slider(0,100)
- X int
- Y int
-
- // This is for the grid size & widget position
- W int
- H int
- AtW int
- AtH int
-
- // Put space around elements to improve look & feel
- Margin bool
-
- // Make widgets fill up the space available
- Expand bool
-
-}
const (
Unknown WidgetType = iota
@@ -79,32 +43,6 @@ const (
Stdout // can be used to capture and display log output
)
-const (
- Add ActionType = iota
- Delete
- Get
- Set
- GetText
- SetText
- AddText
- Show
- Hide
- Enable
- Disable
- Margin
- Unmargin
- Pad
- Unpad
- Append
- Move
- Dump
- User // the user did something (mouse, keyboard, etc)
- InitToolkit // initializes the toolkit
- CloseToolkit // closes the toolkit
- UserQuit // the user closed the GUI
- EnableDebug // open the debugging window
-)
-
func (s WidgetType) String() string {
switch s {
case Root:
@@ -160,45 +98,3 @@ func (s WidgetType) String() string {
}
return "WidgetType.String() Error"
}
-
-func (s ActionType) String() string {
- switch s {
- case Add:
- return "Add"
- case Delete:
- return "Delete"
- case Get:
- return "Get"
- case Set:
- return "Set"
- case GetText:
- return "GetText"
- case SetText:
- return "SetText"
- case AddText:
- return "AddText"
- case Show:
- return "Show"
- case Hide:
- return "Hide"
- case Enable:
- return "Enable"
- case Disable:
- return "Disable"
- case Margin:
- return "Margin"
- case Unmargin:
- return "Unmargin"
- case Pad:
- return "Pad"
- case Unpad:
- return "Unpad"
- case Append:
- return "Append"
- case Move:
- return "Move"
- case Dump:
- return "Dump"
- }
- return "ActionType.String() Error"
-}