-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<Bug>[OglInterface2]: <Not yet fixed>
[Added debug; renamed enum for clarity] [#60]
- Loading branch information
Humberto Sanchez II
committed
Feb 21, 2023
1 parent
c8a1dc3
commit 681e685
Showing
15 changed files
with
267 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
|
||
setup( | ||
name="ogl", | ||
version="0.70.0", | ||
version="0.70.10", | ||
author='Humberto A. Sanchez II', | ||
author_email='[email protected]', | ||
maintainer='Humberto A. Sanchez II', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
from typing import Callable | ||
|
||
from logging import Logger | ||
from logging import getLogger | ||
|
||
from enum import Enum | ||
|
||
from wx import PostEvent | ||
from wx import PyEventBinder | ||
from wx import Window | ||
|
||
from wx.lib.newevent import NewEvent | ||
|
||
|
||
SetStatusTextEvent, EVT_SET_STATUS_TEXT = NewEvent() | ||
|
||
|
||
class DemoEventType(Enum): | ||
SET_STATUS_TEXT = 'SetStatusText' | ||
|
||
|
||
class DemoEventEngine: | ||
def __init__(self, listeningWindow: Window): | ||
|
||
self._listeningWindow: Window = listeningWindow | ||
self.logger: Logger = getLogger(__name__) | ||
|
||
def registerListener(self, event: PyEventBinder, callback: Callable): | ||
self._listeningWindow.Bind(event, callback) | ||
|
||
def sendEvent(self, eventType: DemoEventType, **kwargs): | ||
""" | ||
Args: | ||
eventType: | ||
**kwargs: | ||
""" | ||
match eventType: | ||
case DemoEventType.SET_STATUS_TEXT: | ||
self._sendSetStatusTextEvent(**kwargs) | ||
case _: | ||
self.logger.warning(f'Unknown Demo Event Type: {eventType}') | ||
|
||
def _sendSetStatusTextEvent(self, **kwargs): | ||
|
||
statusMessage: str = kwargs['statusMessage'] | ||
eventToPost: SetStatusTextEvent = SetStatusTextEvent(statusMessage=statusMessage) # type: ignore | ||
PostEvent(dest=self._listeningWindow, event=eventToPost) |
Oops, something went wrong.