Calendar
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE CALENDAR cName | (cVarName) | &(cExpression) 
      [ ; OF cWindow | (cVarName) | &(cExpression) ]
Parent.Name
  
A reference to the Parent Window
      [ ROW nRow ]
0
  
Row position on container window in pixels coordinates
      [ COL nCol ]
0
  
Col position on container window in pixels coordinates
      [ WIDTH nWidth ]
?
  
The desired width size of the Control in pixels
      [ HEIGHT nHeight ]
?
  
The desired height size of the Control in pixels
      [ ROWBOTTOM nRow ]
n/a
  
Bottom Row position on container window in pixels coordinates. This property adjust the HEIGHT property according the ROW property.
      [ COLRIGHT nCol ]
n/a
  
Right Col position on container window in pixels coordinates. This property adjust the WIDTH property according the COL property.
      [ VALUE dValue ]
date()
  
Set or Get date in Calendar
      [ FIRSTDAYOFWEEK nDay ]
7 (Sunday)
  
Day to showing in column 1 of calendar
      [ MAXIMUMDATE dDate ]
Sometime in the year 11 million Current Era
 
 This property holds the maximum date of the currently specified date range.
      [ MINIMUMDATE dDate ]
January 2nd, 4713 Before Current Era
 
 This property holds the minimum date of the currently specified date range.
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for control text
      [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for control text
      [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to control text
      [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to control text
      [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to control text
      [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to control text
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ READONLY .T. | .F. ]
.F.
  This property restrict the input from keyboard and the control is used as output mode only
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ PARENT cControlParent ]   
Get or Set the control name of parent widget
      [ PARENTTYPE n/a ]   
Only for mg_get() function, this property returns the PARENT control type or "" if the parent was not set.
      [ HASFOCUS ]
NIL
  
Only for mg_Get() function. This property returns .T. if control has the application focus
      [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the control. Go to to learn more about it.
      [ FORCEACTION .T. | .F. ]
.F.
  
It force the execution of the actions defined by methods like ACTION, ONENTER, ONCLICK, ONDBLCLICK, etc. when NOTABSTOP property was set '.T.'. This property is useful when application focus is over a control when a VALID clause and it doesn't permit lostfocus.
      [ SHOWGRID .T. | .F. ]
.F.
  
Show/Hide grid of calendar
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed when control value is changed
      [ ONDBLCLICK cOnDblClick | {BOnDblClick} ]
NIL
  
An action to be performed when user press double mouse click
      [ ONGOTFOCUS cOnGotFocus | {BOnGotFocus} ]
NIL
 
 An action to be performed when control is focused
      [ ONLOSTFOCUS cOnLostFocus | {BOnLostFocus} ]
NIL
 
 An action to be performed when control is lost focused
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END CALENDAR 

Jump to Context Menu topic



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    HIDE
n/a
  
This method HIDE the control
    SHOW
n/a
  
This method SHOW the control
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the control to default (Qt_ArrowCursor). Go to to learn more about it.
    RELEASE
n/a
  
This method is used to destroy the control.
    SETFOCUS
n/a
  
This method put the program focus into control
    ONCHANGE
n/a
  
Execute ONCHANGE block coded in CREATE or seted by mg_Set
    ONDBLCLICK
n/a
  
Execute ONDBLCLICK block coded in CREATE or seted by mg_Set
    ONGOTFOCUS
n/a
 
 Execute ONGOTFOCUS block coded in CREATE or seted by mg_Set
    ONLOSTFOCUS
n/a
 
 Execute ONLOSTFOCUS block coded in CREATE or seted by mg_Set



Example:

File: d_calendar.prg


#include "marinas-gui.ch"

Function main()

   SET APPLSTYLE TO "MarinasLooks"

   CREATE WINDOW d_window
      ROW 0 ; COL 0
      WIDTH 820 ; HEIGHT 480
      CAPTION "Marinas-GUI Sample for Calendar Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {216,237,236}
      MAIN .T.

      d_calendar_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_calendar_def.prg

#include "marinas-gui.ch"

Function d_calendar_def()

     CREATE IMAGE Calendar_1Image
        ROW       50
        COL       40
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_focus_off.png"
        TOOLTIP   "Calendar Focus"
     END IMAGE

     CREATE CALENDAR Calendar_1
            ROW    50
            COL    80
            WIDTH  300
            HEIGHT 250
            TOOLTIP "Calendar Default"
            ONCHANGE mg_Set( "d_window" , "Calendar_1Label" , "value" , DtoC( mg_Get( "d_window" , "Calendar_1" , "value" ) ) )
            ONDBLCLICK mg_msginfo( DtoC( mg_Get( "d_window" , "Calendar_1" , "value" ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Calendar_1Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Calendar_1Image" , "picture" , "../resource/d_focus_off.png" )

            CREATE CONTEXT MENU

               CREATE ITEM "Item 1 from Calendar"
                  ONCLICK { || mg_MsgInfo( "Item 1 from Calendar" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

               CREATE ITEM "Item 2 from Calendar"
                  ONCLICK { || mg_MsgInfo( "Item 2 from Calendar" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

            END MENU

     END CALENDAR

     CREATE LABEL Calendar_1Label
        ROW 320
        COL 180
        WIDTH 120
        HEIGHT 30
        FONTSIZE 16
        FONTCOLOR {0,0,255}
        VALUE DtoC( mg_Get( "d_window" , "Calendar_1" , "value" ) )
     END LABEL

     CREATE IMAGE Calendar_2Image
        ROW       50
        COL       400
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_focus_off.png"
        TOOLTIP   "Calendar Focus"
     END IMAGE

     CREATE CALENDAR Calendar_2
            ROW    50
            COL    440
            WIDTH  300
            HEIGHT 250
            FIRSTDAYOFWEEK Qt_Monday
            FONTSIZE 12
            VALUE ctod( "05/03/1967" )
            FONTITALIC .T.
            FONTBOLD .T.
            BACKCOLOR {255,0,0}
            TOOLTIP "Calendar with FirstDayOfWeek property seted to monday"
            ONCHANGE mg_Set( "d_window" , "Calendar_2Label" , "value" , DtoC( mg_Get( "d_window" , "Calendar_2" , "value" ) ) )
            ONDBLCLICK mg_msginfo( DtoC( mg_Get( "d_window" , "Calendar_2" , "value" ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Calendar_2Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Calendar_2Image" , "picture" , "../resource/d_focus_off.png" )
     END CALENDAR

     CREATE LABEL Calendar_2Label
        ROW 320
        COL 540
        WIDTH 120
        HEIGHT 30
        FONTSIZE 16
        FONTCOLOR {255,0,0}
        VALUE DtoC( mg_Get( "d_window" , "Calendar_2" , "value" ) )
     END LABEL

Return .T.




Marinas-GUI Version 03.06 and
Marinas-IDE Version 05.06 and
LEX Files Version 02.06


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: April 27
2017
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




A Harbour/QT framework to make multiplatform programs

(©) Copyright 2009-2017 by Fernando Santolin (aka CarozoDeQuilmes)
CarozoDeQuilmes@gmail.com

2009-2017 Beta tester and full English translator: Bruno Luciani
Bruno.Luciani@gmail.com

2014-2015 Final English corrector: David Worboys
DavidWorboys@hotmail.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic