since code (http://pastebin.com/kerp1Bat)might not display properly here so I pasted onto pastebin (http://pastebin.com/kerp1Bat)
the code is compatible with version below 2010 as floating window and Maya 2011 onwards as Docked to what convention I usually stick to while making my tools for maya... I agree with starks whats the point of floating windows when we can dock...
So in this code I made a BaseGUI class that has createUI method that has some common functionality in to which i call the method self.commonLayout() to which I add controls and a second method after commonLayout() into which I editTabsLayoutcontrol as per requirement.
I would really appreciate if you leave your comments and suggestion and any update you can make feel free,
I saved it as DockedGUI.py
and run this in maya script editor paste
from DockedGUI import BaseGUI