On Tuesday 04 December 2007 07:18:39 am Nate Lowrie wrote: > > > > > > It's not being lazy by any means. It is just being more productive. 8) > Is that what you tell your employer ;-) > > Note here that you can write this as: > > Vsizer.append(dabo.ui.dButton(self, Caption='Button'),1,'x') > > or > > Vsizer.append(dabo.ui.dButton(self, Caption='Button'),'x',1) > > Dabo will automatically switch the arguments if you have them in the > wrong order. > > > Note that OnHit is generally the controls main event. On a button > that means when it is pressed. On a list control it is when a list > item is selected. On a dTextBox it is when you enter text and hit the > enter key. It is a convenient thing to know. If you need specific > events, for instance on mouse over, then you can bind them with > bindEvent. However, only the Hit event may be bound from the control > instantiation.
That's very good point - it can become confusing for newbie's. But when we get into bizobjects we'll set a few more properties and hopefully you will again expand on what is said. > > I also want to let you in on another trick if you use RegIDs... > > Let's take the line > "hs.append(dabo.ui.dButton(self,RegID="selectButton",Caption= > "...",0)" > > Since you declared a RegID, the Hit event is automatically bound to a > method on the form called onHit_selectButton. You can do this with > other events too I do believe. If the methods aren't present, no big > deal, but if they are they will be called. Note they have to reside > in the form class. Saves some code but can be very confusing if you > don't know what is going on. > OK now I'm learning something - I did not know I could do that!!!!! > > Why the evt.stop()? > Actually, Ed brought that up too. First why not stop it - I don't need it any longer? The history - Larry and I were tracing a problem one day and discovered that the evt was firing a method. I don't recall which method (maybe Larry does). I do recall that I thought it was the right thing to happen but was interfering with our debuging. So I decided that I should stop any event after it did it job. > > On one last note, I think that you should make the dTextBox read only. > Coming from a correct code standpoint, if the users are entering the > dTextBox value through the dFileDialog, you should never want them to > type in the dTextBox directly. Makes error checking easier because > you only have to check for NULL and if the file is still there. I am > nit-picking, but it makes for good code. > > Cheers, > > Nate L. Your right! I'll add it for the next installment. -- John Fabiani _______________________________________________ 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/dabo-users/[EMAIL PROTECTED]
