How Do I extend the wxMessageDialog Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How Do I extend the wxMessageDialog

Post by ONEEYEMAN »

Hi,
If you look at the code you will see that I used a placeholder for the wxStdDialogButtonSizer.
You should use the actual sizer instead.

Second - are you testing on HighDPI monitor? Do you use manifest with the DPI Aware set?

Third - how big you expect the dialog to be? Can you run it with the actual strings in the list? (Just remember - this is an example).

Thank you.
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: How Do I extend the wxMessageDialog

Post by ibrahim »

What do you mean by the "actual sizer". I only see a wxBoxSizer and a wxStaticBoxSizer. I don't know how to check my DPI. I expect it to be as big as the wxMessageDialog
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How Do I extend the wxMessageDialog

Post by doublemax »

In general the size is determined by the content, if you add more controls, the dialog size will increase, too. If you want it even bigger, you can set an explicit size yourself.
Use the source, Luke!
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: How Do I extend the wxMessageDialog

Post by ibrahim »

I don't have to set the size for wxMessageDialog, so I shouldnt need to set the size for this. Why do you guys give me hard workarounds. There should be an easy way to add a listbox to a wxMessageDialog without having to do all of this sizer stuff.
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: How Do I extend the wxMessageDialog

Post by doublemax@work »

If you really only need a wxListBox and nothing else, check wxSingleChoiceDialog or wxMultiChoiceDialog.

Build and run the "dialogs" sample that comes with wxWidets, you'll find these dialogs under "Dialogs -> Choices and Selectors".

Maybe one of them does what you need.
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: How Do I extend the wxMessageDialog

Post by ibrahim »

Alright I guess , In the end since wxWidgets can't implement this , I just implemented my own wxDialog that does what I want. And it works fine. Its a bit sad I can't just get the source for the wxMessageDialog, but this is a fine workaround. I'm gonna mark @ONEEYEMAN ' s first reply as the answer
Last edited by ibrahim on Wed May 18, 2022 10:57 am, edited 1 time in total.
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: How Do I extend the wxMessageDialog

Post by ibrahim »

ONEEYEMAN wrote: Fri May 13, 2022 2:04 pm Hi,
You can use wxStdDialogButtonSizer.

Thank you.
Thats not what I did, I just created a button with the ID : "wxID_YES" and "wxID_NO" and put in
"wxDefaultSize" as the size
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How Do I extend the wxMessageDialog

Post by ONEEYEMAN »

Hi,
WxStdDialogButtonSizer takes care of platform difference.

Thank you.
ibrahim
Earned some good credits
Earned some good credits
Posts: 124
Joined: Mon Mar 14, 2022 8:02 am

Re: How Do I extend the wxMessageDialog

Post by ibrahim »

Oh wait yeh thats true
Post Reply