diff --git a/control.py b/control.py index db517bc..ff4fca5 100644 --- a/control.py +++ b/control.py @@ -126,15 +126,15 @@ class rSimpleButton(rControlTemplate): if controlID == None: controlID = self.get_id() rv = ( - "\t${:08x}, /* control ID */\n" + "\t0x{:08x}, /* control ID */\n" "\t{{ {:d}, {:d}, {:d}, {:d} }}, /* rect */\n" "\tSimpleButtonControl {{\n" - "\t\t${:04x}, /* flags */\n" - "\t\t${:04x}, /* more flags */\n" - "\t\t${:08x}, /* refcon */\n" - "\t\t${:08x}, /* title ref */\n" - "\t\t${:08x} /* color table ref */\n" - # "\t\t${}, /* key equiv */\n" + "\t\t0x{:04x}, /* flags */\n" + "\t\t0x{:04x}, /* more flags */\n" + "\t\t0x{:08x}, /* refcon */\n" + "\t\t0x{:08x}, /* title ref */\n" + "\t\t0x{:08x} /* color table ref */\n" + # "\t\t0x{}, /* key equiv */\n" "\t}}" ).format( controlID, @@ -215,16 +215,16 @@ class rCheckControl(rControlTemplate): if controlID == None: controlID = self.get_id() rv = ( - "\t${:08x}, /* control ID */\n" + "\t0x{:08x}, /* control ID */\n" "\t{{ {:d}, {:d}, {:d}, {:d} }}, /* rect */\n" "\tCheckControl {{\n" - "\t\t${:04x}, /* flags */\n" - "\t\t${:04x}, /* more flags */\n" - "\t\t${:08x}, /* refcon */\n" - "\t\t${:08x}, /* title ref */\n" - "\t\t${:04x}, /* initial value */\n" - "\t\t${:08x} /* color table ref */\n" - # "\t\t${}, /* key equiv */\n" + "\t\t0x{:04x}, /* flags */\n" + "\t\t0x{:04x}, /* more flags */\n" + "\t\t0x{:08x}, /* refcon */\n" + "\t\t0x{:08x}, /* title ref */\n" + "\t\t0x{:04x}, /* initial value */\n" + "\t\t0x{:08x} /* color table ref */\n" + # "\t\t0x{}, /* key equiv */\n" "\t}}" ).format( controlID, @@ -309,16 +309,16 @@ class rRadioControl(rControlTemplate): if controlID == None: controlID = self.get_id() rv = ( - "\t${:08x}, /* control ID */\n" + "\t0x{:08x}, /* control ID */\n" "\t{{ {:d}, {:d}, {:d}, {:d} }}, /* rect */\n" "\tRadioControl {{\n" - "\t\t${:04x}, /* flags */\n" - "\t\t${:04x}, /* more flags */\n" - "\t\t${:08x}, /* refcon */\n" - "\t\t${:08x}, /* title ref */\n" - "\t\t${:04x}, /* initial value */\n" - "\t\t${:08x} /* color table ref */\n" - # "\t\t${}, /* key equiv */\n" + "\t\t0x{:04x}, /* flags */\n" + "\t\t0x{:04x}, /* more flags */\n" + "\t\t0x{:08x}, /* refcon */\n" + "\t\t0x{:08x}, /* title ref */\n" + "\t\t0x{:04x}, /* initial value */\n" + "\t\t0x{:08x} /* color table ref */\n" + # "\t\t0x{}, /* key equiv */\n" "\t}}" ).format( controlID, @@ -409,16 +409,16 @@ class rThermometerControl(rControlTemplate): if controlID == None: controlID = self.get_id() rv = ( - "\t${:08x}, /* control ID */\n" + "\t0x{:08x}, /* control ID */\n" "\t{{ {:d}, {:d}, {:d}, {:d} }}, /* rect */\n" "\tThermometerControl {{\n" - "\t\t${:04x}, /* flags */\n" - "\t\t${:04x}, /* more flags */\n" - "\t\t${:08x}, /* refcon */\n" - "\t\t${:04x}, /* value */\n" - "\t\t${:04x}, /* scale */\n" - "\t\t${:08x} /* color table ref */\n" - # "\t\t${}, /* key equiv */\n" + "\t\t0x{:04x}, /* flags */\n" + "\t\t0x{:04x}, /* more flags */\n" + "\t\t0x{:08x}, /* refcon */\n" + "\t\t0x{:04x}, /* value */\n" + "\t\t0x{:04x}, /* scale */\n" + "\t\t0x{:08x} /* color table ref */\n" + # "\t\t0x{}, /* key equiv */\n" "\t}}" ).format( controlID, @@ -506,14 +506,14 @@ class rRectangleControl(rControlTemplate): # penmask / pen pattern not yet supported. rv = ( - "\t${:08x}, /* control ID */\n" + "\t0x{:08x}, /* control ID */\n" "\t{{ {:d}, {:d}, {:d}, {:d} }}, /* rect */\n" "\tRectangleControl {{\n" - "\t\t${:04x}, /* flags */\n" - "\t\t${:04x}, /* more flags */\n" - "\t\t${:08x}, /* refcon */\n" - "\t\t${:04x}, /* pen height */\n" - "\t\t${:04x}, /* pen width */\n" + "\t\t0x{:04x}, /* flags */\n" + "\t\t0x{:04x}, /* more flags */\n" + "\t\t0x{:08x}, /* refcon */\n" + "\t\t0x{:04x}, /* pen height */\n" + "\t\t0x{:04x}, /* pen width */\n" "\t}}" ).format( controlID, @@ -622,14 +622,14 @@ class rStatTextControl(rControlTemplate): # penmask / pen pattern not yet supported. rv = ( - "\t${:08x}, /* control ID */\n" + "\t0x{:08x}, /* control ID */\n" "\t{}, /* rect */\n" "\tStatTextControl {{\n" - "\t\t${:04x}, /* flags */\n" - "\t\t${:04x}, /* more flags */\n" - "\t\t${:08x}, /* refcon */\n" - "\t\t${:08x}, /* text ref (rTextForLETextBox2) */\n" - "\t\t${:04x}, /* text size */\n" + "\t\t0x{:04x}, /* flags */\n" + "\t\t0x{:04x}, /* more flags */\n" + "\t\t0x{:08x}, /* refcon */\n" + "\t\t0x{:08x}, /* text ref (rTextForLETextBox2) */\n" + "\t\t0x{:04x}, /* text size */\n" "\t\t{:d}, /* text justification */\n" "\t}}" ).format( diff --git a/menu.py b/menu.py index bb2cf4e..5455d6a 100644 --- a/menu.py +++ b/menu.py @@ -62,7 +62,7 @@ class rMenuBar(rObject): rv = "\t{\n" kiddos = [x.get_id() for x in self.children] - rv += ",\n".join(["\t\t${:08x}".format(x) for x in kiddos]) + rv += ",\n".join(["\t\t0x{:08x}".format(x) for x in kiddos]) if kiddos: rv += "\n" rv += "\t}" return rv @@ -122,13 +122,13 @@ class rMenu(rObject): menuID = self.menuID if menuID == None: menuID = self.get_id() rv = ( - "\t${:04x}, /* menu ID */\n" - "\t${:04x}, /* flags */\n" - "\t${:08x}, /* title ref */\n" + "\t0x{:04x}, /* menu ID */\n" + "\t0x{:04x}, /* flags */\n" + "\t0x{:08x}, /* title ref (rPString) */\n" ).format(menuID, self.flags, self.title.get_id()) rv += "\t{\n" kiddos = [x.get_id() for x in self.children] - rv += ",\n".join(["\t\t${:08x}".format(x) for x in kiddos]) + rv += ",\n".join(["\t\t0x{:08x}".format(x) for x in kiddos]) if kiddos: rv += "\n" rv += "\t}" return rv @@ -226,11 +226,11 @@ class rMenuItem(rObject): if itemID == None: itemID = self.get_id() return ( - "\t${:04x}, /* id */\n" + "\t0x{:04x}, /* id */\n" "\t{}, {}, /* chars */\n" - "\t${:04x}, /* check */\n" - "\t${:04x}, /* flags */\n" - "\t${:04x} /* title ref */" + "\t0x{:04x}, /* check */\n" + "\t0x{:04x}, /* flags */\n" + "\t0x{:04x} /* title ref (rPString) */" ).format( itemID, _to_char_string(self.itemChar), diff --git a/sound.py b/sound.py index 6ed646b..2b37e26 100644 --- a/sound.py +++ b/sound.py @@ -184,9 +184,9 @@ class rSoundSample(rObject): return ( "\t0, /* format */\n" "\t{}, /* size (pages) */\n" - "\t${:04x}, /* relative pitch */\n" - "\t${:04x}, /* stereo channel */\n" - "\t${:u}, /* sample rate */\n" + "\t0x{:04x}, /* relative pitch */\n" + "\t0x{:04x}, /* stereo channel */\n" + "\t0x{:u}, /* sample rate */\n" "\t..." ).format( self.pages, diff --git a/window.py b/window.py index 6dbc40f..fbe80a1 100644 --- a/window.py +++ b/window.py @@ -131,22 +131,22 @@ class rWindParam1(rObject): def _rez_string(self): return ( - "\t${:04x}, /*frame bits */\n" - "\t${:08x}, /* title */\n" - "\t${:08x}, /* refCon */\n" + "\t0x{:04x}, /*frame bits */\n" + "\t0x{:08x}, /* title */\n" + "\t0x{:08x}, /* refCon */\n" "\t{}, /* zoom rect */\n" - "\t${:08x}, /* color table */\n" + "\t0x{:08x}, /* color table */\n" "\t{}, /* origin */\n" "\t{}, /* data height/width */\n" "\t{}, /* max height/width */\n" "\t{}, /* scroll vert/horz */\n" "\t{}, /* page vert/horz */\n" - "\t${:08x}, /* info refCon */\n" + "\t0x{:08x}, /* info refCon */\n" "\t{:d}, /* info height */\n" "\t{}, /* position */\n" "\t{}, /* plane */\n" - "\t${:08x}, /* controlList */\n" - "\t${:04x}, /* verb */" + "\t0x{:08x}, /* controlList */\n" + "\t0x{:04x}, /* verb */" ).format( self.frameBits, self.title.get_id() if self.title else 0,