News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

exposing txtPrjPath in projectpathpanel.cpp

Started by BtM, February 11, 2012, 08:34:37 PM

Previous topic - Next topic

BtM

it seams that the project path panel does no macro or variable expansion on the path  (or Am I wrong)
So I tried to expose the the text control so it could be done in the script (ala the path panel that does expose the control)
all it takes (IMHO) is one line
   txtPrjPath->SetName(_T("txtPrjPath")); // not such an original name :)
added after line 70 of
codeblocks\src\plugins\scriptedwizard\projectpathpanel.cpp

Does anyone know if the control box was left unexposed for a reason?
if not can anyone tell me how does one go about incorporating it into the code base
Thanks
_Ben

MortenMacFly

Quote from: BtM on February 11, 2012, 08:34:37 PM
it seams that the project path panel does no macro or variable expansion on the path  (or Am I wrong)
C::B version? Platform? What path panel (we have many)? Steps to reproduce?

Quote from: BtM on February 11, 2012, 08:34:37 PM
   txtPrjPath->SetName(_T("txtPrjPath")); // not such an original name :)
This doesn't look good and I don't know what you are trying to "fix" with this.

Please report the "smart way" (http://catb.org/esr/faqs/smart-questions.html).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

BtM

#2
Quote from: MortenMacFly on February 12, 2012, 10:19:57 AM
C::B version? Platform? What path panel (we have many)? Steps to reproduce?
Sorry should have known better  :'( :   Code::Blocks (svn 7671), Win7, Project Path Panel in New Project Wizard
I will demonstrate with new console project but the panel itself is used by many scripts
please see attached screen shots
Quote from: MortenMacFly on February 12, 2012, 10:19:57 AM
This doesn't look good and I don't know what you are trying to "fix" with this.
I need the Projects to be situated relative to the CB directory so if the text control holding the path has a "name"  then I could expand the $(#cbtmp) variable in the script and create the project in a relative path and not absolute


[attachment deleted by admin]

BtM

Quote from: MortenMacFly on February 12, 2012, 10:19:57 AM
C::B version? Platform? What path panel (we have many)? Steps to reproduce?
Sorry should have known better  :'( :   Code::Blocks (svn 7671), Win7, Project Path Panel in New Project Wizard
I will demonstrate with new console project but the panel itself is used by many scripts
please see attached screen shots in previous post
Quote from: MortenMacFly on February 12, 2012, 10:19:57 AM
This doesn't look good and I don't know what you are trying to "fix" with this.
I need the Projects to be situated relative to the CB directory so if the text control holding the path has a "name"  then I could expand the $(#cbtmp) variable in the script and create the project in a relative path and not absolute
_Ben

MortenMacFly

Quote from: BtM on February 14, 2012, 10:29:09 AM
I need the Projects to be situated relative to the CB directory so if the text control holding the path has a "name"  then I could expand the $(#cbtmp) variable in the script and create the project in a relative path and not absolute
Ok, understood. But then your patch doen't do the right thing and won't help.

You have to replace macros using macrosmanager but keep track of the original entry so the macro doesn't get lost.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

BtM

Quote from: MortenMacFly on February 14, 2012, 10:59:47 AM
You have to replace macros using macrosmanager but keep track of the original entry so the macro doesn't get lost.
Thanks, I did think of doing it but decided against, let me explain me reasoning
1. I do not know the implication of changing the code and although I have been teaching C++ for 20 years or so, I am new to CB.
2. in principle I think the less you do to get your objective the better. combined that with the fact that the less you do the less mistakes you make  ;D

so I tried minimal intervention
If the text-control in the panel is exposed just like the text-control in:
SVN\codeblocks\src\plugins\scriptedwizard\genericselectpath.cpp

// Set the control's name so that calls to wxWindow::FindWindowByName() succeed...
txtFolder->SetName(_T("txtFolder"));

Then I can make my own scripted wizard and do the rest with minimal intervention in the actual code base
given that you know much much more about the code-base  what do you think is the right approach in this case
Thanks,
_Ben

MortenMacFly

Quote from: BtM on February 14, 2012, 11:27:58 AM
so I tried minimal intervention
[...]
what do you think is the right approach in this case
If what you tried works for you, I'm fine. I thought you want to make this generally available to all wizards.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

BtM

Quote from: MortenMacFly on February 14, 2012, 11:47:59 AM
I thought you want to make this generally available to all wizards.
I will be more then happy to do it if you think it might be useful,
can you point me at the coding standards document you are using or any other thing I should know? 

MortenMacFly

Quote from: BtM on February 14, 2012, 11:58:57 AM
can you point me at the coding standards document you are using or any other thing I should know? 
Here is for starters:
http://wiki.codeblocks.org/index.php?title=Coding_style

...and here the SDK documentation:
http://prdownload.berlios.de/codeblocks/codeblocks_sdk_doc_r7059.chm
(Its a bit outdated, but still current for your pruposes.)

...also, have a look at the core-code itself (if needed).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

BtM