Author Topic: BOUNTY: Notebook class with "close" button at the right  (Read 136350 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #15 on: August 12, 2005, 10:12:51 pm »
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

  • Guest
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #16 on: August 17, 2005, 06:41:24 am »
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]

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #17 on: August 17, 2005, 07:03:26 am »
So far so good. It's a really evil hack, but looks nice :)

kimastergeorge

  • Guest
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #18 on: August 17, 2005, 08:39:46 pm »
Could somebody try incorperating it into Code::Blocks and telling me what it's like, what problems you have, etc.?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #19 on: August 17, 2005, 09:06:42 pm »
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.
« Last Edit: August 17, 2005, 09:10:10 pm by rickg22 »

kimastergeorge

  • Guest
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #20 on: August 17, 2005, 10:42:06 pm »
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]
« Last Edit: August 17, 2005, 10:48:13 pm by kimastergeorge »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #21 on: August 17, 2005, 11:25:35 pm »
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

  • Guest
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #22 on: August 18, 2005, 12:41:23 am »
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

  • Guest
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #23 on: August 21, 2005, 02:50:57 pm »
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/
« Last Edit: August 21, 2005, 02:52:29 pm by takeshimiya »

Offline tuft

  • Single posting newcomer
  • *
  • Posts: 9
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #24 on: September 11, 2005, 12:20:53 pm »
wxNotebook uses wxTabView to render tabs, what about using that instead of whole wxNotebook?
« Last Edit: September 11, 2005, 02:04:46 pm by tuft »

Offline phlox81

  • Multiple posting newcomer
  • *
  • Posts: 53
    • phlox81.de
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #25 on: December 30, 2005, 04:56:10 pm »
Hm, might wanna look at http://wxforum.shadonet.com/viewtopic.php?t=5761
Could be a solution, so far untested, but imho good looking...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #26 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?

Offline phlox81

  • Multiple posting newcomer
  • *
  • Posts: 53
    • phlox81.de
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #27 on: December 31, 2005, 12:49:39 am »
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...
« Last Edit: December 31, 2005, 12:52:05 am by phlox81 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #28 on: December 31, 2005, 06:19:40 am »
Yes :) But we need to check out the licensing stuff.

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #29 on: December 31, 2005, 06:44:33 am »
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]
« Last Edit: December 31, 2005, 06:48:53 am by 280Z28 »
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool: