HMG 3.3.1 Patch 4

HMG 3.3.1 Patch 4

New features:

– <ParentWindowName>.<GridControlName>.CheckBoxes [ := | –>] lBoolean
– <ParentWindowName>.<GridControlName>.CheckBoxItem ( nRow ) [ := | –>] lBoolean
– <ParentWindowName>.<GridControlName>.GroupEnabled [ := | –>] lBoolean
– <ParentWindowName>.<GridControlName>.GroupDeleteAll
– <ParentWindowName>.<GridControlName>.GroupDelete ( nGroupID )
– <ParentWindowName>.<GridControlName>.GroupExpand ( nGroupID )
– <ParentWindowName>.<GridControlName>.GroupCollapsed ( nGroupID )
– <ParentWindowName>.<GridControlName>.GroupAdd ( nGroupID [, nPosition ] )
– <ParentWindowName>.<GridControlName>.GroupInfo ( nGroupID );
[ := | –>] { [ cHeader ] , [ nAlignHeader ] , [ cFooter ] , [ nAlingFooter ] , [ nState ] }
– <ParentWindowName>.<GridControlName>.GroupItemID ( nItem ) [ := | –>] nGroupID

nAlignHeader & nAlingFooter –> GRID_GROUP_LEFT | GRID_GROUP_CENTER | GRID_GROUP_RIGHT
nState –> GRID_GROUP_NORMAL | GRID_GROUP_COLLAPSED
See this demo:

#include "hmg.ch"

