this is to thank dale on his contribution of his sizer2 class and to extend it a little bit to include grid columns resizing as well.  i found this class very useful so i want to put a spotlight to this one.  dale, you have done an excellent job on this one! cool [h]

yesterday, i saw erik gomez' post about preview query and following the link to his blog is where i found a link on free silk icons created
by mark james which is ideal for treeview, and imho is better than the icons i use before. it is also while reading erik's blog is when i saw the link to dale's resizer class.

last time, russel hill asked about a resizer class inside the forum and since i am not using any, i gave him a screen resolution adjuster instead (combining ideas i glimpsed from yousfi benameur and bushan sahni).  but it left me thinking, maybe i should limit my own form's gui so i can resort to resizing as well.  and since there is a new request for me to help my new employer, i fished out my old bbgsoft and decided to create a new one out of it, this time, with resizing capability. 

tushar likewise said he is using anchoring which is good for resizing forms and objects.  but if you use dale's sizer2 class, do not touch anchoring anymore as the sizer will do the computations and anchoring (less job for us) itself.  assigning anchoring ourselves while using dale's sizer will result to unwanted output.

as i have said, i
downloaded dale's sizer2 class and tried it immediately.  it works to my
satisfaction that i decided to implement it outright.  the only thing, afaik,
that dale left is the resizing of the grid itself.  it resizes the grid
but not the columns. 

so for grid resizing to work properly, place these commands:

grid init event:
this.addproperty("origwidth",this.width)

grid resize event:
local lnloop
for lnloop = 1 to this.columncount
    this.columns(m.lnloop).width = (this.columns(m.lnloop).width/this.origwidth)* (this.width) + 3  && play with the plus
next

and that will fix the problem on grid resizing. 

and here is the result of resizing using dale's sizer2 class, extended with grid column's resizing capability.  i am still using my style in my blog i called "ala silverlight", now on a wide format, windowstate = 2 - maximized:

here is the standard size of the purchase order reprinting module:


and here it is using dale's sizer2 class plus the grid columns' resizing trick above:

you may download the sizer2 class here.

One Response to Extending Dale Dedoroy’s Sizer2 class

  • loo peng says:

    Hi mr. Jun,

    How to make the tree view just like your ErgoX Solution?

    I also want to implement the tree view that display all the form.

    Can you teach me?

    please reply me in the private mail, kinki_2046@hotmail.com

    Thanks.

    Regard,

    loo peng

Leave a Reply

Your email address will not be published. Required fields are marked *