Kirix Support Forums

Changin headers/footers

Please post all general questions, comments, bug reports, and any other wxWebConnect feedback here.

Changin headers/footers

Postby dancb on Fri Sep 02, 2011 5:41 am

There is any way to set headers/footers with webconnect, or may be by writing to the Windows Registry?

TIA.

Daniel
dancb
Registered User
 
Posts: 7
Joined: Sat Aug 27, 2011 7:17 am

Re: Changin headers/footers

Postby jonmmorgan on Fri Sep 02, 2011 8:27 am

I don't know in this context what you mean by headers / footers. If you just mean the HTML headings and something at the bottom of the web control it can do that fine. If not, could you please explain what you mean?
jonmmorgan
Registered User
 
Posts: 94
Joined: Fri May 14, 2010 9:48 am

Re: Changin headers/footers

Postby dancb on Fri Sep 02, 2011 8:36 am

I mean changing the printing headers/footers.

Left, Center and Right header and Left, Center and Right Footer, like Firefox has.
dancb
Registered User
 
Posts: 7
Joined: Sat Aug 27, 2011 7:17 am

Re: Changin headers/footers

Postby jonmmorgan on Sat Sep 03, 2011 9:05 am

Thanks, I now understand. I have noticed before that you can get some funny headers and footers, but never looked into whether you can change them. I don't believe there is any way in the current wxWebConnect, but if you are happy to change it then it looks like you can use the nsIPrintSettings properties:
Code: Select all
  attribute wstring headerStrLeft;
  attribute wstring headerStrCenter;
  attribute wstring headerStrRight;

  attribute wstring footerStrLeft;
  attribute wstring footerStrCenter;
  attribute wstring footerStrRight;


The print settings can be found in m_ptrs->m_print_settings in webcontrol.cpp.

Of course, I haven't tried this so YMMV.
jonmmorgan
Registered User
 
Posts: 94
Joined: Fri May 14, 2010 9:48 am

Re: Changin headers/footers

Postby dancb on Sun Sep 04, 2011 5:05 am

Thank you for the tip Jon, mi mileage is not so good, but with some effort I could implement printing headers/footers by adding some code to webcontrol.cpp.

In void wxWebControl::Print(bool silent)

I added:

if (settings19)
{
settings19->SetHeaderStrLeft(wxToUnichar(HL));
etc. etc.
dancb
Registered User
 
Posts: 7
Joined: Sat Aug 27, 2011 7:17 am

Re: Changin headers/footers

Postby jonmmorgan on Tue Sep 06, 2011 8:52 am

Glad to hear it. I should probably have put those methods in C++ form rather than IDL form rather than expecting you to just figure it out, but I'm glad you got it anyway.
jonmmorgan
Registered User
 
Posts: 94
Joined: Fri May 14, 2010 9:48 am

Return to wxWebConnect Questions, Thoughts & Feedback