joemol

GUI DateTimePicker: Spurious white space in LONGDATE mode

15 posts in this topic

Hello everyone,

I have created a DTP control using the example from _GUICtrlDTP_Create help page. I would like to display a date as, for example, "Thursday: August 15, 2013". I issue the following command,

_GUICtrlDTP_SetFormat( $hDTP, "dddd':' MMMM dd, yyyy" )

The control is created and works fine. The calendar dates are picked and displayed in the edit box and if I do a

$sDate = ControlGetText( $hDTP, "", "" )

the string is well formatted. However, in the edit box itself I get spurious white space as follows. (Underscores show spaces.)

"_Thursday_ : _August_  15, 2013"

In fact the long form of the month name and weekday are centered in a fixed length field with spaces padding both ends so 'Monday', for example, has two spaces added at each end.

I have corrected this using the ControlGetText() and _GUICtrlDTP_SetFormat() in the message loop and $DTN_DATETIMECHANGE case handler, but this is an ugly, nasty and possibly dangerous way to fix a simple trim function.

; Loop until user exits
    Do
        _GUICtrlDTP_SetFormat( $hDTP, "'" & ControlGetText( $hDTP, "", "" ) & "'")
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

.....

    Case $DTN_DATETIMECHANGE ; Sent by a date and time picker (DTP) control whenever a change occurs
        _GUICtrlDTP_SetFormat($hDTP, "dddd: MMMM d, yyyy")
        $tInfo = DllStructCreate($tagNMDATETIMECHANGE, $ilParam)
        Return 0

Questions:

1. How can I get the date picker to stop putting white space around the long form text?

2. If I can't, can anyone suggest a better way to strip the spaces.

3. If I have to leave it as is, can anyone tell me if, in their opinion, I am playing with fire e.g. recursive message generation, or if what I'm doing seems OK.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

take a look at StringStripWS("",7)

i never noticed the padding, but you seem right on this

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

have you tried

GuiCtrlRead or

_GUICtrlDTP_GetSystemTime  ==> no doesn't return the weekday

instead of ControlGetText ?

would be nice to see your script. makes it easier to help

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

Thanks Edano but I think I may not have made myself clear. I have no problem reading the text. The ControlGetText call returns the correct text and I don't have to strip anything from it.

The problem is that the date picker DISPLAYS spurious white space. It looks very, very unprofessional and I am reluctant to present this to my client unless I have no alternative.

The code is a bit long, mostly from the help page, but here goes. This is the version which displays correct text. Comment out the three lines with the ;**** to see the problem.

#include <GUIConstantsEx.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

$Debug_DTP = False ; Check ClassName being passed to DTP functions, set to True and use a handle to another control to see it work

Global $hDTP

_Main()

