Author Topic: How to deactivate automatic saving when changing resources?  (Read 2522 times)

Offline Wanderer82

  • Single posting newcomer
  • *
  • Posts: 8
How to deactivate automatic saving when changing resources?
« on: March 21, 2018, 02:11:04 am »
Hello

One thing that annoys me a lot is the fact that Code::Blocks saves changes in resources automatically overwriting code that I wrote by myself. To be more precise: I want to write code for a wxDialog that creates the dialog elements while running the program. So I don't want to design the Dialog window using Code::Blocks gui but write the code myself. Everytime when I click on the resource in the resource window accidentally, all my code is overwritten automatically. If you don't realize it and save the entire project all code has gone. I was lucky to be able to restore the old versions by using Recuva, a tool for finding deleted files.

Is there a way to change this beaviour of Code::Blocks or at least for specific recources?

Thanks,
Thomas

Offline sodev

  • Regular
  • ***
  • Posts: 498
Re: How to deactivate automatic saving when changing resources?
« Reply #1 on: March 21, 2018, 04:35:42 am »
About lost code, use git or svn and commit regulary and you wont have that problem anymore :).

About losing user made changes, i guess you are talking about wxSmith here? If u want to make an own dialog, why not write it yourself without wxSmith? And if you want to use wxSmith just to create the skeleton, afaik there are special markers in the generated code and you must not remove them and put your custom code in special sections to preserve it, but i never used wxSmith, my memory might be wrong ;D.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: How to deactivate automatic saving when changing resources?
« Reply #2 on: March 21, 2018, 05:55:21 am »
There are special markers in the form of comments before and after the code wxSmith updates.

Edit
Code
    //(*InternalHeadersPCH(DebuggerSettingsCommonPanel)
    #include <wx/string.h>
    #include <wx/intl.h>
    //*)
I think the stuff between //(* and //*) is from wxSmith and you should not add code between those comments.


Tim S.
« Last Edit: March 21, 2018, 08:14:04 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org