Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTDateTimeCtrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTDateTimeCtrl

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: CXTDateTimeCtrl
    Posted: 25 February 2008 at 7:58pm
Hi all
 
I'm struggling with what should be the simple task of using CXTDateTimeCtrl to edit a duration (delay) value.  I want to be able to edit delays from 0s to 1day in HH:MM:SS format, but the format specifiers for the control don't even have SS option, and it seems to use GMT -> local time conversion so I'm getting garbage.
 
Is there an easier way?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2008 at 12:40am
hi,
 
use SetFormat method. See DTM_SETFORMAT in MSDN
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2008 at 1:28am
yep, I read that.
 
Problem is CTime offsets everything to a GMT time, so my numbers are starting with my timezone, i.e. I enter 60 (being seconds), and I get back 01:01:00 in the control.  I set the range from CTime(0) to CTime(24*60*60), but the actual range goes from 1am to 11am only.
 
What would be great would be a dedicated CDurationCtrl.
 
I looked at Mask edit as well, but it's not suited to time values, since all numerics are 0-9, which is no good for minutes, seconds etc.
 
Maybe should extend the mask edit format specifier to allow sub-ranges, i.e. instead of mask of 00:00:00, you could have
 
02d[0-24]:02d[0-59]:02d[0-59]
 
or some regex expression for validation.  Otherwise I guess it's time to handle control feedback messages and do my own input validation.
Back to Top
rsvihalek View Drop Down
Groupie
Groupie


Joined: 21 August 2009
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote rsvihalek Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2009 at 9:36am
Hello everybody,
I need to edit duration (= delay) too, is there any simple way to do that with the XTremeToolkit Pro?

Thank you for the reply
Back to Top
rsvihalek View Drop Down
Groupie
Groupie


Joined: 21 August 2009
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote rsvihalek Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2009 at 12:22pm
So I've found solution, the time has to be set using SYSTEMTIME structure - it is working properly for delay values without any conversion
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.