Error en C:\hmg.3.3.1\SAMPLES\Advanced\GRID_SORT

HMG en Español

Moderator: Rathinagiri

Post Reply
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Error en C:\hmg.3.3.1\SAMPLES\Advanced\GRID_SORT

Post by Javier Tovar » Wed Oct 01, 2014 12:35 am

Hola a todos,

Al compilar me da el siguiente error:
Harbour 3.2.0dev (r1407111333)
Copyright (c) 1999-2014, http://harbour-project.org/" onclick="window.open(this.href);return false;
C:\hmg.3.3.1\SAMPLES\Advanced\GRID_SORT\demo.prg: In function 'HB_FUN_LISTVIEW_GETCOLUMNORDERARRAY':
C:\hmg.3.3.1\SAMPLES\Advanced\GRID_SORT\demo.prg:145:7: error: too many arguments to function 'hb_storni'
C:/hmg.3.3.1/harbour/include/hbapi.h:759:25: note: declared here
C:\hmg.3.3.1\SAMPLES\Advanced\GRID_SORT\demo.prg: In function 'HB_FUN_LISTVIEW_SETCOLUMNORDERARRAY':
C:\hmg.3.3.1\SAMPLES\Advanced\GRID_SORT\demo.prg:157:7: error: too many arguments to function 'hb_parni'
C:/hmg.3.3.1/harbour/include/hbapi.h:643:31: note: declared here
hbmk2: Error: Ejecutando compilador C/C++. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -W -Wall -pipe -IC:/hmg.3.3.1/harbour/include -I../../../../../../hmg.3.3.1/SAMPLES/Advanced/GRID_SORT -IC:/hmg.3.3.1/include C:/Users/Maquina6/AppData/Local/Temp/hbmk_mjlkor.dir/demo.c C:/Users/Maquina6/AppData/Local/Temp/hbmk_xxn1de.c
Consulte Google sobre las funciones y aparentemente pueden recibir más parametros.

Utilizo HMG.3.3.1 Win7

Alguna sugerencia?

Gracias

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Wed Oct 01, 2014 10:36 pm

This is the correct version of the demo.

Code: Select all

#include "hmg.ch"

Memvar fColor

Function Main

Local aRows [20] [3]

   Private fColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2) , { 0,0,255 } , { 0,255,0 } ) }   

   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 640 ;
      HEIGHT 400 ;
      TITLE 'Mixed Data Type Grid Test' ;
      MAIN

      DEFINE MAIN MENU
         DEFINE POPUP 'File'
            MENUITEM 'Set New Columns Order'   ACTION SetOrder()
            MENUITEM 'Get Columns Order'      ACTION GetOrder()
            MENUITEM 'Refresh Grid'         ACTION Form_1.Grid_1.Refresh
            SEPARATOR
            MENUITEM 'Exit'            ACTION Form_1.Release
         END POPUP
      END MENU

      aRows [1]   := { 113.12,date(),1,1 , .t. }
      aRows [2]   := { 123.12,date(),2,2 , .f. }
      aRows [3]   := { 133.12,date(),3,3, .t. }
      aRows [4]   := { 143.12,date(),1,4, .f. }
      aRows [5]   := { 153.12,date(),2,5, .t. }
      aRows [6]   := { 163.12,date(),3,6, .f. }
      aRows [7]   := { 173.12,date(),1,7, .t. }
      aRows [8]   := { 183.12,date(),2,8, .f. }
      aRows [9]   := { 193.12,date(),3,9, .t. }
      aRows [10]   := { 113.12,date(),1,10, .f. }
      aRows [11]   := { 123.12,date(),2,11, .t. }
      aRows [12]   := { 133.12,date(),3,12, .f. }
      aRows [13]   := { 143.12,date(),1,13, .t. }
      aRows [14]   := { 153.12,date(),2,14, .f. }
      aRows [15]   := { 163.12,date(),3,15, .t. }
      aRows [16]   := { 173.12,date(),1,16, .f. }
      aRows [17]   := { 183.12,date(),2,17, .t. }
      aRows [18]   := { 193.12,date(),3,18, .f. }
      aRows [19]   := { 113.12,date(),1,19, .t. }
      aRows [20]   := { 123.12,date(),2,20, .f. }

      @ 10,10 GRID Grid_1 ;
         WIDTH 620 ;
         HEIGHT 330 ;
         HEADERS {'Column 1','Column 2','Column 3','Column 4','Column 5'} ;
         WIDTHS {140,140,140,140,140} ;
         ITEMS aRows ;
         EDIT ;
         COLUMNCONTROLS { ;
            {'TEXTBOX' , 'NUMERIC' , '$ 999,999.99'} , ;
            {'DATEPICKER' , 'DROPDOWN'} , ;
            {'COMBOBOX' , {'One' , 'Two' , 'Three'}} , ;
            { 'SPINNER' , 1 , 20 } , ;
            { 'CHECKBOX' , 'Yes' , 'No' } ;
            } ;
         COLUMNWHEN { ;
            { || This.CellValue > 120 } , ;
            { || This.CellValue = Date() } , ;
            Nil , ;
            Nil , ;
            Nil ;
            } ;
         DYNAMICFORECOLOR { fColor , fColor, fColor, fColor, fColor }

   END WINDOW

   CENTER WINDOW Form_1

   ACTIVATE WINDOW Form_1

