Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
BETA - Image Editor plugin
MortenMacFly:
--- Quote from: seb_seb0 on October 27, 2010, 08:54:27 pm ---But it is a bit overkill for just setting wxAUI colour. Therefore I will go with the patch.
--- End quote ---
Why? That's how C::B stores / reads the settings. I mean you should do this only once on startup. That might be sufficient.
seb_seb0:
--- Quote from: MortenMacFly on October 27, 2010, 08:59:55 pm ---
--- Quote from: seb_seb0 on October 27, 2010, 08:54:27 pm ---But it is a bit overkill for just setting wxAUI colour. Therefore I will go with the patch.
--- End quote ---
Why? That's how C::B stores / reads the settings. I mean you should do this only once on startup. That might be sufficient.
--- End quote ---
Maybe you misunderstood me. When I create an editor, I read the configuration to get the wxAUI settings (colours & size). See in XPMEditorPanel::BuildContent this line (at line 168):
--- Code: ---UpdateAUIColours();
--- End code ---
It will read the configuration, and set the Font, Metrics and Colours for wxAUI.
So on creation, the user settings are respected.
However, if an image editor is already opened, and if the settings are changed by the user, then the new settings are not respected in the already opened editors. This is the only reason why I want to catch this event.
Sebastien
seb_seb0:
Hello,
SVN has been updated (66)
Main changes:
1 - add a patched xpm handler: the one from wxWidgets does not read the images when they have comments inside
2 - added HELP
3 - Size of Tool Panel fixed.
To do:
improve performance on wxGTK (working on it)
do the html doc
Sebastien
seb_seb0:
I have noticed a crash on Linux (this is why the plugin is still in Beta stage).
I cannot find the reason of the crash. The following piece of code is sufficient to make code::blocks crash:
--- Code: ---void XPMEditor::OnAttach()
{
if (m_Singleton == NULL)
{
const FilesGroupsAndMasks *fm = Manager::Get()->GetProjectManager()->GetFilesGroupsAndMasks();
wxString sMask;
if (fm) sMask = fm->GetFileMasks(0);
m_Singleton = this;
}
}
--- End code ---
with the following call stack:
--- Code: ---<frame level="0" function="wxFatalSignalHandler" offset="00000026"/>
<frame level="1"/>
<frame level="2" function="wxBaseArrayPtrVoid::GetCount() const" offset="00000006"/>
<frame level="3" function="FilesGroupsAndMasks::GetFileMasks(unsigned int) const" offset="00000021"/>
<frame level="4" function="XPMEditor::OnAttach()" offset="000001d2"/>
--- End code ---
And whaterver workaround I try, I always receive a crash with either wxBaseArrayPtrVoid::GetCount() or wxBaseArrayPtrVoid::Add()
This crash does not occur on Windows, only on Linux. It is totally impossible to understand for me.
So since this feature is not critical (addition of a virtual folder in the project manager for images), I will simply skip this step for Linux.
But I would like to understand.
Does anybody have an idea on what is going on ?
Sebastien
Jenna:
It works fine here, after some changes to the project-file to make it buildable from inside svn-tree and to use the same configurationa s the (most) contrib-plugins.
The second part of the project-file patch is most likely because of different line-endings.
In XPMEditor.cpp I just added your three lines and removed one unneeded space in a menu-entry.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version