#include <bmpsdlg.h>
Inheritance diagram for BmpDlg:
Public Member Functions | |
BmpDlg () | |
bmpdlg Constructor, Sets The dlgs resource ID and Mode. Errors - See Also - | |
BOOL | InitDialog () |
Sets initial dialog values Errors - See Also -. | |
virtual | ~BmpDlg () |
Destructor, Does nothing. Errors - See Also -. | |
void | Do (OpDescriptor *) |
Overrides DialogOp's Do function to create and display a Bitmap Properties Dialog. Errors - See Also -. | |
BOOL | Create () |
Errors - See Also -. | |
void | UpdateInterpolationCheckbox () |
'smooth when scaled up' has been clicked --> update its state. Errors - See Also - | |
virtual MsgResult | Message (Msg *Messgse) |
Handles all the Bitmap Properties dialog's messages. Errors - See Also -. | |
void | DoWithParam (OpDescriptor *, OpParam *Param) |
This creates and opens the dialog in response to a request from the user. Allows values to be passed in and returned to the caller through the BmpDlgParam class. | |
BmpDlgParam * | CommitDialogValue () |
Called when ok is pressed on the dialog box. Errors - See Also -. | |
void | SetIsManyDisplayed (BOOL Value) |
BOOL | GetIsManyDisplayed () const |
void | SetDelayChanged (BOOL value) |
BOOL | GetDelayChanged () const |
void | SetListDropped (BOOL value) |
BOOL | GetListDropped () const |
void | SetInterpolationChanged (BOOL value) |
BOOL | GetInterpolationChanged () const |
Static Public Member Functions | |
static BOOL | Init () |
bmpdlg Init method. Errors - See Also - | |
static OpState | GetState (String_256 *, OpDescriptor *) |
Returns the OpState for the Bitmap properties dialog operation. Errors - See Also -. | |
static void | InvokeBmpDlg (BmpDlgParam *pBmpDlgParam) |
Open a BMP Dialog. Errors - See Also -. | |
Static Public Attributes | |
static const UINT32 | IDD = _R(IDD_BMP_DLG) |
static const CDlgMode | Mode = MODAL |
static BmpDlgParam * | pParam = NULL |
Protected Attributes | |
BOOL | m_HasDelayChanged |
BOOL | m_IsManyDisplayed |
BOOL | m_ListDropped |
BOOL | m_bInterpolationChanged |
Definition at line 128 of file bmpsdlg.h.
|
bmpdlg Constructor, Sets The dlgs resource ID and Mode. Errors - See Also - BmpDlg::bmpdlg() : DialogOp(BmpDlg::IDD, BmpDlg::Mode)
Definition at line 146 of file bmpsdlg.cpp. 00146 : DialogOp(BmpDlg::IDD, BmpDlg::Mode) 00147 { 00148 m_HasDelayChanged = FALSE; 00149 m_bInterpolationChanged = FALSE; 00150 m_IsManyDisplayed = FALSE; 00151 m_ListDropped = FALSE; 00152 }
|
|
Destructor, Does nothing. Errors - See Also -.
Definition at line 168 of file bmpsdlg.cpp.
|
|
Called when ok is pressed on the dialog box. Errors - See Also -. BmpDlgParam* BmpDlg::CommitDialogValue()
Definition at line 462 of file bmpsdlg.cpp. 00463 { 00464 if(GetDelayChanged()) 00465 { 00466 BOOL Valid = FALSE; 00467 UINT32 Delay = GetLongGadgetValue(_R(IDC_SETDELAY), 0, 65535, _R(IDS_BMPPREFS_INVALIDDELAY) ,&Valid); 00468 if(Valid) 00469 { 00470 pParam->SetAnimDelay(Delay); 00471 00472 if(pParam->GetListSize() >= MORE_THAN_ONE_BITMAP) 00473 pParam->SetAreDelayValuesSame(TRUE); 00474 } 00475 } 00476 00477 if(GetListDropped()) 00478 { 00479 UINT32 RestoreType = GetSelectedValueIndex(_R(IDC_SETREMOVAL)); 00480 00481 if (RestoreType != FOUR) 00482 { 00483 // A new Restore type has been entered. 00484 pParam->SetRestoreType((GIFDisposalMethod)RestoreType); 00485 pParam->SetSameRestoreType(TRUE); 00486 } 00487 } 00488 00489 if(GetInterpolationChanged()) 00490 { 00491 BOOL bInterpolation = GetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE)); 00492 00493 // The 'smooth when scaled up' tick box has been changed. 00494 pParam->SetInterpolation(bInterpolation); 00495 00496 if(pParam->GetListSize() >= MORE_THAN_ONE_BITMAP) 00497 pParam->SetAreInterpolationValuesSame(TRUE); 00498 } 00499 00500 return pParam; 00501 }
|
|
Errors - See Also -. bmpdlg::Create()
Reimplemented from DialogOp. Definition at line 375 of file bmpsdlg.cpp. 00376 { 00377 if (DialogOp::Create()) 00378 { 00379 return TRUE; 00380 } 00381 else 00382 { 00383 //Could not create the dialog box, so call inform error. 00384 InformError(); 00385 // End the operation 00386 End(); 00387 return FALSE; 00388 } 00389 }
|
|
Overrides DialogOp's Do function to create and display a Bitmap Properties Dialog. Errors - See Also -.
Reimplemented from Operation. Definition at line 406 of file bmpsdlg.cpp. 00407 { 00408 ERROR3("BmpDlg::Do called, when should be using DoWithParam!"); 00409 00410 // End the operation 00411 End(); 00412 00413 }
|
|
This creates and opens the dialog in response to a request from the user. Allows values to be passed in and returned to the caller through the BmpDlgParam class.
Reimplemented from Operation. Definition at line 431 of file bmpsdlg.cpp. 00432 { 00433 ERROR3IF(Param == NULL, "BmpPrefsDlg::DoWithParam - NULL Param passed in"); 00434 00435 BOOL ok = FALSE;; 00436 // Force the dialog box to be created, as it is modal it will be opened via a message. 00437 ok = Create(); 00438 00439 if (!ok) 00440 { 00441 // Could not create the dialog box, so call inform error. 00442 InformError(); 00443 // End the operation. 00444 End(); 00445 } 00446 }
|
|
Definition at line 157 of file bmpsdlg.h. 00157 { return m_HasDelayChanged; }
|
|
Definition at line 163 of file bmpsdlg.h. 00163 { return m_bInterpolationChanged; }
|
|
Definition at line 154 of file bmpsdlg.h. 00154 { return m_IsManyDisplayed; }
|
|
Definition at line 160 of file bmpsdlg.h. 00160 { return m_ListDropped; }
|
|
Returns the OpState for the Bitmap properties dialog operation. Errors - See Also -. static OpState GetState(String_256*, OpDescriptor*)
Definition at line 316 of file bmpsdlg.cpp. 00317 { 00318 OpState opState; 00319 return opState; 00320 }
|
|
bmpdlg Init method. Errors - See Also - static BOOL Init();
Reimplemented from SimpleCCObject. Definition at line 338 of file bmpsdlg.cpp. 00339 { 00340 BOOL Ok = FALSE; 00341 Ok = RegisterOpDescriptor( 00342 0, /* Tool ID*/ 00343 _R(IDS_PROPERTIES_DLG), /* String resouirce ID*/ 00344 CC_RUNTIME_CLASS(BmpDlg), /* Runtime class*/ 00345 OPTOKEN_BMP_DLG, /* Token string*/ 00346 BmpDlg::GetState, /* GetState function*/ 00347 0, /* Help ID*/ 00348 0, /* Bubble ID*/ 00349 0, /* Resource ID*/ 00350 0, /* Control ID*/ 00351 SYSTEMBAR_ILLEGAL, /* Bar ID*/ 00352 TRUE, /* Recieve system messages*/ 00353 FALSE, /* Smart duplicate operation*/ 00354 TRUE, /* Clean operation*/ 00355 NULL, /* No vertical counterpart*/ 00356 _R(IDS_PROPERTIES_DLG_ONE) /* String for one copy only*/ 00357 ); 00358 return (Ok); 00359 }
|
|
Sets initial dialog values Errors - See Also -. BOOL BmpDlg::InitDialog()
Definition at line 517 of file bmpsdlg.cpp. 00518 { 00519 ERROR3IF(pParam == NULL, "BmpsDlg::InitDialog called after duff initialisation?!"); 00520 00521 if (pParam->GetMany()==TRUE) 00522 { 00523 SetStringGadgetValue(_R(IDC_NAME), _R(IDS_MANY) ); // Name details 00524 00525 if(pParam->GetSameFormat()) 00526 { 00527 SetStringGadgetValue(_R(IDC_FORMAT), pParam->GetBitmapFormat()); // Format details. 00528 } 00529 else 00530 SetStringGadgetValue(_R(IDC_FORMAT), _R(IDS_MANY)); 00531 00532 // Change the size field and enter the measurements. 00533 SetStringGadgetValue(_R(IDC_SIZEI), _R(IDS_TOTALSIZE) ); 00534 SetStringGadgetValue(_R(IDC_SIZEII), pParam->GetMemoryUsed()); 00535 00536 // Dimensions info 00537 if(pParam->GetSameDimensions()) 00538 { 00539 String_256 DimensionsInfo; // = BitmapWidth+" by "+BitmapHeight+" pixels, "+BitmapCols; 00540 DimensionsInfo.MakeMsg(_R(IDS_SGBITMAP_FULLINFO), (TCHAR *)pParam->GetBitmapWidth(), 00541 (TCHAR *)pParam->GetBitmapHeight()); 00542 SetStringGadgetValue(_R(IDC_DIMENSIONS), DimensionsInfo); 00543 } 00544 else 00545 SetStringGadgetValue(_R(IDC_DIMENSIONS), _R(IDS_MANY)); 00546 00547 // Colour Info 00548 if(pParam->GetSameColors()) 00549 SetStringGadgetValue(_R(IDC_COLOURS), pParam->GetBitmapCols()); 00550 else 00551 SetStringGadgetValue(_R(IDC_COLOURS), _R(IDS_MANY)); 00552 00553 // Transparency Info 00554 if (pParam->GetSameTranspType()) 00555 SetStringGadgetValue(_R(IDC_TRANSPARENT), pParam->GetBitmapTranspType()); 00556 else 00557 SetStringGadgetValue(_R(IDC_TRANSPARENT), _R(IDS_MANY)); 00558 00559 // Animation Delay info 00560 if(pParam->GetAreDelayValuesSame()) 00561 SetLongGadgetValue(_R(IDC_SETDELAY), pParam->GetAnimDelay()); 00562 else 00563 SetStringGadgetValue(_R(IDC_SETDELAY), _R(IDS_MANY) ); 00564 00565 // 'smooth when scaled up' tickbox 00566 if(pParam->GetAreInterpolationValuesSame()) 00567 SetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE), pParam->GetInterpolation()); 00568 else 00569 { 00570 // grey-out the box to represent 'many' different interpolation settings 00571 SetLongGadgetValue(_R(IDC_BMP_ALWAYS_INTERPOLATE), 2 ); 00572 } 00573 00574 00575 /* Animation Restore deatils are no longer dsplyed in the information group. Removed - Ranbir. 00576 00577 if(pParam->GetSameRestoreTpye()) 00578 { 00579 GIFDisposalMethod DisposalMethod = pParam->GetRestoreType(); 00580 00581 switch(DisposalMethod) 00582 { 00583 case GDM_NONE: 00584 { 00585 SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_NOTHING)); 00586 } 00587 break; 00588 00589 case GDM_LEAVE: 00590 { 00591 SetStringGadgetValue(_R(IDC_RESTORE), _R(IDS_RESTORE_LEAVEASIS)); 00592 } 00593 break; 00594 00595 case GDM_BACKTOBACK: 00596 { 00597 SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_BACKGROUND)); 00598 00599 } 00600 break; 00601 00602 case GDM_PREVIOUS: 00603 { 00604 SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_PREVIOUS)); 00605 } 00606 break; 00607 } 00608 */ 00609 if(pParam->GetSameRestoreType()) 00610 { 00611 // Set up the list for our Animation Restore types. 00612 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_NOTHING))); 00613 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_LEAVEASIS))); 00614 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_BACKGROUND))); 00615 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_PREVIOUS))); 00616 SetComboListLength (_R(IDC_SETREMOVAL)); 00617 00618 // Select the correct restore tpye for the List box. 00619 SetSelectedValueIndex(_R(IDC_SETREMOVAL), pParam->GetRestoreType()); 00620 } 00621 else 00622 { 00623 // The animation restore types differ, so display "Many" in the Listbox. 00624 // SetStringGadgetValue (_R(IDC_RESTORE), _R(IDS_MANY)); 00625 SetStringGadgetValue (_R(IDC_SETREMOVAL), _R(IDS_MANY)); 00626 SetSelectedValueIndex(_R(IDC_SETREMOVAL), OPTION_ONE); 00627 SetIsManyDisplayed(TRUE); 00628 pParam->SetSameRestoreType(FALSE); 00629 } 00630 } 00631 else // Only one Bitmap is currently selected. 00632 { 00633 SetStringGadgetValue(_R(IDC_NAME), pParam->GetBitmapName()); // Name details. 00634 00635 SetStringGadgetValue(_R(IDC_FORMAT), pParam->GetBitmapFormat()); // Format details. 00636 00637 SetStringGadgetValue(_R(IDC_SIZEII), pParam->GetMemoryUsed()); // Memeory details. 00638 00639 String_256 DimensionsInfo; // = BitmapWidth+" by "+BitmapHeight+" pixels, "+BitmapCols; 00640 00641 DimensionsInfo.MakeMsg(_R(IDS_SGBITMAP_FULLINFO), (TCHAR *)pParam->GetBitmapWidth(), 00642 (TCHAR *)pParam->GetBitmapHeight()); 00643 SetStringGadgetValue(_R(IDC_DIMENSIONS), DimensionsInfo); // Dimensions details 00644 00645 SetStringGadgetValue(_R(IDC_COLOURS), pParam->GetBitmapCols()); // Colour detalis. 00646 00647 SetStringGadgetValue(_R(IDC_TRANSPARENT), pParam->GetBitmapTranspType()); // Colour detalis. 00648 00649 SetLongGadgetValue(_R(IDC_SETDELAY), pParam->GetAnimDelay()); // Delay details. 00650 00651 SetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE), pParam->GetInterpolation()); 00652 00653 /* Restore details are no longer dislpayed, in the info. field 00654 00655 GIFDisposalMethod DisposalMethod = pParam->GetRestoreType(); // Set the restore details. 00656 00657 switch(DisposalMethod) 00658 { 00659 case GDM_NONE: 00660 { 00661 SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_NOTHING)); 00662 } 00663 break; 00664 00665 case GDM_LEAVE: 00666 { 00667 SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_LEAVEASIS)); 00668 } 00669 break; 00670 00671 case GDM_BACKTOBACK: 00672 { 00673 SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_BACKGROUND)); 00674 } 00675 break; 00676 00677 case GDM_PREVIOUS: 00678 { 00679 SetStringGadgetValue(_R(IDC_RESTORE),_R(IDS_RESTORE_PREVIOUS)); 00680 } 00681 break; 00682 00683 default: 00684 break; 00685 00686 } 00687 */ 00688 // Set up the list for our Animation Restore types. 00689 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_NOTHING))); 00690 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_LEAVEASIS))); 00691 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_BACKGROUND))); 00692 SetStringGadgetValue(_R(IDC_SETREMOVAL), String_32(_R(IDS_RESTORE_PREVIOUS))); 00693 SetComboListLength (_R(IDC_SETREMOVAL)); 00694 SetSelectedValueIndex(_R(IDC_SETREMOVAL), pParam->GetRestoreType()); 00695 } 00696 return TRUE; 00697 }
|
|
Open a BMP Dialog. Errors - See Also -. BOOL BmpDlg::InvokeBmpDlg(BmpDlgParam* pBmpDlgParam)
Definition at line 714 of file bmpsdlg.cpp. 00715 { 00716 ERROR3IF(pBmpDlgParam == NULL, "BmpDlg::BmpDlgParam - NULL Param passed in"); 00717 00718 // Save a refernece for use in the dialog code. 00719 pParam = pBmpDlgParam; 00720 00721 OpDescriptor* OpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(BmpDlg)); 00722 OpDesc->Invoke(pBmpDlgParam, FALSE); 00723 }
|
|
Handles all the Bitmap Properties dialog's messages. Errors - See Also -. MsgResult Message(Msg* Messgse);
Reimplemented from DialogOp. Definition at line 229 of file bmpsdlg.cpp. 00230 { 00231 if (IS_OUR_DIALOG_MSG(Message)) 00232 { 00233 DialogMsg* Msg = (DialogMsg*)Message; 00234 00235 // Now handle the required messages that we respond to. 00236 switch (Msg->DlgMsg) 00237 { 00238 case DIM_CREATE: 00239 { 00240 InitDialog(); 00241 SetDelayChanged(FALSE); 00242 SetListDropped(FALSE); 00243 SetInterpolationChanged(FALSE); 00244 } 00245 break; 00246 case DIM_COMMIT: 00247 { 00248 CommitDialogValue(); 00249 Close(); // Hide the dialog box 00250 End(); // Finish the operation 00251 return OK; 00252 } 00253 break; 00254 case DIM_CANCEL: 00255 { 00256 Close(); // Hide the dialog box 00257 End(); // Finish the operation 00258 return OK; 00259 } 00260 break; 00261 case DIM_LISTDROPPED: 00262 { 00263 SetListDropped(TRUE); 00264 00265 if(GetIsManyDisplayed()) 00266 { 00267 DeleteAllValues(_R(IDC_SETREMOVAL)); 00268 // Set up the new list 00269 00270 SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_NOTHING)); 00271 SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_LEAVEASIS)); 00272 SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_BACKGROUND)); 00273 SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_RESTORE_PREVIOUS)); 00274 SetStringGadgetValue(_R(IDC_SETREMOVAL), _R(IDS_MANY)); 00275 SetSelectedValueIndex(_R(IDC_SETREMOVAL),OPTION_FOUR); 00276 SetComboListLength (_R(IDC_SETREMOVAL)); 00277 SetIsManyDisplayed(FALSE); 00278 } 00279 } 00280 break; 00281 case DIM_TEXT_CHANGED: 00282 { 00283 // A control on the dialog box has been typed in. 00284 if (Msg->GadgetID == _R(IDC_SETDELAY)) 00285 SetDelayChanged(TRUE); 00286 } 00287 break; 00288 case DIM_LFT_BN_CLICKED: 00289 { 00290 // Left button clicked. 00291 if (Msg->GadgetID == _R(IDC_BMP_ALWAYS_INTERPOLATE)) 00292 UpdateInterpolationCheckbox(); 00293 } 00294 break; 00295 default: 00296 break; 00297 } 00298 } 00299 return DialogOp::Message(Message); 00300 }
|
|
Definition at line 156 of file bmpsdlg.h. 00156 { m_HasDelayChanged = value; }
|
|
Definition at line 162 of file bmpsdlg.h. 00162 { m_bInterpolationChanged = value; }
|
|
Definition at line 153 of file bmpsdlg.h. 00153 { m_IsManyDisplayed = Value; }
|
|
Definition at line 159 of file bmpsdlg.h. 00159 { m_ListDropped = value; }
|
|
'smooth when scaled up' has been clicked --> update its state. Errors - See Also - void UpdateInterpolationCheckbox()
Definition at line 187 of file bmpsdlg.cpp. 00188 { 00189 SetInterpolationChanged(TRUE); 00190 00191 // get the current state 00192 BOOL bState = GetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE)); 00193 00194 // this code is broken. How can a BOOL return have 3 states? -AMB 00195 00196 switch(bState) 00197 { 00198 case TRUE: 00199 { 00200 bState = FALSE; 00201 break; 00202 } 00203 default: 00204 { 00205 bState = TRUE; 00206 break; 00207 } 00208 } 00209 00210 SetBoolGadgetSelected(_R(IDC_BMP_ALWAYS_INTERPOLATE), bState); 00211 00212 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|