TextBox
Previous topic  First topic  Next topic







The TEXTBOX control, used for input and output, can handle 3 different types of content: TEXT, NUMERIC and DATEBy default, all textbox are TEXT type, to change the handle data type, have the following properties:

El control TEXTBOX, utilizado para entrada y salida de datos puede manejar 3 diferentes tipos de contenidos: TEXTO, NUMERICO y FECHA
Por default, todo textbox es de tipo TEXTO, para cambiar el tipo de dato a manejar tenemos las siguientes propiedades:


NUMERIC <.T. | .F.>
and
DATE <.T. | .F.>

In all cases, the VALID property can be used to implement a custom TEXTBOX content validation, for example:
VALID {| x | MyValid( x ) }In this way, the function MyValid( xValue ) receives the value of the textbox as a parameter when trying to lose focus.This function should return one of the following values:
.T. : Validation OK, lets lose focus
.F. : Validation Wrong, does not lose focus
"" (Empty string) Validation OK, equivalent to .T.
"user_message" Validation Wrong, NOT lose focus and can also control will send an error message with the text returned by the function, in this case: "user_message"

En todos los casos se puede utilizar la propiedad VALID para ejecutar una validación personal del contenido del TEXTBOX, por ejemplo:
VALID {|x| MyValid( x ) }
De este modo, la función MyValid( xValue ) recibe como parámetro el valor que tiene el textbox al momento de intentar perder el foco.
Dicha función deberá retornar alguno de los siguientes valores:

.T. : Validación OK, permite perder el foco
.F. : Validación Errónea, NO permite perder el foco
"" : (cadena vacía) Validación OK, equivalente a .T.
"user_message" : Validación Errónea, NO permite perder el foco y además, el control va a enviar un mensaje de error con el texto retornado por la función, en este caso: "user_message"


TEXT Textbox (Default)

The textbox of type TEXT can be managed using input masks applying INPUTMASK property
Valid values are:

Los textbox de tipo TEXT pueden ser manejados mediante mascaras de datos de entrada aplicandoles la propiedad INPUTMASK
Los valores aceptados son:


Char  Meaning
A     ASCII alphabetic character required. A-Z, a-z.
a     ASCII alphabetic character permitted but not required.
N     ASCII alphanumeric character required. A-Z, a-z, 0-9.
n     ASCII alphanumeric character permitted but not required.
X     Any character required.
x     Any character permitted but not required.
9     ASCII digit required. 0-9.
0     ASCII digit permitted but not required.
D     ASCII digit required. 1-9.
d     ASCII digit permitted but not required (1-9).
#     ASCII digit or plus/minus sign permitted but not required.
H     Hexadecimal character required. A-F, a-f, 0-9.
h     Hexadecimal character permitted but not required.
B     Binary character required. 0-1.
b     Binary character permitted but not required.
>     All following alphabetic characters are uppercased.
<     All following alphabetic characters are lowercased.
!     Switch off case conversion.
\     Use \ to escape the special characters listed above to use them as separators.


Note: The masks that require any character NOT accept blank characters therefore have no effect the following keys:
BACKSPACE, DELETE and SPACEBAR

Nota: Las mascaras que requieren algun caracter NO aceptan caracteres en blanco, por ende no tienen efecto las siguientes teclas:
BACKSPACE, DELETE y SPACEBAR


It is also possible to convert a character value by applying a mask function by mg_Transform( cValue , cMask )
For example, if coded mg_Transform( "PEPE" , "AA-AA" )
the result will be "PE-PE"

Tambien es posible convertir un valor caracter aplicándole una mascara mediante la funcion mg_Transform( cValue , cMask )
Por ejemplo: si codificamos mg_Transform( "PEPE" , "AA-AA" )
el resultado será: "PE-PE"


Inversely, we can get the original character product of applying a mask using the function mg_UnTransform( cValue , cMask )
For example, if coded mg_UnTransform( "PE-PE" , "AA-AA" )
the result will be "PEPE"

De forma inversa, podemos obtener el caracter original producto de aplicarle una mascara con la funcion mg_UnTransform( cValue , cMask )
Por ejemplo: si codificamos mg_UnTransform( "PE-PE" , "AA-AA" )
el resultado será: "PEPE"



NUMERIC Textbox

The numeric textbox type consist of a free format field where you can enter numeric digits 0 through 9.
Los textbox de tipo numericos consisten de un campo de formato libre en donde se pueden ingresar digitos numericos de 0 a 9.

