|
on UGCelTyp.cpp at line 1291 (v. 7.3) the call
DrawBackground( dc, rect, backcolor, NULL, false, false );
should be
DrawBackground( dc, rect, backcolor, -1, -1, NULL, false, false );
The code works since last false is casted as a NULL pointer and row and col are not evaluated.
|
|
|
|
|
I have a dialog attached to grid. I have called SetCancelMode(TRUE) inside OnSetUp function and checking for cancel flag inside OnEditFinish function. I am checking for a value in edit text box in the grid control. I have other buttons in my dialog. when the text field is empty ,I display error message in OnEditFinish function. There is no problem when I close the dialog using cancel button. But there are 2 problems.
1. I want to close the dialog when user pressed the OK button, but error message should not be displayed when user presses other button. But Error message keeps displaying when the OK button is pressed.
2. When I click other application, the focus in edit box is lost, So even though the data is empty, the error message is not displayed when I click other buttons.
Could you suggest a feasible solution to this problem?
|
|
|
|
|
int CUGCtrl::BestFit(int startCol,int endCol,int CalcRange,int flag)
does NOT use this flag at all?
Is it obsolete flag?
|
|
|
|
|
Manual says for EnableCellOverLap() as follows:
...
This function will allow cells to overlap if you have to display data which exceeds the cells boundaries (the cell will overlap to the next cell). This overlapping will only occur if the adjacent cell contains NO data.
...
Let's say there are two cells: C1 and C2 whose initial widths are both 10 characters. Initially, C1 has "1234567890ABCDE" and C2 is empty.
With cell overlap disabled, I see C1 shows "1234567890" and C2 shows nothing. This is expected.
Next, with cell overlap enalbed, I expect "1234567890" is shown on C1 and "ABCDE" is shown on C2 because C2 contains NO data. However, C1 shows nothing and C2 shows "ABCDE".
You can check this incorrect behavior by running Celltypes demo from Demos folder.
Can anyone tell me how to make this cell overlap work correctly?
[upd1] I have tested the same exe on both XP and Win 7 and found that XP works fine, but Win 7 fails to support cell overlapping. It can be tested using CellTypes.exe from Demos folder.
[upd2] Someone already had raised this issue on Win 7.
http://www.codeproject.com/Articles/20183/The-Ultimate-Grid-Home-Page?msg=4689155#xx4689155xx
It solved cell overlap bug, but introduces a new bug for theme style 1. That is, with theme 1 selected, all row headings fail to display.
If someone can fix this, please let me know.
haerim
-- modified 28-Oct-13 20:46pm.
|
|
|
|
|
Hi
I am looking for a few features:
[1] a droplist whose items have checkboxes along with item labels.
[2] a hybrid/composite cell having a grid as its item. Kind of a grid within a cell.
Let me know how to get these features.
thx
|
|
|
|
|
Among Demo projects, CellTypes projects include all sorts of controls in one dialog.
32-bit version works for all cell types.
However, 64-bit version does not work correctly for the following cell types.
- Dynamic Droplist
- Change Droplist
- Ellipsis button
- Spin button
- etc
I ran both 32 and 64 bit projects at the same time tracing line by line.
For 32 version,
int CUGCellType::OnCellTypeNotify(long ID,int col,long row,long msg,LONG_PTR param){
return m_ctrl->OnCellTypeNotify(ID,col,row,msg,param);
}
correctly calls int CCellTypeDemoGrid::OnCellTypeNotify(long ID,int col,long row,long msg,long param).
But, for 64 version, it calls
int CUGCtrl::OnCellTypeNotify(long ID,int col,long row,long msg,LONG_PTR param).
I don't know why.
thx.
[upd] Similar bug and its fix was reported before. After fixing, things work ok on 64-bit.
//Minor 64-bit issue in the skeleton code member _jg_ 19-Nov-11 0:43 (http://www.codeproject.com/Articles/20183/The-Ultimate-Grid-Home-Page?msg=4081927#xx4081927xx)
-- modified 26-Oct-13 14:14pm.
|
|
|
|
|
Hi,
I'm new to Ultimate Grid (and relatively new to MFC). I have compiled the libraries and have a basic grid project up and running.
I have set it to display Excel-like focus and now want to be able to select a group of cells (say 3 in a column) and then extend the selection to copy the pattern established by the selected cells in a similar way to Excel continues the pattern.
Eg. I select 3 cells in a column, containing 1, 2, 3 respectively. If I extend the selection by 2 cells down I want to populate those cells with 1, 2. If I extend by 4 I want to populate them with 1, 2, 3, 1. I want to repeat the data, not extend the pattern as Excel does.
My problem is that I can't find any (obvious) methods which would allow me to detect when the mouse is over the small square in the bottom-right corner of the Excel Focus Rectangle so that I can change the cursor to indicate that, and to allow clicking the mouse to pick up that corner and extend the Focus Rectangle.
I have seen the Excel Demo and it doesn't seem to be able to allow the user to extend the Excel Focus Rectangle either, so I haven't been able to get clues from that.
Any help greatly appreciated.
Geoff King
|
|
|
|
|
I have two related columns, one an absolute value, another a percent of a reference value. The absolute value is stored in a datasource, and the percent column is calculated from that.
When I change the value, I'd like the percent to update (basically a RedrawCol()), and vice versa. I cannot find any single event for "after changes are made and accepted to a cell". So far I've tried combinations of:
OnEditStart
OnEditFinish
OnEditContinue
OnKillFocus
OnCellChange
But I can't find a solution. I'm about to try setting a dirty flag, then using the mousemove event to check the dirty flag, and redraw if needed. But that seems like a hack on a hack. Any ideas?
|
|
|
|
|
I bought the Ultimate Tools[v9.2] and Gird[v7.1] licenses for commercial using a few years ago.
But the Ultimate tools company is not exist any more.
So, I want to use your upgrade version. At this time. Is it possible to use my licenses with your upgrade versions ?
|
|
|
|
|
You don't need your old license. This project is licensed under the "The Code Project Open License" (CPOL) which is viable for commercial purposes. So you're good to go. You can read about the license here:
http://www.codeproject.com/info/cpol10.aspx[^]
|
|
|
|
|
|
Having some issues with the default number formatting in CUGCell::GetText. Essentially I want the numbers to appear as the user entered them, but be able to sort the columns.
Using SetText gives me control over the formatting, but breaks the sort.
If you call SetNumberDecimals, you can fix the number of decimal places.
Eg, use SetNumberDecimals(5), and SetNumber(0.275) will be displayed as 0.27500, and SetNumber(0.2751234) gets truncated to 0.27512. So this either adds or removes characters from the user input
If you dont call SetNumberDecimals, it will show the entire number and trim the extra zeros, so SetNumber(0.275) is displayed as 0.275, and SetNumber(0.2751234) is 0.2751234. But because the original string is generated with %.20f, you may get a rounding error at the end of the string, and SetNumber(0.275) actually appears as 0.2749999999999999999 or 0.275000000000000003. Which is ugly, distracting, etc.
To fix this I have changed the format string to %.15g, as wikipedia[^] says a 15 digit string is the longest that can be converted to double and back to the original string. I also removed the trim zero code, as the g format should do that too.
I don't know if someone has issues with %g (wanting to avoid scientific notation?, or does it break the localization?)
I would suggest one of the following changes
1. Changing the default format to %.15g, and changing the behaviour for everyone.
2. Add extra options to the SetNumberDecimals behaviour to trim trailing zeros, maybe by setting m_numDecimals without setting UGCELL_NUMBERDEC_SET, so you can specify the number of decimals places but it then trims trailing zeros.
3. Store the format string, SetNumberDecimals would then set the string to
formatStr.Format(_T("%%1.%dlf"), numDecimals) instead of GetText generating this string, and add functions like
SetPrecision(int places){formatStr.Format(_T("%%1.%dg"), places)};
For reference:
if( m_propSetFlags&UGCELL_NUMBERDEC_SET )
{
CString formatStr = _T("%lf");
formatStr.Format(_T("%%1.%dlf"), m_numDecimals ); strDouble.Format( formatStr, m_nNumber );
}
else
{
strDouble.Format(_T("%.20f"), m_nNumber );
strDouble.TrimRight(_T('0'));
}
if(!( m_propSetFlags&UGCELL_NUMBERDEC_SET ))
{
strDouble.TrimLeft(_T('0'));
strDouble.TrimRight(_T('0'));
}
if ( strDouble.Right( 1 ) == _T('.'))
strDouble.TrimRight( _T('.'));
which could be:
if( m_propSetFlags&UGCELL_NUMBERDEC_SET )
{
CString formatStr;
formatStr.Format(_T("%%1.%dlf"), m_numDecimals ); strDouble.Format( formatStr, m_nNumber );
}
else
{
strDouble.Format(_T("%.20f"), m_nNumber );
strDouble.TrimRight(_T('0'));
strDouble.TrimLeft(_T('0'));
}
if ( strDouble.Right( 1 ) == _T('.'))
strDouble.TrimRight( _T('.'));
|
|
|
|
|
Hi,
I have a problem and not sure if it's a bug or if it's just my OS.
This happens in a Dialog based app, after executing m_grid.InsertRow(row).
When I add a row to a list that has collapsed groups after the inserted row it messes the groups and some of them even disappear. The group can lose a record and collapsing/expanding the group brings is back. Also orphaned rows appear between collapsed groups, so for example if you have two collapsed groups one after another you end up with a collapsed group, then a row with data, then then next collapsed group. Again, collapsing/expanding the group brings the order back.
If you expand all groups after the position of the new row before adding then it works fine.
Is this intended behaviour, known issue or something you could look at fixing?
On the other hand I have to say I love this control and thank you very much for your time spent already on it.
kind regards
coldEE
|
|
|
|
|
I opened the "2005" solution, let Microsoft do its thing.
Compiled error free and then compiled and ran the sample that uses the DLL.
My code, sometimes dies on first row or after five or so "rows"
m_grid.QuickSetNumber( r, 1, person->getUserNo() );
m_grid.QuickSetText( r, 2, person->getUserName() );
ds->SetCell(m_GI->m_colInfo[col].colTranslation,row,cell);
line 2820 UGCtrl.cpp
CUGDataSource* ds = 0xabababab ...
I am hoping somebody can help (CUGDataSource maybe?) as I really would like this grid for visual c++ mfc based projects.
Or maybe Project Settings?
Darren
|
|
|
|
|
|
UGCtrl::SetNumberRows does not delete extra rows from the memory manager.
CUGMem::SortBy(int *cols,int numCols,int flags) calls
int CUGMem::SortBy(long startRow, long endRow, int *cols,int numCols,int flags) with startRow=0, and endRow = 0x7fffffff
The problem is if you have a large table, and resize it to a smaller number of rows, then sort it, the default call to SortBy includes the extra "deleted" rows, which still exist but aren't shown. But CUGMem doesn't seem to know about the call to SetNumberRows.
Currently working around it by calling DeleteRow() for each extra row, is there a better solution?
|
|
|
|
|
Yes, this is normal.
If you want to go to the trouble of marking cells as excluded from the sort (using something like SetParam() ) you could then override OnSortEvaluate() and return the appropriate int to keep them at the bottom, calling the CUGCtrl::OnSortEvaluate() version for the rest.
I think. But the short answer is that yes, setting the number of rows in the grid doesn't delete rows in the memory manager.
|
|
|
|
|
Dear Code Project,
When I was reading the the usage of License, I could not understand clearly what it meant.
Therefore, please advice me how I can understand clearly and the detail is following below;
4. Restrictions
"You may distribute the Executable Files and Source Code only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy of the Executable Files or Source Code You distribute and ensure that anyone receiving such Executable Files and Source Code agrees that the terms of this License apply to such Executable Files and/or Source Code."
When I read the sentence above, I could not understand how to include the URL or Source Code or the executable files.
Therefore, please kindly tell me the more detail how I have to include them.
Thank you for taking a time to this matter.
Sincerely,
Tsuyoshi Tsuchiya
|
|
|
|
|
Hi
I can't speak officially for Code Project, but I think it would be sufficient to include a mention of the inclusion of any source licensed under the CPOL in the About Box of your application - something like "This software makes use of Ultimate Grid licensed under the Code Project Open License: http://www.codeproject.com/info/cpol10.aspx[^]"
You normally wouldn't distribute the source, but if so I think it would be ok as long as you did not alter the copyright paragraph at the beginning of each file.
Tim
|
|
|
|
|
Good afternoon Tim
Thank you so much for replying to me.
Once again I would like to ask two more questions about publishing either executive file, source code, or URL on applications. Therefore, please kindly check following below;
1. Just in case, if I or we won't publish the information of code project that we use this resource from this site, executive file, nor source code on our applications, does it mean that I will not be able to use this free ultimate grid?
Please let me know about that.
2. I(We) are thinking if we have to publish to the our application(that is we plan to use) about the inclusion of information of executive file, source code, or URL, can we post the sentence you wrote above on the screen of FAQ or help screen?
If it is no problem for us to use it, please let us know,
Best Regards,
Tsuyoshi TSuchiya
|
|
|
|
|
Hi There!
To satisfy this part of the license you would need to:
Include reference to this license in your own license agreement. Something like:
"Some portions of this application are licensed under the CodeProject Open License (CPOL) version 1.0 which can be found here: http://www.codeproject.com/info/cpol10.aspx[^]. By agreeing to the terms of this license you are also agreeing to be bound by the terms of the referenced version of the CPOL"
and
In the usual place where you reference 3rd party licenses (usually about box but could be help files, FAQ, etc. that are delivered with the product)
"Portions of this application are licensed under the CodeProject Open License (CPOL) which can be found here: http://www.codeproject.com/info/cpol10.aspx[^]
Hope that helps!
David
|
|
|
|
|
Dear Code Project Team,
Good day to you!
Thank you very much for replying to me(us).
Regarding the issue of License terms, we would like to know about it furthermore information to have a clear picture about it. Therefore, again, please kindly check about my two inquiries following below;
1. Yesterday as I questioned to you, we could refer the reference to 3rd party either on applications that we plan to use or another places such as, FAQ, help files, and so on that we can refer to 3rd party as far as I understood.
What if we refer the information, such as, executive files, source code, or even URL to our 2nd resource in which is our web site to let them all know that we refer this information from code project? Is it still possible for us to be able to do that?
2. The other question is we are kind a worrying at the moment if all of sudden, the contents of license terms may change so that we can not update it, we can not use it to 3rd party, even nor, the distribution of source code suddenly stops.
I would like to know that: Is it possibly be able to happen or not to the users?
Please kindly let us know from above two questions.
Thank you very much for taking a time to this matter.
Best Regards.
Tsuyoshi Tsuchiya
|
|
|
|
|
Dear Code Project Team,
Good day to you!
Regarding the usage of License, ever since I have got replying from you on last Thursday, I replied back to you again then I have been waiting and waiting about 5 days. I still have not got replies from you.
Therefore, I will be sending it to you again, and please kindly check the detail following below;
1. The term of License
I(we) are afraid that all of sudden, I will not be able to use the source from code project due to the term of License policy may change. I would like to know that if that possible would be able to happen or not? If it may happen, all end user who use sources from code project, will not be able to use this site or not?
The other issue is that could it be able to happen if the term of license may change, all end users(us) will not be able to update the source? Or not be able to do fixing Bug? Please let us know about the detail of issue.
2. Refer to 3rd party about this source.
Last time, when I got the reply, we have to put the source code, executive files, or may be URL as reference to our application or FAQ, help files, etc.
What if we put the information of about this source to our 2nd source in which is our web site? Is it still ok for us to do that or not? Basically what I mean is I develop the software and establish the web site as well. And I would like to put the URL or whatever need to put on the web site.
From above, these are new questions so please kindly let us know.
Thank you so much for taking a time to this matter.
Best Regards.
Tsuyoshi Tsuchiya
|
|
|
|
|
Member 10053877 wrote: 1. The term of License
As indicated in the license, the term is perpetual.
Member 10053877 wrote: 2. Refer to 3rd party about this source.
I'm sorry, the attribution requirements are clearly outlined in the license and are not subject to change on a per-incident basis.
|
|
|
|
|
Dear David,
Good day to you!
Thank you very much for answering to me about my questions.
From your reply, I would like you to confirm with you about my question No.1.
That is as you wrote "the term is perpetual," what I understood was the content of term of License will not be changing.
Is it right? Or if I am wrong, please clearly explain to me more.
No.2 question is I clearly understand and I will follow what the License is written.
Therefore, please kindly tell me about the contents of License has possibility to change in future or not.
Thank you so much for taking a time to this matter.
Best Regards.
Tsuyoshi Tsuchiya
|
|
|
|
|