Grid Out of Focus after Edit
Moderator: Rathinagiri
Grid Out of Focus after Edit
Hello,
I don't know whether it's a bug or not. I found that after editing a cell/row in a grid (especially when CELLNAVIGATION is not used), form became out of focus.
Again, I am telling, I am not sure whether it's a bug or not.
Please check this.
With best regards.
Sudip
I don't know whether it's a bug or not. I found that after editing a cell/row in a grid (especially when CELLNAVIGATION is not used), form became out of focus.
Again, I am telling, I am not sure whether it's a bug or not.
Please check this.
With best regards.
Sudip
With best regards,
Sudip
Sudip
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid Out of Focus after Edit
I can't verufy that, so, please, if you can post a little sample, could be very useful...sudip wrote:Hello,
I don't know whether it's a bug or not. I found that after editing a cell/row in a grid (especially when CELLNAVIGATION is not used), form became out of focus.
Again, I am telling, I am not sure whether it's a bug or not.
Please check this.
With best regards.
Sudip
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Grid Out of Focus after Edit
Lo que comenta sudip es correcto.
Sucede cuando editas la primera vez; al terminar de editar, el grid pierde el foco. Cuando vas a editar nuevamente la fila conserva el foco.
Esto no es nuevo, viene sucediendo desde varias versiones anteriores.
What sudip says is correct.
It happens when editing the first time, to finish editing, the grid loses focus. When you go back to edit the row keeps the focus.
This is not new, been happening since several earlier versions.
Regards,
Luis VAsquez
Sucede cuando editas la primera vez; al terminar de editar, el grid pierde el foco. Cuando vas a editar nuevamente la fila conserva el foco.
Esto no es nuevo, viene sucediendo desde varias versiones anteriores.
What sudip says is correct.
It happens when editing the first time, to finish editing, the grid loses focus. When you go back to edit the row keeps the focus.
This is not new, been happening since several earlier versions.
Regards,
Luis VAsquez
Re: Grid Out of Focus after Edit
Yes, that is I want to say.luisvasquezcl wrote: What sudip says is correct.
It happens when editing the first time, to finish editing, the grid loses focus. When you go back to edit the row keeps the focus.
This is not new, been happening since several earlier versions.
A small sample is :-
Code: Select all
@ 96, 220 GRID grdCompoundRm ;
WIDTH 300 ;
HEIGHT 250 ;
HEADERS { 'Raw Material', 'Qty', '%' } ;
WIDTHS { 150, 75, 55 } ;
COLUMNCONTROLS { { 'COMBOBOX', aRmnm }, ;
{ 'TEXTBOX', 'NUMERIC', '9999.999' }, ;
{ 'TEXTBOX', 'NUMERIC', '999.99%' }} ;
CELLNAVIGATION ;
edit ;
justify { 0, 1, 1 } ;
on LOSTFOCUS calctot() ;
COLUMNWHEN { { || .t. }, { || .t. }, { || .f. } }
With best regards.
Sudip
With best regards,
Sudip
Sudip
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid Out of Focus after Edit
If you could post a complete small sample, ready to compile, it will help to me a lot.sudip wrote: Roberto, this is not a working sample. If you need I can send you my new project code also.
Regards,
Roberto.
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 Out of Focus after Edit
Your grid definition has references, to a function and an array that are unknown to me. Besides that, the eventual presence of other controls in the window or the window type could be related with the problem, so please post a complete small sample showing the problem, then I'll analyze it.sudip wrote:Code: Select all
@ 96, 220 GRID grdCompoundRm ; WIDTH 300 ; HEIGHT 250 ; HEADERS { 'Raw Material', 'Qty', '%' } ; WIDTHS { 150, 75, 55 } ; COLUMNCONTROLS { { 'COMBOBOX', aRmnm }, ; { 'TEXTBOX', 'NUMERIC', '9999.999' }, ; { 'TEXTBOX', 'NUMERIC', '999.99%' }} ; CELLNAVIGATION ; edit ; justify { 0, 1, 1 } ; on LOSTFOCUS calctot() ; COLUMNWHEN { { || .t. }, { || .t. }, { || .f. } }
Thanks in advance.
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Grid Out of Focus after Edit
Hello Roberto,
I have found that an out of focus problem occurs after first time edit in Grid in CHILD windows only but not in MODAL or MAIN windows.
(My net has some problems. So I shall post a complete sample after some time)
With best regards.
Sudip
I have found that an out of focus problem occurs after first time edit in Grid in CHILD windows only but not in MODAL or MAIN windows.
(My net has some problems. So I shall post a complete sample after some time)
With best regards.
Sudip
With best regards,
Sudip
Sudip
Re: Grid Out of Focus after Edit
Hello Roberto,
Here is a working sample for the problem. Please run and try to change the "Qty" column of the grid first.
Thank you very much.
With best regards.
Sudip
Here is a working sample for the problem. Please run and try to change the "Qty" column of the grid first.
Code: Select all
#include "minigui.ch"
Function Main
DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 700 ;
HEIGHT 560 ;
TITLE 'Grid Edit Problem' ;
MAIN
DEFINE MAIN MENU
DEFINE POPUP 'Test'
MENUITEM 'Test' ACTION GridTest()
END POPUP
END MENU
END WINDOW
ACTIVATE WINDOW Win_1
Return
Function GridTest()
aRmnm := {"Natural Rubber", "PVC", "Sulphur"}
DEFINE WINDOW frmCompound ;
AT 0,0 ;
WIDTH 635 ;
HEIGHT 460 ;
TITLE 'Grid' ;
child ;
ON INIT FillGrid()
@ 10, 10 GRID grdCompoundRm ;
WIDTH 500 ;
HEIGHT 400 ;
HEADERS { 'Raw Material', 'Qty', '%' } ;
WIDTHS { 150, 75, 55 } ;
COLUMNCONTROLS { { 'COMBOBOX', aRmnm }, ;
{ 'TEXTBOX', 'NUMERIC', '9999.999' }, ;
{ 'TEXTBOX', 'NUMERIC', '999.99%' }} ;
CELLNAVIGATION ;
edit ;
justify { 0, 1, 1 } ;
on LOSTFOCUS calctot() ;
COLUMNWHEN { { || .t. }, { || .t. }, { || .f. } }
END WINDOW
CENTER WINDOW frmCompound
ACTIVATE WINDOW frmCompound
RETURN
Function FillGrid()
local i, aGrid := { {1, 10, 0.00}, {3, 5, 0.00}, {2, 5, 0.00}}
frmCompound.grdCompoundRm.DeleteAllItems()
for i = 1 to len( aGrid )
frmCompound.grdCompoundrm.additem( aGrid[ i ] )
next
return nil
static function CalcTot()
local a, i, j, aTemp := { }, mTotWt := 0.00
a := frmCompound.grdCompoundRm.value
i := a[1]
aTemp := frmCompound.grdCompoundRm.item( i )
if i < 1
return
endif
for j = 1 to frmCompound.grdCompoundRm.Itemcount
mTotWt += frmCompound.grdCompoundRm.cell( j, 2 )
next
aTemp[ 3 ] := round(aTemp[ 2 ] / iif(empty(mTotWt), 1, mTotWt)*100, 2)
frmCompound.grdCompoundRm.item( i ) := aTemp
return nil
With best regards.
Sudip
With best regards,
Sudip
Sudip
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid Out of Focus after Edit
Many Thanks!sudip wrote:Hello Roberto,
Here is a working sample for the problem. Please run and try to change the "Qty" column of the grid first.
Thank you very much.Code: Select all
#include "minigui.ch" Function Main DEFINE WINDOW Win_1 ; AT 0,0 ; WIDTH 700 ; HEIGHT 560 ; TITLE 'Grid Edit Problem' ; MAIN DEFINE MAIN MENU DEFINE POPUP 'Test' MENUITEM 'Test' ACTION GridTest() END POPUP END MENU END WINDOW ACTIVATE WINDOW Win_1 Return Function GridTest() aRmnm := {"Natural Rubber", "PVC", "Sulphur"} DEFINE WINDOW frmCompound ; AT 0,0 ; WIDTH 635 ; HEIGHT 460 ; TITLE 'Grid' ; child ; ON INIT FillGrid() @ 10, 10 GRID grdCompoundRm ; WIDTH 500 ; HEIGHT 400 ; HEADERS { 'Raw Material', 'Qty', '%' } ; WIDTHS { 150, 75, 55 } ; COLUMNCONTROLS { { 'COMBOBOX', aRmnm }, ; { 'TEXTBOX', 'NUMERIC', '9999.999' }, ; { 'TEXTBOX', 'NUMERIC', '999.99%' }} ; CELLNAVIGATION ; edit ; justify { 0, 1, 1 } ; on LOSTFOCUS calctot() ; COLUMNWHEN { { || .t. }, { || .t. }, { || .f. } } END WINDOW CENTER WINDOW frmCompound ACTIVATE WINDOW frmCompound RETURN Function FillGrid() local i, aGrid := { {1, 10, 0.00}, {3, 5, 0.00}, {2, 5, 0.00}} frmCompound.grdCompoundRm.DeleteAllItems() for i = 1 to len( aGrid ) frmCompound.grdCompoundrm.additem( aGrid[ i ] ) next return nil static function CalcTot() local a, i, j, aTemp := { }, mTotWt := 0.00 a := frmCompound.grdCompoundRm.value i := a[1] aTemp := frmCompound.grdCompoundRm.item( i ) if i < 1 return endif for j = 1 to frmCompound.grdCompoundRm.Itemcount mTotWt += frmCompound.grdCompoundRm.cell( j, 2 ) next aTemp[ 3 ] := round(aTemp[ 2 ] / iif(empty(mTotWt), 1, mTotWt)*100, 2) frmCompound.grdCompoundRm.item( i ) := aTemp return nil
With best regards.
Sudip
I'll check it ASAP.
Regards,
Roberto.
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 Out of Focus after Edit
Please add the following line to the end (prior to 'return' line) in '_HMG_GRIDINPLACEEDIT' function ('h_grid.prg' file):sudip wrote:Hello Roberto,
Here is a working sample for the problem. Please run and try to change the "Qty" column of the grid first.
Code: Select all
SETFOCUS ( _HMG_SYSDATA [3] [IDX] )
Thanks for the report.
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)