logo
Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related

Label.cpp

00001 //
00002 //  SYNTOPIA. See http://Syntopia.sourceforge.net for details and documentation.        
00003 //
00004 //      Author of this file: Mikael Hvidtfeldt Christensen (mikaelc@users.sourceforge.net)
00005 //
00006 
00007 
00008 
00009 #include "Label.h"
00010 
00011 namespace GUIToolkit {
00012 
00013 Label::Label(std::string s) {
00014         myLabel = s;
00015 }
00016 
00017 Label::~Label() {
00018 }
00019 
00020 
00021 void Label::PutInWinForm(WinForm * WF, int x0, int x1, int y0, int y1) {
00022             ID = (HMENU)GUIControl::GUIInstance->Register(this);
00023                 topWF = WF;
00024 
00025         hLabel = CreateWindowEx(NULL, "STATIC", myLabel.c_str(),  WS_CHILD | WS_EX_TRANSPARENT | WS_VISIBLE  ,
00026             x0, x1,y0 ,y1, WF->hwnd, ID, GetModuleHandle(NULL),  NULL);
00027 
00028                 if(hLabel == NULL) {
00029             MessageBox(WF->hwnd, "Could not create Label.", "Error", MB_OK | MB_ICONERROR);
00030                         // Todo: Should Throw Error
00031                 }  
00032 
00033                 
00034 }
00035 
00036 
00037 }; // end of namespace
00038 

Syntopia Project. Visit the web page, or the SourceForge page.
Docs made by Doxygen. Email: Mikael Christensen