DialogBlocks: over writing project files. Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

DialogBlocks: over writing project files.

Post by tuk1 »

My usual process; Use DialogBlock to create GUI, build and generate the vc project files, then open in vs and add in the Model classes.

Both DB and VS share the same project files/folder.
--

When creating event handlers in DB, there doesn't appear to be a way to define the function:
Capture.PNG
Capture.PNG (49.76 KiB) Viewed 1496 times
So DB creates the source code with function undefined, like this:

Code: Select all

void MAIN_PANEL::OnButtonAddClick( wxCommandEvent& event )
{
	////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_ADD in MAIN_PANEL.
	event.Skip();
	////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_ADD in MAIN_PANEL. 
}

No problem, we can fire up vs2015 and add the defintiion:
Capture.PNG
Capture.PNG (45.74 KiB) Viewed 1496 times

Then, we go back to DB and get the prompt to update the source files so the project files are in sync between VS/DB:
Capture.PNG
Capture.PNG (70.14 KiB) Viewed 1496 times
----------------

The problem comes when adding, for eg, an additional event handler or control which triggers DB to create new source files which overwrite and ignore our previously defined functions back to undefined + any lib includes or other edits we might have committed over on vs2015:

Code: Select all

void MAIN_PANEL::OnButtonAddClick( wxCommandEvent& event )
{
	////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_ADD in MAIN_PANEL.
	event.Skip();
	////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_ADD in MAIN_PANEL. 
}
----------

The only way around this that I can see, would be to completely build the GUI in DB before going over to VS and defining the event handler functions, but its more convenient to jump back and forth between VS & DB to develop/debug the GUI/Model incrementally.

Also, it wont be easy to add anything new to the GUI at a later date using DB as it will overwrite all the function definitions and other edits.

Is this a limitation of DB or am I doing something wrong?
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: DialogBlocks: over writing project files.

Post by doublemax »

I don't use DB, but my first guess would be to put your code above the first comment, not in between.

If that doesn't work, i'd try to remove the comment.

Is there no manual for DialogBlocks?
Use the source, Luke!
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: DialogBlocks: over writing project files.

Post by tuk1 »

doublemax wrote:I don't use DB, but my first guess would be to put your code above the first comment, not in between.

If that doesn't work, i'd try to remove the comment.

Is there no manual for DialogBlocks?
ow I didn't realise the comments(code blocks) were a thing.

There is a ref manual of sorts via the built in help, which works fine once you know what the problem is :D
If you wish to stop DialogBlocks regenerating a particular block of code, remove the special comments.
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
Nunki
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 235
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: DialogBlocks: over writing project files.

Post by Nunki »

Hi tuk1,

At first I also used the same way of building a GUI application as you do. However I also ran into the same thing of generated source and manually added source. And into the process of switching between DB and VS. Then I switched to XRC files and found it much easier to handle. I only use DB for drawing the gui frames and dialogs in an easy way, but let DB store it into an xml based XRC file, which can easily be loaded and displayed. It even allows me to put all dutch dialogs in a subdirectory, as well as the french and the english ones. I only use generated code now and then but only to copy and paste it directly into VS as a one time add to my manual code.
If you would like to have more info and examples on XRC, just send me a message.

Regards,
Nunki
Post Reply