Code Reuse: A Good Thing #

clip2icns/icns class: spent the day (well, evening) converting clip2icns to use the icns class. I've written two new functions for the class, ImportFromClipboard and SaveToFile, and used those to replace the core of c2i's core. Now it's much neater (down to 10 lines from 4 pages) and the code is reusable (as a matter of fact I'm using the ImportFromClipboard code in the dialog preview too, so I've removed some redundant code). This seems to prove that the class is scaling OK (it started as a simple display class) so adding editing capabilities to it shouldn't be that hard. However, I don't know how specific to make it for editing. In one extreme I could just add SetPixel and GetPixel functions, and write the actual editor as a program which makes calls to the class. In the other extreme I could embed everything in the class, and make each new editing window a new instance of it. But that's still a while away.

Post a Comment