00001 #if !defined( __XEDITBOX_H__ ) 00002 #define __XEDITBOX_H__ 00003 00004 namespace Ars 00005 { 00006 class XEditBox : public XBox { 00007 private: 00008 00009 unsigned int m_SelStart; 00010 int m_SelLength; 00011 unsigned int m_DragStart; 00012 mutable int m_ScrollOffset; 00013 bool m_bReadOnly; 00014 bool m_bMouseDown; 00015 bool m_bPassBox; 00016 bool m_bLastMouseMoveInside; 00017 00018 public: 00022 XEditBox( void ); 00023 00025 ~XEditBox( void ); 00026 00027 virtual const bool SetupWindow( const Message &msg ); 00028 00030 virtual void Draw(void); 00031 00034 void SetPassBox( const bool bPassBox ) { m_bPassBox = bPassBox; } 00035 00037 const bool IsPassBox(void) const { return m_bPassBox; } 00038 00041 void SetReadOnly(const bool bReadOnly); 00042 00044 const bool IsReadOnly(void) { return m_bReadOnly; } 00045 00048 virtual void SetWndText( const std::string &sText ); 00049 00051 std::string GetSelText(void); 00052 00053 protected: 00054 00058 void SelDelete(std::string* psString); 00059 00060 virtual const bool evMouseButtonDown( const MouseMessage &msg ); 00061 virtual const bool evMouseButtonUp( const MouseMessage &msg ); 00062 virtual const bool evMouseMove( const MouseMessage &msg ); 00063 virtual const bool evKeyDown( const KeyboardMessage &msg ); 00064 }; 00065 00066 } 00067 00068 #endif