Grid
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE GRID 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
      [ 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
      [ FONTATTRDYNAMIC cFontAttrDynamic | {BFontAttrDynamic} ]
All Global Font Atributes
  
Set font attributes cell dynamically by returning an ARRAY of font attributes (or NIL) from a CodeBlock. The CodeBlock receives two parameters: nRow and nCol. Warning, this property can cause performance problems if you codeblock is not efficient.
ARRAY returned will be { "fontName" , "fontSize" , "fontBold" , "fontItalic" , "fontUnderline" , "fontStrikeOut" }
If a attribute is NIL, global value is used.
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ FONTCOLORHEADER {aFontColor} | aVarFontColor ]
Appl.FontColor
  
Set foreground color (text color) for header of control (columns and rows headers)
      [ BACKCOLORHEADER {aBackColor} | aVarBackColor ]
Appl.BackColor
  
Set background color for header of control (columns and rows headers)
      [ FONTCOLORDYNAMIC cFontColorDynamic | {BFontColorDynamic} ]
FontColor
  
Set fontcolor cell dynamically by returning an STRING of RGB values (or NIL) from a CodeBlock. The CodeBlock receives two parameters: nRow and nCol. Warning, this property can cause performance problems if you codeblock is not efficient.
      [ BACKCOLORDYNAMIC cBackColorDynamic | {BBackColorDynamic} ]
BackColor
  
Set backcolor cell dynamically by returning an STRING of RGB values (or NIL) from a CodeBlock. The CodeBlock receives two parameters: nRow and nCol. Warning, this property can cause performance problems if you codeblock is not efficient.
      [ SELECTIONFONTCOLOR {aFontColor} | aVarFontColor ]   
Set font color for selected cell(s)
      [ SELECTIONBACKCOLOR {aBackColor} | aVarBackColor ]   
Set background color for selected cell(s)
      [ SELECTIONFONTCOLORDYNAMIC cFontColorDynamic | {BFontColorDynamic} ]   
Set fontcolor of selection cell dynamically by returning an STRING of RGB values (or NIL) from a CodeBlock. The CodeBlock receives two parameters: nRow and nCol. Warning, this property can cause performance problems if you codeblock is not efficient.
      [ SELECTIONBACKCOLORDYNAMIC cBackColorDynamic | {BBackColorDynamic} ]   
Set backcolor of selection cell dynamically by returning an STRING of RGB values (or NIL) from a CodeBlock. The CodeBlock receives two parameters: nRow and nCol. Warning, this property can cause performance problems if you codeblock is not efficient.
      [ ALTERNATINGROWCOLOR .T. | .F. ]
.F.
  
This property holds whether to draw the background using alternating colors.
      [ FONTNAMEHEADER "cFontName" ]
Appl.Fontname
  
Font family for text of columns header of control
      [ FONTSIZEHEADER nPoints ]
Appl.FontSize
  
Font size for text of columns header of control
      [ FONTBOLDHEADER .T. | .F. ]
.F.
  
Set Bold attribute to text of columns header of control. Note, if NAVIGATEBY is set to "ROW", all columns are selected, so, depending on the desktop style, all header text will be set BOLD always
      [ FONTITALICHEADER .T. | .F. ]
.F.
  
Set Italic attribute to text of columns header of control
      [ FONTUNDERLINEHEADER .T. | .F. ]
.F.
  
Set Underline attribute to text of columns header of control
      [ FONTSTRIKEOUTHEADER .T. | .F. ]
.F.
  
Set Strikeout attribute to text of columns header of control
      [ FONTNAMEHEADERROWS "cFontName" ]
Appl.Fontname
  
Font family for text of rows header of control
      [ FONTSIZEHEADERROWS nPoints ]
Appl.FontSize
  
Font size for text of rows header of control
      [ FONTBOLDHEADERROWS .T. | .F. ]
.F.
  
Set Bold attribute to text of rows header of control. Note, if NAVIGATEBY is set to "COLUMN", all rows are selected, so, depending on the desktop style, all header text of rows will be set BOLD always.
      [ FONTITALICHEADERROWS .T. | .F. ]
.F.
  
Set Italic attribute to text of rows header of control
      [ FONTUNDERLINEHEADERROWS .T. | .F. ]
.F.
  
Set Underline attribute to text of rows header of control
      [ FONTSTRIKEOUTHEADERROWS .T. | .F. ]
.F.
  
Set Strikeout attribute to text of rows header of control
      [ EDITINPLACEALL aColumnAllowEdit ]
NIL
  
Allow user to edit the cell content for only same specific columns by pressing mouse double click. Look topic Browse and Grid Edit Inplace. Pressing
      [ EDITINPLACEDISPLAYERROR .T. | .F. ]
