mirror of
https://github.com/ksherlock/prez.git
synced 2024-11-04 06:05:17 +00:00
custom resource ranges
This commit is contained in:
parent
a0888b7123
commit
523d3045d2
3
base.py
3
base.py
@ -15,6 +15,7 @@ __all__ = ["rObject", "rText", "rTextBlock", "rTextForLETextBox2",
|
||||
class rObject:
|
||||
rName = None
|
||||
rType = None
|
||||
rRange = range(1,0x07FF0000)
|
||||
|
||||
_rmap = {}
|
||||
_resources = {}
|
||||
@ -63,7 +64,7 @@ class rObject:
|
||||
used.sort()
|
||||
|
||||
|
||||
rr = range(1,0x07FEFFFF)
|
||||
rr = self.rRange
|
||||
if type(rID) == range:
|
||||
rr = rID
|
||||
|
||||
|
7
menu.py
7
menu.py
@ -35,8 +35,9 @@ _menu_item_ids = {}
|
||||
|
||||
def _to_char_string(x):
|
||||
if not x: return '""'
|
||||
if x in (0x0a, 0x0d): return "\\n"
|
||||
if x == ord('"'): return "\""
|
||||
if x == 0x0d: return "\\n" # intentionally backwards
|
||||
if x == 0x0a: return "\\r" #
|
||||
if chr(x) in "\\\\'" : return "\\" + x
|
||||
if x >= 32 and x < 0x7e: return '"' + chr(x) + '"'
|
||||
return "\\${:02x}".format(x)
|
||||
|
||||
@ -72,6 +73,7 @@ class rMenuBar(rObject):
|
||||
class rMenu(rObject):
|
||||
rName = "rMenu"
|
||||
rType = 0x8009
|
||||
rRange = range(0x0001,0xffff)
|
||||
|
||||
# /*-------------------------------------------------------*/
|
||||
# /* Equates for Menu Flags
|
||||
@ -147,6 +149,7 @@ miClose = 0xff
|
||||
class rMenuItem(rObject):
|
||||
rName = "rMenuItem"
|
||||
rType = 0x800a
|
||||
rRange = range(0x100,0xffff)
|
||||
|
||||
# /* --------------------------------------------------*/
|
||||
# /* flag word for menu item
|
||||
|
Loading…
Reference in New Issue
Block a user