Label
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE LABEL 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 cValue ]
NIL
  
A text expressions for the control
      [ AUTOSIZE .T. | .F. ]
.F.
  
Auto adjust control size to text
      [ HYPERLINK cHyperLink ]
NIL
  
HyperLink label. This property allow open an internet address into default web browser
      [ 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
      [ FONTBLINK .T. | .F. ]
.F.
  
Set Blink attribute to control text
      [ BORDER .T. | .F. ]
.F.
  ?
      [ CLIENTEDGE .T. | .F. ]
.F.
  ?
      [ HSCROLL .T. | .F. ]
.F.
  ?
      [ VSCROLL .T. | .F. ]
.F.
  ?
      [ TRANSPARENT .T. | .F. ]
.T.
  Don't fill background control, set Transparent attibute
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ ALIGN nAlign ]
Qt_AlignLeft
  
Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
      [ 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.
      [ 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.
      [ ONCLICK cOnClick | {BOnClick} ]
NIL
  
An action to be performed when control is clicking
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END LABEL 

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.
    ONCLICK
n/a
  
Execute ONCLICK block coded in CREATE or seted by mg_Set



Example:

File: d_label.prg


#include "marinas-gui.ch"

MEMVAR cLabelName
MEMVAR nNumber

Function main()

   PRIVATE cLabelName  := "d_label"
   PRIVATE nNumber     := 33

   SET APPLSTYLE TO "MarinasLooks"

   CREATE WINDOW d_window
      ROW 0 ; COL 0
      WIDTH 820 ; HEIGHT 480
      CAPTION "Marinas-GUI Sample for Label Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {223,242,253}
      MAIN .T.

      d_label_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_label_def.prg

#include "marinas-gui.ch"

Function d_label_def()

      CREATE LABEL Label_1
             ROW    20
             COL    145
             VALUE "Label Sample with Autosize and NOT Transparent"
             AUTOSIZE .T.
             TRANSPARENT .F.
             TOOLTIP "Label Tooltip"

             CREATE CONTEXT MENU

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

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

             END MENU

      END LABEL

      CREATE LABEL Label_2
             ROW    70
             COL    145
             VALUE "Label Sample with FontColor and BackColor"
             FONTSIZE 12
             FONTBOLD .T.
             BACKCOLOR {0,0,255}
             FONTCOLOR {0,255,0}
             AUTOSIZE .T.
             TOOLTIP "Label Tooltip"
      END LABEL

      CREATE LABEL Label_4
             ROW    140
             COL    145
             VALUE "FontBlink, FontBold, FontItalic and Variable Name"
             WIDTH  600
             HEIGHT 30
             FONTSIZE 15
             FONTBOLD .T.
             FONTITALIC .T.
             FONTBLINK .T.
             TRANSPARENT .T.
             TOOLTIP "Label Tooltip"
      END LABEL

      CREATE LABEL &( M->cLabelName + "__" + alltrim( str( M->nNumber ) ) )
             ROW    200
             COL    145
             VALUE "Label Sample with Blink, Underline and Strikeout"
             FONTSIZE 18
             FONTUNDERLINE .T.
             AUTOSIZE .T.
             FONTCOLOR {255,0,0}
             // FONTBLINK .T.
             FONTSTRIKEOUT .T.
             TRANSPARENT .T.
             TOOLTIP "Label Tooltip"
      END LABEL

      CREATE LABEL Label_5
             ROW    270
             COL    145
             WIDTH  600
             HEIGHT 37
             VALUE "Hyperlink to 'Marinas-GUI Help Page'"
          // HYPERLINK "http://www.carozodequilmes.com.ar/Projects/silvergui/_Index_sgd.htm"
             HYPERLINK "../doc/htmlhelp/_Index_help_marinas-gui.htm"
             FONTSIZE 21
             TRANSPARENT .T.
             TOOLTIP "Label Tooltip"
      END LABEL

      CREATE LABEL Label_6
             ROW    350
             COL    145
             VALUE "Label with ONCLICK - Click here !!!"
             FONTSIZE 21
             FONTCOLOR {55,140,68}
             FONTNAME "mg_monospace"
             TRANSPARENT .T.
             AUTOSIZE .T.
             ONCLICK mg_MsgInfo( "ONCLICK from label" )
             TOOLTIP "Label Tooltip"
      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