jmon

Calendar UDF (WIP)

9 posts in this topic

#1 ·  Posted (edited)

Hello everyone,

I started working on this calendar control for my company. It's still a work in progress, and there are some bugs and some features missing, but I still wanted to share it with you guys, to get some comments and ideas for future development.

My question would be: "Would you have done it this way?", meaning, would you have built it with labels as I did, or would it be better using GDI+ or other methods?

Screenshot:

post-66935-0-59860100-1354694498_thumb.j

Here is an example (Try double-clicking on a date):

#include <GUIConstantsEx.au3>

#include "_CalendarUDF.au3"
Opt("GUIOnEventMode", 1)


Global $GUI, $fStartMonday = False, $iGridSize = 1, $sTheme = "Blue"

_Main()

Func _Main()
    Local $GUI = GUICreate("Calendar example", 800, 600, -1, -1, BitOR($WS_SYSMENU, $WS_SIZEBOX))
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetState()

    GUICtrlCreateButton("Toggle grid", 20, 10, 150, 20)
    GUICtrlSetOnEvent(-1, "Btn_ToggleGrid")
    GUICtrlCreateButton("Toggle Start Mon/Sun", 170, 10, 150, 20)
    GUICtrlSetOnEvent(-1, "Btn_ToggleMondaySunday")
    GUICtrlCreateButton("Go to Date", 320, 10, 150, 20)
    GUICtrlSetOnEvent(-1, "Btn_GoToDate")
    GUICtrlCreateButton("Add Event", 470, 10, 150, 20)
    GUICtrlSetOnEvent(-1, "Btn_AddEvent")
    GUICtrlCreateButton("Switch theme", 620, 10, 150, 20)
    GUICtrlSetOnEvent(-1, "Btn_SwitchTheme")

    ;Create the calendar control:
    _GuiCtrlCal_Create("My Calendar", 20, 40, 760, 520, @MON, @YEAR, 30, $fStartMonday, $iGridSize)

    ;Register my function, called when I double click a date:
    _GuiCtrlCal_OnDateDblClickRegister("_MyFunction")

    ;Add some Events:
    _GuiCtrlCal_EventAdd("2012/12/01", "World AIDS Day")
    _GuiCtrlCal_EventAdd("2012/12/25", "Christmas")
    _GuiCtrlCal_EventAdd("2012/12/21", "Winter Solstice")
    _GuiCtrlCal_EventAdd("2012/12/10", "Human Rights day")
    _GuiCtrlCal_EventAdd("2012/12/31", "Happy new year")
    _GuiCtrlCal_EventAdd("2013/01/11", "Human Trafficking Awareness")
    _GuiCtrlCal_EventAdd("2013/01/26", "Australia Day")

    ;Loop:
    While 1
        Sleep(50)
    WEnd

EndFunc


;This function will now be called when I doubleclick on a date.
;This function has to have one parameter that will contain
;the selected date:
Func _MyFunction($sDate)
    ;The selected date is $sDate
    ConsoleWrite("Selected date is: " & $sDate & @CRLF)

    ;Create a small gui to input a text for the event:
    Local $mousePos = MouseGetPos()
    Local $GUIAddEvent = GUICreate("Add Event", 250, 50, $mousePos[0] - 125, $mousePos[1] - 15, $WS_POPUP, $WS_EX_TOPMOST, $GUI)
    GUISetState(@SW_SHOW, $GUIAddEvent)
    Local $Info = GUICtrlCreateLabel("Enter a text and press enter to add the event", 0, 0, 250, 15)
    Local $GUIAddEvent_Input = GUICtrlCreateInput("", 0, 15, 250, 35)
    GUICtrlSetState($GUIAddEvent_Input, $GUI_FOCUS)

    ;Wait for the user to press enter:
    While 1
        If _IsPressed("0D") Then
            Do
                Sleep(10)
            Until Not _IsPressed("0D")
            ExitLoop
        EndIf
        Sleep(50)
    WEnd

    ;Read the text:
    Local $sText = GUICtrlRead($GUIAddEvent_Input)
    If $sText = "" Then Return
    GUIDelete($GUIAddEvent)

    ;Add the event:
    _GuiCtrlCal_EventAdd($sDate, $sText)

EndFunc

Func _Exit()
    _GuiCtrlCal_Destroy()
    Exit
EndFunc

Func Btn_ToggleGrid()
    If $iGridSize = 0 Then
        $iGridSize = 1
    Else
        $iGridSize = 0
    EndIf
    _GuiCtrlCal_SetGridSize($iGridSize)
    _GuiCtrlCal_Refresh()
EndFunc

Func Btn_ToggleMondaySunday()
    $fStartMonday = Not $fStartMonday
    _GuiCtrlCal_SetStartMonday($fStartMonday)
    _GuiCtrlCal_Refresh()
