 |
|
 |
In void COptionTreeColorPopUp::Initialize() function:
change the code
ncm.cbSize = sizeof(NONCLIENTMETRICS);
to:
ncm.cbSize = sizeof(NONCLIENTMETRICS) - sizeof(ncm.iPaddedBorderWidth);
Also in void COptionTree::InitGlobalResources() there is problem with font capturing.
I changed the code:
lfFont.lfHeight = cmInfo.lfMenuFont.lfHeight;
lfFont.lfWeight = cmInfo.lfMenuFont.lfWeight;
lfFont.lfItalic = cmInfo.lfMenuFont.lfItalic;
with:
lfFont.lfHeight = 14;
lfFont.lfWeight = 7;
lfFont.lfItalic = cmInfo.lfMenuFont.lfItalic;
but if there is a more neat, better solution to this, I appreciate it.
|
|
|
|
 |
|
 |
I've had same problem: work with OS>= Vista but not with OS<=XP
The problem is caused by SPI_GETNONCLIENTMETRICS, structure has changed
see: http://msdn.microsoft.com/en-us/library/ms724506%28VS.85%29.aspx
To make it work correctly :
void COptionTree::InitGlobalResources()
{
// Declare variables
CWindowDC dc(NULL);
LOGFONT lfFont;
BOOL bUseSystemFont;
// Delete global resources
DeleteGlobalResources();
/////////////////////////
//fix
////Get system parameter information
// cmInfo.cbSize = sizeof(cmInfo);
// ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(cmInfo), &cmInfo, 0);
NONCLIENTMETRICS cmInfo;
UINT cbSize = sizeof(NONCLIENTMETRICS);
// if we're targeted for Vista, the NONCLIENTMETRICS struct
// will be the wrong size for XP, so adjust if necessary.
#if(WINVER >= 0x0600)
OSVERSIONINFO versionInfo;
versionInfo.dwOSVersionInfoSize = sizeof( versionInfo );
GetVersionEx( &versionInfo );
// If we are running under XP, deduct the size of the
// iPaddedBorderWidth member added in Vista.
if ( versionInfo.dwMajorVersion < 6 )
{
cbSize -= sizeof(int);
}
#endif
cmInfo.cbSize = cbSize;
VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, cmInfo.cbSize, &cmInfo, 0));
//fix
|
|
|
|
 |
|
 |
The max number of column of this project is two, how can I create multi column, such as three or more(like list has this tree function)?
Thank you!
|
|
|
|
 |
|
 |
An excellent work, however, I run the demo with the Boundschecker.
This tool reports 2 errors:
1) The variable COptionTreeList::_CurrentClientRect is used before initialisation.
2) There are resource leaks in COptionTreeList.cpp, line 335.
|
|
|
|
 |
|
 |
How can I use this COption in Microsoft Visual Studio 2005 ?
all of my project is in Visual Studio 2005 and I can back to 2003 ;
plz Help me;
|
|
|
|
 |
|
 |
After modify to work with unicode, I got runtime error when enter the text to edit control, look like the problem come from RegExp class. I did change some "char" to TCHAR, is that cause problem?
|
|
|
|
 |
|
 |
same problem here.
seems this RegExp class is a obsolete one....
work around:
int CEditMask::ValidateInput(const CString &stInputText)
{
std::wstring str(stInputText);
std::tr1::wregex rx(m_stInputMask);
return std::tr1::regex_match(str, rx);
}
Hardware-OS-Software
===== Bridge =======
modified on Wednesday, April 6, 2011 6:49 AM
|
|
|
|
 |
|
 |
How to get notification when a button is clicked in COptionTreeItemEditButton?
|
|
|
|
 |
|
 |
Nothing is exported from the DLL so I can't use it... The demo project can use it, but I just don't understand HOW it can use it when the library clearly isn't exporting anything,
Anyone knows?
-- modified at 17:20 Tuesday 6th November, 2007
|
|
|
|
 |
|
 |
Thank's for control it's really cool stuff.
I've just solving problem with change bg color of CMaskEdit when input is incorect. All characters are printed in maskedit control -> when input doesnt match mask then bg color of CMaskEdit change to red. Change color were implemented in CtlColor (reflection of WM_CTLCOLOR). Problem is that MaskEdit->CtlColor gets never called...so I tried to hadle WM_CTLCOLOR in COptionTreeList->OnCtlColor and inside this call I called maskedit->CtlColor . In this case the call of maskedit->CtlColor were procceded but color doesnt change. Is there any catch on it?
|
|
|
|
 |
|
 |
Hi, Cornelius Eichhorst, thanks you for this useful control. I have added this control to my project, but I found a bug that I can’t resolve by myself.
1) Click a edit in the option tree.
2) Click a control which is not in the option tree, like the check box “Mind Attribute Value” in your demo.
3) Click a label, not the edit or other control, in the option tree, then the text of the edit clicked is disappeared. If you scroll the scroll bar at this step, the edit control will do not stay its location.
I have saved some pictures by printing screen to describe this bug. If you need, give me your email address or email to ln_cheng@163.com. Thank you.
|
|
|
|
 |
|
 |