Func _Main()
    Local $hGUI

    ; Create GUI
    $hGUI = GUICreate("(UDF Created) DateTimePick Create", 400, 300)
    $hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 250 )
    GUISetState()

    ; Set the display format
    _GUICtrlDTP_SetFormat($hDTP, "dddd':' MMMM d, yyyy")
    _GUICtrlDTP_SetFormat($hDTP, "'" & ControlGetText( $hDTP, "", "" ) & "'")   ;****

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

    ; Loop until user exits
    Do
        _GUICtrlDTP_SetFormat( $hDTP, "'" & ControlGetText( $hDTP, "", "" ) & "'")  ;****
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    GUIDelete()
EndFunc   ;==>_Main

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo, $tBuffer, $tBuffer2

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")

    Switch $hWndFrom
        Case $hDTP
            Switch $iCode
                Case $DTN_CLOSEUP ; Sent by a date and time picker (DTP) control when the user closes the drop-down month calendar
                    ; The return value for this notification is not used

                Case $DTN_DATETIMECHANGE ; Sent by a date and time picker (DTP) control whenever a change occurs
                    _GUICtrlDTP_SetFormat($hDTP, "dddd: MMMM d, yyyy")  ;****
                    $tInfo = DllStructCreate($tagNMDATETIMECHANGE, $ilParam)
                    Return 0

                Case $DTN_DROPDOWN ; Sent by a date and time picker (DTP) control when the user activates the drop-down month calendar
                    ; The return value for this notification is not used

                Case $DTN_FORMAT ; Sent by a date and time picker (DTP) control to request text to be displayed in a callback field
                    $tInfo = DllStructCreate($tagNMDATETIMEFORMAT, $ilParam)
                    $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format"))
                    $tBuffer2 = DllStructCreate("char Display[64]", DllStructGetData($tInfo, "pDisplay"))
                    Return 0

                Case $DTN_FORMATQUERY ; Sent by a date and time picker (DTP) control to retrieve the maximum allowable size of the string that will be displayed in a callback field
                    $tInfo = DllStructCreate($tagNMDATETIMEFORMATQUERY, $ilParam)
                    $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format"))
                    DllStructSetData($tInfo, "SizeX", 64)
                    DllStructSetData($tInfo, "SizeY", 10)
                    Return 0

                Case $DTN_USERSTRING ; Sent by a date and time picker (DTP) control when a user finishes editing a string in the control
                    $tInfo = DllStructCreate($tagNMDATETIMESTRING, $ilParam)
                    $tBuffer = DllStructCreate("char UserString[128]", DllStructGetData($tInfo, "UserString"))
                    Return 0

                Case $DTN_WMKEYDOWN ; Sent by a date and time picker (DTP) control when the user types in a callback field
                    $tInfo = DllStructCreate($tagNMDATETIMEFORMATQUERY, $ilParam)
                    $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format"))
                    Return 0

            EndSwitch
        EndSwitch

        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY
 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

i don't know if you noticed it, but as soon as you use

_GUICtrlDTP_SetFormat($hDTP, "'" & ControlGetText( $hDTP, "", "" ) & "'")

.

the timer picker stops working, won't change the date anymore.

so this seems a bad idea

edit: i think i have a solution. wait a min

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

okay this is a dirty and quick workaround, and you will have to adjust some things, but the basic idea is clear:

.

;http://www.autoitscript.com/forum/topic/153297-gui-datetimepicker-spurious-white-space-in-longdate-mode/#entry1103120
;Post #4
;D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\SLICER\Avatar\default_large.png
;by joemol

;Script grabbed by SLICER by Edano here: http://www.autoitscript.com/forum/topic/152402-slicer-autoit-forum-script-grabber/?p=1093575

#include <GUIConstantsEx.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

$Debug_DTP = False ; Check ClassName being passed to DTP functions, set to True and use a handle to another control to see it work

Global $hDTP,$Updated

_Main()

Func _Main()
    Local $hGUI

    ; Create GUI
    $hGUI = GUICreate("(UDF Created) DateTimePick Create", 400, 300)
    $hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 250 )
    GUISetState()

    ; Set the display format
    _GUICtrlDTP_SetFormat($hDTP, "dddd':' MMMM d, yyyy")
   ; _GUICtrlDTP_SetFormat($hDTP, "'" & ControlGetText( $hDTP, "", "" ) & "'")   ;****

