Użytkownik Nate Lowrie napisał:
> Can you post your code?  Just the layout portion is all I want to look at.
>    

Here is code of whole control page:
<code>
import wx
import dabo
from dabo.dLocalize import _
from PagEditBase import PagEditBase

class cCmdButtonGroup(dabo.ui.dPanel):

     _proxy_buttons = []

     def __init__(self, parent, properties=None,
             attProperties=None, buttons=None,
             orientation="h", *args, **kwargs):
         self.__constructed = False
         cName = self._extractKey((properties, attProperties, kwargs), 
"NameBase", "")
         if not cName:
             cName = self._extractKey((properties, attProperties, kwargs),
                 "Name", "cCmdButtonGroup")
         dabo.ui.dPanel.__init__(self, parent=parent, 
properties=properties,
                 attProperties=attProperties, *args, **kwargs)
         self._baseClass = cCmdButtonGroup
         sizer = self.Sizer = dabo.ui.dSizer(orientation)
         idx = 0
         for caption in buttons:
             button = dabo.ui.dButton(self, Caption=caption)
             self.Bind(wx.EVT_BUTTON, self._onWxHit, button, idx)
             self._proxy_buttons.append(button)
             sizer.append1x(button)
             idx += 1
         self.__constructed = True
         self.layout()
         self._properties["NameBase"] = cName
         self._setNameAndProperties(self._properties, **kwargs)


class ItemList(dabo.ui.dListControl):
     def __init__(self, parent, properties=None, attProperties=None,
             *args, **kwargs):
         dabo.ui.dListControl.__init__(self, parent, properties=properties,
             attProperties=attProperties, *args, **kwargs)
         self.MultipleSelect = False
         self.HorizontalRules = False
         self.VerticalRules = False
         self.HeaderVisible = False

     def afterInit(self):
         self.setColumns(("",))
         self.autoSizeColumns()


class PagEditUsersGroups(PagEditBase):
     def createItems(self):
         sizer = self.Sizer
         sizer.DefaultBorder = 5
         gs = dabo.ui.dGridSizer(VGap=5, HGap=5, MaxCols=3)
         gs.append(dabo.ui.dLabel(self, Caption=u"Grupy użytkowników"))
         gs.appendSpacer(1)
         gs.append(dabo.ui.dLabel(self, Caption=u"Przynależność do grup"))
         gs.append(self.addObject(
             ItemList,
             "lstGroups",
             Height=300), "expand")
         gs.append(cCmdButtonGroup(self, buttons=(">", "<"),
             orientation="v", OnHit=self.onListAction))
         gs.append(self.addObject(
             ItemList,
             "lstUserGroups",
             Height=300), "expand")
         gs.append(cCmdButtonGroup(self, buttons=("1", "2"),
             orientation="h"))
         gs.append(cCmdButtonGroup(self, buttons=("3", "4"),
             orientation="h"))
         gs.append(cCmdButtonGroup(self, buttons=("5", "6"),
             orientation="h"))
         gs.setColExpand(True, (0, 2))
         sizer.append(gs, "expand")
         PagEditBase.createItems(self)

     def onListAction(self, evt):
         print "Hit!"
</code>

-- 
Regards
Jacek Kałucki

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to