News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

BOUNTY: Notebook class with "close" button at the right

Started by rickg22, August 02, 2005, 04:09:03 AM

Previous topic - Next topic

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

#19
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.

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.

kimastergeorge

#20
The wxMessageBoxes were for debugging, and I forgot to take them out.

Yes, HitTest() is available. I didn't know it was available for platforms besides Windows, but apparently it is, so I'll rewrite the code to use that.

I've marked the originally GPL code (roughly) in the code, and removed the wxMessageBoxes.

I'll contact the aMule people and ask them if I could use this code under the wxWidget license.

EDIT: Changed the new version of changenb.cpp to have both HitTest for new versions of wxWidgets and no HitTest for old versions.

[attachment deleted by admin]

rickg22

Em are you sure it's a good idea to use hittest? I remember the hittest to be requested only recently in the wxwidgets project.

kimastergeorge

I think it's alright. I keep the old version in there, for wxWidgets 2.5.1 and earlier. If the precompile logic I use doesn't satisfy you, you can always remove the HitTest() code and just use the other one.

takeshimiya

#23
Hi!

Maybe wyoEditor can help regarding this.

He already haves a patch for wx:

[ 748469 ] wxNotebook::HitTest for wxMSW and wxUniv
Right clicking on a notebook tab brings up a context menu when this patch is
applied, otherwise nothing happens. If this patch is applied to make it
usable the define NOTEBOOK_HITTEST in setup.h has to be set to 1 (Only usable
on wxMSW and wxUniv).

Another patch, but little off-topic:
[ 865500 ] wxNotebook: No correct current page after DeletePage
On wxGTK after deleting a page which is before the current page always the
wrong current page is returned (only wxGTK)

Maybe the patches got included in the wx2.6 version, dunno.

See wyoEditor at http://wyoguide.sourceforge.net/

tuft

wxNotebook uses wxTabView to render tabs, what about using that instead of whole wxNotebook?

phlox81

Hm, might wanna look at http://wxforum.shadonet.com/viewtopic.php?t=5761
Could be a solution, so far untested, but imho good looking...

Ceniza

After a few minor changes I got it to compile under Windows and works fine, then I tried to compile it under Linux and the only problems left were just the Unicode ones, and after fixing them... it works!

Now, the questions:

Will it be accepted and added to Code::Blocks?
Will the author mind if we take the code and use it at our will?
Is the current implementation enough or will it need more things to be implemented?

I think the first two are the most important ones. The way it looks must be taken into account too.

So... answers?

phlox81

#27
Quote from: Ceniza on December 30, 2005, 10:45:57 PM
After a few minor changes I got it to compile under Windows and works fine, then I tried to compile it under Linux and the only problems left were just the Unicode ones, and after fixing them... it works!

Now, the questions:

Will it be accepted and added to Code::Blocks?
Will the author mind if we take the code and use it at our will?
Is the current implementation enough or will it need more things to be implemented?

I think the first two are the most important ones. The way it looks must be taken into account too.

So... answers?

its not my work, so, you should aks at the wxforum probably.
And I don't know if you need to modify it, by the means
a bigger Application like C::B has. But it looks like a good start.
I just thought, thats what C::B was looking for...

rickg22


280Z28

I really like the way these tabs look (The statistics tab is active.)

http://azureus.sourceforge.net/img/sc/2.3.0.6/statistics_-_activity.png

Maybe I'll develop an all-new GPL notebook class based on one of these.

I also like these tabs:


[attachment deleted by admin]
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool: