Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Error in HomeBudget Example?
Re: Error in HomeBudget Example? [message #29228 is a reply to message #29226] Tue, 12 October 2010 10:14 Go to previous messageGo to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
It's actually enough to go into Options -> Clear all data from database.

There's some callback during clear to "HomeBudget::UpdateValue()" which does try to get value from empty money grid.

But as I'm not author of any of used classes, I have no idea what went really wrong.

I did try to understand the code, but both DropGrid and GridCtrl do use "rowid = -1;" for very long time, and ignore such option in Get/Set/operator() code, so it's probably desired behavior, and it's the HomeBudget usage of DropGrid exposing this behavior.
(but I think this is not very robust design, using invalid value as "empty" and don't handle it later in Get).

Adding
void HomeBudget::UpdateValue()
{
    if ( money.GetCount() <= 0 ) return; //added
    try

will fix the crashes and it looks like everything else works, but I don't understand the code and I have no idea what else I may have break.

Also I noticed other HomeBudget bug:
Add the category (both the left thing and right thing, although from the UI I have no idea what is what and for what).
Now click on the left one, and choose to remove, you will get correct "You can't remove this group, it's not empty...".
But now the box on right is disabled, so you can't actually remove the content of the group. (without restarting the app)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [FIXED]Case bug in X11Wnd.cpp
Next Topic: problem with fprintf
Goto Forum:
  


Current Time: Fri Apr 26 06:30:44 CEST 2024

Total time taken to generate the page: 0.03871 seconds