$edit=GUICtrlCreateInput("",4, 10, 228,16,0,0) ;    ======> borderless style

   GUICtrlSetData ($edit, "'" & ControlGetText( $hDTP, "", "" ) & "'")   ;****

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

    ; Loop until user exits
    Do
        If $Updated=1 Then
            GUICtrlSetData ($edit, "'" & ControlGetText( $hDTP, "", "" ) & "'")  ;****
            $Updated=0
        EndIf
        ;_GUICtrlDTP_SetFormat( $hDTP, "'" & ControlGetText( $hDTP, "", "" ) & "'")  ;****
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    GUIDelete()
EndFunc   ;==>_Main

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo, $tBuffer, $tBuffer2

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hDTP
            Switch $iCode
                Case $DTN_CLOSEUP ; Sent by a date and time picker (DTP) control when the user closes the drop-down month calendar
                    _DebugPrint("$DTN_CLOSEUP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    $Updated=1
                    ; The return value for this notification is not used
                Case $DTN_DATETIMECHANGE ; Sent by a date and time picker (DTP) control whenever a change occurs
                    $tInfo = DllStructCreate($tagNMDATETIMECHANGE, $ilParam)
                    _DebugPrint("$DTN_DATETIMECHANGE" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _
                            "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _
                            "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _
                            "-->Flag:" & @TAB & DllStructGetData($tInfo, "Flag") & @LF & _
                            "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _
                            "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _
                            "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _
                            "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _
                            "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _
                            "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _
                            "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _
                            "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond"))
                    $Updated=1
                    Return 0
                Case $DTN_DROPDOWN ; Sent by a date and time picker (DTP) control when the user activates the drop-down month calendar
                    _DebugPrint("$DTN_DROPDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; The return value for this notification is not used
                     $Updated=1
               Case $DTN_FORMAT ; Sent by a date and time picker (DTP) control to request text to be displayed in a callback field
                    $tInfo = DllStructCreate($tagNMDATETIMEFORMAT, $ilParam)
                    $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format"))
                    $tBuffer2 = DllStructCreate("char Display[64]", DllStructGetData($tInfo, "pDisplay"))
                    _DebugPrint("$DTN_FORMAT" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _
                            "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _
                            "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _
                            "-->Format:" & @TAB & DllStructGetData($tBuffer, "Format") & @LF & _
                            "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _
                            "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _
                            "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _
                            "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _
                            "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _
                            "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _
                            "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _
                            "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond") & @LF & _
                            "-->Display:" & @TAB & DllStructGetData($tBuffer2, "Display"))
                     $Updated=1
                   Return 0
                Case $DTN_FORMATQUERY ; Sent by a date and time picker (DTP) control to retrieve the maximum allowable size of the string that will be displayed in a callback field
                    $tInfo = DllStructCreate($tagNMDATETIMEFORMATQUERY, $ilParam)
                    $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format"))
                    _DebugPrint("$DTN_FORMATQUERY" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _
                            "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _
                            "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _
                            "-->Format:" & @TAB & DllStructGetData($tBuffer, "Format") & @LF & _
                            "-->SizeX:" & @TAB & DllStructGetData($tInfo, "SizeX") & @LF & _
                            "-->SizeY:" & @TAB & DllStructGetData($tBuffer2, "SizeY"))
                    DllStructSetData($tInfo, "SizeX", 64)
                    DllStructSetData($tInfo, "SizeY", 10)
                    Return 0
                Case $DTN_USERSTRING ; Sent by a date and time picker (DTP) control when a user finishes editing a string in the control
                    $tInfo = DllStructCreate($tagNMDATETIMESTRING, $ilParam)
                    $tBuffer = DllStructCreate("char UserString[128]", DllStructGetData($tInfo, "UserString"))
                    _DebugPrint("$DTN_USERSTRING" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _
                            "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _
                            "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _
                            "-->UserString:" & @TAB & DllStructGetData($tBuffer, "UserString") & @LF & _
                            "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _
                            "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _
                            "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _
                            "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _
                            "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _
                            "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _
                            "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _
                            "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond") & @LF & _
                            "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags"))
                     $Updated=1
                   Return 0
                Case $DTN_WMKEYDOWN ; Sent by a date and time picker (DTP) control when the user types in a callback field
                    $tInfo = DllStructCreate($tagNMDATETIMEFORMATQUERY, $ilParam)
                    $tBuffer = DllStructCreate("char Format[128]", DllStructGetData($tInfo, "Format"))
                    _DebugPrint("$DTN_WMKEYDOWN" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _
                            "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _
                            "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _
                            "-->VirtKey:" & @TAB & DllStructGetData($tInfo, "VirtKey") & @LF & _
                            "-->Format:" & @TAB & DllStructGetData($tBuffer, "Format") & @LF & _
                            "-->Year:" & @TAB & DllStructGetData($tInfo, "Year") & @LF & _
                            "-->Month:" & @TAB & DllStructGetData($tInfo, "Month") & @LF & _
                            "-->DOW:" & @TAB & DllStructGetData($tInfo, "DOW") & @LF & _
                            "-->Day:" & @TAB & DllStructGetData($tInfo, "Day") & @LF & _
                            "-->Hour:" & @TAB & DllStructGetData($tInfo, "Hour") & @LF & _
                            "-->Minute:" & @TAB & DllStructGetData($tInfo, "Minute") & @LF & _
                            "-->Second:" & @TAB & DllStructGetData($tInfo, "Second") & @LF & _
                            "-->MSecond:" & @TAB & DllStructGetData($tInfo, "MSecond"))
                    $Updated=1
                    Return 0
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc   ;==>_DebugPrint

