Is there a wxwidget featuring a title bar? Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
User avatar
ColleenKobe
Experienced Solver
Experienced Solver
Posts: 88
Joined: Mon Aug 31, 2015 3:47 pm

Is there a wxwidget featuring a title bar?

Post by ColleenKobe » Wed Jun 28, 2017 7:13 pm

The lead design engineer on my current project wants me to generate pages in wxWidgets that resemble the drawing below. I made the drawing below in Microsoft Word (it's not actually a program).
Cover_Page.jpg
How do I make the box with curved corners, and the "title bar"?
I know how to make the main page as a wxFrame, and wxCrafter already made the menu bar, and the toolbar. I can figure out the left-size box and the buttons inside it.

What I'm having trouble with is the design of the individual boxes on the right. Specifically, the boxes have to have the curved corners and the colored "title bar." The icon at the beginning of the text in each title bar is probably optional; I haven't asked.

To solve this problem myself, I studied some of the existing wxWidgets tools. I thought wxDataViewListCtrl would be great for the text below the title bar, except I can't figure out how to add the rows of data beneath the title. Suggestions on that? I'm using wxWidgets and wxCrafter, but I don't see any "add row" menu item.

If I can't figure that out, I'm going to make the boxes as a wxListBox of text beneath the title bar. Clicking on a line in any of those individual boxes will bring up a wxDialog box allowing the user to change the settings on that line.

Any suggestions how I can make the boxes with curved edges? And how to add the title bar? I'm not looking for anyone to write code for me here; I just need to be pointed in the right direction.

Thank you.
Colleen

Software Versions
CodeLite 10.0.5
wxWidgets 3.1.0
wxCrafter 2.6
gcc 4.9.3
tdm-gcc 5.1.0.2
Windows 10 Pro, 64-bit

Target platform 32-bit
Target build debug

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 344
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Is there a wxwidget featuring a title bar?

Post by New Pagodi » Wed Jun 28, 2017 7:27 pm

I wrote an accordion control that does that. It's probably way more complicated that what you need though.

I would say that it wouldn't be too hard to write a custom control to do what you want, but the problem is going to be with the rounded corners. I don't think there is a way to use anti-aliasing without wxGraphicsContext and I don't think that currently compiles with any of the gcc versions available on windows.

If no one else comes along with a better suggestion and if you want, I can throw together a custom control using only wxDC, but it won't look as good as it should.

Manolo
Can't get richer than this
Can't get richer than this
Posts: 712
Joined: Mon Apr 30, 2012 11:07 pm

Re: Is there a wxwidget featuring a title bar?

Post by Manolo » Thu Jun 29, 2017 4:08 pm

My idea:
Each box is a wxPanel.
The surrounding curved border can be draw with wxDC::DrawRoundedRectangle().
The title bar at top is a sub-panel, with a wxImage and a wxStaticText. You can set the background color.
Below the title bar, set the control you like: wxDVC, wxListCtrl. etc.
All of it with sizers, of course.

For the case where the background color of each title bar doesn't get rounded, I'd set the background with wxDC::FloodFill() or some other similar idea.

User avatar
ColleenKobe
Experienced Solver
Experienced Solver
Posts: 88
Joined: Mon Aug 31, 2015 3:47 pm

Re: Is there a wxwidget featuring a title bar?

Post by ColleenKobe » Fri Jun 30, 2017 5:36 pm

Thank you, New Pagodi and Manolo, for your suggestions!

I have used elements of both of your suggestions to generate a GUI that roughly matches the criteria. No, there are no rounded corners. But there is a lot of data processing code for me to write and test and a limited time to do it, so it's more important to "just get something working."

Again, thank you for your ideas! If I have time, I'll check out what you've suggested with wxDC.

Colleen

Post Reply