Re: xControls How To
- Posted by Don <eunexus at yahoo.com> Jul 08, 2004
- 478 views
> What about something like this: > > manage( GMID, win_Floor, {0,4}, {0,224}, {win_Floor,164}, {1.0,-5} ) > manage( GMID, win_Floor, {0,4}, {0,224}, {win_Floor,164}, {win_Floor,132} ) > > This would apply a variable height relative to the parent control, > up to a maximum of 132. Hmm. I dont see how this would work as stated above. To me there seems to be a conflict. You will notice that: {win_Floor,164}, {win_Floor,132} Both of these look exactly alike so how can it be determined that you mean dynamically sticky instead of a constant height? > Or use a supplement... > > manage( GMID, win_Floor, {0,4}, {0,224}, {win_Floor,164}, {1.0,-5} ) > manage_max( win_Floor, 0, 132 ) -- width, height > > This enhances the library in a logical way. I do agree with this. If I do decide to add this in it would be either this way or devise a completely new syntax for the creation with backwards compatibility. > > Plus adding in this kind of > > functionality is A) quite easy as it is > > IMO, this goes against the purpose of the xControls library, which is > to automagically manage sizes and positions without having to use > extra code. Actually I disagree with this. Its intended purpose is to give people a simple interface to do simple windows management. The fact that it can also handle some complex management is a bonus. It is not (and was not) intended to be an "end all" solution. If it beyond the scope of this library to handle, it is probably complicated enough to warrant hard coding... > > and B) would muddy up the > > control creation syntax wise. > > Using the above syntax, I don't think it muddies it. No, actually it doesnt. The main reason I am hedging on this is that at the moment, the code is short, sweet, and to the point. Its a very basic loop which can run very fast with a minimal of overhead and almost no conditional branching. Which I actually find amazing considering how flexible it is. Basically it gets down to adding something like this would require alot of conditional checks and code. While it would make your application smaller and easier to read, for anyone not actually using this kind of window they would suffer a performance hit. > > I would just cut and paste the above routine right in your program > > as is. > > Yes, it works fine! > > > Of course, if a lot of people start screaming about this I > > will of course try and support it. > > Thanks, Don! IOU. :)