Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes
CPageSetupDlg Class Reference

#include <PageSetupDlg.h>

Collaboration diagram for CPageSetupDlg:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { IDD = IDD_PAGESETUP }

Public Member Functions

 CPageSetupDlg (nsIPrintSettings *aPrintSettings)
LRESULT OnInitDialog (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnTabSelChange (int idCtrl, LPNMHDR pnmh, BOOL &bHandled)
LRESULT OnOK (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
LRESULT OnCancel (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)

Public Attributes

CPPageDlgmPPage
nsCOMPtr< nsIPrintSettingsmPrintSettings
CPageSetupFormatDlg mFormatDlg
CPageSetupMarginsDlg mMarginsDlg

Detailed Description

Definition at line 412 of file PageSetupDlg.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
IDD 

Definition at line 415 of file PageSetupDlg.h.


Constructor & Destructor Documentation

CPageSetupDlg::CPageSetupDlg ( nsIPrintSettings aPrintSettings) [inline]

Definition at line 430 of file PageSetupDlg.h.

                                                    :
        mPrintSettings(aPrintSettings)
    {
    }

Member Function Documentation

LRESULT CPageSetupDlg::OnCancel ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
) [inline]

Definition at line 496 of file PageSetupDlg.h.

    {
        EndDialog(IDCANCEL);
        return 0;
    }
LRESULT CPageSetupDlg::OnInitDialog ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
) [inline]

Definition at line 435 of file PageSetupDlg.h.

    {
        // The marker tells us where to stick the pages
        RECT rcMarker;
        ::GetWindowRect(GetDlgItem(IDC_PAGE_MARKER), &rcMarker);
        ScreenToClient(&rcMarker);

         // Create the two pages, the first is shown, the second is not
        mFormatDlg.Create(m_hWnd);
        mFormatDlg.Init(mPrintSettings);
        mFormatDlg.SetWindowPos(HWND_TOP, &rcMarker, SWP_SHOWWINDOW);
        
        mMarginsDlg.Create(m_hWnd);
        mMarginsDlg.Init(mPrintSettings);
        mMarginsDlg.SetWindowPos(HWND_TOP, &rcMarker, SWP_HIDEWINDOW);

        // Get the tab control
        HWND hwndTab = GetDlgItem(IDC_TAB);
        
        TCITEM tcItem;
        
        memset(&tcItem, 0, sizeof(tcItem));
        tcItem.mask = TCIF_TEXT;

        tcItem.pszText = _T("Format && Options");
        TabCtrl_InsertItem(hwndTab, 0, &tcItem);

        tcItem.pszText = _T("Margins && Header / Footer");
        TabCtrl_InsertItem(hwndTab, 1, &tcItem);

        TabCtrl_SetCurSel(hwndTab, 0);

        return 0;
    }

Here is the call graph for this function:

LRESULT CPageSetupDlg::OnOK ( WORD  wNotifyCode,
WORD  wID,
HWND  hWndCtl,
BOOL bHandled 
) [inline]

Definition at line 488 of file PageSetupDlg.h.

    {
        mFormatDlg.Apply(mPrintSettings);
        mMarginsDlg.Apply(mPrintSettings);
        EndDialog(IDOK);
        return 0;
    }

Here is the call graph for this function:

LRESULT CPageSetupDlg::OnTabSelChange ( int  idCtrl,
LPNMHDR  pnmh,
BOOL bHandled 
) [inline]

Definition at line 470 of file PageSetupDlg.h.

    {
        HWND hwndTab = GetDlgItem(IDC_TAB);
        if (TabCtrl_GetCurSel(hwndTab) == 0)
        {
            mFormatDlg.SetWindowPos(HWND_TOP, 0, 0, 0, 0,
                SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
            mMarginsDlg.ShowWindow(SW_HIDE); 
        }
        else
        {
            mMarginsDlg.SetWindowPos(HWND_TOP, 0, 0, 0, 0,
                SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
            mFormatDlg.ShowWindow(SW_HIDE); 
        }
        return 0;
    }

Member Data Documentation

Definition at line 427 of file PageSetupDlg.h.

Definition at line 428 of file PageSetupDlg.h.

Definition at line 417 of file PageSetupDlg.h.

Definition at line 426 of file PageSetupDlg.h.


The documentation for this class was generated from the following file: