Development on CodeLite source itself

Discussion about CodeLite development process and patches
foxmuldr
CodeLite Expert
Posts: 120
Joined: Sun May 10, 2009 6:56 am
Contact:

Development on CodeLite source itself

Post by foxmuldr »

I'm beginning to work on CodeLite development, meaning working on the editor itself. I need some help.

First, I have downloaded the latest wxFormBuilder and have been able to add/edit/modify the Misc dialog without problem. I have also been able to associate the user changes with my new m_showDebugOnRun member by duplicating what I found for the checkbox option above it in the file EditorSettingsMiscPanel.cpp, which took the first source line and made the second:

Code: Select all

EditorConfigST::Get()->SaveLongValue(wxT("ShowFullPathInFrameTitle"), m_fullFilePath->IsChecked() ? 1 : 0);
EditorConfigST::Get()->SaveLongValue(wxT("ShowDebugOnRun"), m_showDebugOnRun->IsChecked() ? 1 : 0);
And for the getting, in the same file:

Code: Select all

check = 1;
EditorConfigST::Get()->GetLongValue(wxT("ShowFullPathInFrameTitle"), check);
m_fullFilePath->SetValue(check ? true : false);

check = 1;
EditorConfigST::Get()->GetLongValue(wxT("ShowDebugOnRun"), check);
m_showDebugOnRun->SetValue(check ? true : false);
Does this need to be coded someplace else? Is this generated code? Or am I okay to manually include this?

Also, for my next issue, I cannot find where the menubar formbuilder (or code) is. How do I find it? And how do I edit it?

Thanks in advance! :)
Best regards,
Rick C. Hodgin
www.Visual-FreePro.org
www.LibSF.org
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Development on CodeLite source itself

Post by eranif »

About making GUI entries persistent:
There are 2 ways of doing it
1) Using the method you just used (using EditorConfigST::Get()->SaveLongValue(key, value))
2) Deriving from SerializedObject class and implementing Serialize(Archive &arc) and DeSerialize(Archive &arc) ( have a look at generalinfo.h /cpp for an example of usage). And once the object is created, you can simply use this code to write / load the values from the disk:

Code: Select all

MySettings ms;
ms.SetSomeProperty(1);
ms.SetSomeProperty(wxT("String Prop"));

// write it to disk
EditorConfigST::Get()->WriteObject( wxT("MySettingsName"), &ms );

// read it
MySettings ms2;
EditorConfigST::Get()->ReadObject( wxT("MySettingsName"), &ms2 );
foxmuldr wrote:Does this need to be coded someplace else? Is this generated code? Or am I okay to manually include this?
It should be fine this way
foxmuldr wrote:Also, for my next issue, I cannot find where the menubar formbuilder (or code) is. How do I find it? And how do I edit it?
If you are looking to modify the menubar then it is /usr/share/codelite/rc/menu.xrc

Eran
Make sure you have read the HOW TO POST thread
foxmuldr
CodeLite Expert
Posts: 120
Joined: Sun May 10, 2009 6:56 am
Contact:

Re: Development on CodeLite source itself

Post by foxmuldr »

eranif wrote:About making GUI entries persistent:
There are 2 ways of doing it
1) Using the method you just used (using EditorConfigST::Get()->SaveLongValue(key, value))
2) Deriving from SerializedObject class and implementing Serialize(Archive &arc) and DeSerialize(Archive &arc) ( have a look at generalinfo.h /cpp for an example of usage). And once the object is created, you can simply use this code to write / load the values from the disk:
Which do you recommend?
eranif wrote:If you are looking to modify the menubar then it is /usr/share/codelite/rc/menu.xrc
How about the simple toolbar at the top? And I use a single toolbar for my install. Is it different for non-singles?

- Rick
Best regards,
Rick C. Hodgin
www.Visual-FreePro.org
www.LibSF.org
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Development on CodeLite source itself

Post by eranif »

foxmuldr wrote:Which do you recommend?
For "legacy" code that uses the old method, I would stick with the way it is already done.
For new code, I will use deriving from SerializedObject
foxmuldr wrote:How about the simple toolbar at the top? And I use a single toolbar for my install. Is it different for non-singles?
The toolbars is another story. It is hard coded in the code, have a look at:

clMainFrame::CreateToolbars16() and clMainFrame::CreateToolbars24()

The indication whether codelite should work with single or multiple toolbars is by calling this method:

Code: Select all

PluginManager::Get()->AllowToolbar()
Some other toolbar related info:
- The core application provides 4 toolbars (1 in single toolbar) - standard, search, build and debug
- All other toolbars are provided by the plugins (each plugin has a method named 'CreateToolbar()' which the plugin can choose to implement or to simply return NULL)

Eran
Make sure you have read the HOW TO POST thread
foxmuldr
CodeLite Expert
Posts: 120
Joined: Sun May 10, 2009 6:56 am
Contact:

Re: Development on CodeLite source itself

Post by foxmuldr »

Thanks! Checking it out.
eranif wrote:clMainFrame::CreateToolbars16() and clMainFrame::CreateToolbars24()
...
PluginManager::Get()->AllowToolbar()
...
Some other toolbar related info:
- The core application provides 4 toolbars (1 in single toolbar) - standard, search, build and debug
- All other toolbars are provided by the plugins (each plugin has a method named 'CreateToolbar()' which the plugin can choose to implement or to simply return NULL)
If I prepare a patch, do I submit it to the patches area on SourceForge? Or here? Or how?
Best regards,
Rick C. Hodgin
www.Visual-FreePro.org
www.LibSF.org
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Development on CodeLite source itself

Post by eranif »

Just post it here as attachment - I will test it

Eran
Make sure you have read the HOW TO POST thread
Post Reply