All you need to do is make a view with cels for the button's border and draw it with a loop. If the button is 40 pixels wide and you use a 4 pixel cel, the loop would go from 0 to 9, for example.
You use the left, right, top, bottom properties to draw it.
It involves a lot of size calculation/size adjustment to get it all right.
I'll do a tutorial soon. However, they take a long time to do. Each take far longer to make than they take to read/learn.
The reason I never released a tutorial or the source (except to a few people) is because I personally think the game is more important the window/button styles, and want to see people making games

I didn't create the custom UI from disassembling Sierra's code. It's all very very simple code that just took me a few minutes to think up/plan out. All it involves is drawing some cels and displaying some text at the right coordinates.