Skip to content

Commit

Permalink
Fix issues #96 and #98 (#100)
Browse files Browse the repository at this point in the history
* Fix #96 - setting and getting Adjust Show ID for Iconbar

* Fix #98 - change menu ID property of Iconbar to use signed values

---------

Co-authored-by: Lauren Rad <lauren@cybertapes.com>
  • Loading branch information
laurenrad and laurenrad authored Jan 9, 2024
1 parent ce77bfb commit b512ccb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions riscos_toolbox/objects/iconbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,20 @@ class Iconbar(Object):
SetEvent_Adjust = 0x00000002
SetShow_Select = 0x00000001
SetShow_Adjust = 0x00000002
GetShow_Select = SetShow_Select
GetShow_Adjust = SetShow_Adjust

@property
def icon_handle(self):
return self._miscop_get_signed(Iconbar.GetIconHandle)

@property
def menu_id(self):
return self._miscop_get_unsigned(Iconbar.GetMenu)
return self._miscop_get_signed(Iconbar.GetMenu)

@menu_id.setter
def menu_id(self, id):
return self._miscop_set_unsigned(Iconbar.SetMenu, id)
return self._miscop_set_signed(Iconbar.SetMenu, id)

@property
def select_event(self):
Expand All @@ -66,7 +68,7 @@ def adjust_event(self, id):
@property
def show_select_id(self):
return swi.swi('Toolbox_ObjectMiscOp', 'IiI;i.',
0, self.id, Iconbar.GetShow)
Iconbar.GetShow_Select, self.id, Iconbar.GetShow)

@show_select_id.setter
def show_select_id(self, id):
Expand All @@ -76,11 +78,11 @@ def show_select_id(self, id):
@property
def show_adjust_id(self):
return swi.swi('Toolbox_ObjectMiscOp', 'IiI;.i',
0, self.id, Iconbar.GetShow)
Iconbar.GetShow_Adjust, self.id, Iconbar.GetShow)

@show_adjust_id.setter
def show_adjust_id(self, id):
swi.swi('Toolbox_ObjectMiscOp', 'Ii0i',
swi.swi('Toolbox_ObjectMiscOp', 'IiI0i',
Iconbar.SetShow_Adjust, self.id, Iconbar.SetShow, id)

@property
Expand Down

0 comments on commit b512ccb

Please sign in to comment.