.T.
  
Allow marinas-gui to display an error message when the new value was not saved to the cell. Look topic Browse and Grid Edit Inplace. Pressing
      [ EDITINPLACEDYNAMIC {bCellEvaluateBlock} ]
NIL
  
Allow user to edit the cell content for an specific cell by checking the bCellEvaluateBlock to allow or not edit. Look topic Browse and Grid Edit Inplace. Pressing
      [ EDITINPLACEGLOBAL .T. | .F. ]
.F.
  
Allow user to edit the cell content by pressing mouse double click. Look topic Browse and Grid Edit Inplace. Pressing
      [ EDITINPLACETRIGGERS enum QAbstractItemView::EditTrigger ]
QAbstractItemView_DoubleClicked + QAbstractItemView_EditKeyPressed
  
This property holds which actions will initiate item editing.
Values:
QAbstractItemView_NoEditTriggers (No editing possible.)
QAbstractItemView_CurrentChanged (Editing start whenever current item changes.)
QAbstractItemView_DoubleClicked (Editing starts when an item is double clicked.)
QAbstractItemView_SelectedClicked (Editing starts when clicking on an already selected item)
QAbstractItemView_EditKeyPressed (Editing starts when the platform edit key has been pressed over an item.)
QAbstractItemView_AnyKeyPressed (Editing starts when any key is pressed over an item.)
QAbstractItemView_AllEditTriggers (Editing starts for all above actions.)
      [ EDITINPLACEVALIDALL aColumnCheckNewValue ]
NIL
  
Allow user to evaluate the new cell content for only same specific columns to allow or not the new value. Look topic Browse and Grid Edit Inplace. Pressing
      [ EDITINPLACEVALIDDYNAMIC {bCellEvaluateNewValue} ]
NIL
  
Allow user to evaluate the new cell content for an specific cell by checking the bCellEvaluateBlock to allow or not the new value. Look topic Browse and Grid Edit Inplace. Pressing
      [ ONEDITINPLACESAVE {bOnEditInplaceSaveBlock} ]
NIL
  
Allow user to execute a BLOCK when user save the new value for a cell. Look topic Browse and Grid Edit Inplace. Pressing
      [ EASYSKIP .T. | .F. ]
.F.
  
Allow user to navigate in the control by pressing a key (like an index). Look topic Browse and Grid Key Trap. Pressing
      [ CELL nRow , nCol [ , xValue ] ]   
Only for mg_Get() and mg_Set() functions. Get or Put a value into a cell of control. For mg_Get(), it don't need xValue and return the cell content. For mg_Put(), it need xValue and return .T. for successful or .F. for failed.
      [ ITEM ]
NIL
  
 
      [ ITEMS ]
NIL
  
 
      [ ITEMCOUNT ]   
Only for mg_Get() function. It returns the total amount of rows in control
      [ COLUMNHIDDEN nCol [ , .T. | .F. ] ]
.T. | .F.
  
Only for mg_set() and mg_get(). That property HIDE or SHOW a column. At mg_set() mode, that property returns the previous value.
      [ COLUMNHEADER ]
NIL
   
      [ COLUMNHEADERALL ]
NIL
  
 
      [ COLUMNALIGN ]
NIL
 
  
      [ COLUMNALIGNALL {aDataAlign} ]
Qt_AlignVCenter + Qt_AlignHCenter
  
An array with aligns for each column in the grid
      [ COLUMNALIGNHEADERALL {aHeadersAligns} ]
Qt_AlignVCenter + Qt_AlignLeft
  
An array with aligns for each header of column in the grid
      [ COLUMNWIDTH nColumn [ , nWidth ] ]
NIL
 
 Only for mg_get()/mg_set() functions. This property get/set the with of a specific column
      [ COLUMNWIDTHALL {aWidths} ]
NIL
  
An array with widths for each column in the browse. Used at mg_get() function, this property returns an array with columns widths.
      [ COLUMNCOUNT ]   
Only for mg_Get() function. It returns the total amount of columns in control
      [ ROWHEIGHTALL nHeight ]
18
  
Set/Get the height value for all rows.
      [ ROWHIDDEN nRow [ , .T. | .F. ] ]
.T. | .F.
  
Only for mg_set() and mg_get(). That property HIDE or SHOW a row. At mg_set() mode, that property returns the previous value.
      [ ROWLABELALL .T. | .F. ]
.T.
  
Show/Hide the rows labels for grid (rows labels are numbers from 1 to "itemcount")
      [ DISABLEEVENTS .T. | .F. ]
NIL
  
