Date and Time
Previous topic  First topic  Next topic





DateEdit Create and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE DATEEDIT 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.
      [ AUTOSIZE .T. | .F. ]
.F.
  
Auto adjust control size to text
      [ ALIGN nAlign ]
Qt_AlignLeft
  
Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ CALENDARPOPUP .T. | .F. ]
.T.
  
Enable or Disable calendar popup to select date
      [ VALUE nValue ]
0
  
Control initial position
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ 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
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ 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.
      [ PERMANENT .T. | .F. ]
.F.
  
Only for controls defined into STATUSBAR. This property force this control as permanent statusbar message. Control will be placed at right corner of statusbar and it is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.
      [ HASFOCUS ]   
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.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed while slider is moved
      [ ONENTER cOnEnter | {BOnEnter} ]
NIL
  
An action to be performed when user press ENTER or RETURN keys. You can interrupt the ENTER key propagate to the control returning the __MG_KEY_NO_PROPAGATE constant, e.g. to disable ENTERTAB behavior.
      [ 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
      [ CONTEXTMENUSUPRESSED .T. | .F. ]
.F.
  
Disable the display of the Context Menu of control.
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END DATEEDIT 

Jump to Context Menu topic



DateEdit 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
    ONENTER
n/a
  
Execute ONENTER 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




DateTimeEdit Create and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE DATETIMEEDIT 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.
      [ AUTOSIZE .T. | .F. ]
.F.
  
Auto adjust control size to text
      [ ALIGN nAlign ]
Qt_AlignLeft
  
Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ CALENDARPOPUP .T. | .F. ]
.T.
  
Enable or Disable calendar popup to select date
      [ VALUE nValue ]
0
  
Control initial position
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ 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
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ 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.
      [ PERMANENT .T. | .F. ]
.F.
  
Only for controls defined into STATUSBAR. This property force this control as permanent statusbar message. Control will be placed at right corner of statusbar and it is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.
      [ HASFOCUS ]   
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.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed while slider is moved
      [ ONENTER cOnEnter | {BOnEnter} ]
NIL
  
An action to be performed when user press ENTER or RETURN keys. You can interrupt the ENTER key propagate to the control returning the __MG_KEY_NO_PROPAGATE constant, e.g. to disable ENTERTAB behavior.
      [ 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
      [ CONTEXTMENUSUPRESSED .T. | .F. ]
.F.
  
Disable the display of the Context Menu of control.
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END DATETIMEEDIT 

Jump to Context Menu topic



DateTimeEdit 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
    ONENTER
n/a
  
Execute ONENTER 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




TimeEdit Create and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE TIMEEDIT 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.
      [ AUTOSIZE .T. | .F. ]
.F.
  
Auto adjust control size to text
      [ ALIGN nAlign ]
Qt_AlignLeft
  
Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ VALUE nValue ]
0
  
Control initial position
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ 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
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ PERMANENT .T. | .F. ]
.F.
  
Only for controls defined into STATUSBAR. This property force this control as permanent statusbar message. Control will be placed at right corner of statusbar and it is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.
      [ HASFOCUS ]   
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.
      [ PARENT cParentName ]
NIL
  
Parent window for this widget
      [ PARENTTYPE n/a ]   
Only for mg_get() function, this property returns the PARENT control type or "" if the parent was not set.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed while slider is moved
      [ ONENTER cOnEnter | {BOnEnter} ]
NIL
  
