[debug]> bt 30
[debug]#0 0x00007fff078171b1 in wxDefaultAssertHandler(wxString const&, int, wxString const&, wxString const&, wxString const&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#1 0x00007fff078149ec in wxOnAssert(char const*, int, char const*, char const*, wxString const&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#2 0x00007fff07ebb68e in wxPGProperty::ValueToStringWithCheck(wxVariant&, wxPGPropValFormatFlags) const () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#3 0x00007fff07ebf73e in wxPGProperty::GetValueAsString(wxPGPropValFormatFlags) const () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#4 0x00007ffe8ac9d0b0 in wxPGProperty::GetValueAsString (this=0x10cb5690, flags=0) at F:\code\wxWidgets-3.3.1\include\wx\propgrid\property.h:1427
[debug]#5 0x00007fff07ebc06e in wxPGProperty::GetValueAsStringWithCheck(wxPGPropValFormatFlags) const () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#6 0x00007fff07ec4c0f in wxPGDefaultRenderer::Render(wxDC&, wxRect const&, wxPropertyGrid const*, wxPGProperty*, int, int, int) const () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#7 0x00007fff07ecde13 in wxPropertyGrid::DoDrawItems(wxDC&, wxRect const*) const () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#8 0x00007fff07ecefae in wxPropertyGrid::DrawItems(wxDC&, unsigned int, unsigned int, wxRect const*) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#9 0x00007fff07edbf78 in wxPropertyGrid::OnPaint(wxPaintEvent&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#10 0x00007fff07813467 in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#11 0x00007fff0795ff55 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#12 0x00007fff079628b3 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#13 0x00007fff07962916 in wxEvtHandler::TryHereOnly(wxEvent&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#14 0x00007fff07962983 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#15 0x00007fff07962a61 in wxEvtHandler::ProcessEvent(wxEvent&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#16 0x00007fff07c9453f in wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#17 0x00007fff07960262 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#18 0x00007fff07a47dbb in wxWindow::HandlePaint() () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#19 0x00007fff07a4a158 in wxWindow::MSWHandleMessage(long long*, unsigned int, unsigned long long, long long) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#20 0x00007fff07a3573c in wxWindow::MSWWindowProc(unsigned int, unsigned long long, long long) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#21 0x00007fff084603ac in wxScrolled<wxControl>::MSWWindowProc(unsigned int, unsigned long long, long long) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug]#22 0x00007fff4d47ef5c in USER32!CallWindowProcW () from C:\WINDOWS\System32\user32.dll
[debug]#23 0x00007fff4d47e8cc in USER32!DispatchMessageW () from C:\WINDOWS\System32\user32.dll
[debug]#24 0x00007fff4d4910c3 in USER32!SendMessageTimeoutW () from C:\WINDOWS\System32\user32.dll
[debug]#25 0x00007fff4f491374 in ntdll!KiUserCallbackDispatcher () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug]#26 0x00007fff4d362be4 in win32u!NtUserRealInternalGetMessage () from C:\WINDOWS\System32\win32u.dll
[debug]#27 0x00007fff2a0ad559 in GetMessageExA () from C:\WINDOWS\SYSTEM32\duser.dll
[debug]#28 0x00007fff2a0ad348 in GetMessageExA () from C:\WINDOWS\SYSTEM32\duser.dll
[debug]#29 0x00007fff4d4940d4 in USER32!GetFocus () from C:\WINDOWS\System32\user32.dll
[debug](More stack frames follow...)
[debug]>>>>>>cb_gdb:
[debug]> info threads
[debug] Id Target Id Frame
[debug]* 1 Thread 15368.0x3d30 0x00007fff078171b1 in wxDefaultAssertHandler(wxString const&, int, wxString const&, wxString const&, wxString const&) () from F:\code\wxWidgets-3.3.1\lib\gcc_dll\wxmsw331u_gcc_custom.dll
[debug] 2 Thread 15368.0x4e54 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 3 Thread 15368.0x4f94 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 4 Thread 15368.0x3274 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 5 Thread 15368.0x2fa0 0x00007fff4f48e044 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 6 Thread 15368.0x57ec 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 7 Thread 15368.0x4be0 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 8 Thread 15368.0x16cc 0x00007fff4f48d574 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 9 Thread 15368.0x3228 0x00007fff4f48d574 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 10 Thread 15368.0x26b4 0x00007fff4f48d574 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 11 Thread 15368.0xda4 0x00007fff4f48d574 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 12 Thread 15368.0x27b8 0x00007fff4f48d574 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 130 Thread 15368.0x4a20 0x00007fff4f48d614 in ntdll!ZwRemoveIoCompletion () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 133 Thread 15368.0x274c 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 135 Thread 15368.0x3c5c 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 136 Thread 15368.0x35fc 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 137 Thread 15368.0x37e8 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 138 Thread 15368.0x4f1c 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 143 Thread 15368.0x360c 0x00007fff4f490f84 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 144 Thread 15368.0x4288 0x00007fff4d36a124 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\win32u.dll
[debug] 151 Thread 15368.0x5588 0x00007fff4f48db74 in ntdll!ZwDelayExecution () from C:\WINDOWS\SYSTEM32\ntdll.dll
[debug] 158 Thread 15368.0x4668 0x00007fff4d36a124 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\win32u.dll
[debug]>>>>>>cb_gdb:
[debug]> frame 4
[debug]#4 0x00007ffe8ac9d0b0 in wxPGProperty::GetValueAsString (this=0x10cb5690, flags=0) at F:\code\wxWidgets-3.3.1\include\wx\propgrid\property.h:1427
[debug]F:\code\wxWidgets-3.3.1\include\wx\propgrid\property.h:1427:53089:beg:0x7ffe8ac9d0b0
[debug]>>>>>>cb_gdb:
#4 0x00007ffe8ac9d0b0 in wxPGProperty::GetValueAsString (this=0x10cb5690, flags=0) at F:\code\wxWidgets-3.3.1\include\wx\propgrid\property.h:1427
F:\code\wxWidgets-3.3.1\include\wx\propgrid\property.h:1427:53089:beg:0x7ffe8ac9d0b0
#if WXWIN_COMPATIBILITY_3_2
mutable bool m_oldGetValueAsString = false;
wxString GetValueAsStringWithCheck(wxPGPropValFormatFlags flags = wxPGPropValFormatFlags::Null) const;
wxDEPRECATED_BUT_USED_INTERNALLY_MSG("use GetValueAsString with 'flags' argument as wxPGPropValFormatFlags")
virtual wxString GetValueAsString(int flags) const
{
m_oldGetValueAsString = true;
return GetValueAsString(static_cast<wxPGPropValFormatFlags>(flags));
}
return GetValueAsString(static_cast<wxPGPropValFormatFlags>(flags));
return GetValueAsStringWithCheck(static_cast<wxPGPropValFormatFlags>(flags));
// This is based on the code of wxSystemColourProperty in advprops.h|cpp of wxPropertyGrid
class wxsMyColourPropertyClass : public wxEnumProperty
{
WX_PG_DECLARE_PROPERTY_CLASS(wxsMyColourPropertyClass)
public:
wxsMyColourPropertyClass( const wxString& label = wxEmptyString,
const wxString& name = wxPG_LABEL,
const wxColourPropertyValue& value = wxColourPropertyValue(wxsCOLOUR_DEFAULT,*wxWHITE) );
~wxsMyColourPropertyClass();
virtual void OnSetValue();
virtual bool IntToValue( wxVariant& variant, int number, int argFlags = 0 ) const;
/** Override in derived class to customize how colours are printed as strings.
*/
virtual wxString ColourToString( const wxColour& col, int index, int argFlags = 0 ) const;
/** Returns index of entry that triggers colour picker dialog
(default is last).
*/
virtual int GetCustomColourIndex() const;
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
virtual bool StringToValue( wxVariant& variant,
const wxString& text,
int argFlags = 0 ) const;
#if WXWIN_COMPATIBILITY_3_2
// By call to obsolete function we want to check if user-overriden function is still in use
wxString wxSystemColourProperty::ColourToStringWithCheck(const wxColour& col, int index,
wxPGPropValFormatFlags flags) const
{
m_oldColourToStringCalled = false;
wxString res = ColourToString(col, index, static_cast<int>(flags));
if ( m_oldColourToStringCalled )
{
// Our own function was called - this implies that call was forwarded to the new overriding
// function and there is no need to call it explicitly.
}
else
{ // User-overriden obsolete function was called
wxFAIL_MSG(wxString::Format("in %s use ColourToString with 'flags' argument as wxPGPropValFormatFlags", GetClassInfo()->GetClassName()));
}
return res;
}
#endif // WXWIN_COMPATIBILITY_3_2
wxString wxSystemColourProperty::ColourToString( const wxColour& col,
int index,
wxPGPropValFormatFlags flags ) const
{
if ( index == wxNOT_FOUND )
{
if ( !!(flags & wxPGPropValFormatFlags::FullValue) || !!(m_flags & wxPGPropertyFlags_ColourHasAlpha) )
{
return wxString::Format(wxS("(%i,%i,%i,%i)"),
(int)col.Red(),
(int)col.Green(),
(int)col.Blue(),
(int)col.Alpha());
}
else
{
return wxString::Format(wxS("(%i,%i,%i)"),
(int)col.Red(),
(int)col.Green(),
(int)col.Blue());
}
}
else
{
return m_choices.GetLabel(index);
}
}
wxString wxSystemColourProperty::ValueToString( wxVariant& value,
wxPGPropValFormatFlags flags ) const
{
wxColourPropertyValue val = GetVal(&value);
int index;
if ( !!(flags & wxPGPropValFormatFlags::ValueIsCurrent) )
{
// GetIndex() only works reliably if wxPGPropValFormatFlags::ValueIsCurrent flag is set,
// but we should use it whenever possible.
index = GetIndex();
// If custom colour was selected, use invalid index, so that
// ColourToString() will return properly formatted colour text.
if ( index == GetCustomColourIndex() &&
!(m_flags & wxPGPropertyFlags_HideCustomColour) )
index = wxNOT_FOUND;
}
else
{
index = m_choices.Index(val.m_type);
}
#if WXWIN_COMPATIBILITY_3_2
// Special implementation with check if user-overriden obsolete function is still in use
return ColourToStringWithCheck(val.m_colour, index, flags);
#else
return ColourToString(val.m_colour, index, flags);
#endif // WXWIN_COMPATIBILITY_3_2 | !WXWIN_COMPATIBILITY_3_2
}
#if wxCHECK_VERSION(3, 3, 0)
VALUE.m_colour = wxColour(_T("rgb")+Id->GetValueAsString(wxPGPropValFormatFlags::Null));
#else
VALUE.m_colour = wxColour(_T("rgb")+Id->GetValueAsString());
#endif
You can try something like this (untested):Code#if wxCHECK_VERSION(3, 3, 0)
VALUE.m_colour = wxColour(_T("rgb")+Id->GetValueAsString(wxPGPropValFormatFlags::Null));
#else
VALUE.m_colour = wxColour(_T("rgb")+Id->GetValueAsString());
#endif
I think I have the same problem.Hi, thanks for the test. I just looked at the crash report file, and it is the same crash call stack as mine.
I tried your patch in wxscolourproperty.cpp, but no difference. Still a crash when I try to open a wxsmith old file. I obtain an rpt file if this can help.
Before the crash, I can see that a new tab is open in the editor, but it has a name like Untitled0.
You can try something like this (untested):Code#if wxCHECK_VERSION(3, 3, 0)
VALUE.m_colour = wxColour(_T("rgb")+Id->GetValueAsString(wxPGPropValFormatFlags::Null));
#else
VALUE.m_colour = wxColour(_T("rgb")+Id->GetValueAsString());
#endif
wxString wxsMyColourPropertyClass::ValueToString( wxVariant& value, int argFlags ) const
Not extensivety tested, but it looks OK : wxs files are opened without crash.
Thanks
Not extensivety tested, but it looks OK : wxs files are opened without crash.
Thanks
Active debugger config: GDB/CDB debugger:Default
Selecting target:
src
Adding source dir: F:\code\codeblocks-src\codeblocks_sfmirror\src\
Adding source dir: F:\code\codeblocks-src\codeblocks_sfmirror\src\
Adding file: F:\code\codeblocks-src\codeblocks_sfmirror\src\devel33_64\codeblocks.exe
Changing directory to: F:/code/codeblocks-src/codeblocks_sfmirror/src/devel33_64
Set variable: PATH=.;F:\code\wxWidgets-3.3.1\lib\gcc_dll"";F:\code\codeblocks-src\codeblocks_sfmirror\src\devel33_64;F:\code\codeblocks-src\codeblocks_sfmirror\src\exchndl\win64\lib;...
F:\code\wxWidgets-3.3.1\lib\gcc_dll""
[100.0%] g++.exe -shared -Wl,--out-implib=devel33_64\libcodeblocks.a -Wl,--dll
-LF:\code\wxWidgets-3.3.1\lib\gcc_dll""
-Ldevel33_64
#if WXWIN_COMPATIBILITY_3_2
// By call to obsolete function we want to check if user-overriden function is still in use
wxString wxPGProperty::ValueToStringWithCheck(wxVariant& variant, wxPGPropValFormatFlags flags) const
{
m_oldValueToStringCalled = false;
wxString res = ValueToString(variant, static_cast<int>(flags));
if ( m_oldValueToStringCalled )
{
// Our own function was called - this implies that call was forwarded to the new overriding
// function and there is no need to call it explicitly.
}
else
{ // User-overriden obsolete function was called
wxFAIL_MSG(wxString::Format("in %s use ValueToString with 'flags' argument as wxPGPropValFormatFlags", GetClassInfo()->GetClassName()));
}
return res;
}
#endif // WXWIN_COMPATIBILITY_3_2