Re: [Yact-dev] Source code
Status: Pre-Alpha
Brought to you by:
basic
|
From: Daniel B. <ba...@we...> - 2000-03-12 11:44:53
|
On Sat, Mar 11, 2000 at 04:08:42PM -0800, Marius Sundbakken wrote: > I did a few trivial changes to Yact. I have to get to know the code. Sounds like a good idea! > I tried to do a rubber band selector, but I got all confused by the > inputhandler/provider system. Oh. Well, it's pretty easy. The YInputHandler hierarchy is a state machine for the YDiagram class. To keep things a little bit separate, YDiagram implements the YInputProvider protocol, which is the only link the YInputHandler has to the world. The YInputHandler classes are singletons, which is why all the methods has a "client" parameter. In your case, what you need to do is to add some code in YIHUnactive, the mousePressed() method. Also, the YDiagram::m_currentView must be changed, as it only supports a single selected view right now. > Also, the indention used must be pretty unique. Why do you do this: > > int > foo; > > in the class headers? What's the rationale? Unfortunately, Emacs gets a > bit confused by such "indenting." The rationale is to keep minimize the number of lines that gets affected by a change. For methods, which can have rather long types (including "virtual" etc), it is also a way to get the method name into a place where it is easily spotted. For attributes it looks rather strange though, so I'm rewriting that. Which of course that Vim is a better and more intelligent editor than Emacs, as it has no problems with that indentation. *grin* > Personally I prefer to have the comments for memeber functions in the cpp > file, not in the header. I mean, I do all the work in the cpp files, not > in the header files, so to me, it makes little sense to have the comments > there. Is there a reason for having the comments in the header files? For me it's a way of keeping apart the difference between the interface and the documentation of _what_ the class does from the implementation and _how_ and _why_ it does it. The header file is the "contract" of the class, and as such, is a good place to put the documentation. It also makes it easier to write interface classes, and they have no .cpp file at all. ;) /Basic P.S. I knew that the "I agree with you" thing you pulled on me earlier was just a trick. :) D.S. |