Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Deleting and renaming event handlers in wxsmith.
nishalns:
While programming, we add components and for handling events, we need event handlers. No doubt, wxsmith provides a method for creating these event handlers. But sometimes, suppose, this component becomes unnecessary, and I want to delete it. No doubt, there is a feature for that as well. But the event handlers associated with it are not deleted. Also, sometimes these event handlers become useful for some other new component. In such a case, we might want to rename the event handler name. This renaming can be made manually. But this is not affected in the wxsmith interface. So, I would like to request the code::blocks development team to implement this feature in the next nightly.
But I don't mean to say that the event handler should get deleted while deleting the components with which it is associated. They should be deleted as per the wish and will of the programmer.
I'm sorry if this feature is already implemented. Please let me know if it is so...
Thank you very much for this great IDE. It is my favourite IDE. It has made my development quick, reliable and cheap.
ollydbg:
Could you give use a example and steps about your feature request?
Suppose you have a component named gui1, and you have a function(event handler for it) like handler1().
Now, you delete the gui1 from the GUI designer, so the handler1()'s declaration and implementation is deleted?
Then, you add gui2, and you want to band gui2 to handler1?
Please tell us details, thanks.
I'm not familiar with wxsmith source code, I just give some suggestions. :)
nishalns:
Suppose, I have a button 'btn1'. Now, when I double click on 'btn1', an event handler'Onbtn1Click' is created by code::blocks. After sometime, I want to delete 'btn1'. When this is done, the event handler should not be deleted. Say, I go on to finish the project and at the end I find that this event handler is useless. Then I should be able to delete it.
But sometimes I feel like renaming 'btn1' to 'btn2'(say). Then, just to make it more readable, I should be able to rename the event handler to 'Onbtn2Click'.
The above to cases are examples, and I should be able do delete or rename them at any time I want.
ollydbg:
--- Quote from: nishalns on July 26, 2013, 05:38:54 am ---Suppose, I have a button 'btn1'. Now, when I double click on 'btn1', an event handler'Onbtn1Click' is created by code::blocks. After sometime, I want to delete 'btn1'. When this is done, the event handler should not be deleted. Say, I go on to finish the project and at the end I find that this event handler is useless. Then I should be able to delete it.
But sometimes I feel like renaming 'btn1' to 'btn2'(say). Then, just to make it more readable, I should be able to rename the event handler to 'Onbtn2Click'.
The above to cases are examples, and I should be able do delete or rename them at any time I want.
--- End quote ---
wxsmith does not have much renaming feature, but at any place, you can use the replace tool supplied by C::B, for me, it is CTRL+ R, then I can replace on h/cpp files, that does not take much time. But I'd say it is better that wxsmith can have such renaming feature.
nishalns:
But, if I rename using that method(ctrl+R), then will it be affected in the wxSmith interface.
Navigation
[0] Message Index
[#] Next page
Go to full version