Function Main
Local aRows

   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 800 ;
      HEIGHT 600 ;
      TITLE "Demo: GRID Group" ;
      MAIN 

      aRows := ARRAY (20)
      aRows [1]   := {'Simpson',    'Homer',       '555-5555',   1,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )}   
      aRows [2]   := {'Mulder',     'Fox',         '324-6432',   2,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [3]   := {'Smart',      'Max',         '432-5892',   3,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [4]   := {'Grillo',     'Pepe',        '894-2332',   4,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [5]   := {'Kirk',       'James',       '346-9873',   5,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [6]   := {'Barriga',    'Carlos',      '394-9654',   6,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [7]   := {'Flanders',   'Ned',         '435-3211',   7,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [8]   := {'Smith',      'John',        '123-1234',   8,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [9]   := {'Pedemonti',  'Flavio',      '000-0000',   9,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [10]  := {'Gomez',      'Juan',        '583-4832',  10,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [11]  := {'Fernandez',  'Raul',        '321-4332',  11,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [12]  := {'Borges',     'Javier',      '326-9430',  12,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [13]  := {'Alvarez',    'Alberto',     '543-7898',  13,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [14]  := {'Gonzalez',   'Ambo',        '437-8473',  14,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [15]  := {'Batistuta',  'Gol',         '485-2843',  15,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [16]  := {'Vinazzi',    'Amigo',       '394-5983',  16,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [17]  := {'Pedemonti',  'Flavio',      '534-7984',  17,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [18]  := {'Samarbide',  'Armando',     '854-7873',  18,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [19]  := {'Pradon',     'Alejandra',   '???-????',  19,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [20]  := {'Reyes',      'Monica',      '432-5836',  20,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 

      bColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2),;
                          {128,128,128} , {192,192,192} ) }
      fColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2),; 
                          BLUE , RED ) }



      @ 50,10 GRID Grid_1 ;
         WIDTH 750 ;
         HEIGHT 340 ;
         HEADERS {'Last Name', 'First Name', 'Phone', 'Row', 'Time'};
         WIDTHS  {140, 140, 140, 140, 140};
         ITEMS aRows; 
         COLUMNCONTROLS {NIL,NIL,NIL, { 'SPINNER', 0 , 50 },; 
                        { "TIMEPICKER", _TIMESHORT12H }};
         VALUE 1 EDIT;           
         DYNAMICBACKCOLOR {bColor, bColor, bColor, bColor, bColor};
         DYNAMICFORECOLOR {fColor, fColor, fColor, fColor, fColor};
         TOOLTIP 'Editable Grid Control'; 
         CELLNAVIGATION


/*
- ..CheckBoxes [ := | -->] lBoolean
- ..CheckBoxItem ( nRow ) [ := | -->] lBoolean


- ..GroupEnabled [ := | -->] lBoolean
- ..GroupDeleteAll
- ..GroupDelete ( nGroupID )
- ..GroupExpand ( nGroupID )
- ..GroupCollapsed ( nGroupID )
- ..GroupAdd    ( nGroupID [, nPosition ] )
- ..GroupInfo   ( nGroupID ) [ := | -->] { [;
                 cHeader ],; 
                 [ nAlignHeader ],; 
                 [ cFooter ],; 
                 [ nAlingFooter ],; 
                 [ nState ] }
- ..GroupItemID ( nItem )    [ := | -->] nGroupID

nAlignHeader & nAlingFooter   -->   
                 GRID_GROUP_LEFT | GRID_GROUP_CENTER | GRID_GROUP_RIGHT
nState -->   GRID_GROUP_NORMAL | GRID_GROUP_COLLAPSED

*/


      #define GROUP1_ID   100
      #define GROUP2_ID   200

      Form_1.Grid_1.GroupEnabled := .T.

      Form_1.Grid_1.GroupAdd ( GROUP1_ID , NIL )
      Form_1.Grid_1.GroupAdd ( GROUP2_ID , NIL )

      Form_1.Grid_1.GroupInfo ( GROUP1_ID ) := { "Header Group 1",; 
                    GRID_GROUP_CENTER , "Footer Group 1" ,;
                    GRID_GROUP_CENTER,; 
                    GRID_GROUP_NORMAL }
      Form_1.Grid_1.GroupInfo ( GROUP2_ID ) := { "Header Group 2",; 
                    GRID_GROUP_CENTER , "Footer Group 2",; 
                    GRID_GROUP_CENTER,;
                    GRID_GROUP_NORMAL }

      FOR i := 1 TO Form_1.Grid_1.ItemCount
         IF i <= Form_1.Grid_1.ItemCount/2
            Form_1.Grid_1.GroupItemID (i) := GROUP2_ID
         ELSE
            Form_1.Grid_1.GroupItemID (i) := GROUP1_ID
         ENDIF
      NEXT

      @ 450,  55 BUTTON Button_1 CAPTION "G1-NORMAL"    ACTION ;
                 Form_1.Grid_1.GroupExpand ( GROUP1_ID )
      @ 450, 155 BUTTON Button_2 CAPTION "G1-COLLAPSED" ACTION ;
                 Form_1.Grid_1.GroupCollapsed ( GROUP1_ID )
      @ 450, 355 BUTTON Button_3 CAPTION "G1-GetInfo"   ACTION ;
                 MsgDebug (Form_1.Grid_1.GroupInfo ( GROUP1_ID ))
      @ 500,  55 BUTTON Button_4 CAPTION "G2-NORMAL"    ACTION ;
                 Form_1.Grid_1.GroupExpand ( GROUP2_ID )
      @ 500, 155 BUTTON Button_5 CAPTION "G2-COLLAPSED" ACTION ;
                 Form_1.Grid_1.GroupCollapsed ( GROUP2_ID )
      @ 500, 355 BUTTON Button_6 CAPTION "G2-GetInfo"   ACTION ;
                 MsgDebug (Form_1.Grid_1.GroupInfo ( GROUP2_ID ))
      @ 450, 555 BUTTON Button_7 CAPTION "Group ON/OFF" ACTION ;
                 Form_1.Grid_1.GroupEnabled := .NOT.; 
                 Form_1.Grid_1.GroupEnabled

   END WINDOW

   CENTER WINDOW Form_1

   ACTIVATE WINDOW Form_1

Return

PS: this patch include all new features of previous patches.

GoVisitBlue324x48

DL_PatchFrHMGForum312x48
DL_PatchFrGogDrive312x48

 

 

Advertisements

One response to “HMG 3.3.1 Patch 4

  1. Pingback: HMG News | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s