EndFunc

Func Btn_GoToDate()
    Local $sDate = InputBox("Go to Date", "Input the year, month and day : YYYY/MM/DD", @YEAR & "/" & @MON & "/" & @MDAY)
    If $sDate <> "" Then
        Local $aDate = StringSplit($sDate, "/")
        If Not @error Then
            _GuiCtrlCal_GoToMonth($aDate[1], $aDate[2])
            _GuiCtrlCal_SetSelectedDate($sDate)
        EndIf
    EndIf
EndFunc

Func Btn_AddEvent()
    Local $sDateEvent = InputBox("Event Date", "Input the year, month and day (YYYY/MM/DD) for your event", @YEAR & "/" & @MON & "/" & @MDAY)
    If $sDateEvent = "" Then Return
    Local $sText = InputBox("Event Text", "Input the Text for your event", "My Event")
    If $sText = "" Then Return
    _GuiCtrlCal_EventAdd($sDateEvent, $sText)
EndFunc

Func Btn_SwitchTheme()
    Switch $sTheme
        Case "Blue"
            $sTheme = "Dark"
            _GuiCtrlCal_SetThemeDark()
        Case "Dark"
            $sTheme = "Blue"
            _GuiCtrlCal_SetThemeBlue()
    EndSwitch
EndFunc

And here is the UDF:

_CalendarUDF.au3

Edited by jmon
3 people like this

Share this post


Link to post
Share on other sites



Nice! And a few bugs, but useful.

I had to use

_GuiCtrlCal_EventAdd("2013/01/11", "Human Trafficking Awareness")

instead of

_GuiCtrlCal_EventAdd("2013/1/11", "Human Trafficking Awareness")

;)


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Nice! And a few bugs, but useful.

I had to use

_GuiCtrlCal_EventAdd("2013/01/11", "Human Trafficking Awareness")

instead of

_GuiCtrlCal_EventAdd("2013/1/11", "Human Trafficking Awareness")

;)

Thanks, I fixed the first post.

[edit] Actually this is one of the issues I'm working on, I want to be more flexible on the date, and "2013/01/11" would be equal to "2013/1/11"

Edited by jmon

Share this post


Link to post
Share on other sites

i tried using this but i get the following erro just on loading up 
 