This property set ON/OFF the internal triggers of control. If you set DISABLEEVENTS to .T., ONNAVIGATECELL, ONENTER and others events into control will not be executed until you set DISABLEEVENTS with .F. parameter
      [ DISABLEUPDATE .T. | .F. ]
NIL
  
This property set ON/OFF the display update of control. If you set DISABLEUPDATE to .T., changes into control will not be shown until you set DISABLEUPDATE with .F. parameter
      [ NAVIGATEBY "ROW" | "COL" | "CELL" ]
"ROW"
  
Select navigate mode
      [ IMAGES aImages ]
NIL
  
Images for colunm 1 (This is a compatibility property and in the future will be replaced)
      [ IMAGESLEN ]
NIL
  
Total images for column 1. Only mg_Get() function is allowed. (This is a compatibility property and in the future will be replaced)
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ VALUE nValue ]
NIL
  
Set or Get row position
      [ VALUECOL nValue ]
NIL
  
Set or Get column position
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ 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.
      [ ONDBLCLICK cOnDblClick | {BOnDblClick} ]
NIL
  
An action to be performed when user press double mouse click
      [ 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
      [ ONHEADERCLICKALL abOnHeaderClickAll | { {BOnHeaderClickAll} [ , {BOnHeaderClickAll} ... ] ]
NIL
  
An action to be performed when user press CLICK over headers. Each array elemnet is a block corresponding with column position.
      [ ONNAVIGATECELL cOnNavigateCell | {BOnNavigateCell} ]
NIL
  
An action to be performed when user move the cell position by arrows or mouse
      [ 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 GRID 

Jump to Context Menu topic



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    ADDITEM
n/a
  
?
    ADDCOLUMN
n/a
  
?
    MODCOLUMN
n/a
  
?
    COLUMNSAUTOFITH
n/a
  
Set columns width to content
    DELETEITEM nItem
NIL
  
Delete item number nItem from control
    DELETEALLITEMS
n/a
  
Delete ALL items from control
    HIDE
n/a
  
This method HIDE the control
    SHOW
n/a
  
This method SHOW the control
    HIDECOLUMN nCol
NIL
  
That method HIDE a column.
    HIDEROW nRow
NIL
  
That method HIDE a row.
    SHOWCOLUMN nCol
NIL
  
That method SHOW a column.
    SHOWROW nRow
NIL
  
That method SHOW a row.
    SKIP nStep
n/a
  
This method skip nStep rows
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the control to default (Qt_ArrowCursor). Go to to learn more about it.
    REFRESH
n/a
  
This method is used to refresh the control content.
    RELEASE
n/a
  
This method is used to destroy the control.
    SETFOCUS
n/a
  
This method put the program focus into control
    ONDBLCLICK
n/a
  
Execute ONDBLCLICK block coded in CREATE or seted by mg_Set
    ONENTER
n/a
  
Execute ONENTER block coded in CREATE or seted by mg_Set
    ONHEADERCLICK
n/a
  
Execute ONHEADERCLICK block coded in CREATE or seted by mg_Set
    ONNAVIGATECELL
n/a
  
Execute ONNAVIGATECELL 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



Note: read the following topic: Browse and Grid Performance
Nota: lea el siguiente tópico: Browse and Grid Performance

Note2: read the following topic: Browse and Grid Key Trap
Nota2: lea el siguiente tópico: Browse and Grid Key Trap


Example:

File: d_grid.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 Grid Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {223,242,253}
      MAIN .T.

      d_grid_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_grid_def.prg

#include "marinas-gui.ch"

FUNCTION d_grid_def()

      CREATE LABEL
         ROW 20
         COL 240
         VALUE  "Press DBLCLICK to EditInplace"
         WIDTH 500
         FONTSIZE 10
         FONTBOLD .T.
         FONTITALIC .F.
         FONTCOLOR {0,0,255}
      END LABEL

      CREATE GRID Grid_1
         ROW             60
         COL             110
         WIDTH           640 - 40
         HEIGHT          260
         FONTSIZE        10
         FONTSIZEHEADER  14
         FONTSIZEHEADERROWS  20
         FONTBOLD        .F.
         FONTITALIC      .F.
         COLUMNHEADERALL {'Origin','Is Happy?','Age','Sex','Last Name','First Name','Phone'}
         COLUMNWIDTHALL  {130,100,50,50,110,150,150}
         ITEMS           LoadItems()
         VALUE           4
         VALUECOL        5
         TOOLTIP         "Grid with EDITINPLACE"
         SELECTIONBACKCOLOR  {128, 0, 64}
         SELECTIONFONTCOLOR  {255,255,255}
         BACKCOLORDYNAMIC {|nRow,nCol| GridBackColorDynamic( nRow , nCol ) }
         SELECTIONBACKCOLORDYNAMIC {|nRow,nCol| GridBackColorDynamic( nRow , nCol ) }
         BACKCOLOR       {255,255,210}
         FONTCOLOR       {222,34,7}
         BACKCOLORHEADER {255,100,0}
         FONTCOLORHEADER {255,255,255}
         FONTATTRDYNAMIC {|nRow,nCol| GridFontAttrDynamic( nRow , nCol ) }
         NAVIGATEBY      "row"
         ONENTER         {|| mg_MsgInfo( "ENTER: " + mg_allstr( mg_Get( "d_window" , "Grid_1" , "cell" , mg_Get( "d_window" , "Grid_1" , "value" ) , mg_Get( "d_window" , "Grid_1" , "valuecol" ) ) ) + " (Type: " + valtype( mg_Get( "d_window" , "Grid_1" , "cell" , mg_Get( "d_window" , "Grid_1" , "value" ) , mg_Get( "d_window" , "Grid_1" , "valuecol" ) ) ) + ")" ) }
         // EditInplace uses DBLCLICK to work
     //  ONDBLCLICK      {|| mg_MsgInfo( "DBLCLICK: " + mg_allstr( mg_Get( "d_window" , "Grid_1" , "cell" , mg_Get( "d_window" , "Grid_1" , "value" ) , mg_Get( "d_window" , "Grid_1" , "valuecol" ) ) ) + " (Type: " + valtype( mg_Get( "d_window" , "Grid_1" , "cell" , mg_Get( "d_window" , "Grid_1" , "value" ) , mg_Get( "d_window" , "Grid_1" , "valuecol" ) ) ) + ")" ) }
         EDITINPLACEGLOBAL .T.
         //
         ONGOTFOCUS      mg_Set( "d_window" , "myGridImageFocus" , "picture" , "../resource/d_focus_on.png" )
         ONLOSTFOCUS     mg_Set( "d_window" , "myGridImageFocus" , "picture" , "../resource/d_focus_off.png" )
         ONNAVIGATECELL  {|| GridOnNavigateCell() }

         CREATE CONTEXT MENU

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

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

         END MENU

      END GRID

      CREATE LABEL Grid_Label
         ROW mg_Get( "d_window" , "Grid_1" , "rowBottom" ) + 10
         COL 240
         VALUE  ""
         WIDTH 500
         FONTSIZE 10
         FONTBOLD .T.
         FONTITALIC .F.
         FONTCOLOR {0,0,255}
      END LABEL

      CREATE IMAGE myGridImageFocus
         ROW       9
         if mg_IsControlCreated( "d_window" , "maindemo_tab" )
            COL       mg_Get( "d_window" , "maindemo_tab" , "width" ) - 42
         else
            COL       mg_Get( "d_window" , "width" ) - 42
         endif
         WIDTH     32
         HEIGHT    32
         PICTURE   "../resource/d_focus_off.png"
         TOOLTIP   "Grid Focus"
      END IMAGE

      CREATE RADIOGROUP Grid_Radio
         ROW   365
         COL   110
         ITEMS { "NavigateBy ROW" , "NavigateBy CELL" , "NavigateBy COL" }
         VALUE   1
         ONCHANGE {|| ChangeNavigateBy() }
         FONTCOLOR {255,0,0}
         FONTBOLD .T.
      END RADIOGROUP

      CREATE BUTTON Grid_Button_1
         ROW   370
         COL   290
         CAPTION "Italic Text"
         FONTITALIC .T.
         FONTUNDERLINE .T.
         ONCLICK Italic()
         WIDTH 100
         HEIGHT 40
         TOOLTIP "Set text to Italic"
      END BUTTON

      CREATE BUTTON Grid_Button_2
         ROW   mg_Get( "d_window" , "Grid_Button_1" , "row" )
         COL   820 - mg_Get( "d_window" , "Grid_Button_1" , "width" ) - mg_Get( "d_window" , "Grid_Button_1" , "col" )
         CAPTION "Bold Text"
         FONTBOLD .T.
         FONTUNDERLINE .T.
         ONCLICK Bold()
         WIDTH mg_Get( "d_window" , "Grid_Button_1" , "width" )
         HEIGHT mg_Get( "d_window" , "Grid_Button_1" , "height" )
         TOOLTIP "Set text to Bold"
      END BUTTON

      GridOnNavigateCell()

RETURN .T.

FUNCTION LoadItems()
   LOCAL aRows := {}
   aadd( aRows , {'American',.T.,40,1,'Simpson','Homer','555-5555'} )
   aadd( aRows , {'American',.F.,31,1,'Mulder','Fox','324-6432'} )
   aadd( aRows , {'Asian',.T.,24,1,'Smart','Max','432-5892'} )
   aadd( aRows , {'European',.F.,73,2,'Legrand','Mirta','894-2332'} )
   aadd( aRows , {'American',.F.,74,1,'Kirk','James','346-9873'} )
   aadd( aRows , {'Asian',.F.,5,1,'Barriga','Carlos','394-9654'} )
   aadd( aRows , {'European',.T.,62,2,'Flanders','Samantha','435-3211'} )
   aadd( aRows , {'American',.T.,37,1,'Smith','John','123-1234'} )
   aadd( aRows , {'European',.T.,82,1,'Pedemonti','Flavio','000-0000'} )
   aadd( aRows , {'European',.F.,19,2,'Lovato','Demi','583-4832'} )
   aadd( aRows , {'American',.F.,20,1,'Fernandez','Raul','321-4332'} )
   aadd( aRows , {'European',.T.,21,1,'Borges','Javier','326-9430'} )
   aadd( aRows , {'American',.T.,21,1,'Alvarez','Alberto','543-7898'} )
   aadd( aRows , {'European',.T.,33,1,'Gonzalez','Ambo','437-8473'} )
   aadd( aRows , {'Asian',.T.,4,1,'Batistuta','Gol','485-2843'} )
   aadd( aRows , {'European',.F.,33,1,'Vinazzi','Amigo','394-5983'} )
   aadd( aRows , {'European',.F.,6,1,'Pedemonti','Flavio','534-7984'} )
   aadd( aRows , {'American',.T.,72,1,'Samarbide','Armando','854-7873'} )
   aadd( aRows , {'American',.F.,18,1,'Pradon','Alejandra','???-????'} )
   aadd( aRows , {'American',.F.,69,2,'Reyes','Monica','432-5836'} )
RETURN aRows

FUNCTION Bold()
   mg_Set( "d_window" , "Grid_1" , "fontbold" , !mg_Get( "d_window" , "Grid_1" , "fontbold" ) )
   mg_Do( "d_window" , "Grid_1" , "setfocus" )
RETURN .T.

FUNCTION Italic()
   mg_Set( "d_window" , "Grid_1" , "fontitalic" , !mg_Get( "d_window" , "Grid_1" , "fontitalic" ) )
   mg_Do( "d_window" , "Grid_1" , "setfocus" )
RETURN .T.

FUNCTION ChangeNavigateBy()
   do case
      case mg_Get( "d_window" , "Grid_radio" , "value" ) == 1
         mg_Set( "d_window" , "Grid_1" , "navigateby" , "row" )
      case mg_Get( "d_window" , "Grid_radio" , "value" ) == 2
         mg_Set( "d_window" , "Grid_1" , "navigateby" , "cell" )
      case mg_Get( "d_window" , "Grid_radio" , "value" ) == 3
         mg_Set( "d_window" , "Grid_1" , "navigateby" , "col" )
   endcase
   mg_Do( "d_window" , "Grid_1" , "setfocus" )
RETURN .T.

FUNCTION GridOnNavigateCell()
    Local nRow := mg_Get( "d_window" , "Grid_1" , "value" )
    Local nCol := mg_Get( "d_window" , "Grid_1" , "valuecol" )
    mg_Set( "d_window" , "Grid_Label" , "value" , "Value in focused cell (" + alltrim( str( nRow ) ) + "," + alltrim( str( nCol ) ) + "): " + mg_AllStr( mg_Get( "d_window" , "Grid_1" , "cell" , nRow , nCol ) ) )
 RETURN .T.

FUNCTION GridBackColorDynamic( nRow , nCol )
   if mod( nRow , 2 ) == 0 .AND. mod( nCol , 3 ) == 0
      RETURN {74,164,72}
   endif
   if mod( nRow , 5 ) == 0
      RETURN NIL
   endif
RETURN {211,223,231}

FUNCTION GridFontAttrDynamic( nRow , nCol )
   IF mod( nRow , 2 ) == 0 .AND. mod( nCol , 3 ) == 0
      RETURN { "mg_monospace" , 20 , , .T. }    // { "fontName" , "fontSize" , "fontBold" , "fontItalic" , "fontUnderline" , "fontStrikeOut" }
   ENDIF
   IF mod( nRow , 5 ) == 0
      RETURN NIL
   ENDIF
RETURN { , 16 , , , .T. }    // { "fontName" , "fontSize" , "fontBold" , "fontItalic" , "fontUnderline" , "fontStrikeOut" }



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