Skip to content

Commit f09f6e0

Browse files
committed
UI Wrapped
1 parent 969e0bb commit f09f6e0

38 files changed

Lines changed: 2105 additions & 215 deletions
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from _MatrixOS_UI import UI
2+
3+
class UI(_MatrixOS_UI.UI):
4+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from _MatrixOS_UI4pxNumber import UI4pxNumber
2+
3+
class UI4pxNumber(_MatrixOS_UI4pxNumber.UI4pxNumber):
4+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from _MatrixOS_UIButton import UIButton
2+
3+
class UIButton(_MatrixOS_UIButton.UIButton):
4+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from MatrixOS_UIComponent import UIComponent
2+
from MatrixOS_UIButton import UIButton
3+
from MatrixOS_UISelector import UISelector
4+
from MatrixOS_UI4pxNumber import UI4pxNumber
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from _MatrixOS_UISelector import UISelector, UISelectorDirection, UISelectorLitMode
2+
3+
class UISelector(_MatrixOS_UISelector.UISelector):
4+
pass
5+
6+
class UISelectorDirection(_MatrixOS_UISelector.UISelectorDirection):
7+
pass
8+
9+
class UISelectorLitMode(_MatrixOS_UISelector.UISelectorLitMode):
10+
pass

Applications/Python/PikaPython/_MatrixOS_KeyPad.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ from MatrixOS_Point import Point
55
from MatrixOS_KeyInfo import KeyInfo
66
from MatrixOS_KeyEvent import KeyEvent
77

8-
def Get(timeout_ms: int) -> KeyEvent: ...
9-
def GetKey(keyXY: Point) -> KeyInfo: ...
10-
def GetKeyByID(keyID: int) -> KeyInfo: ...
8+
# Returns KeyEvent on success or None on timeout/failure
9+
def Get(timeout_ms: int) -> any: ...
10+
# Returns KeyInfo if key exists or None if invalid position
11+
def GetKey(keyXY: Point) -> any: ...
12+
# Returns KeyInfo if key exists or None if invalid ID
13+
def GetKeyByID(keyID: int) -> any: ...
1114
def Clear() -> None: ...
1215
def XY2ID(xy: Point) -> int: ...
13-
def ID2XY(keyID: int) -> Point: ...
16+
# Returns Point on success or None if invalid ID
17+
def ID2XY(keyID: int) -> any: ...

Applications/Python/PikaPython/_MatrixOS_MIDI.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from MatrixOS_MidiPacket import MidiPacket
55

6-
def Get(self, timeout_ms: int) -> MidiPacket: ...
6+
# Returns MidiPacket on success or None on timeout/failure
7+
def Get(self, timeout_ms: int) -> any: ...
78
def Send(self, packet: MidiPacket, timeout_ms: int) -> bool: ...
89
def SendSysEx(self, port: int, length: int, data: bytes, include_meta: bool) -> bool: ...
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# MatrixOS Python Interface - UI
2+
# Core UI class for creating user interfaces
3+
4+
from MatrixOS_UIComponent import UIComponent
5+
from MatrixOS_Point import Point
6+
from MatrixOS_KeyEvent import KeyEvent
7+
from MatrixOS_Color import Color
8+
9+
class UI:
10+
def __init__(self, *val) -> None: ...
11+
12+
# UI control methods
13+
def Start(self) -> bool: ...
14+
def SetName(self, name: str) -> bool: ...
15+
def SetColor(self, color: Color) -> bool: ...
16+
def ShouldCreatenewLEDLayer(self, create: bool) -> bool: ...
17+
18+
# Callback setters
19+
def SetSetupFunc(self, setupFunc: any) -> bool: ...
20+
def SetLoopFunc(self, loopFunc: any) -> bool: ...
21+
def SetEndFunc(self, endFunc: any) -> bool: ...
22+
def SetPreRenderFunc(self, pre_renderFunc: any) -> bool: ...
23+
def SetPostRenderFunc(self, post_renderFunc: any) -> bool: ...
24+
def SetKeyEventHandler(self, key_event_handler: any) -> bool: ...
25+
26+
# UI Component management
27+
def AddUIComponent(self, uiComponent: UIComponent, xy: Point) -> bool: ...
28+
def ClearUIComponents(self) -> bool: ...
29+
30+
# UI control
31+
def AllowExit(self, allow: bool) -> bool: ...
32+
def SetFPS(self, fps: int) -> bool: ...
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MatrixOS Python Interface - UI4pxNumber
2+
# 4-pixel font number display component
3+
4+
from _MatrixOS_UIComponent import UIComponent
5+
from MatrixOS_Color import Color
6+
7+
class UI4pxNumber(_MatrixOS_UIComponent.UIComponent):
8+
def __init__(self) -> None: ...
9+
10+
# Configuration
11+
def SetName(self, name: str) -> bool: ...
12+
def SetColor(self, color: Color) -> bool: ...
13+
def SetAlternativeColor(self, alternativeColor: Color) -> bool: ...
14+
def SetDigits(self, digits: int) -> bool: ...
15+
def SetSpacing(self, spacing: int) -> bool: ...
16+
17+
# Value Management
18+
def SetValueFunc(self, getValueFunc: any) -> bool: ...
19+
20+
# Color Functions
21+
def SetColorFunc(self, colorFunc: any) -> bool: ...
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# MatrixOS Python Interface - UIButton
2+
# Button UI component with press and hold callbacks
3+
4+
from _MatrixOS_UIComponent import UIComponent
5+
from MatrixOS_Color import Color
6+
from MatrixOS_Dimension import Dimension
7+
8+
class UIButton(_MatrixOS_UIComponent.UIComponent):
9+
def __init__(self) -> None: ...
10+
11+
def SetName(self, name: str) -> bool: ...
12+
def SetColor(self, color: Color) -> bool: ...
13+
def SetColorFunc(self, colorFunc: any) -> bool: ...
14+
def SetSize(self, dimension: Dimension) -> bool: ...
15+
16+
def OnPress(self, pressCallback: any) -> bool: ...
17+
def OnHold(self, holdCallback: any) -> bool: ...

0 commit comments

Comments
 (0)