To manage decimals we have two options:
  • SET DECIMALS TO <nDecimals> (it is a global SETTING whose default is 2 decimal places)
  • DECIMALS <nDecimals> (is a control property that overrides global settings)
  • .
    Para el manejo de decimales tenemos dos opciones:

  • SET DECIMALS TO <nDecimals> (es un seteo a nivel global cuyo default es 2 decimales)
  • DECIMALS <nDecimals> (es una propiedad del control que sobreescribe el seteo global)
  • .

    Decimals greater than 0 enables the key for decimal point
    You can change the decimal point character in two ways:

  • SET DECIMALPOINT TO <cChar> (it is a global SETTING whose default is Qt_DecimalPoint_Dot)
  • DECIMALS <nDecimals> (it is a control property that overrides global settings)
  • .
    Indicando DECIMALS mayor a 0 se habilita la tecla para punto decimal
    Es posible cambiar el caracter de punto decimal de dos formas:

  • SET DECIMALPOINT TO <cChar> (es un seteo a nivel global cuyo default es Qt_DecimalPoint_Dot)
  • DECIMALPOINT <cChar> (es una propiedad del control que sobreescribe el seteo global.
  • .
    Accepted values for both cases are: Qt_DecimalPoint_Dot o Qt_DecimalPoint_Comma
    Valores aceptados en ambos casos: Qt_DecimalPoint_Dot o Qt_DecimalPoint_Comma

    For use negative fields we have the property:
    ALLOWNEGATIVE <.T. | .F.>
    with this property enables the use of the key '-'

    Para el uso de campos negativos contamos con la propiedad:
    ALLOWNEGATIVE <.T. | .F.>
    con esta propiedad se habilita el uso de la tecla '-'


    When the textbox is no longer edited, ie, when the focus leaves the control, we can format the number to show through the FORMAT property. This property is a string where each position indicates a type of formatting to apply to display data. Valid values are:
    Cuando el textbox deja de ser editado, es decir, cuando se abandona el foco del control, podemos darle formato al numero a mostrar mediante la propiedad FORMAT. Esta propiedad consiste en una cadena de caracteres en donde cada posición indica un tipo de formato a aplicarle al dato a mostrar. Los valores aceptados son:

  • R (add the CR (credit) after the number to show, if its value is greater than zero)(agrega los caracteres CR (crédito) a continuación del número a mostras, si su valor es mayor a cero)
  • B (characters adds DB (debit) after the number to show, if its value is less than zero)(agrega los caracteres DB (débito) a continuación del número a mostrar, si su valor es menor a cero)
  • ( (Add parentheses before and after the number to show if its value is less than zero)(agrega parentesis antes y despues del número a mostrar si su valor es menor a cero)
  • + (Add the + sign before the number to show if its value is greater than zero)(agrega el signo + antes del número a mostrar si su valor es mayor a cero)
  • D (fill with zeros to the right of the decimal point if the number has fewer decimal places than those specified. Normally used to align multiple numeric textbox)(completa con ceros a la derecha los decimales si el número tiene menos decimales de los especificados. Usado normalmente para alinear varios textbox numericos)
  • C (shows a comma instead of point in a decimal point and shows a rather specific point whether to display the thousands separator)(muestra una coma en lugar de punto en el separador de decimales y muestra un punto en lugar de coma si se especifico que se muestren los separadores de miles)
  • M (show thousands separators. By default is a comma, unless you specify the format of 'C' or property with Qt_DecimalPoint_Comma DECIMALPOINT)(muestra separadores de miles. Por default es una coma, salvo que se haya especificado el formato 'C' o la propiedad DECIMALPOINT con Qt_DecimalPoint_Comma)
  • $ (Displays the current monetary unit. By default this is '$' but can be changed using the property or means of the setting MONEYIDENTIFIER overall MONEYIDENTIFIER SET TO <cChar>)(muestra el signo monetario en curso. Por default es '$' pero se puede cambiar mediante la propiedad MONEYIDENTIFIER o mediante el seteo global SET MONEYIDENTIFIER TO <cChar>)
  • < (add a character or a string prefix. By default this is '<' but you can specify other characters owned by PREFIX)(agrega un caracter o un string de prefijo. Por default es '<' pero se puede especificar otro caracter mediante la propiedad PREFIX)
  • > (add a character or a string suffix. By default this is '>' but you can specify a different character with the property SUFFIX)(agrega un caracter o un string de sufijo. Por default es '>' pero se puede especificar otro caracter mediante la propiedad SUFFIX)
  • .


    To test the operation of a format we have the method "GetNumberFormated"
    For example, if we have a TextBox named T_1 in the window "Win" and we want to know how the numeric value content would be formatted:
    -1234 in the form "B(" we could code:
    mg_Do( "Win" , "T_1" , "GetNumberFormated" , "B(" )
    This would result in : (-1234 DB)
    If the format parameter is not coded, format is assumed for the encoded in the textbox T_1

    Para testear el funcionamiento de un formato disponemos del método "GetNumberFormated"
    Por ejemplo, si tenemos un TextBox llamado T_1 en la ventana "Win" y queremos saber como quedaría formateado el contenido numerico con valor: -1234 con el formato "B(" podriamos codificar:
    mg_Do( "Win" , "T_1" , "GetNumberFormated" , "B(" )
    Esto nos daría como resultado: (-1234 DB)
    Si no se codifica el parámetro correspondiente al formato se asume el formato codificado en el textbox T_1


    Note: With this new implementation IMPUTMASK can not be used with textboxs NUMERIC as new features and properties provides similar solutions. Anyway, you can use masks in TEXT type textbox and then convert them to numbers with the function of Harbour VAL( cText )
    Nota: Con esta nueva implementación no es posible utilizar IMPUTMASK con textboxs NUMERIC ya que las nuevas funcionalidades y propiedades nos brindan soluciones similares. De todos modos, se pueden utilizar mascaras en textbox tipo TEXT y luego convertirlos a numeros con la funcion de Harbour VAL( cText )


    DATE Textbox

    The date type controls are formatted according to the SET DATE TO global setting <cDateMode>
    Los controles de tipo date tienen un formato acorde al seteo globla SET DATE TO <cDateMode>

    Using property DATEVALID <.T. | .F.> you can force the automatic validation of the date indicated. By default, this property displays an error message if the date entered is invalid. In case of not wanting to show the error message, but continue to act validation, you can specify the property DATEVALIDMUTE <.T. | .F.>.
    Mediante la propiedad DATEVALID <.T. | .F.> se puede forzar la validación automática de la fecha indicada. Por default, esta propiedad muestra un mensaje de error en caso que la fecha ingresada sea inválida. En caso de no querer mostrar el mensaje de error, pero que siga actuando la validación, se puede especificar la propiedad DATEVALIDMUTE <.T. | .F.>.

    To accept empty dates ALLOWEMPTYDATE <.T. | .F.> property can be specified. If this property is not in TRUE an error message throws indicating that the empty dates are not permitted. To continue to make this control but not display the error message, is posible to use property ALLOWEMPTYDATEMUTE <.T. | .F.>.
    Para aceptar fechas vacias se puede especificar la propiedad ALLOWEMPTYDATE <.T. | .F.>. Si esta propiedad no esta en TRUE se arroja un mensaje de error indicando que las fechas vacias no son permitidas. Para seguir realizando este control, pero que no se muestre el mensaje de error, se puede utilizar la propiedad ALLOWEMPTYDATEMUTE <.T. | .F.>.

    If you need to enter a similar value in a textbox DATE repeatedly to a series of iterations (eg day bills for the month), you can use the SELECTBY property that causes is selected only part of the date that we want to modify when get the focus control
    Valid values are:

    Si necesitamos ingresar un valor similar en un textbox DATE en forma reiterada para una serie de iteraciones (por ejemplo el dia correspondiente a las facturas del mes), se puede utilizar la propiedad SELECTBY que provoca que al obtener el foco del control se seleccione solamente la parte de la fecha que nos interesa modificar.
    Los valores aceptados son:

  • Qt_SelectByAll (Default)
  • Qt_SelectByDay
  • Qt_SelectByMonth
  • Qt_SelectByYear
  • .



    Define and Properties


    Properties
    Status
    Default
    Planned
    Started
    Ready
    Comments
    CREATE TEXTBOX 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
          [ ENABLED .T. | .F. ]
    .T.
      
    Enable or Disable control
          [ VALUE xValue ]
    NIL
      
    A text expressions for the control (Character, Numeric, Date or Password according others properties was settings)
          [ 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
          [ SELECTIONFONTCOLOR {aFontColor} | aVarFontColor ]   
    Set font color for selected textbox area
          [ SELECTIONBACKCOLOR {aBackColor} | aVarBackColor ]   
    Set background color for selected textbox area
          [ CARETPOS nPosition ]
    1
      
    Move cursor position to nPosition. Warnig, if you code CARETPOS before another property is posible that position change and doesn't respect your CARETPOS property. Then, coded CARETPOS before END TEXTBOX
          [ TOOLTIP cToolTip ]
    NIL
      
    Text for display into tooltip
          [ READONLY .T. | .F. ]
    .F.
      
    This property restrict the input from keyboard and the control is used as output mode only
          [ ALIGN nAlign ]
    Qt_AlignLeft
      
    Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
          [ TEXT .T. | .F. ]
    .T.
      
    Free text input (Default)
          [ INPUTMASK cInputMask ]   
    This property holds the validation input mask for TEXT only textboxes. Go to for a complete description
          [ NUMERIC .T. | .F. ]
    .F.
      
    Restrict input text to only digits
          [ ALLOWNEGATIVE .T. | .F. ]
    .F.
      
    Allow user to enter an negative number in an NUMERIC textbox
          [ DECIMALPOINT ]
    Qt_DecimalPoint_Dot
      
    Allow user to change character for decimal point.
    Accepted values are: Qt_DecimalPoint_Dot or Qt_DecimalPoint_Comma
          [ DECIMALS nDecimals ]
    SET DECIMALS TO
      
    Override global SET DECIMALS TO nDec
          [ FORMAT cFormat ]
    ""
      
    This property allow user to modify the display format of a NUMERIC textbox. Go to for a complete description
          [ MONEYIDENTIFIER cMoneyIdentifier ]
    SET MONEYIDENTIFIER TO or "$"
      
    This property allow user to change the global SET MONEYIDENTIFIER used by FORMAT property to show a money identifier before NUMERIC value
          [ PREFIX cPrefix ]
    "<"
      
    This property allow user to change the default char used by FORMAT property to show a prefix identifier before NUMERIC value
          [ SUFFIX cSuffix ]
    ">"
      
    This property allow user to change the default char used by FORMAT property to show a suffix identifier after NUMERIC value
          [ SELECTBY nMode ]
    Qt_SelectByAll
      
    This property allow user to specify witch part of DATE textbox will be selected when DATE textbox get the focus.
    Accepted values are:
    Qt_SelectByAll
    Qt_SelectByDay
    Qt_SelectByMonth
    Qt_SelectByYear
          [ DATE .T. | .F. ]
    .F.
      
    Restrict input text to DATE format
          [ DATEVALID .T. | .F. ]
    .F.
      
    Force user to enter a valid DATE. If not, control will send an error message
          [ DATEVALIDMUTE .T. | .F. ]
    .F.
      
    Supress error message when DATE is invalid and DATEVALID is true
          [ ALLOWEMPTYDATE .T. | .F. ]
    .F.
      
    Allow user to enter an empty date. If not, control will send an error message
          [ ALLOWEMPTYDATEMUTE .T. | .F. ]
    .F.
      
    Supress error message when DATE is empty and ALLOWEMPTYDATE is false
          [ UPPERCASE .T. | .F. ]
    .F.
      
    Convert input text to UPPERCASE
          [ LOWERCASE .T. | .F. ]
    .F.
      
    Convert input text to LOWERCASE
          [ MAXLENGTH nMaxLength ]   
    Max length input characters
          [ PASSWORD .T. | .F. ]
    .F.
      
    Replace display of real characters by asterisks
          [ 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.
          [ 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.
          [ VALID cValid | {BValid} ]
    NIL
      
    An action to be performed when control has lost focus. The user function or BLOCK can return any of this values:
    .T. : Value OK, lost focus
    .F. : Value ERROR, held focus
    "" : (empty string) Value OK, lost focus
    "user_message" : Value Error, held focus and control will send a message with the "user_message"
          [ 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 when control has changed
          [ 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
          [ VISIBLE .T. | .F. ]
    .T.
      
    Show or hide control (like methods SHOW and HIDE)
          [ 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 TEXTBOX 

    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.
        DATEVALID
    n/a
      
    This method is used to check if a TEXTBOX DATE is valid
        GETNUMBERFORMATED [ , cFormat ]
    Property FORMAT of textbox
      
    This method is used to get the numeric value formated by cFormat. If cFormat is not specified, property FORMAT of textbox control will be used.
        VALID
    n/a
      
    Execute VALID block coded in CREATE or seted by mg_Set
        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



    TextBox example SIMPLE:

    File: d_textbox.prg

    #include "marinas-gui.ch"

    MEMVAR cTextBoxName
    MEMVAR nNumber

    Function main()

       PRIVATE cTextBoxName := "d_textbox"
       PRIVATE nNumber      := 33

       SET APPLSTYLE TO "MarinasLooks"

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

          d_textbox_def()

       END WINDOW

       mg_Do( "d_window" , "center" )

       mg_Do( "d_window" , "activate" )

    Return .T.


    File: d_textbox_def.prg

    #include "marinas-gui.ch"

    Function d_textbox_def()

          CREATE TEXTBOX Text_1
                 ROW    20
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 TOOLTIP "BackColor and CaseConvert UPPER"
                 BACKCOLOR {145,242,47}
                 UPPERCASE .t.
                 VALUE  "Convert TO UPPER"
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_1" , "value" ) ) )

                 CREATE CONTEXT MENU

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

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

                 END MENU

          END TEXTBOX

          CREATE LABEL Text_1Label
                 ROW    20
                 COL    520
                 WIDTH  190
                 HEIGHT 24
                 FONTCOLOR {0,0,255}
                 FONTBOLD .T.
                 VALUE "Enter a String value"
          END LABEL

          CREATE TEXTBOX &( M->cTextBoxName + "__" + alltrim( str( M->nNumber ) ) )
                 ROW    70
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 TOOLTIP "ToolTip for TextBox"
                 ALIGN Qt_AlignRight
                 FONTCOLOR {215,9,65}
                 VALUE  "FontColor and ALIGN Right"
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , M->cTextBoxName + "__" + alltrim( str( M->nNumber ) ) , "value" ) ) )
          END TEXTBOX

          CREATE TEXTBOX Text_3
                 ROW    120
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 FONTSIZE 14
                 TOOLTIP "ToolTip for TextBox"
                 FONTBOLD .T.
                 FONTITALIC .T.
                 VALUE  "FontBold, FontItalic and FontSize"
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_3" , "value" ) ) )
          END TEXTBOX

          CREATE TEXTBOX Text_4
                 ROW    170
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 ALIGN Qt_AlignRight
                 TOOLTIP "ToolTip for TextBox with DATATYPE NUMERIC"
                 NUMERIC  .T.
                 VALUE 1234567890
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_4" , "value" ) ) )
          END TEXTBOX

          CREATE LABEL Text_4Label
                 ROW    170
                 COL    520
                 WIDTH  190
                 HEIGHT 24
                 FONTCOLOR {0,0,255}
                 FONTBOLD .T.
                 VALUE "Enter a Numeric value"
          END LABEL

          CREATE TEXTBOX Text_5
                 ROW    220
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 TOOLTIP "ToolTip for TextBox with DATATYPE DATE"
                 BACKCOLOR {181,186,213}
                 DATE .T.
                 VALUE Date()
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_5" , "value" ) ) )
                 ALIGN Qt_AlignCenter
          END TEXTBOX

          CREATE LABEL Text_5Label
                 ROW    220
                 COL    520
                 WIDTH  190
                 HEIGHT 24
                 FONTCOLOR {0,0,255}
                 FONTBOLD .T.
                 VALUE "Enter a DATE value"
          END LABEL

          CREATE TEXTBOX Text_6
                 ROW    270
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 ALIGN Qt_AlignCenter
                 PASSWORD .T.
                 TOOLTIP "ToolTip for TextBox with PASSWORD"
                 VALUE "password"
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_6" , "value" ) ) )
          END TEXTBOX

          CREATE LABEL Text_6Label
                 ROW    270
                 COL    520
                 WIDTH  250
                 HEIGHT 24
                 FONTCOLOR {0,0,255}
                 FONTBOLD .T.
                 VALUE "Enter a value and press ENTER"
          END LABEL

          CREATE TEXTBOX Text_7
                 ROW    320
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 TOOLTIP "ToolTip for TextBox"
                 MAXLENGTH 20
                 VALUE  "MaxLen 20   -------|"
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_7" , "value" ) ) )
          END TEXTBOX

          CREATE TEXTBOX Text_8
                 ROW    370
                 COL    150
                 WIDTH  350
                 HEIGHT 24
                 TOOLTIP "ToolTip for TextBox with OnLostFocus, OnGotFofus and OnChange"
                 VALUE  "OnLostFocus, OnGotFofus and OnChange"
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_8" , "value" ) ) )
                 ONCHANGE mg_Set( "d_window" , "text_8Label" , "value" , mg_Get( "d_window" , "text_8" , "value" ) )
                 ONGOTFOCUS mg_Set( "d_window" , "text_8Label" , "value" , "Focused!!!" )
                 ONLOSTFOCUS mg_Set( "d_window" , "text_8Label" , "value" , "Without Focus" )
          END TEXTBOX

          CREATE LABEL Text_8Label
                 ROW    370
                 COL    520
                 WIDTH  190
                 HEIGHT 24
                 FONTCOLOR {255,0,0}
                 FONTBOLD .T.
                 VALUE  "Without Focus"
          END LABEL

          CREATE TEXTBOX Text_9
                 ROW    420
                 COL    150
                 WIDTH  350
                 HEIGHT 24
              // INPUTMASK "000.000.000.000;_"
                 INPUTMASK "999.999.999.999"
                 VALUE "132.089.067.121"
                 FontCOLOR {0,0,255}
                 TOOLTIP "FontColor and INPUTMASK for an IP address"
                 ONENTER mg_msginfo( mg_allstr( mg_Get( "d_window" , "text_9" , "value" ) ) )
          END TEXTBOX

          CREATE LABEL Text_9Label
                 ROW    420
                 COL    520
                 WIDTH  190
                 HEIGHT 24
                 FONTCOLOR {0,0,255}
                 FONTBOLD             .T.
                 VALUE  "Enter an IP Address"
          END LABEL

    Return .T.

    // ---------------------------------------------------------------------//
    // The followin function sample is called from menu "Other" of MAINDEMO //
    // ---------------------------------------------------------------------//
    Function TextBox_SampleENTERTAB()

       CREATE WINDOW SampleEnterTab
          ROW 0
          COL 0
          MODAL .T.
          ENTERTAB .T.
          WIDTH 632
          HEIGHT 230
          CAPTION "Sample ENTERTAB"
          BACKCOLOR { 186 , 187 , 214 }

          CREATE LABEL Text_4Label
                 ROW    30
                 COL    40
                 WIDTH  78
                 HEIGHT 16
                 VALUE "First Name:"
                 FONTBOLD .T.
                 FONTCOLOR {0,0,255}
          END LABEL

          CREATE TEXTBOX Text_1
                 ROW    20
                 COL    120
                 WIDTH  120
                 HEIGHT 24
          END TEXTBOX

          CREATE LABEL Text_5Label
                 ROW    30
                 COL    280
                 WIDTH  73
                 HEIGHT 17
                 VALUE "Last Name:"
                 FONTBOLD .T.
                 FONTCOLOR {0,0,255}
          END LABEL

          CREATE TEXTBOX Text_2
                 ROW    20
                 COL    355
                 WIDTH  120
                 HEIGHT 24
          END TEXTBOX

          CREATE LABEL Label_1
                 ROW    80
                 COL    40
                 WIDTH  30
                 HEIGHT 20
                 VALUE "Sex:"
                 FONTBOLD .T.
                 FONTCOLOR {0,0,255}
          END LABEL

          CREATE COMBOBOX Combo_1
                 ROW    70
                 COL    73
                 WIDTH  45
                 HEIGHT 24
                 ITEMS {'M','F'}
                 VALUE 1
          END COMBOBOX

          CREATE LABEL Text_9Label
                 ROW    80
                 COL    180
                 WIDTH  27
                 HEIGHT 24
                 VALUE "Age:"
                 FONTBOLD .T.
                 FONTCOLOR {0,0,255}
          END LABEL

          CREATE TEXTBOX Text_3
                 ROW    70
                 COL    220
                 WIDTH  32
                 HEIGHT 24
                 NUMERIC .T.
          END TEXTBOX

          CREATE LABEL Text_6Label
                 ROW    80
                 COL    330
                 WIDTH  33
                 HEIGHT 23
                 VALUE "City:"
                 FONTBOLD .T.
                 FONTCOLOR {0,0,255}
          END LABEL

          CREATE TEXTBOX Text_4
                 ROW    70
                 COL    380
                 WIDTH  120
                 HEIGHT 24
          END TEXTBOX

          CREATE LABEL Text_8Label
                 ROW    130
                 COL    200
                 WIDTH  57
                 HEIGHT 19
                 VALUE "Country:"
                 FONTBOLD .T.
                 FONTCOLOR {0,0,255}
          END LABEL

          CREATE TEXTBOX TextBox77
                 ROW    120
                 COL    260
                 WIDTH  120
                 HEIGHT 24
                 VALUE "Argentina"
          END TEXTBOX

          CREATE LABEL Text_8Label77
                 ROW    170
                 COL    20
                 ALIGN Qt_AlignCenter
                 WIDTH  mg_Get( "SampleEnterTab" , "width" ) - 40
                 HEIGHT 19
                 VALUE "You can view this code from d_textbox_def.prg"
                 FONTBOLD .T.
                 FONTCOLOR {255,255,255}
                 BACKCOLOR {255,0,0}
          END LABEL

          CREATE KEY ESCAPE
             ACTION mg_Do( "SampleEnterTab" , "release" )
          END KEY

       END WINDOW

       mg_Do( "SampleEnterTab" , "center" )

       mg_Do( "SampleEnterTab" , "activate" )

    Return .T.



    TextBox example COMPLEX:

    File: d_textbox2.prg

    #include "marinas-gui.ch"

    Function main()

       SET APPLSTYLE TO "MarinasLooks"

       SET CENTURY ON
       SET DATE TO BRITISH

       SET DECIMALS TO 4

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

          d_textbox_def2()

       END WINDOW

       mg_Do( "d_window" , "center" )

       mg_Do( "d_window" , "activate" )

    Return .T.


    File: d_textbox_def2.prg

    #include "marinas-gui.ch"

    Function d_textbox_def2()

       CREATE LABEL LN_1
           ROW 10
           COL 10
           VALUE "Free NUMERIC without DECIMALS: 123"
       END LABEL
       CREATE  TEXTBOX TN_1
               ROW 10
               COL 491
               NUMERIC .T.
               DECIMALS 0
               ALIGN Qt_AlignRight
               VALUE 123
               ONCHANGE TextBox_Test_onchange( "Numeric" )
               ONLOSTFOCUS TextBox_Test_onlostfocus( "Numeric" )
               ONGOTFOCUS TextBox_Test_ongotfocus( "Numeric" )
       END TEXTBOX
       CREATE BUTTON BN_1
           ROW 10
           COL mg_Get( "d_window" , "TN_1" , "col" ) + mg_Get( "d_window" , "TN_1" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + "Normal: " + mg_allStr( mg_Get( "d_window" , "TN_1" , "value" ) ) + HB_OsNewLine() + "Formated: " + mg_Do( "d_window" , "TN_1" , "GetNumberFormated" ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TN_1" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBN_1
           ROW 10
           COL mg_Get( "d_window" , "BN_1" , "col" ) + mg_Get( "d_window" , "BN_1" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TN_1" , "setfocus" )
       END BUTTON

       CREATE BUTTON PBN_1
           ROW 10
           CAPTION "Put '432' in N1"
           WIDTH 130
           COL mg_Get( "d_window" , "TN_1" , "col" ) - mg_Get( "d_window" , "PBN_1" , "width" ) - 10
           NOTABSTOP .T.
           ONCLICK mg_Set( "d_window" , "TN_1" , "value" , 432 )
       END BUTTON

       CREATE LABEL LN_2
           ROW 40
           COL 10
           VALUE "Free NUMERIC with SET DECIMALS " + alltrim( str( Set( _SET_DECIMALS ) ) ) + ": 123.456789 (COMMA as DECIMALPOINT)"
       END LABEL
       CREATE  TEXTBOX TN_2
               ROW 40
               COL 491
               NUMERIC .T.
               ALIGN Qt_AlignRight
               DECIMALPOINT Qt_DecimalPoint_Comma
               VALUE  123.456789
       END TEXTBOX
       CREATE BUTTON BN_2
           ROW 40
           NOTABSTOP .T.
           COL mg_Get( "d_window" , "TN_2" , "col" ) + mg_Get( "d_window" , "TN_2" , "width" ) + 10
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + "Normal: " + mg_allStr( mg_Get( "d_window" , "TN_2" , "value" ) ) + HB_OsNewLine() + "Formated: " + mg_Do( "d_window" , "TN_2" , "GetNumberFormated" ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TN_2" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBN_2
           ROW 40
           COL mg_Get( "d_window" , "BN_2" , "col" ) + mg_Get( "d_window" , "BN_2" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TN_2" , "setfocus" )
       END BUTTON

       CREATE LABEL LN_3
           ROW 70
           COL 10
           VALUE "Free NUMERIC without DECIMALS + Dolar Sign + ALLOWNEGATIVE: 123"
       END LABEL
       CREATE  TEXTBOX TN_3
               ROW 70
               COL 491
               NUMERIC .t.
               ALIGN Qt_AlignRight
               DECIMALS 0
               MONEYIDENTIFIER "U$S"
               VALID {|x| TextBox_Test_Valid( x ) }
               ALLOWNEGATIVE .t.
               VALUE 123
       END TEXTBOX
       CREATE BUTTON BN_3
           ROW 70
           COL mg_Get( "d_window" , "TN_3" , "col" ) + mg_Get( "d_window" , "TN_3" , "width" ) + 10
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + "Normal: " + mg_allStr( mg_Get( "d_window" , "TN_3" , "value" ) ) + HB_OsNewLine() + "Formated: " + mg_Do( "d_window" , "TN_3" , "GetNumberFormated" ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TN_3" , "value" ) ) )
           NOTABSTOP .T.
       END BUTTON
       CREATE BUTTON FBN_3
           ROW 70
           COL mg_Get( "d_window" , "BN_3" , "col" ) + mg_Get( "d_window" , "BN_3" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TN_3" , "setfocus" )
       END BUTTON

       CREATE LABEL LN_4
           ROW 100
           COL 10
           VALUE "Free NUMERIC with DECIMALS 3 + ALLOWNEGATIVE: -123.456"
       END LABEL
       CREATE   TEXTBOX TN_4
               ROW 100
               COL 491
               TOOLTIP 'Date TextBox 4'
               NUMERIC .t.
               DECIMALS 3
               ALLOWNEGATIVE .t.
               ALIGN Qt_AlignRight
               VALUE -123.456
       END TEXTBOX
       CREATE BUTTON BN_4
          NOTABSTOP .T.
          ROW 100
          COL mg_Get( "d_window" , "TN_4" , "col" ) + mg_Get( "d_window" , "TN_4" , "width" ) + 10
          CAPTION "Get Value"
          ONCLICK mg_Log( HB_OsNewLine() + "Normal: " + mg_allStr( mg_Get( "d_window" , "TN_4" , "value" ) ) + HB_OsNewLine() + "Formated: " + mg_Do( "d_window" , "TN_4" , "GetNumberFormated" ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TN_4" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBN_4
           ROW 100
           COL mg_Get( "d_window" , "BN_4" , "col" ) + mg_Get( "d_window" , "BN_4" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TN_4" , "setfocus" )
       END BUTTON

       CREATE LABEL lf
               ROW 130
               COL 10
               VALUE "Format: "
       END LABEL

       CREATE CHECKBOX CH_CR
               ROW 130
               COL 100
               VALUE .F.
               CAPTION "CR"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Displays CR after positive numbers"
       END CHECKBOX
       CREATE CHECKBOX CH_DB
               ROW 130
               COL 170
               VALUE .F.
               CAPTION "DB"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Displays DB after negative numbers"
       END CHECKBOX
       CREATE CHECKBOX CH_PLUSSIGN
               ROW 130
               COL 240
               VALUE .F.
               CAPTION "+"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Displays always signs: '+' for positive numbers, '-' for negative numbers. By default only for negative."
       END CHECKBOX
       CREATE CHECKBOX CH_PARENTHESES
               ROW 130
               COL 310
               VALUE .F.
               CAPTION "("
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Encloses negative numbers in parentheses"
       END CHECKBOX
       CREATE CHECKBOX CH_PADDECIMALS
               ROW 130
               COL 380
               VALUE .F.
               CAPTION "D"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Pad decimals with zeros"
       END CHECKBOX
       CREATE CHECKBOX CH_DECIMALPOINTCOMMA
               ROW 130
               COL 450
               VALUE .F.
               CAPTION "C"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Decimal point is comma"
       END CHECKBOX
       CREATE CHECKBOX CH_MILLARSEPARATOR
               ROW 130
               COL 520
               VALUE .F.
               CAPTION "M"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Add millar separator sign"
       END CHECKBOX
       CREATE CHECKBOX CH_MONEYIDENTIFIER
               ROW 130
               COL 590
               VALUE .F.
               CAPTION "$"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Add MONEY identifier"
       END CHECKBOX
       CREATE CHECKBOX CH_PREFIXSIGN
               ROW 130
               COL 660
               VALUE .F.
               CAPTION "<"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Add PREFIX sign"
       END CHECKBOX
       CREATE CHECKBOX CH_SUFFIXSIGN
               ROW 130
               COL 730
               VALUE .F.
               CAPTION ">"
               ONCHANGE TextBox_ChangeFormat()
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Add SUFFIX sign"
       END CHECKBOX

       CREATE LABEL LT_1
           ROW 180
           COL 10
           VALUE "Free TEXT: Initial Value"
       END LABEL
       CREATE  TEXTBOX TT_1
               ROW 180
               COL 491
               VALUE "Initial Value"
               ONCHANGE TextBox_Test_onchange( "Text" )
               ONLOSTFOCUS TextBox_Test_onlostfocus( "Text" )
               ONGOTFOCUS TextBox_Test_ongotfocus( "Text" )
       END TEXTBOX
       CREATE BUTTON BT_1
           ROW 180
           COL mg_Get( "d_window" , "TT_1" , "col" ) + mg_Get( "d_window" , "TT_1" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + mg_allStr( mg_Get( "d_window" , "TT_1" , "value" ) ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TT_1" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBT_1
           ROW 180
           COL mg_Get( "d_window" , "BT_1" , "col" ) + mg_Get( "d_window" , "BT_1" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TT_1" , "setfocus" )
       END BUTTON

       CREATE BUTTON PBT_1
           ROW 180
           CAPTION "Put 'NewValue' in T1"
           WIDTH 130
           COL mg_Get( "d_window" , "TT_1" , "col" ) - mg_Get( "d_window" , "PBT_1" , "width" ) - 10
           NOTABSTOP .T.
           ONCLICK mg_Set( "d_window" , "TT_1" , "value" , "newValue" )
       END BUTTON

       CREATE  TEXTBOX TT_2
               ROW 210
               COL 491
               VALUE "4259-2778Q"
               INPUTMASK "0000-9999A"
       END TEXTBOX
       CREATE LABEL LT_2
           ROW 210
           COL 10
           VALUE "Masked TEXT simple [" + mg_Get( "d_window" , "TT_2" , "inputmask" ) + "] initial: " + mg_Get( "d_window" , "TT_2" , "value" )
       END LABEL
       CREATE BUTTON BT_2
           ROW 210
           COL mg_Get( "d_window" , "TT_2" , "col" ) + mg_Get( "d_window" , "TT_2" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + mg_allStr( mg_Get( "d_window" , "TT_2" , "value" ) ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TT_2" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBT_2
           ROW 210
           COL mg_Get( "d_window" , "BT_2" , "col" ) + mg_Get( "d_window" , "BT_2" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TT_2" , "setfocus" )
       END BUTTON

       CREATE  TEXTBOX TT_3
               ROW 240
               COL 491
               VALUE "12D.34DAPEPes"
               INPUTMASK "99\D.99\D\A>AAA!AA"
       END TEXTBOX
       CREATE LABEL LT_3
           ROW 240
           COL 10
           VALUE "Masked TEXT complex [" + mg_Get( "d_window" , "TT_3" , "inputmask" ) + "] initial: " + mg_Get( "d_window" , "TT_3" , "value" )
       END LABEL
       CREATE BUTTON BT_3
           ROW 240
           COL mg_Get( "d_window" , "TT_3" , "col" ) + mg_Get( "d_window" , "TT_3" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + mg_allStr( mg_Get( "d_window" , "TT_3" , "value" ) ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TT_3" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBT_3
           ROW 240
           COL mg_Get( "d_window" , "BT_3" , "col" ) + mg_Get( "d_window" , "BT_3" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TT_3" , "setfocus" )
       END BUTTON

       CREATE  TEXTBOX TT_4
               ROW 270
               COL 491
               VALUE         "978-88-89637-15-9"
               INPUTMASK     "999-99-99999-99-9"
       END TEXTBOX
       CREATE LABEL LT_4
           ROW 270
           COL 10
           VALUE "Masked TEXT, ISBN [" + mg_Get( "d_window" , "TT_4" , "inputmask" ) + "] initial: " + mg_Get( "d_window" , "TT_4" , "value" )
       END LABEL
       CREATE BUTTON BT_4
           ROW 270
           COL mg_Get( "d_window" , "TT_4" , "col" ) + mg_Get( "d_window" , "TT_4" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + mg_allStr( mg_Get( "d_window" , "TT_4" , "value" ) ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TT_4" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBT_4
           ROW 270
           COL mg_Get( "d_window" , "BT_4" , "col" ) + mg_Get( "d_window" , "BT_4" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TT_4" , "setfocus" )
       END BUTTON

       CREATE  TEXTBOX TT_5
               ROW 300
               COL 491
               VALUE         "(cDe)123-a3B/1"
               INPUTMASK     "(AAA)999-NNN/9"
       END TEXTBOX
       CREATE LABEL LT_5
           ROW 300
           COL 10
           VALUE "Masked TEXT complex [" + mg_Get( "d_window" , "TT_5" , "inputmask" ) + "] initial: " + mg_Get( "d_window" , "TT_5" , "value" )
       END LABEL
       CREATE BUTTON BT_5
           ROW 300
           COL mg_Get( "d_window" , "TT_5" , "col" ) + mg_Get( "d_window" , "TT_5" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + mg_allStr( mg_Get( "d_window" , "TT_5" , "value" ) ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TT_5" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBT_5
           ROW 300
           COL mg_Get( "d_window" , "BT_5" , "col" ) + mg_Get( "d_window" , "BT_5" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TT_5" , "setfocus" )
       END BUTTON

       CREATE  TEXTBOX TT_6
               ROW 330
               COL 491
               VALUE         "TextUppercase"
               UPPERCASE     .T.
       END TEXTBOX
       CREATE LABEL LT_6
           ROW 330
           COL 10
           VALUE "Masked TEXT complex [UPPERCASE] initial: " + mg_Get( "d_window" , "TT_6" , "value" )
       END LABEL
       CREATE BUTTON BT_6
           ROW 330
           COL mg_Get( "d_window" , "TT_6" , "col" ) + mg_Get( "d_window" , "TT_6" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + mg_allStr( mg_Get( "d_window" , "TT_6" , "value" ) ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TT_6" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBT_6
           ROW 330
           COL mg_Get( "d_window" , "BT_6" , "col" ) + mg_Get( "d_window" , "BT_6" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TT_6" , "setfocus" )
       END BUTTON

       CREATE  TEXTBOX TD_1
               ROW 390
               COL 491
               DATE .T.
               VALUE date()
       END TEXTBOX
       CREATE LABEL LD_1
           ROW 390
           COL 10
           VALUE "DATE type [" + Set( _SET_DATEFORMAT ) + " seted by SET DATE TO BRITISH], initial: " + mg_AllStr( mg_Get( "d_window" , "TD_1" , "value" ) )
       END LABEL
       CREATE BUTTON BD_1
           ROW 390
           COL mg_Get( "d_window" , "TD_1" , "col" ) + mg_Get( "d_window" , "TD_1" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Get Value"
           ONCLICK mg_Log( HB_OsNewLine() + mg_allStr( mg_Get( "d_window" , "TD_1" , "value" ) ) + HB_OsNewLine() + "Valtype: " + valtype( mg_Get( "d_window" , "TD_1" , "value" ) ) )
       END BUTTON
       CREATE BUTTON FBD_1
           ROW 390
           COL mg_Get( "d_window" , "BD_1" , "col" ) + mg_Get( "d_window" , "BD_1" , "width" ) + 10
           NOTABSTOP .T.
           CAPTION "Set Focus"
           ONCLICK mg_Do( "d_window" , "TD_1" , "setfocus" )
       END BUTTON

       CREATE LABEL lf2
               ROW 420
               COL 10
               VALUE "Properties for DATE:"
       END LABEL

       CREATE CHECKBOX CH_DATEVALID
               ROW 420
               COL 150
               VALUE .F.
               CAPTION "DateValid"
               ONCHANGE mg_Set( "d_window" , "TD_1" , "datevalid" , mg_Get( "d_window" , "CH_DATEVALID" , "value" ) )
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Force DATE valid"
       END CHECKBOX
       CREATE CHECKBOX CH_DATEVALIDMUTE
               ROW 420
               COL 300
               VALUE .F.
               CAPTION "DateValidMute"
               ONCHANGE mg_Set( "d_window" , "TD_1" , "DATEVALIDMUTE" , mg_Get( "d_window" , "CH_DATEVALIDMUTE" , "value" ) )
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Hide message stop for invalid DATE"
       END CHECKBOX
       CREATE CHECKBOX CH_ALLOWEMPTYDATE
               ROW 420
               COL 450
               VALUE .F.
               CAPTION "AllowEmptyDate"
               ONCHANGE mg_Set( "d_window" , "TD_1" , "allowemptydate" , mg_Get( "d_window" , "ch_AllowEmptyDATE" , "value" ) )
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Allow empty DATE"
       END CHECKBOX
       CREATE CHECKBOX CH_ALLOWEMPTYDATEMUTE
               ROW 420
               COL 600
               VALUE .F.
               CAPTION "AllowEmptyDateMute"
               ONCHANGE mg_Set( "d_window" , "TD_1" , "ALLOWEMPTYDATEMUTE" , mg_Get( "d_window" , "CH_ALLOWEMPTYDATEMUTE" , "value" ) )
               NOTABSTOP .T.
               FORCEACTION .T.
               TOOLTIP "Hide message stop for empty DATE"
       END CHECKBOX

       CREATE LABEL lf3
               ROW 450
               COL 10
               VALUE "DATE SelectBy:"
       END LABEL

       CREATE RADIOGROUP RG_DATESELECT
               ROW 446
               COL 120
               WIDTH 700
               ITEMS { "Qt_SelectByFull" , "Qt_SelectByDay" , "Qt_SelectByMonth" , "Qt_SelectByYear" }
               VALUE 1
               TOOLTIP "Change the selection on GOT focus for DATE type"
               HORIZONTAL .T.
               NOTABSTOP .T.
               FORCEACTION .T.
               ONCHANGE mg_Set( "d_window" , "TD_1" , "Selectby" , mg_Get( "d_window" , "RG_DateSelect" , "value" ) )
       END RADIOGROUP

    Return Nil

    Function TextBox_ChangeFormat()
       LOCAL cNumFormat := ""

       cNumFormat += IIF( mg_Get( "d_window" , "CH_CR" , "value" ) == .T., "R", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_DB" , "value" ) == .T., "B", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_PARENTHESES" , "value" ) == .T., "(", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_PLUSSIGN" , "value" ) == .T., "+", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_PADDECIMALS" , "value" ) == .T., "D", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_DECIMALPOINTCOMMA" , "value" ) == .T., "C", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_MILLARSEPARATOR" , "value" ) == .T., "M", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_MONEYIDENTIFIER" , "value" ) == .T., "$", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_PREFIXSIGN" , "value" ) == .T., "<", "" )
       cNumFormat += IIF( mg_Get( "d_window" , "CH_SUFFIXSIGN" , "value" ) == .T., ">", "" )

       mg_Set( "d_window" , "TN_1" , "Format" , cNumFormat )
       mg_Set( "d_window" , "TN_2" , "Format" , cNumFormat )
       mg_Set( "d_window" , "TN_3" , "Format" , cNumFormat )
       mg_Set( "d_window" , "TN_4" , "Format" , cNumFormat )
    Return NIL

    STATIC Function TextBox_Test_onchange( cType )
       !? HB_SYMBOL_UNUSED( cType )
       ? "On Change " + cType
    Return .T.

    STATIC Function TextBox_Test_onlostfocus( cType )
       !? HB_SYMBOL_UNUSED( cType )
       ? "On LostFocus " + cType
    Return .T.

    STATIC Function TextBox_Test_ongotfocus( cType )
       !? HB_SYMBOL_UNUSED( cType )
       ? "On GotFocus " + cType
    Return .T.

    STATIC Function TextBox_Test_Valid( xValue )
       ? xValue
       if xValue > 200
          RETurn .T.
       endif
    Return "Invalid Value for control T3, must be grete than 200"




    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