GRID : an error in property "value" ?
Moderator: Rathinagiri
GRID : an error in property "value" ?
Hi everybody.
Today I experimented with the grid, and created a program to save provinces.
Please see the movie GridValueProperty I recorded in attachment. Included also the program source and database.
The program shows the grid property "value" in a messagebox.
When there are 2 records in the database, I delete the second record. Is there then an error in the grid property "value" ?
The grid row remains 2, even when I select the first row.
(And is there a problem with the coloring ? I use cell navigation, but the whole line turns blue since then).
Kind regards, Marc
Today I experimented with the grid, and created a program to save provinces.
Please see the movie GridValueProperty I recorded in attachment. Included also the program source and database.
The program shows the grid property "value" in a messagebox.
When there are 2 records in the database, I delete the second record. Is there then an error in the grid property "value" ?
The grid row remains 2, even when I select the first row.
(And is there a problem with the coloring ? I use cell navigation, but the whole line turns blue since then).
Kind regards, Marc
- Attachments
-
- GridValueProperty.zip
- (2.39 MiB) Downloaded 263 times
-
- PRV.zip
- (1.44 MiB) Downloaded 291 times
- dragancesu
- Posts: 926
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: GRID : an error in property "value" ?
Code: Select all
*------------------------------------------------------------------------------*
FUNCTION PRV_Button_Delete()
*------------------------------------------------------------------------------*
LOCAL aRC := Win_PRV.Grid_PRV.Value
LOCAL aItem := Win_PRV.Grid_PRV.Item(aRC[1])
IF PRV->(DBSeek( aItem[1] + aItem[2] ))
IF MsgOkCancel ("Delete " + aItem[2] + " " + ALLTRIM(aItem[3]), "Controle")
PRV->(DBDelete())
PRV->(DBUnlock())
PRV->(DBSkip())
IF PRV->(EOF())
PRV->(DBGobottom())
ENDIF
Win_PRV.Grid_PRV.DeleteItem( aRC[1] )
??? Win_PRV.Grid_PRV.Value := { aRC[1], aRC[2] }
*IF aRC[1] > Win_PRV.Grid_PRV.ItemCount
* IF Win_PRV.Grid_PRV.ItemCount > 0
* aRC[1] := Win_PRV.Grid_PRV.ItemCount
* ENDIF
*ENDIF
ENDIF
ENDIF
PRV_RefreshData()
Win_PRV.Grid_PRV.Setfocus
RETURN
I do not know how long a programmer, I have long used the clipper, then I found harbour and was thrilled when I started I HMG again I was at the beginning and it took me a few months to adjust, windows programming is a little different than for dos
As long as you have experience with programming when you go with the new man is a beginner (like him or not), and it must also be set to pass the cases where there are plenty of HMG
You may want to write your previous experience with programming
p.s. forget refresh button, create a function that solve after actions that seek to
Re: GRID : an error in property "value" ?
The program is now modified to avoid the error in the grid property "value". See the latest attachment PRV.ZIP.
If anybody has any remarks on things that could be better, please let me know. I know Clipper (DOS, TBrowse), but I am a HMG-IDE beginner.
I do hope that the HMG development team will handle the issue I demonstrated in the movie GridValuePropery I posted earlier.
To the HMG team I would like to say you are doing a great job and make many programmers all over the world very happy.
Keep up the good work![Smile :-)](./images/smilies/icon_e_smile.gif)
Kind regards, Marc
If anybody has any remarks on things that could be better, please let me know. I know Clipper (DOS, TBrowse), but I am a HMG-IDE beginner.
I do hope that the HMG development team will handle the issue I demonstrated in the movie GridValuePropery I posted earlier.
To the HMG team I would like to say you are doing a great job and make many programmers all over the world very happy.
Keep up the good work
![Smile :-)](./images/smilies/icon_e_smile.gif)
Kind regards, Marc
- Attachments
-
- PRV.zip
- (1.45 MiB) Downloaded 336 times
- serge_girard
- Posts: 3178
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: GRID : an error in property "value" ?
Very nice and you will become a real HMG-man!
Serge
Serge
There's nothing you can do that can't be done...
Re: GRID : an error in property "value" ?
+1serge_girard wrote:Very nice and you will become a real HMG-man!
Serge
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: GRID : an error in property "value" ?
Hi Marc,TopsMarc wrote:The program is now modified to avoid the error in the grid property "value". See the latest attachment PRV.ZIP.
If anybody has any remarks on things that could be better, please let me know. I know Clipper (DOS, TBrowse), but I am a HMG-IDE beginner.
...
Kind regards, Marc
Thanks for your sample
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
I've adapted this example to a recent build of Minigui Extended Edition 16.04 with a small improvements
![Cool 8-)](./images/smilies/icon_cool.gif)
Please take a look for an attached code with the proposed modifications.
- Attachments
-
- prv-ex.zip
- Source code
- (873.12 KiB) Downloaded 293 times
-
- Updated look of application
- prv.png (68.71 KiB) Viewed 5496 times
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: GRID : an error in property "value" ?
Thank you all for your support. I am learning and all help is welcome.
Hi Grigory, you did some fine modifications. I like it
. I do get syntax errors when I try to compile your MiniGui modifications in HMG-IDE, e.g. .SetArray is invalid. Some things seem to be different in MiniGui compared to HMG-IDE. I read about Harbour, xHarbour, MiniGui, HMG, HMG-IDE, HwGui, ooHG and similar. I didn't really know what to choose. But HMG-IDE was very well documented, so I chose that one.
Is there a special reason why you use MiniGui ? Has MiniGui advantages compared to HMG-IDE ?
If there is a bug in e.g. the GRID in HMG-IDE, is the same bug then present in MiniGui or not ? Are bugs quickly repaired by the development team in MiniGui ? I do have a lot of questions
Kind regards, Marc
Hi Grigory, you did some fine modifications. I like it
![Smile :-)](./images/smilies/icon_e_smile.gif)
Is there a special reason why you use MiniGui ? Has MiniGui advantages compared to HMG-IDE ?
If there is a bug in e.g. the GRID in HMG-IDE, is the same bug then present in MiniGui or not ? Are bugs quickly repaired by the development team in MiniGui ? I do have a lot of questions
![Smile :)](./images/smilies/icon_e_smile.gif)
Kind regards, Marc
Re: GRID : an error in property "value" ?
Hi Marc,TopsMarc wrote:Thank you all for your support. I am learning and all help is welcome.
Hi Grigory, you did some fine modifications. I like it. I do get syntax errors when I try to compile your MiniGui modifications in HMG-IDE, e.g. .SetArray is invalid. Some things seem to be different in MiniGui compared to HMG-IDE. I read about Harbour, xHarbour, MiniGui, HMG, HMG-IDE, HwGui, ooHG and similar. I didn't really know what to choose. But HMG-IDE was very well documented, so I chose that one.
Is there a special reason why you use MiniGui ? Has MiniGui advantages compared to HMG-IDE ?
If there is a bug in e.g. the GRID in HMG-IDE, is the same bug then present in MiniGui or not ? Are bugs quickly repaired by the development team in MiniGui ? I do have a lot of questions![]()
Thanks for your interest!
You can read about MiniguiEx on this forum at
http://hmgforum.com/viewtopic.php?f=5&t ... cial#p1319
The Minigui Team provide a new builds on the monthly basis for BCC, mingw32 and mingw64 C-compilers.
BTW I don't use any IDE personally but a free coding only
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
Sorry I can not promote the MiniguiEx project on this friendly forum
![Embarrassed :oops:](./images/smilies/icon_redface.gif)
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: GRID : an error in property "value" ?
Hi Mark,TopsMarc wrote:Hi everybody.
Today I experimented with the grid, and created a program to save provinces.
Please see the movie GridValueProperty I recorded in attachment. Included also the program source and database.
The program shows the grid property "value" in a messagebox.
When there are 2 records in the database, I delete the second record. Is there then an error in the grid property "value" ?
The grid row remains 2, even when I select the first row.
(And is there a problem with the coloring ? I use cell navigation, but the whole line turns blue since then).
Kind regards, Marc
this is the correct way:
Code: Select all
*------------------------------------------------------------------------------*
FUNCTION PRV_Button_Delete()
*------------------------------------------------------------------------------*
LOCAL aRC := Win_PRV.Grid_PRV.Value
LOCAL aItem := Win_PRV.Grid_PRV.Item(aRC[1])
IF PRV->(DBSeek( aItem[1] + aItem[2] ))
IF MsgOkCancel ("Delete " + aItem[2] + " " + ALLTRIM(aItem[3]), "Controle")
PRV->(DBDelete())
PRV->(DBUnlock())
PRV->(DBSkip())
IF PRV->(EOF())
PRV->(DBGobottom())
ENDIF
Win_PRV.Grid_PRV.DeleteItem( aRC[1] )
// Win_PRV.Grid_PRV.Value := { aRC[1], aRC[2] } --> assigns a wrong value when delete the last item
IF aRC[1] > Win_PRV.Grid_PRV.ItemCount
IF Win_PRV.Grid_PRV.ItemCount > 0
aRC[1] := Win_PRV.Grid_PRV.ItemCount
Win_PRV.Grid_PRV.Value := { aRC[1], aRC[2] }
ENDIF
ENDIF
ENDIF
ENDIF
PRV_RefreshData()
Win_PRV.Grid_PRV.Setfocus
RETURN
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: GRID : an error in property "value" ?
I have fixed the problem in updating the Value property when an item is deleted in the Grid control.
Thanks for report Marc.
Thanks for report Marc.