Saturday, January 14, 2017

AnchorX

I decided to revisit my AnchorSizer class because basically I just dragged the old ssAnchorSizer from ssClasses then dropped it to my ssUltimate library, and simply renamed it (as well as GridSort and GridLock).  My focus back then is on other new classes I was planning to make for ssUltimate and so I simply moved those ones there.

Today though, I decided to revisit my codes there... and I winced, LOL!  And shuddered too, which is what we normally experience for the sheer horror of seeing our old codes after learning better ones.  Anyway, I cannot simply remove that AnchorSizer anymore as others may be using those already plus while I do not like (now) the codes I used there and the way I manipulate resizing, those nevertheless work good on the resizing need.

So instead I created a new and better Sizer class for the insides of listbox, combobox and grid and named it simply as AnchorX.  So what has been changed here?

1.  Binding from anywhere on form.  Unlike its ancestors ssAnchorSizer (for ssClasses) and AnchorSizer (for ssUltimate) which has a rule that the class should be on the same container as that of the object(s) that will be bound to it, this one can be bound to object(s) from anywhere within the form, no matter how deep it is.

2.  Simplified codings.  No more Macro Substitutions (Ewwww!).  Shorter codes.  Reduced number of class properties needed to bare essentials.

3.  More precise calculations for resizing especially on grid.  Whereas before, I have to force adjust the last column, this one does a real accurate resizing based on original column widths plus your grid setup (are DeleteMark, RecordMark and Scrollbar shown or not?).

4.  Fixed problem on column naming on Grid.  It won't care anymore on the names of columns plus its position/order.

5.  No more extra call for its _Resize() method.  The class now binds itself on form's resize.  

6.  Simplified calls straightly referencing the actual objects.  This is only what we all need now:

* On combobox init:
Thisform.AnchorX1._cbo = this

* On grid init:
Thisform.AnchorX1._grd = this

* On listbox init:
Thisform.AnchorX1._lst = this


I urge my subscribers to replace AnchorSizer with AnchorX on their forms so I can totally remove that old class later from within the library.  That of course will happen pending their later confirmation to me that I can then safely remove that...that AnchorSizer.

See what's on ssUltimate now:  http://sandstorm36.blogspot.com/2015/12/whats-on-ssultimate-library.html

No comments:

Post a Comment