RadioGroup
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE RADIOGROUP 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
      [ ITEM nItem [ , cText ] ]
NIL
  
Value text of item nItem (ONLY available for mg_Get() and mg_Set() functions). The function mg_Get() for ITEM property always return a CHARACTER value
      [ ITEMS aItems ]
NIL
  
An array with control options
      [ AUTOSIZE .T. | .F. ]
.F.
  Auto adjust control size to 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
      [ HEIGHTITEM nHeight ]
?
  
Height of each item in RADIOGROUP
      [ WIDTHITEM nWidth ]
?
  
Width of each item in RADIOGROUP
      [ HSPACING nPixels ]
0
  
Space between RADIOGROUP items (For horizontal orientation)
      [ VSPACING nPixels ]
0
  
Space between RADIOGROUP items (For vertical orientation (Default))
      [ 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
      [ HORIZONTAL .T. | .F. ]
.F.
  
Display options in Horizontal mode (not verticaly)
      [ VALUE nValue ]
1
  
Item to display
      [ ITEMCOUNT ]   
Only for mg_Get() function. It returns the total amount of items in control
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ 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 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.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed when control value is changed
      [ 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)
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END RADIOGROUP 

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.
    ADDITEM nItem , cText
NIL
  
Insert a new item to control. When the item was added, you can add ICON to item by ITEMICON property (mg_Set() function)
    DELETEITEM nItem
NIL
  
Delete item number nItem from control
    GETCHILDREN
n/a
  
This method return an array containing a list of controls that have this control as parent
    GETCONTROLS
n/a
  
This method return an array containing a list of controls that have this control as parent, except those that are not shown on screen (e.g. TIMER or CONTEXTMENU)
    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
    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_radiogroup.prg


#include "marinas-gui.ch"

MEMVAR cRadioGroupName
MEMVAR nNumber

Function main()

   PRIVATE cRadioGroupName := "d_RadioGroup"
   PRIVATE nNumber         := 33

   SET APPLSTYLE TO "MarinasLooks"

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

      d_radiogroup_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_radiogroup_def.prg

#include "marinas-gui.ch"

Function d_radiogroup_def()

      CREATE IMAGE RadioGroup_1Image
             ROW    26
             COL    130
             WIDTH  32
             HEIGHT 32
             PICTURE "../resource/d_focus_off.png"
             TOOLTIP "Radiogroup focus activate/deactivate by OnGotFocus/OnLostFocus Properties"
      END IMAGE

      CREATE RADIOGROUP RadioGroup_1
             ROW    31
             COL    171
             WIDTH  300
             ITEMS {'Sample with BackColor, FontBold and FontColor','Option 2','Option 3','Option 4'}
             VALUE 1
             FONTBOLD .T.
             BACKCOLOR {117,186,255}
             FONTCOLOR {0,0,255}
             TOOLTIP "RadioGroup ToolTip"
             ONGOTFOCUS mg_Set( "d_window" , "RadioGroup_1Image" , "picture" , "../resource/d_focus_on.png" )
             ONLOSTFOCUS mg_Set( "d_window" , "RadioGroup_1Image" , "picture" , "../resource/d_focus_off.png" )

             CREATE CONTEXT MENU

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

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

             END MENU

      END RADIOGROUP

      CREATE IMAGE ( M->cRadioGroupName + "__" + alltrim( str( M->nNumber ) ) + "Image" )
             ROW    155
             COL    130
             WIDTH  32
             HEIGHT 32
             PICTURE "../resource/d_focus_off.png"
             TOOLTIP "Radiogroup focus activate/deactivate by OnGotFocus/OnLostFocus Properties"
      END IMAGE

      CREATE RADIOGROUP ( M->cRadioGroupName + "__" + alltrim( str( M->nNumber ) ) )
             FONTCOLOR {0,119,60}
             COL    171
             ITEMS {'Sample with FontItalic, FontName and FontSize','VSpacing 10','Item 3'}
             VALUE 2
             FONTNAME "mg_monospace"
             VSPACING  10
             FONTSIZE 14
             FONTITALIC .T.
             ROW    160
             TOOLTIP "RadioGroup ToolTip"
             ONGOTFOCUS mg_Set( "d_window" , M->cRadioGroupName + "__" + alltrim( str( M->nNumber ) ) + "Image" , "picture" , "../resource/d_focus_on.png" )
             ONLOSTFOCUS mg_Set( "d_window" , M->cRadioGroupName + "__" + alltrim( str( M->nNumber ) ) + "Image" , "picture" , "../resource/d_focus_off.png" )
      END RADIOGROUP

      CREATE IMAGE RadioGroup_3Image
             TOOLTIP "Radiogroup focus activate/deactivate by OnGotFocus/OnLostFocus Properties"
             ROW    295
             COL    130
             WIDTH  32
             HEIGHT 32
             PICTURE "../resource/d_focus_off.png"
      END IMAGE

      CREATE RADIOGROUP RadioGroup_3
             ROW    300
             COL    171
             ITEMS {'Horizontal','Backcolor','Underline'}
             FONTUNDERLINE .T.
             VALUE 3
             BACKCOLOR {0,0,255}
             HORIZONTAL .T.
             FONTCOLOR {255,255,255}
             FONTBOLD .T.
             TOOLTIP "RadioGroup Horizontal"
             WIDTH  500
             ONGOTFOCUS mg_Set( "d_window" , "RadioGroup_3Image" , "picture" , "../resource/d_focus_on.png" )
             ONLOSTFOCUS mg_Set( "d_window" , "RadioGroup_3Image" , "picture" , "../resource/d_focus_off.png" )
      END RADIOGROUP

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