News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Code::blocks keeps changing my code

Started by lethjakman, July 14, 2010, 04:30:09 AM

Previous topic - Next topic

lethjakman

Every time I exit my code, code::blocks  my code is different, and as a result broken. A lot of this code I have never seen before, but I know darn good and well that I use Connect() rather than event tables. How do I make this stop? I don't want code::blocks changing what I wrote, I wrote it the way I wrote it because I want it that way. Thank you!

MortenMacFly

Quote from: lethjakman on July 14, 2010, 04:30:09 AM
Every time I exit my code, code::blocks  my code is different, and as a result broken. A lot of this code I have never seen before, but I know darn good and well that I use Connect() rather than event tables. How do I make this stop? I don't want code::blocks changing what I wrote, I wrote it the way I wrote it because I want it that way. Thank you!
As you give no more details I assume you are using wxSmith. Well - a GUI builder works in that way: It has special "tagged" regions in your source file that will be filled by wxSmith. You should not change code inside these regions as it will get overwritten. If you don't want that, you can specialise the functionality yourself by e.g. not using wxSmith to connect the events but your own implementation. Just make sure you are outside the wxSmith regions (they start with //(* and end with //*)).
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]

lethjakman

Hey! Thank you for the response. I'm not sure how to give details since my code has been rewritten. My code is written by hand, no GUI builder. The best way I can describe it is it removes all my Connect()'s and add's this.

BEGIN_EVENT_TABLE(PastriesDialog, wxDialog)
    EVT_CLOSE(PastriesDialog::OnClose)
    EVT_BUTTON(idBtnQuit, PastriesDialog::OnQuit)
    EVT_BUTTON(idBtnAbout, PastriesDialog::OnAbout)
END_EVENT_TABLE()


Plus a lot of other stuff at the top like


//helper functions
enum wxbuildinfoformat {
    short_f, long_f };

wxString wxbuildinfo(wxbuildinfoformat format)
{
    wxString wxbuild(wxVERSION_STRING);

    if (format == long_f )
    {
#if defined(__WXMSW__)
        wxbuild << _T("-Windows");
#elif defined(__WXMAC__)
        wxbuild << _T("-Mac");
#elif defined(__UNIX__)
        wxbuild << _T("-Linux");
#endif

#if wxUSE_UNICODE
        wxbuild << _T("-Unicode build");
#else
        wxbuild << _T("-ANSI build");
#endif // wxUSE_UNICODE
    }

    return wxbuild;
}




I apologise for not including examples at the beginning, I'm kinda confused as to how to explain it. Really a lot of my code isn't recognizable anymore.

Jenna

The code you provide looks exactly like the code produced by C::B's wizard through "File -> New -> Project... -> wxWidgets project" if you call it "Pastries" and chose "Dialog" as type (I just tried this).

Are you sure you reopen the saved project and do not use the wizard ?

Are you sure your changes are saved ? Look at the timestamps of the files and see if there are files with the ending "cbtemp" .