EditBox
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE EDITBOX 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.
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ VALUE xValue ]
NIL
  
A PLAIN text for the control
      [ VALUEHTML xValueHtml ]
NIL
  
A HTML text for the control (Rich TEXT)
      [ 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 area
      [ SELECTIONBACKCOLOR {aBackColor} | aVarBackColor ]   
Set background color for selected area
      [ SELECTEDTEXT ]   
This property is used with mg_Get function, it returns the selected area from EditBox control.
      [ PLAINTEXT .T. | .F. ]
.F.
  
This property is used to change Qt Editbox Class to support large files, but, in contradistinction, the HTML features are limited
      [ CARETPOS nPosition ]
1
  
Move cursor position to nPosition. Warning, if you code CARETPOS before another property is posible that position change and doesn't respect your CARETPOS property. Then, coded CARETPOS before END EDITBOX. To move to end of document, use CARETPOS -1
      [ CURSORROW nRow ]
1
  
Move cursor position to nRow (line). Warning, if you code CURSORROW before another property is posible that position change and doesn't respect your CURSORROW property. Then, coded CURSORROW before END EDITBOX. To move to end of document, use the CARETPOS property
      [ CURSORCOL nCol ]
1
  
Move cursor position to nCol in current line (row). Warning, if you code CURSORCOL before another property is posible that position change and doesn't respect your CURSORCOL property. Then, coded CURSORCOL before END EDITBOX.
      [ 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
      [ 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 ]   
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.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed when control has changed
      [ ONCURSORMOVE cOnCursorMove | {BOnCursorMove} ]
NIL
  
An action to be performed when cursor changes its position.
      [ 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.
      [ 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
      [ ONCONTROL+W cOnControl+W | {BOnControl+W} ]
NIL
  
An action to be performed when CONTROL+W key has pressed
      [ ONESCAPE cOnEscape | {BOnEscape} ]
NIL
  
An action to be performed when ESCAPE key has pressed
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ WORDWRAP .T. | .F. ]
.F.
  
Breaks lines at word boundaries.
      [ 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 EDITBOX 

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
    FIND cText
n/a
  
Find string cText if EDITBOX and move cursor to position. If the string was found, the text is highlighted (selected)
    COPY
n/a
  
Copy selected area to Clipboard
    CUT
n/a
  
Move selected area to Clipboard
    PASTE
n/a
  
Copy Clipboard content to EditBox control at the current cursor position. There is an area selected, it will be replaced, else, the clipboard content will be insert
    SELECTALL
n/a
  
Select all EditBox content.
    UNDO
n/a
  
Undoes the last operation.
    REDO
n/a
  
Redoes the last operation.
    APPENDHTML
n/a
  
Append a HTML text at end of current content
    APPENDTEXT
n/a
  
Append a PLAIN text at end of current content
    INSERTHTML
n/a
  
Insert a HTML text at current cursor position
    INSERTTEXT
n/a
  
Append a PLAIN text at current cursor position
    GOTOLINE nLine
n/a
  
Move the cursor to nLine
    ONCHANGE
n/a
  
Execute ONCHANGE block coded in CREATE or seted by mg_Set
    ONCURSORMOVE
n/a
  
Execute ONCURSORMOVE 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_editbox.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 Editbox Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {223,242,253}
      MAIN .T.

      d_editbox_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_editbox_def.prg

#include "marinas-gui.ch"

Function d_editbox_def()

   CREATE EDITBOX EditBox_1
      ROW       10
      COL       40
      if mg_IsControlCreated( "d_window" , "maindemo_tab" )
         WIDTH     mg_Get( "d_window" , "maindemo_tab" , "width" ) - 50
         HEIGHT    ( mg_Get( "d_window" , "maindemo_tab" , "height" ) / 2 ) - 20
         VALUEHTML memoread( "../doc/d_editbox_sample.html" )
      else
         WIDTH     mg_Get( "d_window" , "width" ) - 50
         HEIGHT    ( mg_Get( "d_window" , "height" ) / 2 ) - 20
         VALUEHTML memoread( "d_editbox_sample.html" )
      endif
      TOOLTIP "EditBox ToolTip"
      ONCHANGE mg_Set( "d_window" , "EditBox_1Image2" , "picture" , "../resource/d_modified.png" )
      ONGOTFOCUS mg_Set( "d_window" , "EditBox_1Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "EditBox_1Image" , "picture" , "../resource/d_focus_off.png" )

      CREATE CONTEXT MENU

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

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

      END MENU

   END EDITBOX

   CREATE IMAGE EditBox_1Image
      ROW       30
      COL       6
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_focus_off.png"
      TOOLTIP   "EditBox Focus"
   END IMAGE

   CREATE IMAGE EditBox_1Image2
      ROW       80
      COL       10
      WIDTH     16
      HEIGHT    68
      PICTURE   "../resource/d_original.png"
      TOOLTIP   "Status by OnChange Property/Method"
   END IMAGE

   CREATE EDITBOX EditBox_2
      COL       40
      if mg_IsControlCreated( "d_window" , "maindemo_tab" )
         ROW       ( mg_Get( "d_window" , "maindemo_tab" , "height" ) / 2 )
         WIDTH     mg_Get( "d_window" , "maindemo_tab" , "width" ) - 50
         HEIGHT    ( mg_Get( "d_window" , "maindemo_tab" , "height" ) / 2 ) - 40
      else
         ROW       ( mg_Get( "d_window" , "height" ) / 2 ) + 10
         WIDTH     mg_Get( "d_window" , "width" ) - 50
         HEIGHT    ( mg_Get( "d_window" , "height" ) / 2 ) - 20
      endif
      BACKCOLOR {0,0,0}
      FONTCOLOR {0,255,0}
      FONTNAME "mg_monospace"
      VALUE 'Editbox with plain text' + HB_OsNewLine() + ;
            HB_OsNewLine() + ;
            '#include ' + HB_OsNewLine() + ;
            HB_OsNewLine() + ;
            'function main()' + HB_OsNewLine() + ;
            HB_OsNewLine() + ;
            '   CREATE WINDOW test' + HB_OsNewLine() + ;
            '      ROW 0          ' + HB_OsNewLine() + ;
            '      COL 0          ' + HB_OsNewLine() + ;
            '      WIDTH 200      ' + HB_OsNewLine() + ;
            '      HEIGHT 200     ' + HB_OsNewLine() + ;
            HB_OsNewLine() + ;
            '         CREATE BUTTON myButton   ' + HB_OsNewLine() + ;
            '            ROW 50                ' + HB_OsNewLine() + ;
            '            COL 50                ' + HB_OsNewLine() + ;
            '            WIDTH 100             ' + HB_OsNewLine() + ;
            '            HEIGHT 100            ' + HB_OsNewLine() + ;
            '            CAPTION "TEST"        ' + HB_OsNewLine() + ;
            '            ONCLICK mg_msginfo( "TEST" )   ' + HB_OsNewLine() + ;
            '         END BUTTON               ' + HB_OsNewLine() + ;
            HB_OsNewLine() + ;
            '   END WINDOW        ' + HB_OsNewLine() + ;
            HB_OsNewLine() + ;
            '   mg_Do( "test" , "activate" )     ' + HB_OsNewLine() + ;
            HB_OsNewLine() + ;
            'Return .T.                          '
      TOOLTIP "EditBox ToolTip"
      ONCHANGE mg_Set( "d_window" , "EditBox_2Image2" , "picture" , "../resource/d_modified.png" )
      ONGOTFOCUS mg_Set( "d_window" , "EditBox_2Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "EditBox_2Image" , "picture" , "../resource/d_focus_off.png" )
   END EDITBOX

   CREATE IMAGE EditBox_2Image
      ROW       mg_Get( "d_window" , "EditBox_2" , "row" ) + 20
      COL       6
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_focus_off.png"
      TOOLTIP   "EditBox Focus"
   END IMAGE

   CREATE IMAGE EditBox_2Image2
      ROW       mg_Get( "d_window" , "EditBox_2" , "row" ) + 70
      COL       10
      WIDTH     16
      HEIGHT    68
      PICTURE   "../resource/d_original.png"
      TOOLTIP   "Status by OnChange Property/Method"
   END IMAGE

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