Grid with more indexes
Moderator: Rathinagiri
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Grid with more indexes
Hello,
I have problem with grid refresh for dbf file with more indexes.
Example:When first time I enter in test menue is ok . Then I sort grid with dbf to descending number (index 4) , grid is ok restorted to descending, then I go out with ESC to main menue and back to test. I get wrong grid ( see gridpic.jpg ).
Complete sources and pic in attached zip file.
#include "hmg.ch"
Function Main
REQUEST DBFNTX
RDDSETDEFAULT( "DBFNTX" )
SET DELETED ON
SET DATE GERMAN
SET CENTURY ON
SET EXCLUSIVE OFF
SET BROWSESYNC ON
SET LANGUAGE TO SLOVENIAN
SET NAVIGATION EXTENDED
REQUEST HB_CODEPAGE_SLWIN
HB_SETCODEPAGE( "SLWIN" )
Private bColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2) , { 245,245,245 } , { 255,255,255 } ) }
Private fColor := { || { 0,0,255 }}
DEFINE WINDOW meni ;
AT 20,20 ;
WIDTH getdesktopWidth()-50 ;
HEIGHT getDeskTopHeight()-120 ;
TITLE 'Test' ;
MAIN
DEFINE MAIN MENU
POPUP 'Menue'
ITEM '&1. Test' ACTION (test())
END POPUP
END MENU
END WINDOW
CENTER WINDOW meni
ACTIVATE WINDOW meni
close databases
return
procedure test
select 2
use naslovi alias naslovi
set index to naslovi,naziv
select 5
use gl_pred alias gl_pred
set index to gl_pred1,gl_pred2,gl_pred3,gl_pred4,gl_pred5
set relation to sifra into naslovi
go top
katerig:=reccount()
DEFINE WINDOW predrac ;
AT 20,20 ;
WIDTH getdesktopWidth()-50 ;
HEIGHT getDeskTopHeight()-120 ;
TITLE 'Test' ;
MODAL
@ 65,5 GRID Grid_pred ;
WIDTH getdesktopWidth()-70 ;
HEIGHT getDeskTopHeight()-270 ;
HEADERS { 'Num.','Šifra','Ime kupca','Datum','Znesek','Rabat','DDV','Zaslužek','Za plačilo',;
'Dod.stroški','Datum plačila','Valuta','Knjižen','Status','Plačano po','predračunu',;
'Vrsta','Zav.za davek'} ;
WIDTHS { 70,70,240,100,90,90,90,90,100,90,100,50,60,50,90,80,40,40 } ;
ROWSOURCE "GL_PRED" ;
VALUE { 1, 1} ;
COLUMNFIELDS { 'gl_pred->STEV','gl_pred->SIFRA','NASLOVI->NAZIV','gl_pred->DATUM','transform(round(gl_pred->vse,2),"@E 99,999,999.99")',;
'transform(round(gl_pred->rabat,2),"@E 9,999,999.99")','transform(round(gl_pred->davek,2),"@E 9,999,999.99")',;
'transform(round(gl_pred->prep,2),"@E 9,999,999.99")','transform(round(gl_pred->skupaj,2),"@E 9,999,999.99")',;
'transform(round(gl_pred->ptt,2),"@E 9,999,999.99")','gl_pred->DATUM_PLA','gl_pred->VALUTA','gl_pred->KNJ','gl_pred->STATUS',;
'transform(gl_pred->PLACANO,"@E 9,999,999.99")','gl_pred->PRED','substr(gl_pred->KON,2,1)', 'substr(naslovi->KOM2,46,1)' } ;
JUSTIFY { BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,;
BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,;
BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT };
TOOLTIP 'Seznam predračunov' ;
ON DBLCLICK test1() ;
FONT 'ARIAL' SIZE 10 ;
ON HEADCLICK { { || Sort_stevpred() },,, { || Sort_datpred() } } ;
HEADERIMAGES { '02.bmp','00.bmp','00.bmp','00.bmp' } ;
DYNAMICFORECOLOR { fColor,fColor,fColor,fColor,fColor,fColor,fcolor,fcolor;
,fColor,fColor,fColor,fColor,fcolor,fColor,fColor,fColor,fColor,fColor} ;
DYNAMICBACKCOLOR { bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,{|| if ( gl_pred->prep < 0 , {255,150,150} , {150,255,150} ) };
,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor };
LOCKCOLUMNS 5
ON KEY ESCAPE ACTION predrac.release
END WINDOW
CENTER WINDOW predrac
ACTIVATE WINDOW predrac
close databases
return
procedure sort_stevpred()
if indexord()=1
set order to 4
predrac.Grid_pred.HeaderImages( 1 ) := '01.bmp'
predrac.Grid_pred.HeaderImages( 4 ) := '00.bmp'
else
set order to 1
predrac.Grid_pred.HeaderImages( 1 ) := '02.bmp'
predrac.Grid_pred.HeaderImages( 4 ) := '00.bmp'
endif
predrac.Grid_pred.Refresh
return
procedure sort_datpred()
if indexord()=2
set order to 5
predrac.Grid_pred.HeaderImages( 4 ) := '01.bmp'
predrac.Grid_pred.HeaderImages( 1 ) := '00.bmp'
else
set order to 2
predrac.Grid_pred.HeaderImages( 4 ) := '02.bmp'
predrac.Grid_pred.HeaderImages( 1 ) := '00.bmp'
endif
predrac.Grid_pred.Refresh
return
procedure test1()
select naslovi
msginfo("test")
set deleted off
predrac.Grid_pred.recno:=10
set deleted on
return
best regards Rado
I have problem with grid refresh for dbf file with more indexes.
Example:When first time I enter in test menue is ok . Then I sort grid with dbf to descending number (index 4) , grid is ok restorted to descending, then I go out with ESC to main menue and back to test. I get wrong grid ( see gridpic.jpg ).
Complete sources and pic in attached zip file.
#include "hmg.ch"
Function Main
REQUEST DBFNTX
RDDSETDEFAULT( "DBFNTX" )
SET DELETED ON
SET DATE GERMAN
SET CENTURY ON
SET EXCLUSIVE OFF
SET BROWSESYNC ON
SET LANGUAGE TO SLOVENIAN
SET NAVIGATION EXTENDED
REQUEST HB_CODEPAGE_SLWIN
HB_SETCODEPAGE( "SLWIN" )
Private bColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2) , { 245,245,245 } , { 255,255,255 } ) }
Private fColor := { || { 0,0,255 }}
DEFINE WINDOW meni ;
AT 20,20 ;
WIDTH getdesktopWidth()-50 ;
HEIGHT getDeskTopHeight()-120 ;
TITLE 'Test' ;
MAIN
DEFINE MAIN MENU
POPUP 'Menue'
ITEM '&1. Test' ACTION (test())
END POPUP
END MENU
END WINDOW
CENTER WINDOW meni
ACTIVATE WINDOW meni
close databases
return
procedure test
select 2
use naslovi alias naslovi
set index to naslovi,naziv
select 5
use gl_pred alias gl_pred
set index to gl_pred1,gl_pred2,gl_pred3,gl_pred4,gl_pred5
set relation to sifra into naslovi
go top
katerig:=reccount()
DEFINE WINDOW predrac ;
AT 20,20 ;
WIDTH getdesktopWidth()-50 ;
HEIGHT getDeskTopHeight()-120 ;
TITLE 'Test' ;
MODAL
@ 65,5 GRID Grid_pred ;
WIDTH getdesktopWidth()-70 ;
HEIGHT getDeskTopHeight()-270 ;
HEADERS { 'Num.','Šifra','Ime kupca','Datum','Znesek','Rabat','DDV','Zaslužek','Za plačilo',;
'Dod.stroški','Datum plačila','Valuta','Knjižen','Status','Plačano po','predračunu',;
'Vrsta','Zav.za davek'} ;
WIDTHS { 70,70,240,100,90,90,90,90,100,90,100,50,60,50,90,80,40,40 } ;
ROWSOURCE "GL_PRED" ;
VALUE { 1, 1} ;
COLUMNFIELDS { 'gl_pred->STEV','gl_pred->SIFRA','NASLOVI->NAZIV','gl_pred->DATUM','transform(round(gl_pred->vse,2),"@E 99,999,999.99")',;
'transform(round(gl_pred->rabat,2),"@E 9,999,999.99")','transform(round(gl_pred->davek,2),"@E 9,999,999.99")',;
'transform(round(gl_pred->prep,2),"@E 9,999,999.99")','transform(round(gl_pred->skupaj,2),"@E 9,999,999.99")',;
'transform(round(gl_pred->ptt,2),"@E 9,999,999.99")','gl_pred->DATUM_PLA','gl_pred->VALUTA','gl_pred->KNJ','gl_pred->STATUS',;
'transform(gl_pred->PLACANO,"@E 9,999,999.99")','gl_pred->PRED','substr(gl_pred->KON,2,1)', 'substr(naslovi->KOM2,46,1)' } ;
JUSTIFY { BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,;
BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,;
BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT,BROWSE_JTFY_RIGHT };
TOOLTIP 'Seznam predračunov' ;
ON DBLCLICK test1() ;
FONT 'ARIAL' SIZE 10 ;
ON HEADCLICK { { || Sort_stevpred() },,, { || Sort_datpred() } } ;
HEADERIMAGES { '02.bmp','00.bmp','00.bmp','00.bmp' } ;
DYNAMICFORECOLOR { fColor,fColor,fColor,fColor,fColor,fColor,fcolor,fcolor;
,fColor,fColor,fColor,fColor,fcolor,fColor,fColor,fColor,fColor,fColor} ;
DYNAMICBACKCOLOR { bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,{|| if ( gl_pred->prep < 0 , {255,150,150} , {150,255,150} ) };
,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor,bcolor };
LOCKCOLUMNS 5
ON KEY ESCAPE ACTION predrac.release
END WINDOW
CENTER WINDOW predrac
ACTIVATE WINDOW predrac
close databases
return
procedure sort_stevpred()
if indexord()=1
set order to 4
predrac.Grid_pred.HeaderImages( 1 ) := '01.bmp'
predrac.Grid_pred.HeaderImages( 4 ) := '00.bmp'
else
set order to 1
predrac.Grid_pred.HeaderImages( 1 ) := '02.bmp'
predrac.Grid_pred.HeaderImages( 4 ) := '00.bmp'
endif
predrac.Grid_pred.Refresh
return
procedure sort_datpred()
if indexord()=2
set order to 5
predrac.Grid_pred.HeaderImages( 4 ) := '01.bmp'
predrac.Grid_pred.HeaderImages( 1 ) := '00.bmp'
else
set order to 2
predrac.Grid_pred.HeaderImages( 4 ) := '02.bmp'
predrac.Grid_pred.HeaderImages( 1 ) := '00.bmp'
endif
predrac.Grid_pred.Refresh
return
procedure test1()
select naslovi
msginfo("test")
set deleted off
predrac.Grid_pred.recno:=10
set deleted on
return
best regards Rado
- Attachments
-
- TEST.ZIP
- (815.21 KiB) Downloaded 367 times
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid with more indexes
Thanks for the report.
I'll check it ASAP.
I'll check it ASAP.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid with more indexes
I've fixed.Roberto Lopez wrote:Thanks for the report.
I'll check it ASAP.
Please, replace libhmg.a with the attached one and test again.
Thanks again for the report.
- Attachments
-
- libhmg.rar
- (194.67 KiB) Downloaded 323 times
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Re: Grid with more indexes
Thanks Roberto,
it works.
best regards Rado
it works.
best regards Rado
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Re: Grid with more indexes
Hello Roberto,
I have the same problem with refresh also when in one grid is another grid and you go out of second grid
Program in attached file : Menue : Test
Select with DBLclick number 26 to go to another grid and then with ESC to first grid.
Best regards Rado
I have the same problem with refresh also when in one grid is another grid and you go out of second grid
Program in attached file : Menue : Test
Select with DBLclick number 26 to go to another grid and then with ESC to first grid.
Best regards Rado
- Attachments
-
- TEST.ZIP
- (726.03 KiB) Downloaded 334 times
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid with more indexes
Thanks. I'll check it.radohabjan wrote:Hello Roberto,
I have the same problem with refresh also when in one grid is another grid and you go out of second grid
Program in attached file : Menue : Test
Select with DBLclick number 26 to go to another grid and then with ESC to first grid.
Best regards Rado
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid with more indexes
Fixed.radohabjan wrote:Hello Roberto,
I have the same problem with refresh also when in one grid is another grid and you go out of second grid
Program in attached file : Menue : Test
Select with DBLclick number 26 to go to another grid and then with ESC to first grid.
Best regards Rado
Please, test with the attached lib.
- Attachments
-
- test3033d.rar
- (194.46 KiB) Downloaded 292 times
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Re: Grid with more indexes
Hello Roberto,
refresh is now OK, the problem is still in in grid column Num.
Explenation : if you select with Dblclick Num. 26 and than with ESC back , you get in column Num. number 22.
Same is also with all numbers higher as 26. And when you scroll the main grid it's all mixed.
Perhaps is there some problem with record numbers ( set deleted on )
Bert regard Rado
refresh is now OK, the problem is still in in grid column Num.
Explenation : if you select with Dblclick Num. 26 and than with ESC back , you get in column Num. number 22.
Same is also with all numbers higher as 26. And when you scroll the main grid it's all mixed.
Perhaps is there some problem with record numbers ( set deleted on )
Bert regard Rado
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid with more indexes
I'll check again.radohabjan wrote:Hello Roberto,
refresh is now OK, the problem is still in in grid column Num.
Explenation : if you select with Dblclick Num. 26 and than with ESC back , you get in column Num. number 22.
Same is also with all numbers higher as 26. And when you scroll the main grid it's all mixed.
Perhaps is there some problem with record numbers ( set deleted on )
Bert regard Rado
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid with more indexes
I've tested...radohabjan wrote:Hello Roberto,
refresh is now OK, the problem is still in in grid column Num.
Explenation : if you select with Dblclick Num. 26 and than with ESC back , you get in column Num. number 22.
Same is also with all numbers higher as 26. And when you scroll the main grid it's all mixed.
Perhaps is there some problem with record numbers ( set deleted on )
Bert regard Rado
1. I open the first grid.
2. I go to record 26.
3. I double click it (the second grid window opens).
4. I close the second window (clicking [X]).
5. The record 26 looks exactly the same as prior to open the second grid.
The problem arises only when you press [Esc].
I must to find why this happens...
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)