Tabla de Contenidos



Calendar Control

Calendar

Introduction


The calendar may be put as direct call, so the internal design of the frame comes out, that nothing can be changed and none of the indicated attributes does something.
Or either is put as content, using the viewmode, then it applies all the attributes we are going to explain.
Following the controls and attributes necessaries to create the calencar function are described:

Attributes Description
viewmode=“calendarview”This is for the month
viewmode=”week”This is to switch to weekly calendar mode
forecolor:#FFFFFFFont color
bgcolor:#DFDFDFBackground color by default
cell-forecolor:#ffffff
cell-border-width:2Size of the border of each line
cell-align:center Cell alignment
align:center General alignment of the control
fontsize:12 Font size
cell-selected-bgcolor:#00000000 Background color of the selected cell
cell-selected-border-color:#00CC00 Border color of the selected cell
weekdays-bgcolor:#00000000Weekdays color
weekdays-forecolor:#333333,#999999,#999999,#999999,#999999,#999999,#999999Font color of each one of the days: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
weekdays-fontsize:5Week days size
weekdays-longname:false What type of name comes out, whether the long type or the short type
weekdays-align:topleft Alignment of that names
border-width:2Size of the borders
textfont-bold:trueTo do it in bold bold
cell-border-color:#00000000Cell border color
page-swipe:falseIf it allows the months or weeks to swipe with the finger. By default true
border:falseIf it has a border or it has not
week-start-hour:0Start of the time indicated in the day, since the days are divided between 0 to 23:59
week-end-hour:1
cell-bgcolor=“##FLD_MAP_COLOREMPRESA##“ Cell color
cell-other-month-bgcolor=”##FLD_MAP_COLORCALENDARIO_NOMESACTUAL##“Cell color of the days of the other month which is not the month selected.
cell-selected-forecolor=”##FLD_MAP_COLOREMPRESA##“ Font color of the day selected. It allows width and height to set the size, the ideal it would be setting all the attributes in a class and associate it with.


Example about how it is called:

<prop name="Calend" type="Z" cell-bgcolor="##FLD_MAP_COLOREMPRESA##" onchange="refresh" cell-other-month-bgcolor="##FLD_MAP_COLORCALENDARIO_NOMESACTUAL##" cell-selected-forecolor="##FLD_MAP_COLOREMPRESA##" contents="calendario" width="495px" height="240px" class="z_calendario" viewmode="calendarview" />


Control of the calendar by script


this.Contents("DatosCalendario”).variables(“moveto”)=“prev” To move to the previous month or week
this.Contents(”DatosCalendario“).variables(“moveto”)=“next” To move to the next month or week


This node is executed when selecting one day of the month



<ondateselected refresh="true" show-wait-dialog="false" refresh-owner="MAP_FASE,DatosPoblaciones,MAP_FECHA,MAP_TITLE_NAMES_MES,MAP_TITLE_ANO,MAP_RUTA">
      <action name="runscript">
        <param name="DATEVALUE" />
        <param name="TIMEVALUE" />
        <param name="EVENTVALUE" />
        <script language="vbscript">   


This is to take the value of the date of the selected day.


            
thisDataColl.OwnerObject("MAP_FECHA")=DATEVALUE
            thisDataColl.OwnerObject("MAP_TITLE_NAMES_MES")=ucase(cstr(monthname(DATEVALUE)))
            thisDataColl.OwnerObject("MAP_TITLE_ANO")= cstr(year(DATEVALUE))
        </script>
      </action>
    </ondateselected>


This node is executed when the month is changed


    <onpageselected refresh="true" show-wait-dialog="false" refresh-owner="MAP_FASE,DatosPoblaciones,MAP_FECHA,MAP_TITLE_NAMES_MES,MAP_TITLE_ANO,MAP_RUTA">
      <action name="runscript">
        <param name="DATEVALUE" />
        <param name="TIMEVALUE" />
        <param name="EVENTVALUE" />
        <script language="vbscript">          
            thisDataColl.OwnerObject("MAP_FECHA")= DATEVALUE
            thisDataColl.OwnerObject("MAP_TITLE_NAMES_MES")=ucase(cstr(monthname(DATEVALUE)))
            thisDataColl.OwnerObject("MAP_TITLE_ANO")= cstr(year(DATEVALUE))
        </script>
      </action>
    </onpageselected>


This is executed when we are going to paint the calendar, by each cell of it. If it is script it is heavy, it may take a long time.
This node is previous to the attributes that were subsequently made. It is recommended not to use if speed is required.



      <oncelldraw>
      <action name="runscript">
        <param name="CELLDATE" />
        <script language="VBScript">
                             Poner el script que sea.                              
                               </script>
      </action>
    </oncelldraw>