Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

More flexability for classwizard

<< < (2/3) > >>

polygon7:
Yet Another Small Feature ;)


--- Code: ---Index: src/plugins/classwizard/classwizarddlg.cpp
===================================================================
--- src/plugins/classwizard/classwizarddlg.cpp (wersja 4836)
+++ src/plugins/classwizard/classwizarddlg.cpp (kopia robocza)
@@ -211,6 +211,8 @@
     ForceDirectory(headerFname);
     cbEditor * new_ed = Manager::Get()->GetEditorManager()->New(headerFname.GetFullPath());
     wxString buffer = new_ed->GetControl()->GetText();
+    Manager::Get()->GetMacrosManager()->ReplaceMacros(buffer);
+
     wxString tabstr = usestabs ? wxString(_T("\t")) : wxString(_T(' '),tabsize);
     wxString eolstr;
     if(eolmode == 2)
@@ -304,6 +306,7 @@
     ForceDirectory(implementationFname);
     new_ed = Manager::Get()->GetEditorManager()->New(implementationFname.GetFullPath());
     buffer = new_ed->GetControl()->GetText();
+    Manager::Get()->GetMacrosManager()->ReplaceMacros(buffer);
 
     buffer << _T("#include \"") << m_Header << _T("\"") << eolstr;
     buffer << eolstr;

--- End code ---

wobien:

--- Quote from: polygon7 on January 21, 2008, 08:39:28 pm ---Yet Another Small Feature ;)
--- End quote ---
Maybe my ignorance, but can you explain what this feature does?
regards,
Wobien

MortenMacFly:

--- Quote from: wobien on January 24, 2008, 11:19:36 am ---Maybe my ignorance, but can you explain what this feature does?

--- End quote ---
It allows using C::B macros in the template file. Those macros will be replaced when the class file(s) are being created. Quite an interesting feature - I have both patches applied for testing for some time now... looks good! :-)

polygon7:

--- Quote from: wobien on January 24, 2008, 11:19:36 am ---
--- Quote from: polygon7 on January 21, 2008, 08:39:28 pm ---Yet Another Small Feature ;)
--- End quote ---
Maybe my ignorance, but can you explain what this feature does?
regards,
Wobien

--- End quote ---

For example, in Editor->Default code you have:

--- Code: ---/**
 * Project : $PROJECT_NAME
 * Author : $AUTHOR
 * File : $ACTIVE_EDITOR_STEM.$ACTIVE_EDITOR_EXT
 * Date : $TODAY
 *
 * Version : $$Id: $$
 *
 * Copyrights (c) $YEAR $AUTHOR
 *
 */

--- End code ---

after creating file by Class Wizard (with this patch) you will have:


--- Code: ---/**
 * Project : Some project
 * Author : Your name
 * File : main.cpp
 * Date : 2008-01-24
 *
 * Version : $Id: $
 *
 * Copyrights (c) 2008 Your name
 *
 */

--- End code ---

P.S. $AUTHOR should be created in Environment settings->Environment variables
      (Just go there and click "Add", then write AUTHOR as key and your name as value).

:)

wobien:
Thanks for your explanation. That's a nice feature.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version