Author Topic: wxSmith - Resources - Events - Removing old/empty events + Renaming old ones  (Read 4591 times)

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Dear byo,

I never thought I started with wxWidgets, especially with those weird layout things...

But I have to admit, after getting used to it, it is very nice. Your plugin has really come along way...

Mind a comment and suggestion?

Something that I find missing (not really missing, just something that makes sense to me...) is when you select a certain event ... such as double clicking on a new button ... and you enter your code into it ... now usually by this time I just started with code and haven't done the whole gui yet so Variable names will change... when I change then... the function's name is still the old variable name ... for instance (On"OldName"Click, instead of On"NewName"Click). Can we change this or is there a reason for the current implementation?

Secondly, when you created an empty event function, is it possible just before compile time that the function be removed. Can the function also be removed if you select -None- within the Resources - Events tab?

Best regards, and thanks for an awesome tool!

joubertdj

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Something that I find missing (not really missing, just something that makes sense to me...) is when you select a certain event ... such as double clicking on a new button ... and you enter your code into it ... now usually by this time I just started with code and haven't done the whole gui yet so Variable names will change... when I change then... the function's name is still the old variable name ... for instance (On"OldName"Click, instead of On"NewName"Click). Can we change this or is there a reason for the current implementation?

Secondly, when you created an empty event function, is it possible just before compile time that the function be removed. Can the function also be removed if you select -None- within the Resources - Events tab?

Hi, thaks for your positive opinion on wxSmith :)

About those two suggestions you propose - of course It could be implemented even with quite small effort. But there's one problem with it. Let's take an example - changing name of funciton, even if it is a handler for wxWidgets event is in fact just a refactoring thing + modification of assigned handler name in resource. I could do this by simply searching for some patterns in source code but it's quite easy to make a mistake here - for example when name equivalent to handler's function is also used somewhere else (like variable name or maybe preprocessor directive name etc). I could simply mess it up everywhere. Simillarily - removing empty functions could cause some important parts of code to be removed. It may also change behavior in some cases - for example when you've written your own handler for wxPAINT - if it's present, your method is used to paint. If it's not, some original method is onvoked instead.

But not to be so pesymistic about those features - they can be implemented but good c++ parser is needed first. And AFAIK ceniza is working on one right now.

Regards
  BYO