Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Ceniza on May 22, 2007, 06:44:29 am
-
This problem is well known, but I was wondering: why are we using a read-only wxComboBox instead of a wxChoice?
The bug is very strange, and I don't remember seeing it before, but it's now there and don't want to go away (if I heard correctly someone said it was fixed in wxWidgets 2.8.x, but it would be nice to have it working with 2.6.x too).
I decided, just for fun, to edit compiler_toolbar.xrc changing the wxComboBox for a wxChoice and removing the <style> line and it seems to be working fine so far (even though something tells me I should have checked all casts in the plugin too). The only thing that doesn't work is showing the selected target when you just open a project (it also happens with those wxChoice that replaced the tabs interface when you just open the dialog), but it doesn't seem to cause any problems :?
Maybe someone wants to try that workaround in the meanwhile and see how it goes, but if there's not a good reason to keep the wxComboBox then it would be nice to replace it, definitely, by a wxChoice :D
-
yeah I remember a year ago or longer also on linux (or maybe windows) there were other problems with wxComboBox. In the compiler settings, it was not following the selection, it was always lagging 1 behind (your previous choice) and that was fixed back then by me by switching to wxChoice.
Now you did 2 things :
a) wxComboBox -> wxChoice
b) something with <style>
questions what happens when only b) is carried out on the wxComboBox ??
-
Well... the only difference is that I can write whatever I want in the text control of the wxComboBox (it would be strange if that didn't happen :P), but if I try to select any other target using the button, it'll disappear anyway.
-
Found the first problem of the hacky conversion to wxChoice: if you open a project, close it and then open another one, all the possible build targets of both projects will be merged. It's surely caused by the fact the compiler plugin tries to use it as a wxComboBox.
The nice thing is that casting it to a wxChoice before calling SetSelection(m_TargetIndex) in CompilerGCC::DoRecreateTargetMenu makes wxChoice get the right value for the build target when you just open a project (that's the only cast to wxChoice I've tried so far :wink:).
So, it seems the move to wxChoice is a good option :D
-
So, it seems the move to wxChoice is a good option :D
Apply it then for others to test it too ;)
-
I'll give it a try in the morning (GMT-05:00) then... bed time now :D