Return Nil

PROCEDURE SetOrder()
local aColumns := { 5, 4, 3, 2, 1 }

   _SetColumnOrderArray( "Grid_1", "Form_1", aColumns )

   Form_1.Grid_1.Refresh

RETURN

PROCEDURE GetOrder()
local a

   a := _GetColumnOrderArray( "Grid_1", "Form_1" )

   aEval( a, {|x,i| MsgInfo ( "Column " + ltrim( str ( x ) ), ltrim( str ( i ) ) )} )

RETURN

*--------------------------------------------------------------------
Function _GetColumnOrderArray( ControlName , ParentForm )
*--------------------------------------------------------------------
Local i, nColumnCount, aSort
   i := GetControlIndex( ControlName , ParentForm )
   nColumnCount := HMG_LEN (_HMG_SYSDATA [ 33 ] [i])
   aSort := ListView_GetColumnOrderArray( _HMG_SYSDATA [ 3 ] [i], nColumnCount )
Return aSort

*--------------------------------------------------------------------
Function _SetColumnOrderArray( ControlName , ParentForm, aSort )
*--------------------------------------------------------------------
Local i, nColumnCount
   i := GetControlIndex( ControlName , ParentForm )
   nColumnCount := HMG_LEN (_HMG_SYSDATA [ 33 ] [i])
   ListView_SetColumnOrderArray( _HMG_SYSDATA [ 3 ] [i], nColumnCount, aSort )
Return Nil
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Wed Oct 01, 2014 10:41 pm

Gracias Dr. Claudio Soto por su siempre apoyo! :)

Saludos

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Wed Oct 01, 2014 11:03 pm

Hola Dr. Claudio Soto!

Me intriga su código que puso más arriba, ya que hay dos funciones que no se de donde las toma para que se ejecute el programa:

- ListView_GetColumnOrderArray
- ListView_SetColumnOrderArray

Estas entán en HMG o son de Windows?

Consulte Google y existen unas que las consideran macros de Windows.

Saludos
Last edited by Javier Tovar on Wed Oct 01, 2014 11:05 pm, edited 1 time in total.

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Wed Oct 01, 2014 11:05 pm

Javier Tovar wrote:Hola Dr. Claudio Soto!

Me intriga su código que puso más arriba, ya que hay dos funciones que no se de donde las toma para que se ejecute el programa:

- ListView_GetColumnOrderArray
- ListView_SetColumnOrderArray

Estas entán en HMG o son de Windows?

Saludos
See file SOURCE\c_GridEx.c
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Wed Oct 01, 2014 11:10 pm

Gracias nuevamente Dr, Claudio Soto! :)

Saludos

Post Reply