00001 /* Crown and Cutlass 00002 * Crown and Cutlass ListBox Class 00003 */ 00004 00005 #include "../Callback.h" 00006 #include "../Log.h" 00007 #include <guichan.hpp> 00008 #include "CCListBox.h" 00009 00010 CCListBox::CCListBox(gcn::ListModel *listModel, cCallback *recallFunction): 00011 gcn::ListBox(listModel) { 00012 Log::s_log->DebugMessage("Creating CCListBox"); 00013 m_callback = recallFunction; 00014 00015 setEnabled(true); 00016 } 00017 00018 void CCListBox::mousePress(int x, int y, int button) { 00019 if (button == gcn::MouseInput::LEFT && hasMouse()) 00020 { 00021 setSelected(y / getFont()->getHeight()); 00022 m_callback->Execute(0); 00023 } 00024 }
1.4.7