.

Edit: added borderless input style

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

you can still improve the idea by putting a real child gui with only the input on top of the edit of the picker.

cheers E.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

Thank you Edano. I find that my date picker continues to work even after it hits the ControlGetText. (I'm running Win7 64 Ultimate by the way). However I will try your method with the child gui tomorrow and let you know.

It's just coming up to 1.30 a.m. here and I'm due to the office at 8.30. Been at it since 6 a.m. so I think I will give it a rest for now.

Thanks again. Much appreciated!

Share this post


Link to post
Share on other sites

yep


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

I have a much smaller solution, which works well. I incorporated it in my project and had the data entry people test it all day. I added extra features e.g. blocking invalid dates and having TODAY and YESTERDAY as the date pick. I will post the whole thing tomorrow.

Thank you Edano. I have saved your code snippet so I can use it when I need a border-less overlay.

Here is the test code.

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <GuiDateTimePicker.au3>

Local $sDate

$hGUI = GUICreate( "Test", 220, 160 )
$date = GUICtrlCreateDate( "", 10, 20, 200, 20 )
$hDate = ControlGetHandle( "Test", "", $date )
$hLabel1 = GUICtrlCreateLabel( "", 10,  50, 100, 20 )
$hButton = GUICtrlCreateButton( "Display", 70, 95, 80, 30 )

GUISetState()

_GUICtrlDTP_SetFormat( $hDate, "dddd':' MMMM d, yyyy" )
_GUICtrlDTP_SetFormat( $hDate, "'" & ControlGetText( $hDate, "", "" ) & "'" )

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
        Exit
        Case $hButton
        $aDate = _GUICtrlDTP_GetSystemTime( $hDate )
        $sDate =  $aDate[ 2 ] & '/' & $aDate[ 1 ] & '/' & $aDate[ 0 ]
        GUICtrlSetData( $hlabel1, $sDate )
    Case $date
        _GUICtrlDTP_SetFormat( $hDate, "dddd':' MMMM d, yyyy" )
        _GUICtrlDTP_SetFormat( $hDate, "'" & ControlGetText( $hDate, "", "" ) & "'" )
    EndSwitch
WEnd
1 person likes this

Share this post


Link to post
Share on other sites

astonishing, but it works and looks perfect. forget my workaround.

how did you come to this solution, to change the format in this way ? simple trying ? it's not logical.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

I'm happy you like it and even happier that it's now in production at my client's radiology practice.

I would like to claim credit for it but actually I based this code on the example I found in the help page on GUICtrlCreateButton. Desperation is the real mother of invention!

Anyway, here is the test code reworked with some bells and whistles.

1. It correctly formats the long date in the edit box, as above

2. It shows "TODAY" if today's date is selected and "YESTERDAY" for the day before. I am adding two buttons for Today and Yesterday to the dialog as these cover 90% of my client's needs. But the 10% is still important.

3. It shows "Invalid Date" for any future date and blocks the return until a valid date is selected. (There are no post-dated images. You can't look at X-ray or MRI studies which haven't been done yet!)

I hope it's of some help to others.

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <GuiDateTimePicker.au3>

#include <Array.au3>

Global $hDateGUI
Global $cnDate
Global $hDate
Global $hButton

MsgBox( 0, "DATE", GetStudyDate() )
Exit

Func GetStudyDate()
    Local $sDate
    $hDateGUI = GUICreate( "Karisma Study Date", 220, 160 )
    $cnDate = GUICtrlCreateDate( "", 10, 20, 200, 20 )
    $hDate = ControlGetHandle( "Karisma Study Date", "", $cnDate )
    $hButton = GUICtrlCreateButton( "Accept", 70, 95, 80, 30 )
    GUISetState()
    $sDate = GetAdate()
    GUIDelete( $hDateGUI )
    Return $sDate
EndFunc

Func GetADate()
    Local $sDate
    _GUICtrlDTP_SetFormat( $hDate, "YYYY'/'MM'/'dd" )
    $aDate = _GUICtrlDTP_GetSystemTime( $hDate )
    _GUICtrlDTP_SetFormat( $hDate, "dddd':' MMMM d, yyyy" )
    _GUICtrlDTP_SetFormat( $hDate, "'TODAY'" )

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ContinueCase
            Case $hButton
                If ControlGetText( $hDate, "", "" ) = "Invalid Date" Then ContinueLoop
                _GUICtrlDTP_SetFormat( $hDate, "dddd':' MMMM d, yyyy" )
                $aDate = _GUICtrlDTP_GetSystemTime( $hDate )
                $sDate =  $aDate[ 2 ] & '/' & $aDate[ 1 ] & '/' & $aDate[ 0 ]
                Return $sDate
            Case $cnDate
                _GUICtrlDTP_SetFormat( $hDate, "dddd':' MMMM d, yyyy" )
                _GUICtrlDTP_SetFormat( $hDate, "'" & ControlGetText( $hDate, "", "") & "'" )
                $aDate = _GUICtrlDTP_GetSystemTime( $hDate )
                If _DateDiff( 'D', _NowCalc(), $aDate[ 0 ] & '/' & $aDate[ 1 ] & '/' & $aDate[ 2 ] ) = 0 Then
                    _GUICtrlDTP_SetFormat( $hDate, "'TODAY'" )
                ElseIf _DateDiff( 'D', _NowCalc(), $aDate[ 0 ] & '/' & $aDate[ 1 ] & '/' & $aDate[ 2 ] ) = -1 Then
                        _GUICtrlDTP_SetFormat( $hDate, "'YESTERDAY'" )
                    ElseIf _DateDiff( 'D', _NowCalc(), $aDate[ 0 ] & '/' & $aDate[ 1 ] & '/' & $aDate[ 2 ] ) > 0 Then
                        _GUICtrlDTP_SetFormat( $hDate, "'Invalid Date'" )
                EndIf
        EndSwitch
    WEnd
EndFunc
1 person likes this

Share this post


Link to post
Share on other sites

i just recently made an x ray viewer with gdiplus and a database with all the metadata in the image binaries for my practice. and a search algorithm that even finds patients with typos in the data .... very cool, maybe i sell it in af ew years. nowadays you can run around with tablets and don't need big pcs and monitors anymore in every room.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

Any software for radiology reporting, management or practice administration is welcome.

I am using Autoit only because the suite of software used in this (and most other practices) is a melange of old and new bits e.g. Karisma, iSite, eFilm, PACS tools, Dicom utilities etc. I have to screen-scrape, autofill, SQL and patch binaries just to get anything done. You can make lots of money if you create something which helps to clean up this mess. I'm getting too old for this, but thinking of doing it....

Cheers and good luck.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Any software for radiology reporting, management or practice administration is welcome.

I am using Autoit only because the suite of software used in this (and most other practices) is a melange of old and new bits e.g. Karisma, iSite, eFilm, PACS tools, Dicom utilities etc. I have to screen-scrape, autofill, SQL and patch binaries just to get anything done. You can make lots of money if you create something which helps to clean up this mess. I'm getting too old for this, but thinking of doing it....

Cheers and good luck.

.

yes you have to find the right interface (files) to the primary software. astonishingly, i never found any encryption tho they claim to do it. i made a recall program for patients (because the professional programs are too stupid), electronical appointment calendar (with patient name from combo) and individual treatment duration time, and a portable (on a tablet, for out-of-practice visitations) administration software with a card reader connected to parse the (as well not encrypted !) patient data from the health cards.

all in autoit, but did not sell it yet. i just like it that it works the way i want it and don't have the flaws of professional software.

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

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