Custom Controls |
Post Reply |
Author | |
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
Posted: 15 March 2011 at 6:09am |
I opened this for anyone who would like to share their custom controls starting with HH:MM ...
class CControlEditHHMMCtrl : public CXTPMaskEditT<CXTPControlEditCtrl> { public: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); DECLARE_MESSAGE_MAP() }; class CControlEditHHMM: public CXTPControlEdit { DECLARE_XTP_CONTROL(CControlEditHHMM) public: CXTPControlEditCtrl* CreateEditControl() { return new CControlEditHHMMCtrl(); } }; BEGIN_MESSAGE_MAP(CControlEditHHMMCtrl, CXTPMaskEditT<CXTPControlEditCtrl>) ON_MASKEDIT_REFLECT() ON_WM_CREATE() END_MESSAGE_MAP() IMPLEMENT_XTP_CONTROL(CControlEditHHMM, CXTPControlEdit) int CControlEditHHMMCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { SetEditMask(_T("00:00"), _T("__:__"), _T("00:00")); return CXTPMaskEditT<CXTPControlEditCtrl>::OnCreate(lpCreateStruct); } < id="gwProxy" ="">< ="jsCall;" id="jsProxy" =""> |
|
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
how do I limit HH to 0-23 and MM to 0-59 ?< id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hi;
Take a look at boost::regex! I solved it this way:
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
ok thanks, something like that would be useful in CXTPMaskEdit? instead I handled
BOOL CControlEditHHMMSSCtrl::CheckChar(TCHAR& nChar, int nPos) to check characters |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |