#include <optsprin.h>
Inheritance diagram for PrintGeneralTab:
Public Member Functions | |
PrintGeneralTab () | |
PrintGeneralTab constructor. | |
~PrintGeneralTab () | |
PrintGeneralTab destructor. | |
virtual BOOL | HandleMsg (DialogMsg *Msg) |
Handles all the print general options tabs messages. | |
virtual BOOL | CommitSection () |
Takes the values in the Print General section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box. | |
virtual CDlgResID | GetPageID () |
Private Member Functions | |
BOOL | EnableControls () |
The enables and disables the various controls depending on the values held in the given print control object. | |
virtual BOOL | ShowDetails () |
Sets values for the print general section of the options dialog box. |
Definition at line 202 of file optsprin.h.
|
PrintGeneralTab constructor.
Definition at line 865 of file optsprin.cpp.
|
|
PrintGeneralTab destructor.
Definition at line 885 of file optsprin.cpp.
|
|
Takes the values in the Print General section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box.
Reimplemented from PrintBaseTab. Definition at line 1029 of file optsprin.cpp. 01030 { 01031 if (IsAllGreyed() || pDocument == NULL) 01032 return(PrintBaseTab::CommitSection()); 01033 01034 ERROR3IF(pPrefsDlg == NULL, "PrintGeneralTab::CommitSection called with no dialog pointer"); 01035 01036 if (!TalkToPage()) 01037 return TRUE; // Just return if TalkToPage() fails 01038 01039 /* 01040 //--- 01041 // RANGE CHECK ALL VALUES TO MAKE SURE THEY ARE SENSIBLE 01042 //--- 01043 01044 PrintControl* pPrCtrl = GetPrintControl(); 01045 ERROR2IF(pPrCtrl == NULL,TRUE,"The doc's print component gave me a NULL print control object"); 01046 01047 // We only want to change the values of the doc print control as if we are importing the values 01048 // from a file, i.e. we don't want other values changing as a result of these calls 01049 pPrCtrl->StartImport(); 01050 01051 // Only set the members this tab has changed. 01052 |* pPrCtrl->SetPrintLayers( LocalPrintControl.GetPrintLayers()); 01053 pPrCtrl->SetPSLevel( LocalPrintControl.GetPSLevel()); 01054 pPrCtrl->SetPrintMethod( LocalPrintControl.GetPrintMethod()); 01055 pPrCtrl->SetBitmapResMethod(LocalPrintControl.GetBitmapResMethod()); 01056 pPrCtrl->SetDotsPerInch( LocalPrintControl.GetDotsPerInch()); 01057 pPrCtrl->SetFillQuality( LocalPrintControl.GetFillQuality()); 01058 pPrCtrl->SetTextOptions( LocalPrintControl.GetTextOptions()); 01059 *| 01060 01061 CGadgetID LayerGadgets[] = { _R(IDC_ALLFOREGROUND), _R(IDC_VISIBLEFOREGROUND), NULL }; 01062 BOOL Result = (pPrefsDlg->GetRadioGroupSelected(LayerGadgets) == _R(IDC_ALLFOREGROUND)); 01063 pPrCtrl->SetPrintLayers((Result) ? PRINTLAYERS_ALLFOREGROUND : PRINTLAYERS_VISIBLEFOREGROUND); 01064 01065 CGadgetID PSGadgets[] = { _R(IDC_PSLEVELAUTO), _R(IDC_PSLEVEL1), _R(IDC_PSLEVEL2), NULL }; 01066 ResourceID PSRadio = pPrefsDlg->GetRadioGroupSelected(PSGadgets); 01067 if (PSRadio == _R(IDC_PSLEVELAUTO)) 01068 pPrCtrl->SetPSLevel(PSLEVEL_AUTO); 01069 else if (PSRadio == _R(IDC_PSLEVEL1)) 01070 pPrCtrl->SetPSLevel(PSLEVEL_1); 01071 else if (PSRadio == _R(IDC_PSLEVEL2)) 01072 pPrCtrl->SetPSLevel(PSLEVEL_2); 01073 01074 CGadgetID MethodGadgets[] = { _R(IDC_PRINTMETHOD_NORMAL), _R(IDC_PRINTMETHOD_BITMAP), _R(IDC_PRINTMETHOD_AABITMAP), NULL }; 01075 ResourceID MethodRadio = GetRadioGroupSelected(MethodGadgets)); 01076 if (MethodRadio == _R(IDC_PRINTMETHOD_NORMAL)) 01077 pPrCtrl->SetPrintMethod(PRINTMETHOD_NORMAL); 01078 else if (MethodRadio == _R(IDC_PRINTMETHOD_BITMAP)) 01079 pPrCtrl->SetPrintMethod(PRINTMETHOD_BITMAP); 01080 else if (MethodRadio == _R(IDC_PRINTMETHOD_AABITMAP)) 01081 pPrCtrl->SetPrintMethod(PRINTMETHOD_AABITMAP); 01082 01083 CGadgetID DPIGadgets[] = { _R(IDC_DPIAUTO), _R(IDC_DPIMANUAL), NULL }; 01084 Result = (pPrefsDlg->GetRadioGroupSelected(DPIGadgets) == _R(IDC_DPIAUTO)); 01085 pPrCtrl->SetBitmapResMethod((Result) ? BITMAPRES_AUTO : BITMAPRES_MANUAL); 01086 01087 Result = pPrefsDlg->GetBoolGadgetSelected(_R(IDC_ALLTEXTASSHAPES)); 01088 pPrCtrl->SetTextOptions((Result) ? PRINTTEXTOPTIONS_ALLTEXTASSHAPES : PRINTTEXTOPTIONS_NORMAL); 01089 01090 WORD Index; 01091 pPrefsDlg->GetValueIndex(_R(IDC_FILLQUALLIST), &Index); 01092 pPrCtrl->SetFillQuality(PrintFillQuality(Index)); 01093 01094 INT32 DPI = pPrefsDlg->GetLongGadgetValue(_R(IDC_DPIEDIT),0,0); 01095 pPrCtrl->SetDotsPerInch(DPI); 01096 01097 // Finished making the changes. 01098 pPrCtrl->EndImport(); 01099 */ 01100 return(PrintBaseTab::CommitSection()); 01101 }
|
|
The enables and disables the various controls depending on the values held in the given print control object.
Implements PrintBaseTab. Definition at line 1191 of file optsprin.cpp. 01192 { 01193 if (pPrefsDlg == NULL) return TRUE; 01194 01195 if (!TalkToPage()) 01196 return(TRUE); 01197 01198 // General controls 01199 EnableControl(_R(IDC_PRINT_DOCNAME), TRUE); 01200 EnableControl(_R(IDC_OUTPUT_DOCNAMETEXT),TRUE); 01201 01202 // The layers group 01203 EnableControl(_R(IDC_GROUP_PRINTLAYERS),TRUE); 01204 EnableControl(_R(IDC_ALLFOREGROUND), TRUE); 01205 EnableControl(_R(IDC_VISIBLEFOREGROUND),TRUE); 01206 01207 // postscript level group 01208 BOOL IsPostcript = CCPrintDialog::IsPostscript(); 01209 /* 01210 // Job 10463: remove PS Level bits - default to Level 2 01211 EnableControl(_R(IDC_GROUP_PSLEVEL),IsPostcript); 01212 EnableControl(_R(IDC_PSLEVELAUTO), IsPostcript); 01213 EnableControl(_R(IDC_PSLEVEL1), IsPostcript); 01214 EnableControl(_R(IDC_PSLEVEL2), IsPostcript); 01215 */ 01216 01217 // print method group (print as...) 01218 EnableControl(_R(IDC_GROUP_PRINTMETHOD), TRUE); 01219 EnableControl(_R(IDC_PRINTMETHOD_NORMAL), TRUE); 01220 EnableControl(_R(IDC_PRINTMETHOD_BITMAP), TRUE); 01221 EnableControl(_R(IDC_PRINTMETHOD_AABITMAP), TRUE); 01222 01223 // Bmp DPI group 01224 EnableControl(_R(IDC_GROUP_DPI), TRUE); 01225 EnableControl(_R(IDC_DPIAUTO), TRUE); 01226 EnableControl(_R(IDC_DPIMANUAL), TRUE); 01227 EnableControl(_R(IDC_DPIEDIT), (LocalPrintControl.GetBitmapResMethod() == BITMAPRES_MANUAL)); 01228 EnableControl(_R(IDC_DPIEDITTEXT), (LocalPrintControl.GetBitmapResMethod() == BITMAPRES_MANUAL)); 01229 01230 // Fill quality group 01231 BOOL Normal = (LocalPrintControl.GetPrintMethod() == PRINTMETHOD_NORMAL); 01232 EnableControl(_R(IDC_GROUP_FILLQUAL), Normal && (!IsPostcript)); 01233 EnableControl(_R(IDC_FILLQUALTEXT), Normal && (!IsPostcript)); 01234 EnableControl(_R(IDC_FILLQUALLIST), Normal && (!IsPostcript)); 01235 01236 // Text options 01237 EnableControl(_R(IDC_GROUP_TEXTOPTIONS), TRUE); 01238 EnableControl(_R(IDC_ALLTEXTASSHAPES), TRUE); 01239 01240 return TRUE; 01241 }
|
|
Implements OptionsTabs. Definition at line 889 of file optsprin.cpp. 00889 { return _R(IDD_OPTSTAB_PRINTGENERAL); }
|
|
Handles all the print general options tabs messages.
Reimplemented from PrintBaseTab. Definition at line 906 of file optsprin.cpp. 00907 { 00908 ERROR2IF(Msg == NULL,FALSE,"PrintGeneralTab::Message null message received"); 00909 ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintGeneralTab::HandleMsg called with no dialog pointer"); 00910 00911 BOOL ok = TalkToPage(); // The print general tab identifier 00912 if (!ok) 00913 return TRUE; // page not present 00914 00915 switch(Msg->DlgMsg) 00916 { 00917 case DIM_LFT_BN_CLICKED: 00918 OptionsTabs::SetApplyNowState(TRUE); 00919 if (FALSE) {} 00920 // Print layers 00921 else if (Msg->GadgetID == _R(IDC_ALLFOREGROUND)) 00922 { 00923 LocalPrintControl.SetPrintLayers(PRINTLAYERS_ALLFOREGROUND); 00924 } 00925 else if (Msg->GadgetID == _R(IDC_VISIBLEFOREGROUND)) 00926 { 00927 LocalPrintControl.SetPrintLayers(PRINTLAYERS_VISIBLEFOREGROUND); 00928 } 00929 #if 0 00930 // Job 10463: remove PS Level bits - default to Level 2 00931 // Postscript language level 00932 else if (Msg->GadgetID == _R(IDC_PSLEVELAUTO)) 00933 { 00934 LocalPrintControl.SetPSLevel(PSLEVEL_AUTO); 00935 } 00936 else if (Msg->GadgetID == _R(IDC_PSLEVEL1)) 00937 { 00938 LocalPrintControl.SetPSLevel(PSLEVEL_1); 00939 } 00940 else if (Msg->GadgetID == _R(IDC_PSLEVEL2)) 00941 { 00942 LocalPrintControl.SetPSLevel(PSLEVEL_2); 00943 } 00944 #endif 00945 // Print method 00946 else if (Msg->GadgetID == _R(IDC_PRINTMETHOD_NORMAL)) 00947 { 00948 LocalPrintControl.SetPrintMethod(PRINTMETHOD_NORMAL); 00949 ShowDetails(); 00950 } 00951 else if (Msg->GadgetID == _R(IDC_PRINTMETHOD_BITMAP)) 00952 { 00953 LocalPrintControl.SetPrintMethod(PRINTMETHOD_BITMAP); 00954 ShowDetails(); 00955 } 00956 else if (Msg->GadgetID == _R(IDC_PRINTMETHOD_AABITMAP)) 00957 { 00958 LocalPrintControl.SetPrintMethod(PRINTMETHOD_AABITMAP); 00959 ShowDetails(); 00960 } 00961 00962 // Bitmap DPI 00963 else if (Msg->GadgetID == _R(IDC_DPIAUTO)) 00964 { 00965 LocalPrintControl.SetBitmapResMethod(BITMAPRES_AUTO); 00966 ShowDetails(); 00967 } 00968 else if (Msg->GadgetID == _R(IDC_DPIMANUAL)) 00969 { 00970 LocalPrintControl.SetBitmapResMethod(BITMAPRES_MANUAL); 00971 ShowDetails(); 00972 } 00973 // Text options 00974 else if (Msg->GadgetID == _R(IDC_ALLTEXTASSHAPES)) 00975 { 00976 PrintTextOptions pto = LocalPrintControl.GetTextOptions(); 00977 pto = (pto == PRINTTEXTOPTIONS_NORMAL) ? PRINTTEXTOPTIONS_ALLTEXTASSHAPES 00978 : PRINTTEXTOPTIONS_NORMAL; 00979 LocalPrintControl.SetTextOptions(pto); 00980 ShowDetails(); 00981 } 00982 00983 break; 00984 00985 case DIM_SELECTION_CHANGED: 00986 OptionsTabs::SetApplyNowState(TRUE); 00987 if (Msg->GadgetID == _R(IDC_FILLQUALLIST)) 00988 { 00989 WORD Index; 00990 pPrefsDlg->GetValueIndex(_R(IDC_FILLQUALLIST),&Index); 00991 LocalPrintControl.SetFillQuality(PrintFillQuality(Index)); 00992 ShowDetails(); 00993 } 00994 break; 00995 00996 case DIM_TEXT_CHANGED: 00997 OptionsTabs::SetApplyNowState(TRUE); 00998 if (Msg->GadgetID == _R(IDC_DPIEDIT)) 00999 { 01000 INT32 DPI = pPrefsDlg->GetLongGadgetValue(_R(IDC_DPIEDIT),0,0); 01001 LocalPrintControl.SetDotsPerInch(DPI); 01002 } 01003 break; 01004 01005 default: 01006 return(PrintBaseTab::HandleMsg(Msg)); 01007 } 01008 01009 return TRUE; 01010 }
|
|
Sets values for the print general section of the options dialog box.
Implements PrintBaseTab. Definition at line 1119 of file optsprin.cpp. 01120 { 01121 ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintGeneralTab::ShowDetailscalled with no dialog pointer"); 01122 01123 String_256 Str; 01124 01125 // The print layers group 01126 PrintLayers pl = LocalPrintControl.GetPrintLayers(); 01127 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_ALLFOREGROUND), pl == PRINTLAYERS_ALLFOREGROUND); 01128 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_VISIBLEFOREGROUND),pl == PRINTLAYERS_VISIBLEFOREGROUND); 01129 01130 /* 01131 // Job 10463: remove PS Level bits - default to Level 2 01132 // Postscript language level 01133 PSLevel PSLvl = LocalPrintControl.GetPSLevel(); 01134 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_PSLEVELAUTO),PSLvl == PSLEVEL_AUTO); 01135 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_PSLEVEL1), PSLvl == PSLEVEL_1); 01136 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_PSLEVEL2), PSLvl == PSLEVEL_2); 01137 */ 01138 01139 // Print method 01140 PrintMethodType pm = LocalPrintControl.GetPrintMethod(); 01141 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_PRINTMETHOD_NORMAL), pm == PRINTMETHOD_NORMAL); 01142 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_PRINTMETHOD_BITMAP), pm == PRINTMETHOD_BITMAP); 01143 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_PRINTMETHOD_AABITMAP), pm == PRINTMETHOD_AABITMAP); 01144 01145 if (CCPrintDialog::IsPostscript()) 01146 Str.Load(_R(IDS_K_OPTSPRIN_POSTSCIPT)); 01147 else 01148 Str.Load(_R(IDS_K_OPTSPRIN_NORMAL)); 01149 01150 pPrefsDlg->SetStringGadgetValue(_R(IDC_PRINTMETHOD_NORMAL),Str); 01151 01152 // Bitmap resolution 01153 BitmapResMethod brm = LocalPrintControl.GetBitmapResMethod(); 01154 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_DPIAUTO), brm == BITMAPRES_AUTO); 01155 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_DPIMANUAL),brm == BITMAPRES_MANUAL); 01156 pPrefsDlg->SetLongGadgetValue(_R(IDC_DPIEDIT), LocalPrintControl.GetDotsPerInch()); 01157 01158 // The bitmap resolution group text 01159 if (pm == PRINTMETHOD_NORMAL) Str.Load(_R(IDS_K_OPTSPRIN_TRANSRES)); 01160 if (pm == PRINTMETHOD_BITMAP) Str.Load(_R(IDS_K_OPTSPRIN_BITMAPRES)); 01161 if (pm == PRINTMETHOD_AABITMAP) Str.Load(_R(IDS_K_OPTSPRIN_AABITMAPRES)); 01162 pPrefsDlg->SetStringGadgetValue(_R(IDC_GROUP_DPI),Str); 01163 01164 // Fill quality group 01165 pPrefsDlg->SetSelectedValueIndex(_R(IDC_FILLQUALLIST),INT32(LocalPrintControl.GetFillQuality())); 01166 01167 // Text options 01168 PrintTextOptions pto = LocalPrintControl.GetTextOptions(); 01169 pPrefsDlg->SetBoolGadgetSelected(_R(IDC_ALLTEXTASSHAPES), pto != PRINTTEXTOPTIONS_NORMAL); 01170 01171 // All done! 01172 return EnableControls(); 01173 }
|