(657) : ==> Unknown function name.:
$__aCALDAYS[$i][0] = GUICtrlCreateLabel("", $iDayPosX + _Iif($iDayOfWeek = 7, 0, $iGridSize), $iDayPosY + $iGridSize, $iDayWidth - $iGridSize, $iDayHeight - $iGridSize)
$__aCALDAYS[$i][0] = GUICtrlCreateLabel("", $iDayPosX + ^ ERROR

Share this post


Link to post
Share on other sites

dynamitemedia,

The _Iif function no longer exists - you need to replace it with a ternary expression. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Awesome UDF.

mLipok


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Just what I needed. Thanks a lot!!!!:wub:

Share this post


Link to post
Share on other sites

On line 657 in the UDF you need to change to the following in what is now autoit version 3.3.14.2:

 

$__aCALDAYS[$i][0] = GUICtrlCreateLabel("", $iDayPosX + ($iDayOfWeek = 7 ? 0 : $iGridSize), $iDayPosY + $iGridSize, $iDayWidth - $iGridSize, $iDayHeight - $iGridSize)

 

1 person likes this

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#9 ·  Posted

could you post latest calendar UDF, if have any?

Thank lots!!!

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

  • Similar Content

    • Chimp
      By Chimp
      This script generates a calendar of 12 pages in pdf format (ready to be printed if you want)
      it include for each month also the previous and the next month on the same page.
      It makes use of the "MPDF_UDF.au3" udf by taietel from >this topic
      you must download that udf and save it in the same folder with this script.
      (it seems that the version modified by bdr529 from post #231 is more updated.
      I used that one with my script.)
      Happy new year
      ; Create a Calendar in pdf ; ; download the "MPDF_UDF.au3" udf from here: http://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/?p=1158973 ; it is at the bottom of post #231. Download and save it in the same path of this script. #include "MPDF_UDF.au3" ; #include <date.au3> $sYear = "2015" ; <--- change the year if you need another $sMonths = "January,February,March,April,May,June,July,August,September,October,November,December" $sDaysOfWeek = "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" ; --- just change above names to localize (following names are italian for example) --- ; $sMonths = "Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre" ; $sDaysOfWeek = "Lunedì,Martedì,Mercoledì,Giovedì,Venerdì,Sabato,Domenica" ; ------------------------------------------------------------------------------------- Local $aMonths = StringSplit($sMonths, ","), $aDaysOfWeek = StringSplit($sDaysOfWeek, ",") Local $aPreviousMonth, $aNextMonth, $iDayOfWeek, $aColors[2] = ["0x000000", "0xFF0000"], $aDummy ; ;set the properties for the pdf _SetTitle("Calendar " & $sYear) _SetSubject("Calendar made with AutoIt (www.autoitscript.com)") _SetKeywords("calendar, pdf") _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_FULLPAGE) _SetOrientation($PDF_ORIENTATION_PORTRAIT) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\Calendar_" & $sYear & ".pdf") ;=== load used font(s) === _LoadFontTT("_TimesNR", $PDF_FONT_TIMES) _LoadFontTT("_TimesNRB", $PDF_FONT_TIMES, $PDF_FONT_BOLD) ; For $Month = 1 To 12 ; Generate 12 months _BeginPage() ; begin page ; --- create areas that will contains days ----------------------------------------------- _InsertTable(00.50, 00.50, 20.00, 28.50, 1, 1, 0xB0B0B0, 0xB0B0B0) ; background _InsertTable(00.80, 26.10, 19.40, 02.60, 1, 1, 0xFF0000, 0x000000, 0.03) ; main month title _InsertTable(00.80, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; previous month (the little on the left) _InsertTable(00.80, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of previous month _InsertTable(03.80, 00.80, 13.40, 25.00, 2, 16, 0xFFFFFF, 0x000000) ; this month _DrawLine(03.80, 00.80, 17.20, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0) ; border of this month _DrawLine(17.20, 00.80, 17.20, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0) _DrawLine(17.20, 25.80, 03.80, 25.80, "0X2", 0, 0.03, 0x000000, 0, 0) _DrawLine(03.80, 25.80, 03.80, 00.80, "0X2", 0, 0.03, 0x000000, 0, 0) _InsertTable(17.50, 00.80, 02.70, 25.00, 1, 1, 0xFFFFFF, 0x000000, 0.03) ; next month (the little on the right) _InsertTable(17.50, 25.01875, 02.70, 00.78125, 1, 1, 0xFF0000, 0x000000, 0.03) ; title of next month ; --- now fill the areas with the dates -------------------------------------------------- _InsertRenderedText(10.5, 27, StringUpper($aMonths[$Month]) & " " & $sYear, "_TimesNR", 50, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Main Month _DateTimeSplit(_DateAdd("M", -1, $sYear & "/" & $Month & "/1"), $aPreviousMonth, $aDummy) ; Previous Month _InsertRenderedText(2.15, 25.28, StringUpper($aMonths[$aPreviousMonth[2]]) & " " & $aPreviousMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Previous Month _DateTimeSplit(_DateAdd("M", 1, $sYear & "/" & $Month & "/1"), $aNextMonth, $aDummy) ; Next Month _InsertRenderedText(18.85, 25.28, StringUpper($aMonths[$aNextMonth[2]]) & " " & $aNextMonth[1], "_TimesNRB", 8.5, 100, $PDF_ALIGN_CENTER, 0xffffff, 0xffffff) ; Next Month For $i = 1 To 31 If _DateIsValid($aPreviousMonth[1] & "/" & $aPreviousMonth[2] & "/" & $i) Then ; previous month $iDayOfWeek = _DateToDayOfWeekISO($aPreviousMonth[1], $aPreviousMonth[2], $i) _InsertRenderedText(01.80, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Previous Month's days _InsertRenderedText(02.00, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iDayOfWeek], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) EndIf If _DateIsValid($aNextMonth[1] & "/" & $aNextMonth[2] & "/" & $i) Then ; next month $iDayOfWeek = _DateToDayOfWeekISO($aNextMonth[1], $aNextMonth[2], $i) _InsertRenderedText(18.50, 24.4 - 0.78125 * ($i - 1), $i, "_TimesNR", 12, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) ; Next Month's days _InsertRenderedText(18.70, 24.4 - 0.78125 * ($i - 1), StringLeft($aDaysOfWeek[$iDayOfWeek], 3), "_TimesNR", 10, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) EndIf If _DateIsValid($sYear & "/" & $Month & "/" & $i) Then ; main month $iDayOfWeek = _DateToDayOfWeekISO($sYear, $Month, $i) _InsertRenderedText(05.30 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $i, "_TimesNRB", 24, 100, $PDF_ALIGN_RIGHT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) _InsertRenderedText(05.60 + (06.70 * Int($i / 17)), 26.30 - 1.5625 * ($i - (16 * Int($i / 17))), $aDaysOfWeek[$iDayOfWeek], "_TimesNR", 22, 100, $PDF_ALIGN_LEFT, $aColors[$iDayOfWeek = 7], $aColors[$iDayOfWeek = 7]) EndIf If $i < 31 Then ; separator line between days in previous and next month _DrawLine(01.00, 25 - 0.78125 * $i, 03.30, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0) _DrawLine(17.70, 25 - 0.78125 * $i, 20.00, 25 - 0.78125 * $i, 2, 10, 0.02, 0x000000, 0, 0) EndIf Next _EndPage() ; next month will be in a new page Next ; next month ;write the buffer to disk _ClosePDFFile() ; --- Functions --- Func _InsertTable($iX, $iY, $iW = 0, $iH = 0, $iCols = 0, $iRows = 0, $lFillColor = 0xFFFFFF, $lBorderColor = 0x000000, $fThickness = 0.01) Local $iPgW = Round(_GetPageWidth() / _GetUnit(), 1) Local $iPgH = Round(_GetPageHeight() / _GetUnit(), 1) If $iW = 0 Then $iW = $iPgW - $iX - 2 If $iH = 0 Then $iH = $iPgH - $iY - 2 Local $iColW = $iW / $iCols Local $iRowH = $iH / $iRows _SetColourStroke($lBorderColor) For $i = 0 To $iRows - 1 For $j = 0 To $iCols - 1 _Draw_Rectangle($iX + $j * $iColW, $iY + $iH - ($i + 1) * $iRowH, $iColW, $iRowH, $PDF_STYLE_STROKED, 0, $lFillColor, $fThickness) Next Next _SetColourStroke(0) EndFunc ;==>_InsertTable Func _Iif($fTest, $vTrueVal, $vFalseVal) If $fTest Then Return $vTrueVal Else Return $vFalseVal EndIf EndFunc ;==>_Iif edit:
      p.s. if you get this error: ERROR: _Iif() already defined.
      then just remove the _Iif() function from the bottom of this script
      this occurs with older AutoIt versions
    • Kanashius
      By Kanashius
      This program can be used to create simple alarms (msgbox or soundfile can be added to every alarm).
      The program is just running in background, if you close it. (Use Tooltip to exit.)
      I translated the Programm in english to post it here. If you like it, please leave me a comment, also if you have any suggestions to make it better or if you found bugs.
      For more information and direct executables, please visit my website: http://kanashius.de/?page=kalender
      kalenderfenster_source.zip
    • arts
      By arts
      I'm trying to make bold some days of a calendar. I get those days from a SQLite database. Using the _GUICtrlMonthCal_SetDayState function I almost got it working. Please look at the following ugly code and help me to understand why when the variable $finalX is calculated by the script it doesn't work (no bolding days) but, if I declare the value of the same variable manually, it works... I'm sure I'm doing something stupid but can't see it.
       
      [...] ;---- BUSY DAYS if _SQLite_GetTable2d(-1,'select A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, ID from mydatabase where DEADLINE like "%' & "-" & $tTeste & "-" & '%" ORDER BY 1 D, C;', $arows, $irows, $icols) = $SQLITE_OK Then _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($lvList)) Local $final[ubound($arows)] Local $finalX = "" Local $tempDay = "" Local $val_hex[ubound($arows)] Local $val_pre = "" for $1 = 1 to ubound($arows) - 1 _GUICtrlListView_AddItem($lvList, $arows[$1][0]) for $2 = 1 to ubound($arows,2) - 1 _GUICtrlListView_AddsubItem($lvList,$1-1, $arows[$1][$2], $2) next $tempDay = StringLeft(($arows[$1][3]), 2) $val_pre = Number($tempDay); + 0 ConsoleWrite("val_pre: " & $val_pre & @CRLF) $val_hex[$1] = "BitShift(0x0001,-" & "(" & $val_pre & "-1)" & ")" ConsoleWrite("val_hex[$1]: " & $val_hex[$1] & @CRLF) next ConsoleWrite("===========================" & @CRLF) $final = _ArrayUnique($val_hex) $finalX = _ArrayToString($final, " + ", 1) $finalX = StringTrimLeft($finalX, 3); <<------ COMPUTED $finalX doesn't work ConsoleWrite("FinalX:"&$finalX & @CRLF) ;------>> When I declare the same value as the computed above, it WORKS.. --->> $finalX = BitShift(0x0001,-(28-1)) + BitShift(0x0001,-(29-1)) + BitShift(0x0001,-(30-1)) + BitShift(0x0001,-(15-1)) + BitShift(0x0001,-(7-1)) + BitShift(0x0001,-(24-1)) + BitShift(0x0001,-(1-1)) + BitShift(0x0001,-(11-1)) + BitShift(0x0001,-(2-1)) EndIf ;--------------- Local $aMasks[_GUICtrlMonthCal_GetMonthRangeSpan($idMonthCal, True)] $aMasks[1] = $finalX; <<<-------- bold days _GUICtrlMonthCal_SetDayState($idMonthCal, $aMasks) GUICtrlSetState($tabCalendar, $GUI_SHOW) EndFunc ;==>BusyDays