An action to be performed when user press ENTER or RETURN keys. You can interrupt the ENTER key propagate to the control returning the __MG_KEY_NO_PROPAGATE constant, e.g. to disable ENTERTAB behavior.
      [ 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
      [ CONTEXTMENUSUPRESSED .T. | .F. ]
.F.
  
Disable the display of the Context Menu of control.
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END TIMEEDIT 

Jump to Context Menu topic



TimeEdit 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
    ONENTER
n/a
  
Execute ONENTER 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_datetime.prg


#include "marinas-gui.ch"

Function main()

   SET APPLSTYLE TO "MarinasLooks"

   SET CENTURY ON
   SET DATE TO BRITISH
   SET TIME FORMAT TO "hh:mm:ss.fff am"

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

      d_datetime_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_datetime_def.prg

#include "marinas-gui.ch"

Function d_datetime_def()

   //============================================================//
   // DateEdit                                                   //
   //============================================================//

   CREATE FRAMEBOX DateEdit_FrameBox_1
      ROW    20
      COL    20
      WIDTH  ( mg_Get( "d_window" , "width" ) / 2 ) - ( 20 * 2 )
      HEIGHT 210
      CAPTION "DateEdit Control"
   END FRAMEBOX

   CREATE IMAGE DateEdit_1Image
      ROW       60
      COL       30
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "DateEdit Focus"
   END IMAGE

   CREATE DATEEDIT DateEdit_1
      ROW    60
      COL    70
      WIDTH  130
      FONTCOLOR {255,0,0}
      FONTBOLD .T.
      HEIGHT 30
      VALUE date()
      TOOLTIP "DateEdit with ContextMenu"
  //  ONENTER { || mg_MsgInfo( dToC( mg_Get( "d_window" , "DateEdit_1" , "value" ) ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelDateEdit_1" , "value" , dToC( mg_Get( "d_window" , "DateEdit_1" , "value" ) ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "DateEdit_1Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "DateEdit_1Image" , "picture" , "../resource/d_null.png" )

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

   END DATEEDIT

   CREATE LABEL LabelDateEdit_1
      ROW    mg_Get( "d_window" , "DateEdit_1" , "row" )
      COL    260
      ALIGN  Qt_AlignVCenter
      HEIGHT mg_Get( "d_window" , "DateEdit_1" , "height" )
      WIDTH  100
      FONTCOLOR mg_Get( "d_window" , "DateEdit_1" , "fontcolor" )
      FONTBOLD  mg_Get( "d_window" , "DateEdit_1" , "fontbold" )
      VALUE     dToC( mg_Get( "d_window" , "DateEdit_1" , "value" ) )
   END LABEL

   CREATE IMAGE DateEdit_2Image
      ROW       100
      COL       30
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "DateEdit Focus"
   END IMAGE

   CREATE DATEEDIT DateEdit_2
      ROW    100
      COL    70
      WIDTH  130
      HEIGHT 30
      CALENDARPOPUP .T.
      VALUE sToD( "20111225" )    // yyyyMMdd
      TOOLTIP "DateEdit with CalendarPopup"
      ALIGN Qt_AlignRight
   // ONENTER { || mg_MsgInfo( dToC( mg_Get( "d_window" , "DateEdit_2" , "value" ) ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelDateEdit_2" , "value" , dToC( mg_Get( "d_window" , "DateEdit_2" , "value" ) ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "DateEdit_2Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "DateEdit_2Image" , "picture" , "../resource/d_null.png" )
   END DATEEDIT

   CREATE LABEL LabelDateEdit_2
      ROW    mg_Get( "d_window" , "DateEdit_2" , "row" )
      COL    260
      ALIGN  Qt_AlignVCenter
      HEIGHT mg_Get( "d_window" , "DateEdit_2" , "height" )
      WIDTH  100
      FONTCOLOR mg_Get( "d_window" , "DateEdit_2" , "fontcolor" )
      FONTBOLD  mg_Get( "d_window" , "DateEdit_2" , "fontbold" )
      VALUE     dToC( mg_Get( "d_window" , "DateEdit_2" , "value" ) )
   END LABEL

   CREATE IMAGE DateEdit_3Image
      ROW       140
      COL       30
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "DateEdit Focus"
   END IMAGE

   CREATE DATEEDIT DateEdit_3
      ROW    140
      COL    70
      WIDTH  130
      HEIGHT 40
      BACKCOLOR {0,0,255}
      FONTCOLOR {255,255,255}
      FONTBOLD .T.
      FONTSIZE 12
      FONTITALIC .T.
      FONTNAME "mg_roman"
      VALUE sToD( "20111225" )    // yyyyMMdd
      TOOLTIP "DateEdit with custom colors and fonts"
   // ONENTER { || mg_MsgInfo( dToC( mg_Get( "d_window" , "DateEdit_3" , "value" ) ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelDateEdit_3" , "value" , dToC( mg_Get( "d_window" , "DateEdit_3" , "value" ) ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "DateEdit_3Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "DateEdit_3Image" , "picture" , "../resource/d_null.png" )
   END DATEEDIT

   CREATE LABEL LabelDateEdit_3
      ROW         mg_Get( "d_window" , "DateEdit_3" , "row" )
      COL         260
      ALIGN       Qt_AlignVCenter
      HEIGHT      mg_Get( "d_window" , "DateEdit_3" , "height" )
      WIDTH       100
      FONTCOLOR   mg_Get( "d_window" , "DateEdit_3" , "backcolor" )
      FONTBOLD    mg_Get( "d_window" , "DateEdit_3" , "fontbold" )
      FONTITALIC  mg_Get( "d_window" , "DateEdit_3" , "fontitalic" )
      FONTSIZE    mg_Get( "d_window" , "DateEdit_3" , "fontsize" )
      FONTNAME    mg_Get( "d_window" , "DateEdit_3" , "fontname" )
      VALUE       dToC( mg_Get( "d_window" , "DateEdit_3" , "value" ) )
   END LABEL

   CREATE LABEL LabelDateFormat
      ROW         195
      COL         40
      WIDTH       mg_Get( "d_window" , "DateEdit_FrameBox_1" , "width" ) - 40
      ALIGN       Qt_AlignHCenter
      FONTBOLD    .T.
      VALUE       "Harbour DateFormat: " + Set( _SET_DATEFORMAT )
   END LABEL

   //============================================================//
   // TimeEdit                                                   //
   //============================================================//

   CREATE FRAMEBOX TimeEdit_FrameBox_1
      ROW    20
      COL    ( mg_Get( "d_window" , "width" ) / 2 ) + 20
      if mg_IsVarDefined( "mg_MainDemo" )
         WIDTH  ( mg_Get( "d_window" , "width" ) / 2 ) - 60
      else
         WIDTH  ( mg_Get( "d_window" , "width" ) / 2 ) - ( 20 * 2 )
      endif
      HEIGHT 210
      CAPTION "TimeEdit Control"
   END FRAMEBOX

   CREATE IMAGE TimeEdit_1Image
      ROW       60
      COL       ( mg_Get( "d_window" , "width" ) / 2 ) + 30
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "TimeEdit Focus"
   END IMAGE

   CREATE TIMEEDIT TimeEdit_1
      ROW    60
      COL    ( mg_Get( "d_window" , "width" ) / 2 ) + 70
      WIDTH  160
      FONTCOLOR {255,0,0}
      FONTBOLD .T.
      HEIGHT 30
      ALIGN Qt_AlignRight
      VALUE time()
      TOOLTIP "TimeEdit with ContextMenu"
  //  ONENTER { || mg_MsgInfo( mg_Get( "d_window" , "TimeEdit_1" , "value" ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelTimeEdit_1" , "value" , mg_Get( "d_window" , "TimeEdit_1" , "value" ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "TimeEdit_1Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "TimeEdit_1Image" , "picture" , "../resource/d_null.png" )

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

   END TIMEEDIT

   CREATE LABEL LabelTimeEdit_1
      ROW    mg_Get( "d_window" , "TimeEdit_1" , "row" )
      COL    ( mg_Get( "d_window" , "width" ) / 2 ) + 250
      ALIGN  Qt_AlignVCenter
      HEIGHT mg_Get( "d_window" , "TimeEdit_1" , "height" )
      WIDTH  110
      FONTCOLOR mg_Get( "d_window" , "TimeEdit_1" , "fontcolor" )
      FONTBOLD  mg_Get( "d_window" , "TimeEdit_1" , "fontbold" )
      VALUE     mg_Get( "d_window" , "TimeEdit_1" , "value" )
   END LABEL

   CREATE IMAGE TimeEdit_2Image
      ROW       100
      COL       ( mg_Get( "d_window" , "width" ) / 2 ) + 30
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "TimeEdit Focus"
   END IMAGE

   CREATE TIMEEDIT TimeEdit_2
      ROW    100
      COL    ( mg_Get( "d_window" , "width" ) / 2 ) + 70
      WIDTH  160
      HEIGHT 30
      VALUE "13:34:12.006"      // HH:mm:SS.fff
      TOOLTIP "TimeEdit"
   // ONENTER { || mg_MsgInfo( mg_Get( "d_window" , "TimeEdit_2" , "value" ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelTimeEdit_2" , "value" , mg_Get( "d_window" , "TimeEdit_2" , "value" ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "TimeEdit_2Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "TimeEdit_2Image" , "picture" , "../resource/d_null.png" )
   END TIMEEDIT

   CREATE LABEL LabelTimeEdit_2
      ROW    mg_Get( "d_window" , "TimeEdit_2" , "row" )
      COL    ( mg_Get( "d_window" , "width" ) / 2 ) + 250
      ALIGN  Qt_AlignVCenter
      HEIGHT mg_Get( "d_window" , "TimeEdit_2" , "height" )
      WIDTH  110
      FONTCOLOR mg_Get( "d_window" , "TimeEdit_2" , "fontcolor" )
      FONTBOLD  mg_Get( "d_window" , "TimeEdit_2" , "fontbold" )
      VALUE     mg_Get( "d_window" , "TimeEdit_2" , "value" )
   END LABEL

   CREATE IMAGE TimeEdit_3Image
      ROW       140
      COL       ( mg_Get( "d_window" , "width" ) / 2 ) + 30
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "TimeEdit Focus"
   END IMAGE

   CREATE TIMEEDIT TimeEdit_3
      ROW    140
      COL    ( mg_Get( "d_window" , "width" ) / 2 ) + 70
      WIDTH  160
      HEIGHT 40
      BACKCOLOR {0,0,255}
      FONTCOLOR {255,255,255}
      FONTBOLD .T.
      FONTSIZE 12
      FONTITALIC .T.
      FONTNAME "mg_roman"
      VALUE "13:34:12"          // HH:mm:SS.fff
      TOOLTIP "TimeEdit with custom colors and fonts"
   // ONENTER { || mg_MsgInfo( mg_Get( "d_window" , "TimeEdit_3" , "value" ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelTimeEdit_3" , "value" , mg_Get( "d_window" , "TimeEdit_3" , "value" ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "TimeEdit_3Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "TimeEdit_3Image" , "picture" , "../resource/d_null.png" )
   END TIMEEDIT

   CREATE LABEL LabelTimeEdit_3
      ROW         mg_Get( "d_window" , "TimeEdit_3" , "row" )
      COL         ( mg_Get( "d_window" , "width" ) / 2 ) + 250
      ALIGN       Qt_AlignVCenter
      HEIGHT      mg_Get( "d_window" , "TimeEdit_3" , "height" )
      WIDTH       130
      FONTCOLOR   mg_Get( "d_window" , "TimeEdit_3" , "backcolor" )
      FONTBOLD    mg_Get( "d_window" , "TimeEdit_3" , "fontbold" )
      FONTITALIC  mg_Get( "d_window" , "TimeEdit_3" , "fontitalic" )
      FONTSIZE    mg_Get( "d_window" , "TimeEdit_3" , "fontsize" )
      FONTNAME    mg_Get( "d_window" , "TimeEdit_3" , "fontname" )
      VALUE       mg_Get( "d_window" , "TimeEdit_3" , "value" )
   END LABEL

   CREATE LABEL LabelTimeFormat
      ROW         195
      COL         ( mg_Get( "d_window" , "width" ) / 2 ) + 40
      WIDTH       mg_Get( "d_window" , "TimeEdit_FrameBox_1" , "width" ) - 40
      ALIGN       Qt_AlignHCenter
      FONTBOLD    .T.
      VALUE       "Harbour TimeFormat: " + Set( _SET_TIMEFORMAT )
   END LABEL

   //============================================================//
   // DateTimeEdit                                               //
   //============================================================//

   CREATE FRAMEBOX DateTimeEdit_FrameBox_1
      ROW    250
      COL    20
      if mg_IsVarDefined( "mg_MainDemo" )
         WIDTH  mg_Get( "d_window" , "width" ) - 60
      else
         WIDTH  mg_Get( "d_window" , "width" ) - ( 20 * 2 )
      endif
      HEIGHT 210
      CAPTION "DateTimeEdit Control"
   END FRAMEBOX

   CREATE IMAGE DateTimeEdit_1Image
      ROW       290
      COL       60
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "DateTimeEdit Focus"
   END IMAGE

   CREATE DATETIMEEDIT DateTimeEdit_1
      ROW    290
      COL    100
      WIDTH  260
      FONTCOLOR {255,0,0}
      FONTBOLD .T.
      HEIGHT 30
      ALIGN Qt_AlignRight
      VALUE HB_DateTime()
      TOOLTIP "DateTimeEdit with ContextMenu"
  //  ONENTER { || mg_MsgInfo( HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_1" , "value" ) ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelDateTimeEdit_1" , "value" , HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_1" , "value" ) ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "DateTimeEdit_1Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "DateTimeEdit_1Image" , "picture" , "../resource/d_null.png" )

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

   END DATETIMEEDIT

   CREATE LABEL LabelDateTimeEdit_1
      ROW    mg_Get( "d_window" , "DateTimeEdit_1" , "row" )
      COL    440
      ALIGN  Qt_AlignVCenter
      HEIGHT mg_Get( "d_window" , "DateTimeEdit_1" , "height" )
      WIDTH  210
      FONTCOLOR mg_Get( "d_window" , "DateTimeEdit_1" , "fontcolor" )
      FONTBOLD  mg_Get( "d_window" , "DateTimeEdit_1" , "fontbold" )
      VALUE     HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_1" , "value" ) )
   END LABEL

   CREATE IMAGE DateTimeEdit_2Image
      ROW       330
      COL       60
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "DateTimeEdit Focus"
   END IMAGE

   CREATE DATETIMEEDIT DateTimeEdit_2
      ROW    330
      COL    100
      WIDTH  260
      HEIGHT 30
      VALUE HB_StoT( "20111225133412006" ) // yyyyMMddhhmmssfff
      TOOLTIP "DateTimeEdit with CalendarPopup"
      CALENDARPOPUP .T.
   // ONENTER { || mg_MsgInfo( HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_2" , "value" ) ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelDateTimeEdit_2" , "value" , HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_2" , "value" ) ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "DateTimeEdit_2Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "DateTimeEdit_2Image" , "picture" , "../resource/d_null.png" )
   END DATETIMEEDIT

   CREATE LABEL LabelDateTimeEdit_2
      ROW    mg_Get( "d_window" , "DateTimeEdit_2" , "row" )
      COL    440
      ALIGN  Qt_AlignVCenter
      HEIGHT mg_Get( "d_window" , "DateTimeEdit_2" , "height" )
      WIDTH  210
      FONTCOLOR mg_Get( "d_window" , "DateTimeEdit_2" , "fontcolor" )
      FONTBOLD  mg_Get( "d_window" , "DateTimeEdit_2" , "fontbold" )
      VALUE     HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_2" , "value" ) )
   END LABEL

   CREATE IMAGE DateTimeEdit_3Image
      ROW       370
      COL       60
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_null.png"
      TOOLTIP   "DateTimeEdit Focus"
   END IMAGE

   CREATE DATETIMEEDIT DateTimeEdit_3
      ROW    370
      COL    100
      WIDTH  310
      HEIGHT 40
      BACKCOLOR {0,0,255}
      FONTCOLOR {255,255,255}
      FONTBOLD .T.
      FONTSIZE 12
      FONTITALIC .T.
      FONTNAME "mg_roman"
      VALUE HB_StoT( "20111225133412006" ) // yyyyMMddhhmmssfff
      TOOLTIP "DateTimeEdit with custom colors and fonts"
   // ONENTER { || mg_MsgInfo( HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_3" , "value" ) ) ) }
      ONCHANGE { || mg_Set( "d_window" , "LabelDateTimeEdit_3" , "value" , HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_3" , "value" ) ) ) }
      ONGOTFOCUS mg_Set( "d_window" , "DateTimeEdit_3Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "DateTimeEdit_3Image" , "picture" , "../resource/d_null.png" )
   END DATETIMEEDIT

   CREATE LABEL LabelDateTimeEdit_3
      ROW         mg_Get( "d_window" , "DateTimeEdit_3" , "row" )
      COL         440
      ALIGN       Qt_AlignVCenter
      HEIGHT      mg_Get( "d_window" , "DateTimeEdit_3" , "height" )
      WIDTH       270
      FONTCOLOR   mg_Get( "d_window" , "DateTimeEdit_3" , "backcolor" )
      FONTBOLD    mg_Get( "d_window" , "DateTimeEdit_3" , "fontbold" )
      FONTITALIC  mg_Get( "d_window" , "DateTimeEdit_3" , "fontitalic" )
      FONTSIZE    mg_Get( "d_window" , "DateTimeEdit_3" , "fontsize" )
      FONTNAME    mg_Get( "d_window" , "DateTimeEdit_3" , "fontname" )
      VALUE       HB_TtoC( mg_Get( "d_window" , "DateTimeEdit_3" , "value" ) )
   END LABEL

   CREATE LABEL LabelDateTimeFormat
      ROW         425
      COL         10
      WIDTH       mg_Get( "d_window" , "width" ) - 20
      ALIGN       Qt_AlignHCenter
      FONTBOLD    .T.
      VALUE       "Harbour Date and Time Format: " + Set( _SET_DATEFORMAT ) + " " + Set( _SET_TIMEFORMAT )
   END LABEL

Return .T.




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


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: March 09
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

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


Jump to Donation Topic


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

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic