In case anyone wants to make to make their programs feel like an annoying webpage, I've written an accordion control. I derived it wxBookCtrlBase, so if you know how to use wxNotebook, you should be able to use this as well. The code is a little more than can easily be dumped here, but you can get a zip file on my github page. Here are a few examples:
I wanted this to be simple but highly customizable. But that's not an easy balance to maintain and I ended up with over 100 methods. However, it's mostly the same 15 commands repeated several times for different pieces of the control. There's a doxyfile to generate documentation. I tried to make it look like the wxWidgets documentation, but there were a few things I couldn't figure out. There are also 3 samples. A basic sample shows how to set a few things and add stuff to the control. An extended sample explores more of its capabilities. And finally, a builder sample uses a property grid to set an accordion's properties and can generate c++ code to make an accordion with those properties.
Any suggestions or spelling/grammar/phrasing corrections for the documentation would be appreciated.
wxAccordion - an accordion control
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxAccordion - an accordion control
Very nice, thanks.
To reduce the number of methods, i think you should introduce a new class, e.g. wxAccordionCaptionStyle. You would have one instance for each state. That would also have the advantage that you could copy a style and modify it, as many styles will have attributes that are identical to the other styles.
To reduce the number of methods, i think you should introduce a new class, e.g. wxAccordionCaptionStyle. You would have one instance for each state. That would also have the advantage that you could copy a style and modify it, as many styles will have attributes that are identical to the other styles.
Use the source, Luke!
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxAccordion - an accordion control
Thanks for the suggestion. I just did that.
Also I just learned how to host doxygen documentation on github. If anyone is interested, the documentation is available here.
Also I just learned how to host doxygen documentation on github. If anyone is interested, the documentation is available here.
Re: wxAccordion - an accordion control
Thank you, a very nice control and very nice documentation
I would like to suggest creating an entry on the wxCode page if possible, and maybe also add a note to the foldbar entry?
I would like to suggest creating an entry on the wxCode page if possible, and maybe also add a note to the foldbar entry?
wxWidgets 3.1.2, MinGW64 8.1.0, g++ 8.1.0, Ubuntu 19.04, Windows 10, CodeLite + wxCrafter
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.
Re: wxAccordion - an accordion control
Very good control, nice looking and well documentation..
Anyway, could you add Makefile to build both source lib and examples? Due to not all of users able to build the control without complete guidance.
Anyway, could you add Makefile to build both source lib and examples? Due to not all of users able to build the control without complete guidance.
wxWidgets Journal at http://yasriady.blogspot.com
-
- Super wx Problem Solver
- Posts: 469
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxAccordion - an accordion control
I don't really know how to make build files, so I used the wxCode bakefiles to generate a set of build files. I hope they work, but I've only tested them with visualc with monlithic-shared and multilib-static configurations.
Since the bakefiles were from the wxCode project, they stick a "wxcode-" in front of the library name. Sorry if that confuses anyone.
Since the bakefiles were from the wxCode project, they stick a "wxcode-" in front of the library name. Sorry if that confuses anyone.
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: wxAccordion - an accordion control
Great Control. Thanks!
You can seem some reasoning to avoid Bakefile in this link:
https://github.com/mtangoo/wxDatabase/issues/2
I think bakefile isn't good option. I had same question and I went with CMake. Very easy to follow from their tutorial.New Pagodi wrote:I don't really know how to make build files, so I used the wxCode bakefiles to generate a set of build files. I hope they work, but I've only tested them with visualc with monlithic-shared and multilib-static configurations.
Since the bakefiles were from the wxCode project, they stick a "wxcode-" in front of the library name. Sorry if that confuses anyone.
You can seem some reasoning to avoid Bakefile in this link:
https://github.com/mtangoo/wxDatabase/issues/2
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?