Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B
BOUNTY: Notebook class with "close" button at the right
rickg22:
wow, looks really neat! :D
Anyway, something in mind: the close button should trigger an event, but it should _NOT_ automatically close the tab, because, we want to handle that event.
Regarding the border: Are you sure it can't be changed with the style flags when creating the notebook object? Anyway, I can't wait to see the windows screenshot! You rock! 8)
kimastergeorge:
Okay, I've got a mostly final version.
wxWidgets doesn't seem to want to let me connect a wxEVT_RIGHT_DOWN event to the notebook. Take a look at my code, line 92, in closenb.cpp.
Also, I haven't tested the events generated by my class. You will have to test and modify as needed yourselves.
The code isn't very well commented... but it's generally the same as wxNotebook.
If you want to add a button to the right of the tabs, or anywhere else, just add it before or after the wxNotebook in the sizer containing the wxNotebook and the wxButton.
I have Windows screenshots, too.
[attachment deleted by admin]
Ceniza:
So far so good. It's a really evil hack, but looks nice :)
kimastergeorge:
Could somebody try incorperating it into Code::Blocks and telling me what it's like, what problems you have, etc.?
rickg22:
kimastergeorge: I haven't tried it yet, however i see some things:
1) There's a hittest function, i don't know if wx242 supports it.
2) There are lot of wxMessageBoxes in there!
Otherwise, it *seems* it's pretty usable, it replicates most if not all the functionality of notebooks (We use RemovePage() in codeblocks, and it's in your class! :)
I have some obvservations, tho.
--- Quote --- * Much thanks to the aMule project for the GPL code
* for their CLOSABLENB, which is used here for
* the code for the popups, and the events are based on
* them.
--- End quote ---
Could it be possible for you to define what part exactly of the aMule project's code you're using? Is it nothing but the popups? I'd rather like to see a closablenb not GPL licensed (but wxWidgets licensed) so more people could use it without having to fear legal implications yadda yadda.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version