Sign in to follow this  
Followers 0
Skizmata

GUICtrlCreateDate Help Entry Possibly Inccorect

6 posts in this topic

#1 ·  Posted (edited)

I can't seem to figure out how to change the date displayed in a date control created with GUICtrlCreateDate(). In the help file there is a link to the function GUICtrlCreateDateGUICtrlUpdate() that doesn't seem to exist. I assumed that GUICtrlUpdate() was replaced by GUICtrlSetData() but it doesn't seem to work either.

Your help is much appreciated.

Thanks in advance.

Edited by Skizmata

AutoIt changed my life.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

"Date : The date or time depending the style of the control."

From GuiCtrlSetData.

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
;i

Example1()

; example1
Func Example1()
    Local $date, $msg

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
    $button_change = GuiCtrlCreateButton("Change this sucker!", 50, 150)
    GUISetState()

    ; Run the GUI until the dialog is closed
    Do
        $msg = GUIGetMsg()
        If $msg = $button_change Then GUICtrlSetData($date, Random(2000,2010,1) & "/" & Random(10,12,1) & "/" & Random(10,28,1))
    Until $msg = $GUI_EVENT_CLOSE

    MsgBox(0, "Date", GUICtrlRead($date))
    GUIDelete()
EndFunc   ;==>Example1

Read HelpFile more carefully :]

Edited by 4ggr35510n

Share this post


Link to post
Share on other sites

Thanks so much for the help. This was exactly what I needed.

Aside from the snarky "Read HelpFile more carefully :]" comment.

It would appear that the help file is incorrect and the line "To set or change information in the control see GUICtrlUpdate...." in GUICtrlCreateDate() should be a link to GUICtrlSetData() instead of GUICtrlUpdate(). I know this from a careful reading of the help file.


AutoIt changed my life.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

But inside GuiCtrlUpdate... chapter there was a link to GuiCtrlSetData.

What's more, you have even correctly assumed you need GUISD function, inside which you could find suitable paragraph.

I can't find 'snarky' in any dictionary, so I'll assume that it's a complement ;]

Glad I could help ;)

Edited by 4ggr35510n

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you would read your dictionary more carefully you would find it. You can find common usage here, http://www.merriam-webster.com/dictionary/snarky. Since I expect a snarky asshole to say some nonsense about online dictionaries I also found it in my print edition of "The Oxford Dictionary of English Etymology" (1966) on page 840 where it says it is of or relating to the imaginary animal in 'Lewis Carroll' (C.L. Dodgson)'s "The Hunting of the Snark".

Anyway, forums are the last vestige of this kind of back handed nonsense soon to be beat out entirely be systems like StackOverflow.com where credibility is built by getting the right answer (as you did) not by provoking more attention (as you also did). Forms foster condescension and arrogance among casual users to try to boost post count. When someone gives a good answer and does it like an arrogant jerk they are improving their odds of having another post to comment on. Since post count gets confused for creditability on these antiquated systems this is a self reinforcing mechanism that has always annoyed me.

Thanks for the help you are very much correct. I don't think I will help bolster your post count any further.

Edited by Skizmata

AutoIt changed my life.

Share this post


Link to post
Share on other sites

Thanks so much for the help. This was exactly what I needed.

Aside from the snarky "Read HelpFile more carefully :]" comment.

It would appear that the help file is incorrect and the line "To set or change information in the control see GUICtrlUpdate...." in GUICtrlCreateDate() should be a link to GUICtrlSetData() instead of GUICtrlUpdate(). I know this from a careful reading of the help file.

I don't think the helpfile is wrong, just poorly worded there as "information" implies the data. What they mean is "update an aspect of the control" whether it be the color, text, data, whatever of the control.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0