Author Topic: exposing txtPrjPath in projectpathpanel.cpp  (Read 9710 times)

Offline BtM

  • Multiple posting newcomer
  • *
  • Posts: 17
exposing txtPrjPath in projectpathpanel.cpp
« 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)
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #1 on: February 12, 2012, 10:19:57 am »
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?

   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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BtM

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #2 on: February 12, 2012, 02:10:37 pm »
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
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]
« Last Edit: February 14, 2012, 10:27:44 am by BtM »

Offline BtM

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #3 on: February 14, 2012, 10:29:09 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
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #4 on: February 14, 2012, 10:59:47 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BtM

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #5 on: February 14, 2012, 11:27:58 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
Code
	// 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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #6 on: February 14, 2012, 11:47:59 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BtM

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #7 on: February 14, 2012, 11:58:57 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? 

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #8 on: February 14, 2012, 12:11:14 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BtM

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: exposing txtPrjPath in projectpathpanel.cpp
« Reply #9 on: February 14, 2012, 12:30:26 pm »
thanks will get reading