Add into COptionTreeItemCheckBox handler for message WM_LBUTTONUP and put inside this code
void COptionTreeItemCheckBox::OnLButtonUp(UINT nFlags, CPoint point)
{
CRect rcClient;
GetClientRect(&rcClient);
// See if check was pressed
if (rcClient.PtInRect(point) == TRUE)
{
// -- Reverse check
SetCheck(!GetCheck(),true);
// -- Force redraw
Invalidate();
// -- Update window
UpdateWindow();
}
CWnd::OnLButtonUp(nFlags, point);
}
|
|
|
|
 |
|
 |
Thank you. I have tried to add your code to my project, but compiler tell me:
error C2065: 'SetCheck' : undeclared identifier
error C2065: 'GetCheck' : undeclared identifier
How to resolve this error?
|
|
|
|
 |
|
 |
The following notice appears in "PreciseTimer.h":
This module is part of the SONARIS Financial Function Libraries.
(C) 1991-2003 ORIMOS Financial Analytics GmbH
Cotheniusstrasse 3, 10407 Berlin
All rights reserved. The use of the software without express written
permission of ORIMOS Financial Analytics GmbH is strictly prohibited.
Who is the author of this class? What permissions, if any, have they granted?
|
|
|
|
 |
|
 |
sorry,
i forgot to take the license comment out.
the orginal source for class
CPreciseTimer
where found in the net:
http://www.codeproject.com/cpp/precisetimer.asp
regards
|
|
|
|
 |
|
 |
The following files need to be modified to build a Unicode configuration:
OptionTree.cpp
OptionTreeFileDlg.cpp
OptionTreeFontSel.cpp
OptionTreeItemColor.cpp
OptionTreeItemEdit.cpp
OptionTreeItemEditButton.cpp
OptionTreeItemFile.cpp
OptionTreeItemFont.cpp
OptionTreeSpinnerButton.cpp
PreciseTimer.cpp
editmask.cpp
editmask.h
regexp.cpp
regexp.h
OptionTreeItem.h
OptionTreeItemComboBox.h
OptionTreeItemEdit.h
OptionTreeItemEditButton.h
OptionTreeItemFont.h
The changes mostly involve:
- changing 'char' to 'TCHAR'
- changing "" to _T("")
- changing ato?() functions to _tsto?() functions
More files must be changed in order to build demo but that was not tackled.
|
|
|
|
 |
|
 |
Thank you! Very usefull control.
But there is a problem to displaing a COptionTreeItemComboBox with CBS_SIMPLE style.
I try to replace CBS_DROPDOWNLIST style by CBS_SIMPLE or CBS_DROPDOWN in method:
COptionTreeItemComboBox::CreateComboItem( DWORD dwAddStyle ):
...
DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWN; //HERE
...
bRet = Create(dwStyle, m_rcAttribute, m_otOption->GetCtrlParent(), GetCtrlID());
...
but combobox control does not change its view on focus. What`s problem?
Thank you.
And...
In your .exe try to click to not checkBox-button-RECT in "Check Box Items->Without Text". There is a small bug.
|
|
|
|
 |
|
 |
But I opened the project in MS Visual Studio 2005, found these lines cant be recognized properly,
in editmask.cpp, PreTranslateMessage, line 70, in the 'if' parentheses,
if (c == '? || c == '? || c == '? || c == '? ||
c == '? || c == '? || c == '? ||
Would you please show me the right code? Thanks a lot.
|
|
|
|
 |
|
 |
Hi,
First of Good Job! You seem to have fixed quite a few issues in the original COptionTree. I would like to use your version instead of the original but have a few questions. I would appreciate any help.
I have problems receiving change notifications for image lists in the original version. The notifications are sent after clicking on the image but before the actual image selection box appears. So i don't even have the chance to react on the changed selection because the event triggers before the actual user interaction happens. Did you fix this?
Certain changes are signaled with a message beep (i.e. changing images). Can this be deactivated in the control?
Best Regards,
Ingo
|
|
|
|
 |
|
 |
the beep simply could be deactivated by disabling any line wich contains the call of:
Beep(...)
|
|
|
|
 |
|
 |
Is there a way to hide an item or subtree(make it not visible in the tree) without removing it completely?
|
|
|
|
 |
|
 |
I would Also Like to know how to do this...
|
|
|
|
 |
|
 |
hi crazyjeb80,
it should be possible to hide an item without removing it:
look at
COptionTreeItem
extend its memberlist by an member
bHidden
goto to
COptionTreeItem::DrawItem
may be nothing more to do than to return 0
if bHidden == true.
but check this. may be there are some side effects.
|
|
|
|
 |
|
 |
Cornelius,
with your help my project is complete almost.
Thank you very much.
Some detailes are left -
buttons in the grid does not react to clicks in Windows 95 family.
I think I can to make custom buttons, but maybe it is possible to
modify your code slightly to make it work?
Ury
|
|
|
|
 |
|
 |
sorry ury,
but having no experience in programming for win98.
i'd have to check all included libs and used functions for their win98 compatibility -
and that's to much for me.
it should be possible to debug what's going on. therefore begin your examinations in
COptionTreeList::OnLButtonUp
and watch for
m_otOption->ButtonClicked
good luck
|
|
|
|
 |