src/icon.cpp

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) 2006 by Kirill Kolodyazhniy.
00003 * See the file "license.terms" for information on usage and redistribution
00004 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00005 */
00006 
00007 #include "stdinc.h"
00008 #include "icon.h"
00009 #include "exception.h"
00010 namespace MWidgets
00011 {
00012         /*******************************************************************************/
00013         Icon::Icon()
00014         {
00015                 m_hIcon=NULL;
00016         };
00017         /*******************************************************************************/
00018         void Icon::Load(std::string fileName)
00019         {
00020                 if(!m_hIcon)
00021                         m_hIcon=(HICON)LoadImage(NULL,fileName.c_str(),IMAGE_ICON,0,0,LR_LOADFROMFILE);
00022                 else
00023                         EXCEPT("Icon::Load - icon ovveride!");
00024         };
00025         /*******************************************************************************/
00026         void Icon::Free()
00027         {
00028                 if(m_hIcon)
00029                         DestroyIcon(m_hIcon);
00030                 m_hIcon=NULL;
00031         };
00032         /*******************************************************************************/
00033         Icon::~Icon()
00034         {
00035                 if(m_hIcon)
00036                         DestroyIcon(m_hIcon);
00037         };
00038         /*******************************************************************************/
00039         HICON Icon::GetHICON()
00040         {
00041                 return m_hIcon;
00042         };
00043         /*******************************************************************************/
00044 };

Generated on Thu Oct 26 13:47:45 2006 for MWidgets by  doxygen 1.4.7