wxGtk: Paper size selection in the print dialogue grayed out [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.
Post Reply
gunterkoenigsmann
Earned a small fee
Earned a small fee
Posts: 13
Joined: Tue May 31, 2016 11:30 am

wxGtk: Paper size selection in the print dialogue grayed out [SOLVED]

Post by gunterkoenigsmann » Sun Nov 20, 2016 2:02 pm

Dear all,

in wxMaxima the following code pops up a printer dialog. Unfortunately in wxWidgets 3.1.0 the paper size selection is grayed out leaving the users with only A4 as a Choice.

Is there any way to re-enable it?
The application itself would be able to print on any arbitrary page size.

Thanks a lot,
and kind regards,

Gunter.

Code: Select all

  {
    wxPrintDialogData printDialogData;
    if (m_printData)
      printDialogData.SetPrintData(*m_printData);
    wxPrinter printer(&printDialogData);
    wxString title(_("wxMaxima document")), suffix;

    if (m_console->m_currentFile.Length())
    {
      wxString suffix;
      wxFileName::SplitPath(m_console->m_currentFile, NULL, NULL, &title, &suffix);
      title << wxT(".") << suffix;
    }

    MathPrintout printout(title);
    MathCell* copy = m_console->CopyTree();
    printout.SetData(copy);
    if (printer.Print(this, &printout, true))
    {
      if (m_printData != NULL)
        delete m_printData;
      
      m_printData = new wxPrintData(printer.GetPrintDialogData().GetPrintData());
    }
    break;
  }

Last edited by gunterkoenigsmann on Mon Nov 21, 2016 8:13 am, edited 1 time in total.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2569
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxGtk: Paper size selection in the print dialogue grayed out

Post by PB » Sun Nov 20, 2016 2:36 pm

Sorry, I do not use Linux but is your issue different from the recently fixed http://trac.wxwidgets.org/ticket/17712?

gunterkoenigsmann
Earned a small fee
Earned a small fee
Posts: 13
Joined: Tue May 31, 2016 11:30 am

Re: wxGtk: Paper size selection in the print dialogue grayed out

Post by gunterkoenigsmann » Sun Nov 20, 2016 2:46 pm

Hey! Thanks a lot!

This is exactly the issue I encountered.

Seems like the same thing happens on wxMsw, too: https://github.com/andrejv/wxmaxima/issues/807

Don't know if that is fixed yet, though.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2569
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxGtk: Paper size selection in the print dialogue grayed out

Post by PB » Sun Nov 20, 2016 2:54 pm

Can you reproduce the issue in the printing sample bundled with wxWidgets? I have just tried on Windows 7 and the paper size can be set there?

gunterkoenigsmann
Earned a small fee
Earned a small fee
Posts: 13
Joined: Tue May 31, 2016 11:30 am

Re: wxGtk: Paper size selection in the print dialogue grayed out

Post by gunterkoenigsmann » Sun Nov 20, 2016 2:59 pm

On linux yes - but I will upgrade to the wxWidgets git master and test if it is fixed there. On windows I will test as soon as I can get my hands on a win machine with a working compiler.

gunterkoenigsmann
Earned a small fee
Earned a small fee
Posts: 13
Joined: Tue May 31, 2016 11:30 am

Re: wxGtk: Paper size selection in the print dialogue grayed out

Post by gunterkoenigsmann » Sun Nov 20, 2016 4:39 pm

Ok... ...on my linux box the current trunk of wxWidgets allows me to choose a page size => Problem solved here. Will check with wxMSW as soon as I can.
Thanks a lot!
and kind regards,

Gunter

User avatar
doublemax
Moderator
Moderator
Posts: 15174
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxGtk: Paper size selection in the print dialogue grayed out

Post by doublemax » Sun Nov 20, 2016 5:41 pm

There was a very recent fix for GTK: http://trac.wxwidgets.org/ticket/17712
Use the source, Luke!

gunterkoenigsmann
Earned a small fee
Earned a small fee
Posts: 13
Joined: Tue May 31, 2016 11:30 am

Re: wxGtk: Paper size selection in the print dialogue grayed out

Post by gunterkoenigsmann » Mon Nov 21, 2016 8:12 am

Ok... ...wxWidgets 3.1.0 works on windows, too. Thanks a lot fr your help!
...will now try to find out how to mark this thread as [Solved].

Post Reply