Example #1
0
	def _afterInit(self):
		#self.Value = datetime.date.today()  ## no, don't set default, it could override val. in db.
		if not self.Value:
			self.update()  ## First try to get it from the db
		if not self.Value and self.Value is not None:
			self.Value = None  ## If it is still blank, default to None so the control works correctly
		if self.showCalButton:
			# Create a button that will display the calendar
			self.calButton = dButton(self.Parent, Size=(self.Height, self.Height),
					Right=self.Right, Caption="V")
			self.calButton.Visible = True
			self.calButton.bindEvent(dEvents.Hit, __onBtnClick)

		# Tooltip help
		self._defaultToolTipText = _("""Available Keys:
=============
T : Today
+ : Up One Day
- : Down One Day
[ : Up One Month
] : Down One Month
M : First Day of Month
N : Clear the date
H : Last Day of montH
Y : First Day of Year
R : Last Day of yeaR
C: Popup Calendar to Select
""")
		self.DynamicToolTipText = lambda: {True: self._defaultToolTipText,
				False: None}[self.Enabled and not self.ReadOnly]

		super(dDateTextBox, self)._afterInit()
Example #2
0
 def afterInit(self):
     ms = self.Sizer = dabo.ui.dBorderSizer(self, "v", DefaultBorder=5)
     self.gauge = dGauge(self, Size=(75, 12))
     lblTitle = dLabel(self, Name="lblTitle", Caption="", FontBold=True)
     butCancel = dButton(self,
                         Name="butCancelReportProgress",
                         CancelButton=False,
                         Caption="Cancel",
                         Enabled=False,
                         OnHit=self.onCancel)
     ms.append(lblTitle)
     ms.append(self.gauge, "expand")
     ms.append(butCancel, alignment="right")
     self.Visible = False
Example #3
0
 def afterInit(self):
     ms = self.Sizer = dabo.ui.dBorderSizer(self, "v", DefaultBorder=5)
     self.gauge = dGauge(self, Size=(75, 12))
     lblTitle = dLabel(self, Name="lblTitle", Caption="", FontBold=True)
     butCancel = dButton(
         self,
         Name="butCancelReportProgress",
         CancelButton=False,
         Caption="Cancel",
         Enabled=False,
         OnHit=self.onCancel,
     )
     ms.append(lblTitle)
     ms.append(self.gauge, "expand")
     ms.append(butCancel, alignment="right")
     self.Visible = False
Example #4
0
    def _afterInit(self):
        #self.Value = datetime.date.today()  ## no, don't set default, it could override val. in db.
        if not self.Value:
            self.update()  ## First try to get it from the db
        if not self.Value and self.Value is not None:
            self.Value = None  ## If it is still blank, default to None so the control works correctly
        if self.showCalButton:
            # Create a button that will display the calendar
            self.calButton = dButton(self.Parent,
                                     Size=(self.Height, self.Height),
                                     Right=self.Right,
                                     Caption="V")
            self.calButton.Visible = True
            self.calButton.bindEvent(dEvents.Hit, __onBtnClick)

        # Tooltip help
        self._defaultToolTipText = _("""Available Keys:
=============
T : Today
+ : Up One Day
- : Down One Day
[ : Up One Month
] : Down One Month
M : First Day of Month
N : Clear the date
H : Last Day of montH
Y : First Day of Year
R : Last Day of yeaR
C: Popup Calendar to Select
""")
        self.DynamicToolTipText = lambda: {
            True: self._defaultToolTipText,
            False: None
        }[self.Enabled and not self.ReadOnly]

        super(dDateTextBox, self)._afterInit()