User forums > Using Code::Blocks

Script C::B

<< < (2/6) > >>

LETARTARE:
I will try ...

LETARTARE:
hello,
@oBFusCATed
Here are the proposed amendment

--- Code: ---Index: src/include/projectfile.h
===================================================================
--- src/include/projectfile.h (révision 7550)
+++ src/include/projectfile.h (copie de travail)
@@ -64,6 +64,11 @@
           * @param targetName The build target's name to remove this file from. */
         void RemoveBuildTarget(const wxString& targetName);
 
+        /**
+  * @return An array of strings, containing the names of all the build
+  * targets this file belongs to. */
+        wxArrayString GetbuildTargets();
+
         /** Show the file properties dialog.
           * @param parent The parent window for the dialog (can be NULL).
           * @return True if the user closed the dialog with "OK", false if closed it with "Cancel".
Index: src/sdk/projectfile.cpp
===================================================================
--- src/sdk/projectfile.cpp (révision 7550)
+++ src/sdk/projectfile.cpp (copie de travail)
@@ -130,6 +130,10 @@
         generatedFiles[i]->RemoveBuildTarget(targetName);
 }
 
+ wxArrayString ProjectFile::GetbuildTargets() {
+ return buildTargets;
+ }
+
 bool ProjectFile::ShowOptions(wxWindow* parent)
 {
     ProjectFileOptionsDlg dlg(parent, this);
Index: src/sdk/scripting/bindings/scriptbindings.cpp
===================================================================
--- src/sdk/scripting/bindings/scriptbindings.cpp (révision 7550)
+++ src/sdk/scripting/bindings/scriptbindings.cpp (copie de travail)
@@ -380,6 +380,7 @@
                 func(&ProjectFile::AddBuildTarget, "AddBuildTarget").
                 func(&ProjectFile::RenameBuildTarget, "RenameBuildTarget").
                 func(&ProjectFile::RemoveBuildTarget, "RemoveBuildTarget").
+                func(&ProjectFile::GetbuildTargets, "GetbuildTargets").
                 func(&ProjectFile::GetBaseName, "GetBaseName").
                 func(&ProjectFile::GetObjName, "GetObjName").
                 func(&ProjectFile::SetObjName, "SetObjName").

--- End code ---

I tested

--- Code: ---function connecte(prjfileori, project) { // ProjectFile , cbProject
local nt = project.GetBuildTargetsCount();
local ciori ;
local nameci;
for (local ci = 0; ci < nt; ci++) {
nameci = project.GetBuildTarget(ci).GetTitle();
// return 'wxStringArray' from 'buildTargets'
ciori = prjfileori.GetbuildTargets().Index(nomci);
if (ciori != -1)
break;
}
return ciori;
}
--- End code ---

in svn7550, and version 10.05, it works ok.

For testing I use a script large that uses  'Project * GetFile (int)', which has not been around svn7587 and replaced by 'FilesList& GetFileList ()'. But no connection for scripts !!
How so ?
The scripts 'MortenMacFly'

--- Quote ---find_broken_files.script
--- End quote ---

--- Quote ---make_dist.script
--- End quote ---
no longer works ( -> svn 7587).

LETARTARE:
@oBFusCATed
No comments ??

oBFusCATed:
I'm not sure what you are trying to achieve with this new version...

"wxArrayString GetbuildTargets()" doesn't look, too good, I think I prefer "const wxArrayString& GetbuildTargets() const;".

LETARTARE:
Translate by GOOGLE

Yes, of course, is much better.
Unfortunately, trying to svn7620, I found that 'Project * cbProject::GetFile (int)' was missing from svn 7588.
This method was replaced by 'FilesList * cbProject::GetFilesList()' and 'FilesList * ProjectBuildTarget::GetFilesList()', but without connection to the scripts !
I guess 'FileList' is difficult to link scripts.

For then there is no further access to a file indexing for scripts!
Also, most scripts become unusable.

Is this an oversight, or is it voluntary?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version