yell if invalid orientation given

This commit is contained in:
David Rose 2005-12-12 17:28:53 +00:00
parent 20b5398ab8
commit ba4c626028
2 changed files with 6 additions and 2 deletions

View File

@ -106,8 +106,10 @@ class DirectScrollBar(DirectFrame):
def setOrientation(self): def setOrientation(self):
if self['orientation'] == HORIZONTAL: if self['orientation'] == HORIZONTAL:
self.guiItem.setAxis(Vec3(1, 0, 0)) self.guiItem.setAxis(Vec3(1, 0, 0))
else: elif self['orientation'] == VERTICAL:
self.guiItem.setAxis(Vec3(0, 0, -1)) self.guiItem.setAxis(Vec3(0, 0, -1))
else:
raise ValueError, 'Invalid value for orientation: %s' % (self['orientation'])
def setManageButtons(self): def setManageButtons(self):
self.guiItem.setManagePieces(self['manageButtons']) self.guiItem.setManagePieces(self['manageButtons'])

View File

@ -99,8 +99,10 @@ class DirectSlider(DirectFrame):
def setOrientation(self): def setOrientation(self):
if self['orientation'] == HORIZONTAL: if self['orientation'] == HORIZONTAL:
self.guiItem.setAxis(Vec3(1, 0, 0)) self.guiItem.setAxis(Vec3(1, 0, 0))
else: elif self['orientation'] == VERTICAL:
self.guiItem.setAxis(Vec3(0, 0, 1)) self.guiItem.setAxis(Vec3(0, 0, 1))
else:
raise ValueError, 'Invalid value for orientation: %s' % (self['orientation'])
def destroy(self): def destroy(self):
DirectFrame.destroy(self) DirectFrame.destroy(self)