bug browse.prg version 23/11/2011

Moderator: Rathinagiri

JosK
Posts: 46
Joined: Tue Nov 08, 2011 11:38 pm

bug browse.prg version 23/11/2011

Post by JosK »

error no Exported variable: ClassName:nCellRowIndex
error no Exported variable: ClassName:nNew also nDiff

browse.prg is from abstractgrid
virtualgrid is from abstractgrid

Virtualgrid has data nNew init 0 but browse.prg not

You must add data nCellRowIndex and nNew and nDiff to browse.prg
(look at line 342 in browse.prg. It uses ::nNew but there is no line DATA nNew init so it must be added)
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: bug browse.prg version 23/11/2011

Post by mrduck »

Which is the sample that gives you problem ?
JosK wrote:error no Exported variable: ClassName:nCellRowIndex
error no Exported variable: ClassName:nNew also nDiff

browse.prg is from abstractgrid
virtualgrid is from abstractgrid

Virtualgrid has data nNew init 0 but browse.prg not

You must add data nCellRowIndex and nNew and nDiff to browse.prg
(look at line 342 in browse.prg. It uses ::nNew but there is no line DATA nNew init so it must be added)
JosK
Posts: 46
Joined: Tue Nov 08, 2011 11:38 pm

Re: bug browse.prg version 23/11/2011

Post by JosK »

mrduck wrote:Which is the sample that gives you problem ?
JosK wrote:error no Exported variable: ClassName:nCellRowIndex
error no Exported variable: ClassName:nNew also nDiff

browse.prg is from abstractgrid
virtualgrid is from abstractgrid

Virtualgrid has data nNew init 0 but browse.prg not

You must add data nCellRowIndex and nNew and nDiff to browse.prg
(look at line 342 in browse.prg. It uses ::nNew but there is no line DATA nNew init so it must be added)
There are some bugs in browse.prg. (I have correct some bugs in browse.prg, mostly DATA used in class but not defined. I have not uploaded the code)
I like virtualgrid.prg more so i don't look at bugs in browse.prg anymore.
You can see my other posts for a nice example with virtualgrid, tab-pages, jkgrid/virtualgrid, setkey, layoutbox, insets. (you must expand youre screen and then you see wat insets does.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: bug browse.prg version 23/11/2011

Post by mrduck »

Can you please attach a zip file with all the modifies source code ? It's very time consuming extracting the coe from the messages posted.

Thanks
JosK
Posts: 46
Joined: Tue Nov 08, 2011 11:38 pm

Re: bug browse.prg version 23/11/2011

Post by JosK »

the zip (browse, virtualgrid, abstractgrid)
Attachments
HMGJK.ZIP
(16.64 KiB) Downloaded 251 times
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: bug browse.prg version 23/11/2011

Post by Ricci »

Josk, the common language for comments in the sources should be english, please.

I don´t understand this change in browse.prg:

Code: Select all

      //::nNew := y + 1  //error line ->no exported variable classname()nNew
      ::nNew := y+1
In Virtualgrid you deleted the methods AllowAppend() and AllowDelete() because they seem to do do nothing (now), but they are there because of HMG3 compatibility!
JosK
Posts: 46
Joined: Tue Nov 08, 2011 11:38 pm

Re: bug browse.prg version 23/11/2011

Post by JosK »

Ricci wrote:Josk, the common language for comments in the sources should be english, please.

I don´t understand this change in browse.prg:

Code: Select all

      //::nNew := y + 1  //error line ->no exported variable classname()nNew
      ::nNew := y+1
In Virtualgrid you deleted the methods AllowAppend() and AllowDelete() because they seem to do do nothing (now), but they are there because of HMG3 compatibility!
with the browse.prg of 23/11/2011 i get the error no exported variable classname() nNew add that line
therefore i have add nNew, nDiff .. to browse.prg:

DATA cClass INIT "BROWSE"
DATA QAbstractItemModel INIT NIL
DATA nCellRowIndex INIT 0
DATA nCellColIndex INIT 0
DATA aStruct INIT NIL
DATA QHeaderView INIT NIL
DATA oSize INIT NIL
DATA nCX INIT 0
DATA nCY INIT 0
DATA QAbstractItemDelegate INIT NIL
DATA QItemSelectionModel INIT NIL
DATA nCurrent INIT NIL
DATA nNew INIT NIL
DATA nDiff INIT NIL
DATA nMasterRecNo INIT NIL
DATA nRecordCount INIT 0
DATA oQHeaderView INIT NIL
DATA nValue INIT NIL
DATA bOnDblClick INIT NIL
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: bug browse.prg version 23/11/2011

Post by mrduck »

I think that BROWSE was somehow deemed obsolete by Rathinagiri when he revised code of grid and virtualgrid.

Infact there is no samples/browse.

Probably we should complete this migration.... please wait till next tuesday and I will try to do a resume on the subject.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: bug browse.prg version 23/11/2011

Post by mrduck »

mrduck wrote: Infact there is no samples/browse.
I also did some work on abstractgrid / virtualgrid / grid / browse but samples\browse was already deleted....

Next week I'll check...
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: bug browse.prg version 23/11/2011

Post by mrduck »

JosK wrote:virtualgrid
Hi JosK,
I had a look at your changes.

ABSTRACTGRID:
I can't understand your comment (DEZE EVAL DOEN WE ALLEEN BIJ INVOEREN EN NIET BIJ OPBOUWEN SCHERM)... can you please exaplain why you removed the eval ?

Perhaps because it is already done in DoKeyboardEvents ?
JosK wrote:JKgrid
First of all I'd like to suggest to you and other developers reading the thread that when we need to "specialize" a hmg4 class we may inherit from the base one and override the specific methods.

For example, in the case of JKgrid I'd do:

Code: Select all

CLASS JKGRID FROM ABSTRACTGRID
   METHOD DoCellKeyBoardEvents
ENDCLASS
When you need you overload other methods. In this way you keep the original code and specialize what you need.

JKGrid has a different handling of keypresses during editing, it actually adds some features... so I'd write:

Code: Select all

METHOD xxx

   // handle special new cases

  super:xxx()  // handle the standard cases
In this way I think the code is cleaner and easier to handle....

Later for the contents...
Post Reply