snakefoot / cgridlistctrlex Goto Github PK
View Code? Open in Web Editor NEWMFC Grid control using a custom draw CListCtrl with subitem editing and formatting
Home Page: http://www.codeproject.com/KB/list/CGridListCtrlEx.aspx
MFC Grid control using a custom draw CListCtrl with subitem editing and formatting
Home Page: http://www.codeproject.com/KB/list/CGridListCtrlEx.aspx
What steps will reproduce the problem?
1. if (col==3) // Year won
{
CGridColumnTraitHyperLink* pHyperLinkTrait = new CGridColumnTraitHyperLink;
pHyperLinkTrait->SetShellFilePrefix(_T("http://en.wikipedia.org/wiki/UEFA_Euro_"));
pHyperLinkTrait->AddImageIndex(0, _T("First Flag"), false);
//When added the second image, it will cuase problem.
pHyperLinkTrait->AddImageIndex(1, _T("Second Flag"), true);
pHyperLinkTrait->SetIconClickBeginEdit(TRUE);
pTrait = pHyperLinkTrait;
}
2.
3.
What is the expected output? What do you see instead?
we can click on the icon and get to the new address.
What version of the product are you using? On what operating system?
winxp sp3 / vs2010
Please provide any additional information below.
when comments out the line pHyperLinkTrait->AddImageIndex(1, _T("Second Flag"), true); everything is OK.
Original issue reported on code.google.com by [email protected]
on 29 Aug 2012 at 6:57
Attachments:
The CGridListCtrlEx is good enough. But I must limit user's operation to make the things under control. So, is there a switch to disable it? Or the minimize effort to implement it. Thanks.
In the source files "CGridColumnTraitCombo.cpp" and "CGridListCtrlEx.cpp",
min() and max() are used, assuming "using namespace std". Please use
std::min and std::max instead.
Original issue reported on code.google.com by [email protected]
on 26 Dec 2008 at 11:44
Hey Rolf
As promised I have a new trait class for you (see attachments).
It's a numeric based column trait, capable of handling percision based numbers,
which I hacked together from the slightly modified 'Numeric Edit Control' code
project (http://www.codeproject.com/KB/edit/NumEditCtl.aspx).
// Interger Example: NNNN
CGridColumnTraitNumericEdit* numericCol = new CGridColumnTraitNumericEdit();
numericCol->SetLimitText(4);
numericCol->SetAllowNegativeValues(false);
numericCol->SetDigitsAfterDecimal(0);
m_list_ctrl.InsertColumnTrait(idx, "Interger Example", LVCFMT_LEFT, 100, idx,
numericCol);
// Double Example: NNNN.NN
CGridColumnTraitNumericEdit* numericCol = new CGridColumnTraitNumericEdit();
numericCol->SetLimitText(6);
numericCol->SetAllowNegativeValues(false);
numericCol->SetDigitsBeforeDecimal(4);
numericCol->SetDigitsAfterDecimal(2);
m_list_ctrl.InsertColumnTrait(idx, "Double Example", LVCFMT_LEFT, 100, idx,
numericCol);
Feel free to tidy it up refine it a little more, like I said it was hacked
together, lol
Thanks for all your help thus far :)
Darren
Original issue reported on code.google.com by [email protected]
on 8 Dec 2011 at 2:38
Attachments:
What steps will reproduce the problem?
1. Create and fill the control without image list
2. Run under WinXP or Win2k
3. Program will crash.
The problem is in Draw icon code.
You get the image list pointer but never check if it is valid. File
CGridRowTraitXP.cpp, line 113:
// Draw icon
CImageList* pImageList = owner.GetImageList(LVSIL_SMALL);
Just add one if:
if (pImageList)
{
COLORREF oldBkColor = pImageList->SetBkColor(backColor);
pImageList->Draw ( pDC,
nImage,
rcIcon.TopLeft(),
ILD_NORMAL );
pImageList->SetBkColor(oldBkColor);
}
The problem never occurs on Windows Vista becuase owner.UsingVisualStyle()
returns true at the beginning of OnCustomDraw().
Thanks!
Original issue reported on code.google.com by [email protected]
on 9 Oct 2009 at 5:49
Actually I need to ListCtrl has to support Any control support. Instead of
particular control. Anyway this is useful for datatype based data entry etc.
Actually Last time I asked for Check box Support. But owner has no time for
that. I am also very busy for helping him further. But I designed a class
by using other controls. I am attaching that code here. Please anybody have
a look on that and update me regarding that.I am not tested the code.
Original issue reported on code.google.com by [email protected]
on 7 May 2009 at 4:44
Attachments:
Please see attached file. After you start the app, click on "Fill" Button to
add one row with a vector row.
Then you have the Audio Column, where I have added a combo with the style:
CBS_DROPDOWNLIST
Other ones, are normal common combo boxes. The Subtitle and Angle work as
expected, the Audio combo have the problem, that if I click on the column, the
column item will lost the text inside the item, so the combobox appear to be
empty.
Original issue reported on code.google.com by [email protected]
on 10 Mar 2011 at 5:13
Attachments:
I'm a beginner of MFC, please forgive me if I make some stupid mistakes.
The two listctrl will work normally if use CListCtrl, but when using
CGridListCtrlEx, the second one should be CListCtrl or the program will
break.
The extra bug is that first CGridListCtrlEx cannot create normally now,
but the code is almost same as the previous test program.
Thanks anyway for the help.
Original issue reported on code.google.com by [email protected]
on 19 Sep 2008 at 9:37
Attachments:
I want to make a button trait to popup a dialog to select something, so I add a
line to test on CGridColumnTraitHyperLink::OnClickEditStart, but it cause
problem.
What steps will reproduce the problem?
1.in CGridColumnTraitHyperLink.cpp CGridColumnTraitHyperLink::OnClickEditStart
make these changes:
...
//OnShellExecute(owner, nRow, nCol, cellText);
MessageBox(NULL,_T("Are you Ready?"),_T("Title"),MB_OK);
return 0;
...
2.
3.
What is the expected output? What do you see instead?
Wiki column should work as we expected.
when click on the hyperlink cell, it will popup a MessageBox, then I click OK
to go back to the main dialog, it will make the current row move to the end of
CGridListCtrlEx.
What version of the product are you using? On what operating system?
I am using XP sp3 and VS2012.
Please provide any additional information below.
when put code in CGridColumnTraitImage, it will cause the same problem.
topic issues please click here.
http://www.codeproject.com/Messages/4348706/Popup-a-dialog-when-click-at-a-CGrid
ColumnTraitIma.aspx
Original issue reported on code.google.com by [email protected]
on 27 Aug 2012 at 8:27
Attachments:
What steps will reproduce the problem?
1. Compile, run, Insert -> Tractor menu item
2. Put either column in edit mode
3. Press ESC key
What is the expected output? What do you see instead?
Expect to see column exit edit mode putting text back to before edit
state. Assertion happening instead.
What version of the product are you using? On what operating system?
1.6 Windows XP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 29 Sep 2009 at 6:39
Attachments:
What steps will reproduce the problem?
1. Build the project using CMake (I'm using V2.8.3).
2. Open in Visual Studio (I'm using VS 2010).
3. Run CGridListCtrlExIssue.cpp.
4. Click OK in the resultant dialog.
What is the expected output? What do you see instead?
I would expect the second Dialog to open correctly. However, it crashes inside
BOOL CGridListCtrlEx::RegisterDropTarget() when creating the CGridListCtrlEx.
What version of the product are you using? On what operating system?
The latest version of CGridListCtrlEx checked out from SVN on 21/11/2011 08:49.
Please provide any additional information below.
This problem only occurs when there is a CRichEditCtrl on the first dlg.
I have posted on the Discussion Board of CGridListCtrlEx on 18 Nov, my name is
Lee Tunnicliffe.
Original issue reported on code.google.com by [email protected]
on 21 Nov 2011 at 12:53
Attachments:
In the case of dynamic inserting / deleting column, there is no public method to do it.
NM_CUSTOMDRAW never be fired in VS2017
so I cant change the color of the headers because the OnDisplayRowColor method not called
are there any solutions?
=======================
if i wanna the NM_CUSTOMDRAW message, I have to set the VS_OWNERDRAWFIXED style.
the problem is the CGridListCtrlEx will crash on OnPaint if I set this style
I like what I see with this list control. On thing that would make this
easier for me to use in a large project would be to use a general data
model as an alternative to subclassing the the dialog. This separates the
grid control from the actual data in a more elegant way (in my own opinion)
than using a virtual list control. It doesn't make the virtual list control
option impossible.
I've enclosed diffs and sources files to implement this. If you like what
you see, I can continue to develop along these lines.
Original issue reported on code.google.com by [email protected]
on 17 Sep 2009 at 2:53
Attachments:
When copying to clipboard, the built in functions add a leading tab, and skips cells that don't have any data. This makes for inconsistent results when trying to copy + paste into spread sheets and wanting to keep columns lined up. I've made an edit to improve this behavior; use as needed. (github messes up formatting? :( )
bool CRunListCtrlEx::OnDisplayToClipboard(int nRow, CString& strResult)
{
const int nColCount = GetColumnCount();
CString strCellText;
bool leadingTab = false;
for (int i = 0; i < nColCount; ++i)
{
int nCol = GetHeaderCtrl()->OrderToIndex(i);
if (!IsColumnVisible(nCol))
continue;
#if _MFC_VER >= 0x0710
strCellText.ReleaseBufferSetLength(0); // Clear without freeing buffer
#else
strCellText = _T("");
#endif
if (!CGridListCtrlEx::OnDisplayToClipboard(nRow, nCol, strCellText))
continue;
if (leadingTab)
strResult += _T("\t");
else
leadingTab = true;
strResult += strCellText;
}
return true;
}
Hi,
I've got a edit box disappearing problem.
What steps will reproduce the problem?
1. Override NM_DBLCLK and delete all items from the list control in the
handler.
2. Populate list control with fake data, assign image list with the first
column and make the fist column editable.
3. Start label editing in the fist column.
4. Double click on the item icon to generate NM_DBLCLK.
5. The list box will be empty, but the edit box will remain visible and
will contain text.
Actually, it will be closed, then it will be shown again.
I'm using the latest version I've downloaded today from Google Code.
I have temporary solved the problem by manually posting WM_CLOSE to the
edit control after getting NM_DBLCLK and nulling the m_pEditor.
I'm also think that the control should behave like the original ListContol
does. I.e. it should start label editing only when you're clicking on the
item's label, not on the icon. (This paragraph is just a suggestion :)
Please feel free to contact me if you need any additional info.
Thanks,
M.R.
Original issue reported on code.google.com by [email protected]
on 16 Mar 2010 at 8:13
usage:
1. CGridColumnTraitCheckBox* pCheckBoxTrait = new
CGridColumnTraitCheckBox(nStateImageIdx);
pTrait = CheckBoxTrait;
}
m_ListCtrl.InsertColumnTrait(col+1, title, LVCFMT_LEFT,
100, col, pTrait);
2. m_ListCtrl.SetItemText(nItem, nCellCol, _T("0"));
m_ListCtrl.SetItemText(nItem, nCellCol, _T("1"));
m_ListCtrl.SetItemText(nItem, nCellCol, _T("2"));
3. show checked , unchecked , 3 state image automatic.
Original issue reported on code.google.com by [email protected]
on 31 May 2010 at 6:50
Attachments:
Hi, it's Michael again.
The 3rd parameter of CGridListCtrlEx::EditCell() is position clicked, in client
coordinates. However the 3rd parameter has default value (-1, -1) when the
editing will never start because the passed point is checked at least in
CGridColumnTraitEdit::OnEditBegin() to be inside the cell rect.
So, before calling the EditCell() one must call GetCellRect() first and then
pass some inside point to the EditCell().
Here is an example:
CRect rect;
GetCellRect(nItem, kColName, LVIR_LABEL, rect);
EditCell(nItem, kColName, rect.CenterPoint());
I don't know if it's an issue, but probably EditCell() should check if the 3rd
parameter is (-1, -1) and calculate an inside point by itself.
Thanks for great control and have a nice day!
Michael.
Original issue reported on code.google.com by [email protected]
on 8 Jul 2010 at 3:30
If you add one columntrait with a CDateTimeCtrl and DTS_TIMEFORMAT, all works rightly except when you want to edit it.
In the image, you can see how the CListCtrl over draw the spinbutton.
I tried to solve with WS_CLIPCHILDREN, but in this case I have problems with list control headers when I do drag and drop over the list ctrl.
I would like to be able to do multi-select edit (that is, select multiple
rows, and edit the values in a single column for all selected rows). There
is a 'bug' that is preventing this.
In CGridListCtrlEx::OnLButtonDown, there is a call to
CListCtrl::OnLButtonDown(nFlags, point). This should only happen if
startEdit is false. Then the selection will be maintained throughout the
edit. Otherwise, the selection changes only to the single item and it is
impossible to find out what was previously selected.
That is, replace
// Update the focused cell before calling CListCtrl::OnLButtonDown()
// as it might cause a row-repaint
m_FocusCell = nCol;
CListCtrl::OnLButtonDown(nFlags, point);
with
// Update the focused cell before calling CListCtrl::OnLButtonDown()
// as it might cause a row-repaint
m_FocusCell = nCol;
if (!startEdit)
{
CListCtrl::OnLButtonDown(nFlags, point);
}
What steps will reproduce the problem?
1. Select 2 rows
2. Start an edit by clicking in the last selected cell
3. Notice the selection is lost
Original issue reported on code.google.com by [email protected]
on 29 Sep 2009 at 3:47
I would like to add two items to the context menu that is displayed when right-clicking the column headers:
These are copied from the items that Windows Explorer has in its context menu when right-clicking on one of its column headers, and they will behave the same way:
This issue is not asking for the code to be written—it is asking for feedback on the implementation before I write code that may end up rejected or lingering forever in a PR.
Issues/Topics for Discussion:
I want these items to appear at the very top of the context menu, just like they do in Windows. However, that may be considered a breaking change. Would it be accepted if I inserted these items at the top of the context menu (by modifying CGridListCtrlEx::OnContextMenuHeader()
), followed by a separator?
Assuming that I were to do that, would it be preferred that I shift the indices of the existing items (which are numbered 1, 2, and 3) down, so that the new items are numbered 1 and 2? Or would it be preferred that I assign the new items indices 4 and 5, even though they will be inserted in the menu above item index 1?
Should the automatic insertion of these items be configurable by the client of the control, as with CGridListCtrlEx::HasColumnEditor()
? Personally, I am thinking that they should always be inserted for all grid controls, so I would be inclined not to add the complexity, but I am open to doing more work if it would increase the odds of the PR getting accepted. Or, you know, if someone has a logical counter-argument. :-)
If you don't like any of these ideas, then I will need to figure out alternatives (because I really am that stubborn). Unfortunately, the only option available to me now, without modifying the code, is to override the CGridListCtrlEx::OnContextMenuHeader()
function, not call the base-class implementation, and handle everything myself. I'd rather not do that, as I like most of the default implementation. But I have no way to customize the default implementation, since it creates the menu, shows it, and handles its commands all in the same function.
As a compromise, I could modify the CGridListCtrlEx::OnContextMenuHeader()
function to call a new protected
member function (something like OnPrepareContextMenuHeader()
) immediately before it shows the context menu (with TrackPopupMenu()
). I could pass a non-const (mutable) reference to the CMenu
object (menu
) to this member function so that derived classes could customize the menu in whatever way they want before it is displayed. Of course, I'd still need to figure out how derived classes could handle selection of the items that they add. This is why I'd rather not do it this way.
Advice? Suggestions?
What steps will reproduce the problem?
1. Chinese tip display error.
2.
3.
What is the expected output? What do you see instead?
same with text in ListCtrl.
What version of the product are you using? On what operating system?
subversion version 276. run on windows 2008.
Please provide any additional information below.
attachment.
Original issue reported on code.google.com by [email protected]
on 8 Apr 2010 at 2:36
Attachments:
What steps will reproduce the problem?
1. Convert the demo project/solution to Visual Studio 2008
2. Build the project
What is the expected output? What do you see instead?
- Demo application does not build correctly without modification.
Modified build settings after conversion to use the existing manifest
instead of automatically creating one. Also removed deprecated /Wp64
compile option checking for 64-bit portability.
The following warnings remain:
cgridlistctrlex.cpp(948) : warning C4189: 'nColItemData' : local variable
is initialized but not referenced
cgridlistctrlex.cpp(949) : warning C4189: 'nRowItemData' : local variable
is initialized but not referenced
cgridlistctrlex.cpp(1123) : warning C4189: 'nRow' : local variable is
initialized but not referenced
I have attached Visual Studio 2008 solution and project files that work
correctly.
Original issue reported on code.google.com by [email protected]
on 26 Dec 2008 at 10:17
Attachments:
In the function BOOL CGridListCtrlEx::OnBeginDrag(NMHDR* pNMHDR, LRESULT*
pResult), the declared NMLISTVIEW* pLV =
reinterpret_cast<NMLISTVIEW*>(pNMHDR); is unused. This can cause compiler
warnings.
Original issue reported on code.google.com by [email protected]
on 29 Sep 2009 at 8:48
What steps will reproduce the problem?
for( int i = 0; i < GetHeaderCtrl()->GetItemCount() ; ++i )
{
//find biggest string that can be currently displayed in this column
::CString const aHeaderName = this->GetColumnHeading(i);
// header length
int const aHeaderLength = this->GetColumnHeading(i).GetLength();
What is the expected output? What do you see instead?
The actual header length. The magic number 510.
What version of the product are you using? On what operating system?
Win7 x64.
Please provide any additional information below.
This just occured after I updated the code to 2.1 version (latest). I noticed
this immediately because my columns are optimized based on header legnth and on
the max string length of all possible combo box values ( where applicable ).
Reverting to older version ( 1.9 I think ) fixed this problem.
Original issue reported on code.google.com by [email protected]
on 10 Jul 2012 at 8:30
What steps will reproduce the problem?
1. Set focus to any cell.
2. First click, sets focus to the cell with a combo box.
3. Second click, actually enable the drop down arrow.
4. Third click then expands the drop down.
5. Fourth click then selects the new value.
What is the expected output? What do you see instead?
I would expect that when I set focus to the new combo box, the drop down arrow
is enabled at the same click thus saving us a valuable click.
What version of the product are you using? On what operating system?
Latest.
Please provide any additional information below.
Win764, WinXP64, WinXP32
Original issue reported on code.google.com by [email protected]
on 6 Jul 2012 at 7:38
Help please understand how to add a callback for a checkbox click event? Or how to implement a mechanism to track checkbox switching in the application? Thank.
Sharing source between applications that use this component is a little
cumbersome. If there were a separate project file that could be included
in a solution, and then have dependencies defined within the solution,
that would facilitate reuse and make this a proper standalone component.
Original issue reported on code.google.com by [email protected]
on 10 Apr 2009 at 2:58
You can end a combo box edit by clicking away to loose focus on the
control. This ends up setting a new value for the cell, even if the user
never selected or typed in anything.
What steps will reproduce the problem?
1. Put a break point in CGridListCtrlEx::OnEndLabelEdit
2. Select a cell in the State column so that the combo box shows
3. Click somewhere else in the control so the edit looses focus
4. Notice the breakpoint in OnEndLabelEdit gets hit, even though you didn't
type in anything
What is the expected output? What do you see instead?
The problem is that CGridEditorComboBoxEdit sends the WM_KEYUP message with
VK_RETURN, even if the value was not modified. The solution is to send
VK_ESCAPE if the value was not modified.
I've copied the changes to the code below. I've just added a new member to
CGridEditorComboBoxEdit and use this to track if the value has actually
been changed.
*******************CGridColumnTraitCombo.h**********************:
class CGridEditorComboBox : public CComboBox
{
public:
CGridEditorComboBox(int nRow, int nCol, int nMaxWidth);
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID);
virtual void EndEdit(bool bSuccess);
protected:
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnNcDestroy();
afx_msg void OnDestroy();
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg UINT OnGetDlgCode();
afx_msg void OnDropDown();
afx_msg void OnCloseUp();
afx_msg void OnEditChange();
afx_msg void OnChangeSelection();
DECLARE_MESSAGE_MAP();
CGridEditorComboBoxEdit m_Edit; //!< Subclassed edit control inside the
CComboBox
bool m_Completed; //!< Ensure the editor only reacts to a single close event
int m_Row; //!< The index of the row being edited
int m_Col; //!< The index of the column being edited
int m_MaxWidth; //!< Max width (in pixels) of the CComboBox when doing
dropdown
bool m_Modified; //!< If the value has been modified (should process
EndEdit(true))
};
*******************CGridColumnTraitCombo.cpp**********************:
BEGIN_MESSAGE_MAP(CGridEditorComboBox, CComboBox)
//{{AFX_MSG_MAP(CGridEditorComboBox)
ON_WM_KILLFOCUS()
ON_WM_GETDLGCODE()
ON_WM_DESTROY()
ON_WM_KEYUP()
ON_WM_NCDESTROY()
ON_CONTROL_REFLECT(CBN_CLOSEUP, OnCloseUp)
ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropDown)
ON_CONTROL_REFLECT(CBN_EDITCHANGE, OnEditChange)
ON_CONTROL_REFLECT(CBN_SELCHANGE, OnChangeSelection)
ON_CONTROL_REFLECT(CBN_SELENDOK, OnChangeSelection)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//------------------------------------------------------------------------
//! CGridEditorComboBox - Constructor
//------------------------------------------------------------------------
CGridEditorComboBox::CGridEditorComboBox(int nRow, int nCol, int nMaxWidth)
:m_Row(nRow)
,m_Col(nCol)
,m_Completed(false)
,m_MaxWidth(nMaxWidth)
,m_Modified(false)
{}
//------------------------------------------------------------------------
//! The cell value editor was closed and the entered should be saved.
//!
//! @param bSuccess Should the entered cell value be saved
//------------------------------------------------------------------------
void CGridEditorComboBox::EndEdit(bool bSuccess)
{
// Avoid two messages if key-press is followed by kill-focus
if (m_Completed)
return;
m_Completed = true;
// Send Notification to parent of ListView ctrl
CString str;
GetWindowText(str);
LV_DISPINFO dispinfo = {0};
dispinfo.hdr.hwndFrom = GetParent()->m_hWnd;
dispinfo.hdr.idFrom = GetDlgCtrlID();
dispinfo.hdr.code = LVN_ENDLABELEDIT;
dispinfo.item.iItem = m_Row;
dispinfo.item.iSubItem = m_Col;
if (bSuccess && m_Modified)
{
dispinfo.item.mask = LVIF_TEXT | LVIF_PARAM;
dispinfo.item.pszText = str.GetBuffer(0);
dispinfo.item.cchTextMax = str.GetLength();
dispinfo.item.lParam = GetItemData(GetCurSel());
}
ShowWindow(SW_HIDE);
GetParent()->GetParent()->SendMessage( WM_NOTIFY,
GetParent()->GetDlgCtrlID(), (LPARAM)&dispinfo );
PostMessage(WM_CLOSE);
}
//------------------------------------------------------------------------
//! CBN_EDITCHANGE message handler called when the edit control for the
CComboBox control
//! has been modified.
//------------------------------------------------------------------------
void CGridEditorComboBox::OnEditChange()
{
m_Modified = true;
}
//------------------------------------------------------------------------
//! CBN_SELCHANGE, CBN_SELENDOK message handler called when the selection
in the CComboBox control
//! has been modified.
//------------------------------------------------------------------------
void CGridEditorComboBox::OnChangeSelection()
{
m_Modified = true;
}
Original issue reported on code.google.com by [email protected]
on 30 Sep 2009 at 1:22
Demostration of how CGridListCtrlEx can be used with the VC6 compiler.
Original issue reported on code.google.com by sweaty1
on 15 Dec 2008 at 12:33
Attachments:
new feature:
1、one click to edit,like Access 2007.
2、add new record.
What is the expected output? What do you see instead?
like Access 2007
What version of the product are you using? On what operating system?
subversion version 276. run on windows 2008.
Original issue reported on code.google.com by [email protected]
on 15 Apr 2010 at 7:38
Attachments:
After I changed text of ComboEdit control by using SetCurSel(), then exit application by clicking x, application crashed. I tracked on CGridEditorComboBox::EndEdit(), and m_Completed is false, but at that time, its parent window had been destroyed. I found it just set m_pComboBox as NULL in CGridColumnTraitCombo::OnEditEnd(), not using delete. Is there any risk of memory leak?
There is:
void CGridColumnTraitCombo::AddItem (DWORD_PTR nItemData, const CString &strItemText)
But, after nItemData is added, I don't know if there is a way to get it back by passing the corresponding text or get it from cell directly.
I'm trying to figure out how to have a column of drop downs with each cell in the column having different options in the drop down. Can you please describe how this can be done without creating a new column trait?
It will be very helpful if there is one.
What steps will reproduce the problem?
1. Open the dialog by clicking on the toolbar (Green Round icon)
2. Click ADD and OK (ADD will insert a row)
3. Reload the dialog and Click ADD, and then it will crash
What is the expected output? What do you see instead?
Clean additions of rows in reloading
What version of the product are you using? On what operating system?
WindowsXP, Visual Studio 6 (Service Pack: I'm not sure Sorry about this)
Please provide any additional information below.
The class view information is broken at the last step that I was making this
sample code. If it hurts, then let me know.
Original issue reported on code.google.com by [email protected]
on 25 Jun 2010 at 1:44
Attachments:
What steps will reproduce the problem?
1. Using the latest demo project, go into edit mode on a cell, any cell.
2. While on edit mode press the OK or Cancel or any other button.
3. You shall notice that u actually need two clicks to press the button.
4. In normal MFC controls, e.g. a combobox , even if it has focus, when you
click on a button the button will be clicked, regardless of where the focus is.
What is the expected output? What do you see instead?
I expect that when I click the button, even if it does not have focus, it
should be clicked.
What version of the product are you using? On what operating system?
Windows XP 32 bit , Windows 7 64 bit, version 2.0
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 4 May 2012 at 11:31
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 19 May 2010 at 6:34
I am subclassing CGridListCtrlEx to show a list of task as follow:
I need to change font on a row that the asscociated task has "Done" status, so I implement OnDisplayRowFont
like this:
bool TODOGridCtrl::OnDisplayRowFont(int nRow, LOGFONT & font)
{
//If this is Done task, set italic font
if (GetItemText(nRow, Task::STATUS) == "Done") {
font.lfItalic = TRUE;
font.lfStrikeOut = TRUE;
return true;
}
return false;
}
But the problem is that when I clear all item (by DeleteAllItems()
) and re-add data to the list view, sometime it give me an error like this:
So, did my OnDisplayRowFont
implement correct or I must do something else?
And why set font italic make a text bigger than non-italic font, how to reduce the font size?
What steps will reproduce the problem?
1. Create a combo box trait
2. Put inside strings of variable length
3. Use SetColumnWidthAuto
What is the expected output? What do you see instead?
I would expect that the maximum width of the column is defined by the
length of the maximum row in the combo box or or the header length ( depends on
which one is bigger ) PLUS the combo box arrow. What happens is that while the
width is optimized for the currently displayed value of a combo box, once you
click on it the arrow of the combo box hides part / all of the actual value.
What version of the product are you using? On what operating system?
2.0, Win7, WinXP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 21 Jun 2012 at 2:33
Support for progress bar CGridColumnTraitProgress
Allow Progress bar with/without Theme +start/end positioning
Usage: Progression is read from the text value as %, Can be int or double.
The progress bar can either start from 0 (default) or from a start position set
in % also
'Simple progress' set text "ee.dd" as % or progress where 0<= ee <=100. dd
being decimal part if any
'Start/end progress' set text "nn.dd,ss.dd" where <= ee,ss <=100, dd being
decimal part if any
Exemple: "40.3,60" (Start is first value).
Sorting:
When 2 end values are == , then start is used with high as highest (smallest
bar is 'bigger')
Options:
UseTheme(true/false)
Even if a Theme is available will draw solid bar
Default is to try to load a theme.
Note: 'Theme' usage require lib UxTheme.lib from MS (Require Recent OS)
otherwise only Solid mode is available
HooverShowValue(false/true);
Values can bee seen when hoover over bar, or be hidden
Note:
- Doc updated under section "TODO"
- Not tested under XP
- Demo Not updated for VS2008 2003 or VC++ (should just need to include the
cpp+.h)
Original issue reported on code.google.com by [email protected]
on 11 Jan 2012 at 4:34
Attachments:
I used virtual mode to edit cell, it threw "heap corruption detected" exception on debug mode.
I used ms vc2015.
what‘s happening?
if (m_ComboList.GetSize()>0)
{
// Add Fixed Items to ComboBox
LoadList(m_ComboList, -1);
// Guess the currently selected item in the list
CString item = owner.GetItemText(nRow, nCol);
int nCurSel = m_pComboBox->FindString(-1, item);
if (nCurSel!=-1)
m_pComboBox->SetCurSel(nCurSel);
else
m_pComboBox->SetWindowText(item);
} **//stoped here, it seems that "m_pComboBox" is null
else
{
// Items are going to be added dynamically
CString item = owner.GetItemText(nRow, nCol);
m_pComboBox->SetWindowText(item);
}
What steps will reproduce the problem?
1. click on the second column (combo) for only once
2. Do not click on the dropdown arrow and click the other column or row
3. AfxMessageBox(_T("strCell =0 ")); AfxMessageBox(_T("pComboEditor == NULL"));
What is the expected output? What do you see instead?
strCell and pComboEditor should not be NULL
What version of the product are you using? On what operating system?
VC2010 with Winxp SP3 English version, latest code from googlecode.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 16 Oct 2012 at 2:09
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.