def _getConnection(self): return getattr(self, "_connection", None) def _setConnection(self, val): self._connection = val def _getCalendarLayout(self): return getattr(self, "_calendar_layout", "month") def _setCalendarLayout(self, val): self._calendar_layout = val assert val in ("month", "week") dabo.ui.callAfterInterval(10, self.updateLayout()) CalendarLayout = property(_getCalendarLayout, _setCalendarLayout, None, """Either "month" or "week".""") Connection = property(_getConnection, _setConnection, None, "Dabo dConnection instance.") if __name__ == "__main__": # If you want Sunday to be the first weekday, you need code like # the following commented lines in your application prior to # importing pmcalendar: #import calendar #calendar.setfirstweekday(6) dabo.dApp(MainFormClass=FrmCalendar).start()
gs.append(label, alignment=("top", "right") ) gs.append(objectRef, "expand") gs.append( (25, 1) ) gs.setColExpand(True, 1) mainSizer.insert(0, gs, "expand", 1, border=20) # Add top and bottom margins mainSizer.insert( 0, (-1, 10), 0) mainSizer.append( (-1, 20), 0) self.Sizer.layout() self.itemsCreated = True super(PagEditCategory, self).createItems() if __name__ == "__main__": from FrmCategory import FrmCategory app = dabo.dApp(MainFormClass=None) app.setup() class TestForm(FrmCategory): def afterInit(self): pass frm = TestForm(Caption="Test Of PagEditCategory", Testing=True) test = PagEditCategory(frm) test.createItems() frm.Sizer.append1x(test) frm.show() app.start()
self.pnlNavigation.setCaption(val) def _getConnection(self): return getattr(self, "_connection", None) def _setConnection(self, val): self._connection = val def _getCalendarLayout(self): return getattr(self, "_calendar_layout", "month") def _setCalendarLayout(self, val): self._calendar_layout = val assert val in ("month", "week") dabo.ui.callAfterInterval(10, self.updateLayout()) CalendarLayout = property(_getCalendarLayout, _setCalendarLayout, None, """Either "month" or "week".""") Connection = property(_getConnection, _setConnection, None, "Dabo dConnection instance.") if __name__ == "__main__": # If you want Sunday to be the first weekday, you need code like # the following commented lines in your application prior to # importing pmcalendar: #import calendar #calendar.setfirstweekday(6) dabo.dApp(MainFormClass=FrmCalendar).start()
# -*- coding: utf-8 -*- import dabo import wx if __name__ == "__main__": dabo.ui.loadUI("wx") class CklCategoriesBase(dabo.ui.dCheckList): def initProperties(self): self._needChoiceUpdate = True def updateChoices(self): self._needChoiceUpdate = False if self.Form.Testing: self.Choices = ("Test", "Appetizers", "Greens") self.Keys = (1, 2, 3) return self.Choices, self.Keys = self.Form.getCategoryChoicesAndKeys() def update(self): self.super() dabo.ui.callAfterInterval(200, self.doUpdate) def doUpdate(self): if self._needChoiceUpdate: self.updateChoices() class CklCategoriesSelect(CklCategoriesBase): def initProperties(self): self.super() self.Width = 200 self.Height = 250 self.FontSize = 7 self.SaveRestoreValue = True class CklCategoriesEdit(CklCategoriesBase):
def main(): app=dabo.dApp() app.MainFormClass = MainForm app.BasePrefKey = "projFrm" app.start()
def main(): app = dabo.dApp() app.MainFormClass = MainForm app.BasePrefKey = "testFrm" app.start()
#!/usr/bin/env python # -*- coding: utf-8 -*- import dabo dabo.ui.loadUI("wx") app = dabo.dApp() # IMPORTANT! Change app.MainFormClass value to the name # of the form class that you want to run when your # application starts up. app.MainFormClass = dabo.ui.dFormMain app.start()