BfxPlugInDlg Class Reference

#include <bfxdlg2.h>

Inheritance diagram for BfxPlugInDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject BfxBrightnessContrastDlg BfxColourDepthDlg BfxFlipAndRotateDlg BfxResizeDlg BfxSpecialEffectsDlg List of all members.

Public Member Functions

 BfxPlugInDlg (CDlgResID id=BfxPlugInDlg::IDD)
 ~BfxPlugInDlg ()
 Destructor.
MsgResult Message (Msg *Message)
 This is the message handler for the BfxPlugInDlg.
void Do (OpDescriptor *)
 Like all Do functions invokes the BfxPlugInDlg.
void DoWithParam (OpDescriptor *pOp, OpParam *pParam)
 Performs the BfxOp for the first time.

Static Public Member Functions

static BOOL Init ()
 The standard Init fn for the op.
static OpState GetState (String_256 *, OpDescriptor *)
 The standard GetState fn, does nothing.

Static Public Attributes

static const CDlgMode Mode = MODAL
static UINT32 IDD = _R(IDD_BFXDLG)

Protected Member Functions

void HandleFlipAndRotateMsg (DialogMsg *Msg, BOOL *pCommitValues, BOOL *pEndDialog)
 All messages generated from the tabbed dialog's page 1 get processed here.
void HandleResizeMsg (DialogMsg *Msg, BOOL *pCommitValues, BOOL *pEndDialog)
 All messages generated from the tabbed dialog's page 1 get processed here.
void HandleBrightnessAndContrastMsg (DialogMsg *Msg, BOOL *pCommitValues, BOOL *pEndDialog)
 All messages generated from the tabbed dialog's page 1 get processed here.
void HandleDitherMsg (DialogMsg *Msg, BOOL *pCommitValues, BOOL *pEndDialog)
 All messages generated from the tabbed dialog's page 1 get processed here.
void HandleSpecialEffectsMsg (DialogMsg *Msg, BOOL *pCommitValues, BOOL *pEndDialog)
 All messages generated from the tabbed dialog's page 1 get processed here.
void HandleAlchemistMsg (DialogMsg *Msg, BOOL *pCommitValues, BOOL *pEndDialog)
 All messages generated from the tabbed dialog's page 1 get processed here.
void Remove24BitTempCopy ()
BOOL RenderBitmap (ReDrawInfoType *ExtraInfo, KernelBitmap *BitmapToUse)
 Fills a renderable control with a bitmap.
BOOL FixOriginalComboBox ()
 Makes the combo box reflect the bitmaps within the document.
BOOL ReadOriginalComboBox ()
 Chooses a different bitmap from the combo box.
BOOL SetParameters (INT32 p1=0, INT32 p2=0, INT32 p3=0)
BOOL CheckOriginalBitmap ()
 Ensures pOriginal points to a valid bitmap in this document.
BOOL DestinationChanged ()
 Invalidates area for destination bitmap, marks no destination as yet.
BOOL FindBitmap ()
 Set pOriginal to point at a bitmap.
BOOL OriginalChanged ()
 Invalidates area for original bitmap, marks no destination as yet.
BOOL ClearDestination (BOOL Redraw=TRUE)
 Marks no dest bitmap.
BOOL SetEffect (CCRuntimeClass *Effect)
 Choses the bitmap effect for processing.
BOOL SetDirty (BOOL Redraw=TRUE)
 Clears the clean flag and deletes the effect.

Protected Attributes

INT32 Param1
INT32 Param2
INT32 Param3
double Matrix [9]
KernelBitmappOriginal
KernelBitmappDestination
KernelBitmappPrevOriginal
BitmapInfopOrigInfo
BOOL Clean
CList< String_256, String_256m_p24BitCopyNames
BOOL m_UseInitial
AccusoftBitmapEffectpFX
CDlgResID OpenPage
Documentm_pDocument
OpParamm_pParam

Static Protected Attributes

static BOOL InteractiveBCC = TRUE

Detailed Description

Definition at line 132 of file bfxdlg2.h.


Constructor & Destructor Documentation

BfxPlugInDlg::BfxPlugInDlg CDlgResID  id = BfxPlugInDlg::IDD  ) 
 

Definition at line 201 of file bfxdlg2.cpp.

00201                                        : DialogOp(id, BfxPlugInDlg::Mode) 
00202 {
00203     pOriginal = NULL;
00204     pDestination = NULL;
00205     pPrevOriginal=NULL;
00206     pOrigInfo = NULL;
00207     m_UseInitial = TRUE;
00208     Clean = FALSE;
00209     pFX = NULL;
00210     SetParameters();
00211     for (INT32 i = 0; i<=8; i++) Matrix[i]=(i==4)?1.0:0.0;
00212 
00213     m_pParam = NULL;
00214     m_pDocument = NULL;
00215 }        

BfxPlugInDlg::~BfxPlugInDlg  ) 
 

Destructor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95

Definition at line 227 of file bfxdlg2.cpp.

00228 {
00229     // Check to see if we needed to generate a copy of any 32bit BMPs
00230     if(!m_p24BitCopyNames.IsEmpty())
00231     {
00232         // If so remove the tempory version!
00233         Remove24BitTempCopy();
00234     }
00235 
00236     if (pFX) delete pFX;
00237     if (pDestination) {TRACEUSER( "Neville", _T("Destructor deleting destination\n"));delete pDestination;}
00238     if (pOrigInfo) delete pOrigInfo;
00239 }        


Member Function Documentation

BOOL BfxPlugInDlg::CheckOriginalBitmap  )  [protected]
 

Ensures pOriginal points to a valid bitmap in this document.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
pOriginal set [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 546 of file bfxdlg2.cpp.

00547 {
00548     Document * pDoc = Document::GetSelected();
00549 
00550     // Get the bitmap list
00551     BitmapList* Bitmaps = NULL;
00552     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00553 
00554     if (Bitmaps == NULL)
00555     {
00556         pOriginal = NULL;
00557         return OriginalChanged();
00558     }
00559 
00560     KernelBitmap * pBmp = NULL;
00561 
00562     if(pOriginal != NULL)
00563     {
00564         // Check to see if the Bitmap we`re operating on is 32Bit!
00565         if(pOriginal->ActualBitmap->GetBitmapInfoHeader()->biBitCount == 32)
00566         {
00567             // First check to see if we`ve already got a 24bit copy of the 32bit BMP!
00568             BOOL AlreadyHaveCopy = FALSE;
00569             
00570             // Get first bitmap in the bitmap list
00571             pBmp = (KernelBitmap *)(Bitmaps->GetHead());
00572 
00573             // While the BMP is valid do the conversion!
00574             while (pBmp != NULL)
00575             {
00576                 // check to see if this bitmap has already been converted!
00577                 String_256 strTemp = pOriginal->GetName();
00578                 strTemp += TEXT("(24-bit Copy)");
00579                 if (pBmp->GetName().CompareTo(strTemp) == 0)
00580                 {
00581                     // Has been converted so set the flag and break out of the while loop!
00582                     AlreadyHaveCopy = TRUE;
00583                     break;
00584                 }
00585                 // Get the next bitmap in the list
00586                 pBmp = (KernelBitmap *) Bitmaps->GetNext(pBmp);
00587             }
00588 
00589             // If the flag has been set then use the converted bitmap that`s already there!
00590             if(AlreadyHaveCopy)
00591             {
00592                 InformWarning(_R(IDS_BFX_USE_CONVERT_MSG),_R(IDS_OK),0,0,0,1,2);
00593                 pOriginal = pBmp;
00594             }
00595             else
00596             {
00597                 // Ask the user wether or not they want to use a 24bit copy of the BMP or use the Default Bitmap?
00598                 InformWarning(_R(IDS_BFX_BMP_CONVERT_MSG),_R(IDS_OK),0,0,0,1,2);
00599 
00600                 // Setup a new name to give converted 32Bit BMPs
00601                 String_256 NewName = pOriginal->GetName();
00602                 NewName += "(24-bit Copy)";
00603 
00604                 // Add the name to our copy name list
00605                 m_p24BitCopyNames.AddTail(NewName);
00606 
00607                 // We need to convert the 32Bit to 24Bit, so setup a new Kernel Bitmap!
00608                 UINT32 Height = pOriginal->GetBitmapInfoHeader()->biHeight;
00609                 UINT32 Width = pOriginal->GetBitmapInfoHeader()->biWidth;
00610                 KernelBitmap* pNewBMP = new KernelBitmap( Width, Height, 24, 96);
00611 
00612                 if(pNewBMP != NULL)
00613                 {
00614                     // We need to convert it to 24Bit
00615                     pNewBMP->ActualBitmap = CBMPBits::RenderKernelBMPToTransparentWhiteRect(pOriginal,TRUE,24);
00616                 
00617                     // Set the new Bitmap name!
00618                     pNewBMP->SetName(NewName);
00619 
00620                     // Make the Original Bitmap = to the new Bitmap!
00621                     pOriginal = pNewBMP;
00622 
00623                     // Attach the bitmap to the Bitmap List!
00624                     pNewBMP->Attach(Document::GetCurrent()->GetBitmapList());
00625                 }
00626                 else
00627                 {
00628                     ERROR2(FALSE,"Could not make 24Bit Bitmap Copy Of 32Bit Source!");
00629                 }
00630             }
00631 
00632             FixOriginalComboBox();
00633             return OriginalChanged();
00634         }
00635     }
00636 
00637     pBmp = (KernelBitmap *)(Bitmaps->GetHead());
00638 
00639     while (pBmp != NULL)
00640     {
00641         if (pBmp == pOriginal) return OriginalChanged(); // OK we've found it.
00642         pBmp = (KernelBitmap *) Bitmaps->GetNext(pBmp);
00643     }
00644 
00645     pOriginal = (KernelBitmap *)(Bitmaps->GetHead()); // possibly NULL but certainly on the list
00646     return OriginalChanged();
00647 }

BOOL BfxPlugInDlg::ClearDestination BOOL  Redraw = TRUE  )  [protected]
 

Marks no dest bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 453 of file bfxdlg2.cpp.

00454 {
00455     if (pDestination)
00456     {
00457         delete pDestination;
00458         pDestination = NULL; //TRACEUSER( "Neville", _T("ClearDestination deleting dest\n"));
00459         return ((!Redraw) || (DestinationChanged()));
00460     }
00461     return TRUE;
00462 }

BOOL BfxPlugInDlg::DestinationChanged  )  [protected]
 

Invalidates area for destination bitmap, marks no destination as yet.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 429 of file bfxdlg2.cpp.

00430 {
00431     if (OpenPage)
00432     {
00433         InvalidateGadget(_R(IDC_BFXDLG_ORIGREDRAW2));
00434     }
00435     return TRUE;
00436 }

void BfxPlugInDlg::Do OpDescriptor  )  [virtual]
 

Like all Do functions invokes the BfxPlugInDlg.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 2005 of file bfxdlg2.cpp.

02006 {
02007     //String_256 Title(_R(IDS_BFXDLG));
02008     //SetName(&Title); 
02009     BOOL ok = Create(); // Create the dialog please
02010     if (!ok)
02011     {
02012         /*InformError(blobby)*/;    // Display an error if this is a real dialog please
02013         OpenPage=0;
02014         End(); 
02015     }
02016 //  TalkToPage(0);
02017     //SetStringGadgetValue(_R(ID_APPLY_NOW), _R(IDS_BFXDLG_TEST));
02018     //SetStringGadgetValue(IDOK, _R(IDS_BFXDLG_INSERT));
02019     //SetStringGadgetValue(IDCANCEL, _R(IDS_BFXDLG_CLOSE));
02020 }

void BfxPlugInDlg::DoWithParam OpDescriptor pOp,
OpParam pParam
[virtual]
 

Performs the BfxOp for the first time.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/2/95
Parameters:
OpDescriptor (unused) [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
The first parameter should be a kernel bitmap to use or null to just bring the dialog up

Reimplemented from Operation.

Definition at line 2039 of file bfxdlg2.cpp.

02040 {
02041     // remember the parameter so that we can return the ok/cancel to the caller
02042     m_pParam = pParam;
02043 
02044     KernelBitmap * pBitmap = NULL;
02045     if (pParam)
02046     {
02047         pBitmap = (KernelBitmap *)(void *)(pParam->Param1);
02048         m_pDocument = (Document*)(pParam->Param2);
02049     }
02050 
02051     if (pBitmap && pBitmap->IsKindOf(CC_RUNTIME_CLASS(KernelBitmap)))
02052     {
02053         // open and create the dialog box
02054         Do(pOp);
02055 
02056         OriginalChanged();
02057     }
02058 
02059     return;
02060 }

BOOL BfxPlugInDlg::FindBitmap  )  [protected]
 

Set pOriginal to point at a bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
pOriginal set [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 479 of file bfxdlg2.cpp.

00480 {
00481 //  pOriginal = NULL;
00482 
00483     // Check if the dialog is being invoked via a parameter (eg. from the Bitmap Gallery).
00484     if (m_pParam != 0)
00485     {
00486         pOriginal = (KernelBitmap*) m_pParam->Param1;
00487         return CheckOriginalBitmap();
00488     }
00489 
00490     Range Sel(*(GetApplication()->FindSelection()));
00491     Node* FirstSelectedNode = Sel.FindFirst(); 
00492     if (FirstSelectedNode != NULL) // No nodes selected so End
00493     {
00494         Node* CurrentNode = FirstSelectedNode;       
00495         Node* NextCurrent; 
00496         
00497         // Do all bitmaps. OK this should pick up the fill as well. Never mind
00498         while (CurrentNode != NULL)
00499         {
00500             NextCurrent = Sel.FindNext(CurrentNode);
00501             if  (CurrentNode->IsSelected() &&
00502                  CurrentNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeBitmap)) 
00503             {         
00504                 pOriginal = ((NodeBitmap *)(CurrentNode))->GetBitmap();
00505                 return CheckOriginalBitmap();
00506             }
00507 
00508             CurrentNode = NextCurrent; 
00509         }
00510     } 
00511 
00512     // Find the first Fill Attribute in the selection
00513     AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr();
00514 
00515     while (pAttrNode != NULL)
00516     {
00517         if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrBitmapColourFill)))
00518         {
00519             pOriginal = pAttrNode->GetBitmap();
00520             return CheckOriginalBitmap();
00521         }
00522 
00523         // Check the next fill
00524         pAttrNode = AttrFillGeometry::FindNextSelectedAttr();
00525     }
00526 
00527     return CheckOriginalBitmap();
00528 }

BOOL BfxPlugInDlg::FixOriginalComboBox  )  [protected]
 

Makes the combo box reflect the bitmaps within the document.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-
This routine is heavilly copied from one within the fill tool

Definition at line 666 of file bfxdlg2.cpp.

00667 {
00668     // Find the doccomponent with the list of bitmaps in it
00669     Document * pDoc = Document::GetSelected();
00670 
00671     // Get the bitmap list
00672     BitmapList* Bitmaps = NULL;
00673     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00674 
00675     if (Bitmaps == NULL)
00676         return TRUE;
00677 
00678     String_256 Str;
00679 
00680     if (OpenPage)
00681     {
00682         DeleteAllValues(_R(IDC_BFXDLG_ORIGCOMBO));
00683     }
00684 
00685     BOOL DoneMain = FALSE;
00686     INT32 SelIndex = 0;
00687 
00688     // need a pointer of type CustomComboBoxControlDataItem to insert items into
00689     // a custom combobox ....
00690     CustomComboBoxControlDataItem* theItem = NULL;
00691 
00692     if (Bitmaps->GetCount() > 0)
00693     {
00694         INT32 Index = 0;
00695 
00696         ListItem* pBmp = Bitmaps->GetHead();
00697 
00698         while (pBmp != NULL)
00699         {
00700             /*Str = ((KernelBitmap*)pBmp)->ActualBitmap->GetName();
00701             if (OpenPage)
00702             {
00703                 if (((KernelBitmap*)(pBmp)) == pOriginal)
00704                 {
00705                     SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str, FALSE, -1);
00706                     DoneMain = TRUE;
00707                     SelIndex=Index;
00708                 }
00709                 SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str,FALSE, Index++);
00710             }*/
00711 
00712             if (OpenPage)
00713             {
00714                 if (!((KernelBitmap*)pBmp)->HasBeenDeleted())   // Ignore deleted bitmaps
00715                 {
00716                     Str = ((KernelBitmap*)pBmp)->ActualBitmap->GetName();
00717                     // for the standard combobox - the following line sufficed
00718     //              SetStringGadgetValue(_R(IDC_EFFECT),&Str,FALSE, Index);
00719 
00720                     // but for a custom combobox we have to do a lot more work ....
00721                 
00722                     theItem = new CustomComboBoxControlDataItem ();
00723                     theItem->itemName = Str;
00724                     theItem->itemID = Index;
00725 
00726                     KernelBitmap* bitmap = ((KernelBitmap*)pBmp);
00727 
00728                     // make the custom combobox know about our bitmap ....
00729                     theItem->oilItemBitmap = (KernelBitmap*) bitmap;
00730 
00731                     // and insert the data item into the cutsom combobox ....
00732                     
00733                     if (((KernelBitmap*)(pBmp)) == pOriginal)
00734                     {
00735                         SetCustomComboGadgetValue ( _R(IDC_BFXDLG_ORIGCOMBO), theItem, TRUE, 0);
00736                         
00737                         String_64 Str;
00738                         Str = ((KernelBitmap*)(pBmp))->GetName ();
00739                         
00740                         // call custom controls interface ....
00741                         SelectCustomComboGadgetValueOnString (_R(IDC_BFXDLG_ORIGCOMBO), &Str);
00742                         
00743                         //SetCustomComboGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str, FALSE, -1);
00744                         DoneMain = TRUE;
00745                         SelIndex=Index;
00746 
00747                         Index++;
00748                     }
00749                     else
00750                     {
00751                         SetCustomComboGadgetValue ( _R(IDC_BFXDLG_ORIGCOMBO), theItem, TRUE, 0);
00752                         Index++;
00753                     }
00754                 }
00755             }
00756 
00757             pBmp = Bitmaps->GetNext(pBmp);
00758         }
00759     }
00760     else
00761     {
00762         /*Str.Load(_R(IDS_K_BFXDLG_DEFAULT));
00763         if (OpenPage) SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str,TRUE, 0);*/
00764     }
00765 
00766     if (OpenPage)
00767     {
00768         Str.Load(_R(IDS_K_BFXDLG_DEFAULT));
00769         //SetComboListLength(_R(IDC_BFXDLG_ORIGCOMBO));
00770         if (!DoneMain)
00771         {
00772             // call custom controls interface ....
00773             SelectCustomComboGadgetValueOnString (_R(IDC_BFXDLG_ORIGCOMBO), &Str);
00774             
00775             //SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str, FALSE, -1);
00776             //SetSelectedValueIndex(_R(IDC_BFXDLG_ORIGCOMBO), 0);
00777         }
00778         /*else
00779         {
00780             SetSelectedValueIndex(_R(IDC_BFXDLG_ORIGCOMBO), SelIndex);
00781         }*/
00782     }
00783     return TRUE;
00784 }

OpState BfxPlugInDlg::GetState String_256 ,
OpDescriptor
[static]
 

The standard GetState fn, does nothing.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1865 of file bfxdlg2.cpp.

01866 {    
01867     OpState OpSt;
01868     return(OpSt);
01869 }

void BfxPlugInDlg::HandleAlchemistMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[protected]
 

All messages generated from the tabbed dialog's page 1 get processed here.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Msg,: The message sent from page 1 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BfxPlugInDlg::Message

Definition at line 1779 of file bfxdlg2.cpp.

01780 {
01781     //TalkToPage(_R(IDD_BFXPLUGINDLG_PG6));  // The Coords Page identifier
01782     switch(Msg->DlgMsg)
01783     {
01784         case DIM_CREATE:
01785             {
01786                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_HUE_CHECK), TRUE); 
01787                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SATURATION_CHECK), TRUE); 
01788                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VALUE_CHECK), TRUE); 
01789                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_RAINBOW_CHECK), TRUE); 
01790                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VARIATION_CHECK), TRUE); 
01791                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SHAPES_CHECK), TRUE); 
01792                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_STYLE_CHECK), TRUE); 
01793                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_OPACITY_CHECK), TRUE); 
01794                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_GRAIN_CHECK), TRUE); 
01795 
01796                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_HUE_SLIDER), 0, 127, 1);
01797                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_HUE_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01798                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_HUE_SLIDER), 64); 
01799                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_SATURATION_SLIDER), 0, 127, 1);
01800                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_SATURATION_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01801                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SATURATION_SLIDER), 64); 
01802                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_VALUE_SLIDER), 0, 127, 1);
01803                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_VALUE_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01804                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VALUE_SLIDER), 64); 
01805                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_RAINBOW_SLIDER), 0, 127, 1);
01806                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_RAINBOW_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01807                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_RAINBOW_SLIDER), 64); 
01808                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_VARIATION_SLIDER), 0, 127, 1);
01809                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_VARIATION_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01810                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VARIATION_SLIDER), 64); 
01811                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_SHAPES_SLIDER), 0, 127, 1);
01812                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_SHAPES_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01813                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SHAPES_SLIDER), 64); 
01814                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_STYLE_SLIDER), 0, 127, 1);
01815                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_STYLE_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01816                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_STYLE_SLIDER), 64); 
01817                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_OPACITY_SLIDER), 0, 127, 1);
01818                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_OPACITY_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01819                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_OPACITY_SLIDER), 64); 
01820                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_GRAIN_SLIDER), 0, 127, 1);
01821                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_GRAIN_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01822                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_GRAIN_SLIDER), 64); 
01823 
01824             }
01825             break; //RUN THROUGH
01826 
01827         case DIM_SLIDER_POS_SET:
01828         //case DIM_SLIDER_POS_CHANGING:
01829         case DIM_LFT_BN_CLICKED:
01830         case DIM_SELECTION_CHANGED:
01831         case DIM_TEXT_CHANGED:             // Text changed 
01832             {
01833                 SetDirty();
01834             }
01835 //          break;
01836             *pCommitValues = TRUE;
01837 
01838         case DIM_SOFT_COMMIT:
01839         case DIM_COMMIT:
01840             {
01841             }
01842             break;
01843 
01844     }
01845 }

void BfxPlugInDlg::HandleBrightnessAndContrastMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[protected]
 

All messages generated from the tabbed dialog's page 1 get processed here.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Msg,: The message sent from page 1 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BfxPlugInDlg::Message

Definition at line 1426 of file bfxdlg2.cpp.

01427 {
01428     //TalkToPage(_R(IDD_BFXPLUGINDLG_PG3));  // The Coords Page identifier
01429     switch(Msg->DlgMsg)
01430     {
01431         case DIM_CREATE:
01432             SetGadgetRange(_R(IDC_BFXDLG_BRIGHTNESS), -127, 127, 1);
01433             SetGadgetBitmaps(_R(IDC_BFXDLG_BRIGHTNESS), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
01434             SetGadgetRange(_R(IDC_BFXDLG_CONTRAST), -127, 127, 1);
01435             SetGadgetBitmaps(_R(IDC_BFXDLG_CONTRAST), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
01436             SetGadgetRange(_R(IDC_BFXDLG_COLOUR), -127, 127, 1);
01437             SetGadgetBitmaps(_R(IDC_BFXDLG_COLOUR), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
01438             SetLongGadgetValue(_R(IDC_BFXDLG_BRIGHTNESS), 0); 
01439             SetLongGadgetValue(_R(IDC_BFXDLG_CONTRAST), 0); 
01440             SetLongGadgetValue(_R(IDC_BFXDLG_COLOUR), 0); 
01441             break;
01442 //      case DIM_SLIDER_POS_SET:
01443 //      case DIM_SLIDER_POS_IDLE:
01444         case DIM_LFT_BN_CLICKED:
01445         case DIM_SELECTION_CHANGED:
01446             {
01447                 switch (Msg->GadgetID)
01448                 {
01449                     case _R(IDC_BFXDLG_BRIGHTNESS):
01450                     case _R(IDC_BFXDLG_CONTRAST):
01451                     case _R(IDC_BFXDLG_COLOUR):
01452                         SetDirty();
01453                         break;
01454                     default:
01455                         break;
01456                 }
01457             }
01458             break;
01459 
01460         case DIM_SLIDER_POS_SET:
01461         case DIM_SLIDER_POS_IDLE:
01462             m_UseInitial = FALSE;
01463         case DIM_SOFT_COMMIT:
01464         case DIM_COMMIT:
01465             {
01466                 INT32 Brightness = -GetLongGadgetValue(_R(IDC_BFXDLG_BRIGHTNESS),-127,127);
01467                 INT32 Contrast = -GetLongGadgetValue(_R(IDC_BFXDLG_CONTRAST),-127,127);
01468                 INT32 Colour = -GetLongGadgetValue(_R(IDC_BFXDLG_COLOUR),-127,127);
01469                 if (Msg->DlgMsg == DIM_SLIDER_POS_SET || Msg->DlgMsg == DIM_SLIDER_POS_IDLE)
01470                 {
01471                     if (InteractiveBCC)
01472                     {                   
01473                         if ((!pFX) || (!pFX->IsKindOf(CC_RUNTIME_CLASS(ABFXBrightnessContrast))) ||
01474                             (Brightness!=Param1) || (Contrast!=Param2) || (Colour!=Param3))
01475                         {
01476                             *pCommitValues = TRUE;
01477                             *pEndDialog = FALSE;
01478                             SetDirty(FALSE); // no redraw right now
01479                         }
01480                         else break;
01481                     }
01482                     else
01483                     {
01484                         SetDirty();
01485                         break;
01486                     }
01487                 }
01488                 SetEffect(CC_RUNTIME_CLASS(ABFXBrightnessContrast));
01489                 SetParameters(Brightness, Contrast, Colour);
01490             }
01491             break;
01492 
01493     }
01494 }

void BfxPlugInDlg::HandleDitherMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[protected]
 

All messages generated from the tabbed dialog's page 1 get processed here.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Msg,: The message sent from page 1 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BfxPlugInDlg::Message

Definition at line 1512 of file bfxdlg2.cpp.

01513 {
01514     //TalkToPage(_R(IDD_BFXPLUGINDLG_PG4));  // The Coords Page identifier
01515     switch(Msg->DlgMsg)
01516     {
01517         case DIM_CREATE:
01518             SetLongGadgetValue(_R(IDC_BFXDLG_BAYERMONO), TRUE); 
01519             SetLongGadgetValue(_R(IDC_BFXDLG_HALFTONEMONO), FALSE); 
01520             SetLongGadgetValue(_R(IDC_BFXDLG_DIFFUSIONMONO), FALSE); 
01521             SetLongGadgetValue(_R(IDC_BFXDLG_BAYERCOLOUR), FALSE); 
01522             SetLongGadgetValue(_R(IDC_BFXDLG_DIFFUSIONCOLOUR), FALSE); 
01523             SetLongGadgetValue(_R(IDC_BFXDLG_POPULARITY), FALSE); 
01524             SetLongGadgetValue(_R(IDC_BFXDLG_MAKEGREYSCALE), FALSE); 
01525             SetLongGadgetValue(_R(IDC_BFXDLG_OCTREECOLOUR), FALSE); 
01526             
01527 //EnableGadget(_R(IDC_BFXDLG_DIFFUSIONCOLOUR), FALSE); // Accusoft library crashes
01528 //EnableGadget(_R(IDC_BFXDLG_OCTREECOLOUR), FALSE); // Accusoft library crashes
01529 
01530             //EnableGadget (_R(IDC_BFXDLG_ORIGCOMBO), TRUE);    // need to force custom control to redraw!
01531             
01532             break;
01533 
01534         case DIM_LFT_BN_CLICKED:
01535         case DIM_SELECTION_CHANGED:
01536             {
01537                 m_UseInitial = FALSE;
01538                 switch (Msg->GadgetID)
01539                 {
01540                     case _R(IDC_BFXDLG_BAYERMONO):
01541                     case _R(IDC_BFXDLG_HALFTONEMONO):
01542                     case _R(IDC_BFXDLG_DIFFUSIONMONO):
01543                     case _R(IDC_BFXDLG_BAYERCOLOUR):
01544                     case _R(IDC_BFXDLG_DIFFUSIONCOLOUR):
01545                     case _R(IDC_BFXDLG_POPULARITY):
01546                     case _R(IDC_BFXDLG_MAKEGREYSCALE):
01547                     case _R(IDC_BFXDLG_OCTREECOLOUR):
01548                         SetDirty();
01549                         break;
01550                     default:
01551                         break;
01552                 }
01553             }
01554 //          break;
01555             *pCommitValues = TRUE;
01556 
01557         case DIM_SOFT_COMMIT:
01558         case DIM_COMMIT:
01559             {
01560                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_BAYERMONO)      )) SetEffect(CC_RUNTIME_CLASS(ABFXBayerMono));
01561                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_HALFTONEMONO)   )) SetEffect(CC_RUNTIME_CLASS(ABFXHalftoneMono));
01562                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_DIFFUSIONMONO)  )) SetEffect(CC_RUNTIME_CLASS(ABFXDiffusionMono));
01563                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_BAYERCOLOUR)    )) SetEffect(CC_RUNTIME_CLASS(ABFXBayerColour));
01564                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_DIFFUSIONCOLOUR))) SetEffect(CC_RUNTIME_CLASS(ABFXDiffusionColour));
01565                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_POPULARITY)     )) SetEffect(CC_RUNTIME_CLASS(ABFXPopularityColour));
01566                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_MAKEGREYSCALE)  )) SetEffect(CC_RUNTIME_CLASS(ABFXMakeGreyscale));
01567                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_OCTREECOLOUR)      )) SetEffect(CC_RUNTIME_CLASS(ABFXOctree));
01568             }
01569             break;
01570 
01571     }
01572 }

void BfxPlugInDlg::HandleFlipAndRotateMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[protected]
 

All messages generated from the tabbed dialog's page 1 get processed here.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Msg,: The message sent from page 1 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BfxPlugInDlg::Message

Definition at line 1253 of file bfxdlg2.cpp.

01254 {
01255     //TalkToPage(_R(IDD_BFXPLUGINDLG_PG1));  // The Coords Page identifier
01256     switch(Msg->DlgMsg)
01257     {
01258         case DIM_CREATE:
01259             SetLongGadgetValue(_R(IDC_BFXDLG_FLIPX), TRUE); 
01260             SetLongGadgetValue(_R(IDC_BFXDLG_FLIPY), FALSE); 
01261             SetLongGadgetValue(_R(IDC_BFXDLG_ROTATE90), FALSE); 
01262             SetLongGadgetValue(_R(IDC_BFXDLG_ROTATE180), FALSE); 
01263             SetLongGadgetValue(_R(IDC_BFXDLG_ROTATE270), FALSE); 
01264             break;
01265 
01266         case DIM_LFT_BN_CLICKED:
01267         case DIM_SELECTION_CHANGED:
01268             {
01269                 m_UseInitial = FALSE;
01270                 switch (Msg->GadgetID)
01271                 {
01272                     case _R(IDC_BFXDLG_FLIPX):
01273                     case _R(IDC_BFXDLG_FLIPY):
01274                     case _R(IDC_BFXDLG_ROTATE90):
01275                     case _R(IDC_BFXDLG_ROTATE180):
01276                     case _R(IDC_BFXDLG_ROTATE270):
01277                         SetDirty();
01278                         break;
01279                     default:
01280                         break;
01281                 }
01282             }
01283 //          break;
01284             *pCommitValues = TRUE;
01285 
01286         case DIM_SOFT_COMMIT:
01287         case DIM_COMMIT:
01288             {
01289                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_FLIPX))) SetEffect(CC_RUNTIME_CLASS(ABFXFlipX));
01290                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_FLIPY))) SetEffect(CC_RUNTIME_CLASS(ABFXFlipY));
01291                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_ROTATE90) )) SetEffect(CC_RUNTIME_CLASS(ABFXRotate90 ));
01292                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_ROTATE180))) SetEffect(CC_RUNTIME_CLASS(ABFXRotate180));
01293                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_ROTATE270))) SetEffect(CC_RUNTIME_CLASS(ABFXRotate270));
01294             }
01295             break;
01296 
01297     }
01298 }

void BfxPlugInDlg::HandleResizeMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[protected]
 

All messages generated from the tabbed dialog's page 1 get processed here.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Msg,: The message sent from page 1 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BfxPlugInDlg::Message

Definition at line 1317 of file bfxdlg2.cpp.

01318 {
01319     static BOOL ReEntered = FALSE;
01320     BOOL RescanSize = FALSE;
01321     //TalkToPage(_R(IDD_BFXPLUGINDLG_PG2));  // The Coords Page identifier
01322     switch(Msg->DlgMsg)
01323     {
01324         case DIM_SET_ACTIVE:
01325             ReEntered = FALSE; // Just in case we get out of sync
01326             break;
01327 
01328         case DIM_CREATE:
01329             FindBitmap();
01330             SetLongGadgetValue(_R(IDC_BFXDLG_INTERP), TRUE); 
01331             SetLongGadgetValue(_R(IDC_BFXDLG_ASPECT), TRUE); 
01332             RescanSize=TRUE;
01333 
01334             // Disable this to begin with, until a new and different size is entered.
01335             EnableGadget(_R(ID_APPLY_NOW), FALSE);
01336             break;
01337 
01338         case DIM_OUT_OF_SPACE: // BODGE!!
01339             if (Msg->GadgetID == _R(IDC_BFXDLG_ORIGREDRAW))
01340                 RescanSize=TRUE;
01341             break;
01342 
01343         case DIM_SELECTION_CHANGED:
01344         case DIM_SLIDER_POS_SET:
01345         //case DIM_SLIDER_POS_CHANGING:
01346         case DIM_LFT_BN_CLICKED:
01347         case DIM_TEXT_CHANGED:             // Text changed 
01348         {
01349             m_UseInitial = FALSE;
01350             SetDirty();
01351             INT32 NewX = GetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE),0,10000000);
01352             INT32 NewY = GetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE),0,10000000);
01353             EnableGadget(_R(ID_APPLY_NOW),
01354                             NewX != (INT32) pOrigInfo->PixelWidth || NewY != (INT32) pOrigInfo->PixelHeight);
01355 
01356             if ((GetLongGadgetValue(_R(IDC_BFXDLG_ASPECT),0,1)!=0) && !ReEntered)
01357             {
01358                 switch (Msg->GadgetID)
01359                 {
01360                     case _R(IDC_BFXDLG_NEWXSIZE):
01361                         if (pOrigInfo->PixelWidth)
01362                         {
01363                             ReEntered = TRUE;
01364                             SetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE), (INT32)(0.5+ (
01365                                 ((double)(pOrigInfo->PixelHeight))/((double)(pOrigInfo->PixelWidth))*((double)(NewX)) )));
01366                             ReEntered = FALSE;
01367                         }
01368                         break;
01369                 
01370                     case _R(IDC_BFXDLG_NEWYSIZE):
01371                         if (pOrigInfo->PixelHeight)
01372                         {
01373                             ReEntered = TRUE;
01374                             SetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE), (INT32)(0.5+ (
01375                                 ((double)(pOrigInfo->PixelWidth))/((double)(pOrigInfo->PixelHeight))*((double)(NewY)) )));
01376                             ReEntered = FALSE;
01377                         }
01378                         break;
01379 
01380                     default:
01381                         break;
01382                 }
01383             }
01384             break;
01385         }
01386         case DIM_SOFT_COMMIT:
01387         case DIM_COMMIT:
01388             {
01389                 SetEffect(CC_RUNTIME_CLASS(ABFXResize));
01390                 INT32 NewX = GetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE),0,10000000);
01391                 INT32 NewY = GetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE),0,10000000);
01392                 if (NewX<2) NewX = 2;
01393                 if (NewY<2) NewY = 2;
01394                 SetParameters(NewX, NewY, (INT32)(BOOL)(GetLongGadgetValue(_R(IDC_BFXDLG_INTERP),0,1)!=0));
01395                 }
01396             break;
01397     }
01398 
01399     if (RescanSize && pOrigInfo)
01400     {
01401         ReEntered = TRUE;
01402         SetLongGadgetValue(_R(IDC_BFXDLG_ORIGXSIZE), pOrigInfo->PixelWidth);
01403         SetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE),  pOrigInfo->PixelWidth);
01404         SetLongGadgetValue(_R(IDC_BFXDLG_ORIGYSIZE), pOrigInfo->PixelHeight);
01405         SetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE),  pOrigInfo->PixelHeight);
01406         ReEntered = FALSE;
01407     }
01408 }

void BfxPlugInDlg::HandleSpecialEffectsMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[protected]
 

All messages generated from the tabbed dialog's page 1 get processed here.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Msg,: The message sent from page 1 of the dialog [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
BfxPlugInDlg::Message

Definition at line 1591 of file bfxdlg2.cpp.

01592 {
01593     //TalkToPage(_R(IDD_BFXPLUGINDLG_PG5));  // The Coords Page identifier
01594     switch(Msg->DlgMsg)
01595     {
01596         case DIM_CREATE:
01597             {
01598                 SetLongGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO), 0); 
01599                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM1), (INT32)(Matrix[0]+0.5));
01600                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM2), (INT32)(Matrix[1]+0.5));
01601                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM3), (INT32)(Matrix[2]+0.5));
01602                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM4), (INT32)(Matrix[3]+0.5));
01603                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM5), (INT32)(Matrix[4]+0.5));
01604                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM6), (INT32)(Matrix[5]+0.5));
01605                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM7), (INT32)(Matrix[6]+0.5));
01606                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM8), (INT32)(Matrix[7]+0.5));
01607                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM9), (INT32)(Matrix[8]+0.5));
01608                 SetGadgetRange(_R(IDC_BFXDLG_AMOUNT), 0, 127, 1);
01609                 SetGadgetBitmaps(_R(IDC_BFXDLG_AMOUNT), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01610                 SetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT), 64); 
01611 
01612                 DeleteAllValues(_R(IDC_BFXDLG_EFFECTCOMBO));
01613 
01614                 String_256 Str0(_R(IDS_BFXDLG_EFFECTMENU0));
01615                 String_256 Str1(_R(IDS_BFXDLG_EFFECTMENU1));
01616                 String_256 Str2(_R(IDS_BFXDLG_EFFECTMENU2));
01617                 String_256 Str3(_R(IDS_BFXDLG_EFFECTMENU3));
01618                 String_256 Str4(_R(IDS_BFXDLG_EFFECTMENU4));
01619                 String_256 Str5(_R(IDS_BFXDLG_EFFECTMENU5));
01620                 String_256 Str6(_R(IDS_BFXDLG_EFFECTMENU6));
01621                 String_256 Str7(_R(IDS_BFXDLG_EFFECTMENU7));
01622                 String_256 Str8(_R(IDS_BFXDLG_EFFECTMENU8));
01623                 String_256 Str9(_R(IDS_BFXDLG_EFFECTMENU9));
01624                 String_256 Str10(_R(IDS_BFXDLG_EFFECTMENU10));
01625                 String_256 Str11(_R(IDS_BFXDLG_EFFECTMENU11));
01626                 String_256 Str12(_R(IDS_BFXDLG_EFFECTMENU12));
01627                 String_256 Str13(_R(IDS_BFXDLG_EFFECTMENU13));
01628                 String_256 Str14(_R(IDS_BFXDLG_EFFECTMENU14));
01629                 String_256 Str15(_R(IDS_BFXDLG_EFFECTMENU15));
01630                 String_256 Str16(_R(IDS_BFXDLG_EFFECTMENU16));
01631                 String_256 Str17(_R(IDS_BFXDLG_EFFECTMENU17));
01632                 String_256 Str18(_R(IDS_BFXDLG_EFFECTMENU18));
01633                 String_256 Str19(_R(IDS_BFXDLG_EFFECTMENU19));
01634             
01635                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str0,FALSE, 0);
01636                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str1,FALSE, 1);
01637                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str2,FALSE, 2);
01638                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str3,FALSE, 3);
01639                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str4,FALSE, 4);
01640                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str5,FALSE, 5);
01641                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str6,FALSE, 6);
01642                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str7,FALSE, 7);
01643                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str8,FALSE, 8);
01644                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str9,FALSE, 9);
01645                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str10,FALSE, 10);
01646                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str11,FALSE, 11);
01647                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str12,FALSE, 12);
01648                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str13,FALSE, 13);
01649                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str14,FALSE, 14);
01650                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str15,FALSE, 15);
01651                 if (IsUserName("Neville"))
01652                 {
01653                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str16,FALSE, 16);
01654                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str17,FALSE, 17);
01655                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str18,FALSE, 18);
01656                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str19,FALSE, 19);
01657                 }           
01658                 
01659                 
01660                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str11, FALSE, -1);
01661                 SetComboListLength(_R(IDC_BFXDLG_EFFECTCOMBO));
01662                 SetSelectedValueIndex(_R(IDC_BFXDLG_EFFECTCOMBO), 11);
01663             }
01664             //break; RUN THROUGH
01665 
01666         case DIM_SLIDER_POS_SET:
01667             if(Msg->DlgMsg != DIM_CREATE)
01668             {
01669                 m_UseInitial = FALSE;
01670             }
01671         //case DIM_SLIDER_POS_CHANGING:
01672         case DIM_LFT_BN_CLICKED:
01673         case DIM_SELECTION_CHANGED:
01674         case DIM_TEXT_CHANGED:             // Text changed 
01675             {
01676                 SetDirty();
01677                 INT32 Choice = GetSelectedValueIndex(_R(IDC_BFXDLG_EFFECTCOMBO));
01678                 BOOL GreyAmount = (Choice <= 9);
01679                 BOOL GreyCustom = (Choice != 0);
01680                 EnableGadget(_R(IDC_BFXDLG_CUSTOM1), !GreyCustom);
01681                 EnableGadget(_R(IDC_BFXDLG_CUSTOM2), !GreyCustom);
01682                 EnableGadget(_R(IDC_BFXDLG_CUSTOM3), !GreyCustom);
01683                 EnableGadget(_R(IDC_BFXDLG_CUSTOM4), !GreyCustom);
01684                 EnableGadget(_R(IDC_BFXDLG_CUSTOM5), !GreyCustom);
01685                 EnableGadget(_R(IDC_BFXDLG_CUSTOM6), !GreyCustom);
01686                 EnableGadget(_R(IDC_BFXDLG_CUSTOM7), !GreyCustom);
01687                 EnableGadget(_R(IDC_BFXDLG_CUSTOM8), !GreyCustom);
01688                 EnableGadget(_R(IDC_BFXDLG_CUSTOM9), !GreyCustom);
01689                 EnableGadget(_R(IDC_BFXDLG_AMOUNT), !GreyAmount);
01690                 EnableGadget(_R(IDC_BFXDLG_AMOUNTTXT), !GreyAmount);
01691             }
01692             
01693             if (Msg->DlgMsg == DIM_CREATE) break; else *pCommitValues = TRUE;
01694 
01695         case DIM_SOFT_COMMIT:
01696                 m_UseInitial = FALSE;
01697         case DIM_COMMIT:
01698             {
01699                 INT32 Choice = GetSelectedValueIndex(_R(IDC_BFXDLG_EFFECTCOMBO));
01700                 Matrix[0]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM1),-255.0,255.0);
01701                 Matrix[1]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM2),-255.0,255.0);
01702                 Matrix[2]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM3),-255.0,255.0);
01703                 Matrix[3]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM4),-255.0,255.0);
01704                 Matrix[4]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM5),-255.0,255.0);
01705                 Matrix[5]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM6),-255.0,255.0);
01706                 Matrix[6]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM7),-255.0,255.0);
01707                 Matrix[7]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM8),-255.0,255.0);
01708                 Matrix[8]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM9),-255.0,255.0);
01709 
01710                 switch (Choice)
01711                 {
01712                     case 0:
01713                     case 1:
01714                     case 2:
01715                     case 3:
01716                     case 4:
01717                     case 5:
01718                     case 6:
01719                     case 7:
01720                     case 8:
01721                     case 9:
01722                         SetEffect(CC_RUNTIME_CLASS(ABFXSpecialEffect));
01723                         SetParameters((INT32) Choice);
01724                         break;
01725                     case 10:
01726                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01727                         SetParameters(((INT32) 127-GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)), 1);
01728                         break;
01729                     case 11:
01730                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01731                         SetParameters(((INT32) 127-GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)), 2);
01732                         break;
01733                     case 12:
01734                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01735                         SetParameters(((INT32) 127-GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)), 3);
01736                         break;
01737                     case 13:
01738                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01739                         SetParameters(((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127))-127, 1);
01740                         break;
01741                     case 14:
01742                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01743                         SetParameters(((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127))-127, 2);
01744                         break;
01745                     case 15:
01746                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01747                         SetParameters(((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127))-127, 3);
01748                         break;
01749                     case 16:
01750                     case 17:
01751                     case 18:
01752                     case 19:
01753                         SetEffect(CC_RUNTIME_CLASS(ABFXRemoveDither));
01754                         SetParameters((127-((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)))<<1, 30, Choice-16);
01755                         break;
01756                 }                                           
01757             }
01758 
01759     }
01760 }

BOOL BfxPlugInDlg::Init void   )  [static]
 

The standard Init fn for the op.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 1888 of file bfxdlg2.cpp.

01889 {  
01890     GetApplication()->DeclareSection( "Bitmap Effects", 1);
01891     GetApplication()->DeclarePref( "Bitmap Effects", "Interactive Brightness & Contrast", &InteractiveBCC, FALSE, TRUE);
01892     
01893     BOOL ok = TRUE; 
01894     ok = ok && RegisterOpDescriptor(
01895                                     0,                         // Tool ID                    
01896                                     _R(IDS_BFXDLGM),               // String resource ID        
01897                                     CC_RUNTIME_CLASS(BfxBrightnessContrastDlg),  // Runtime class              
01898                                     OPTOKEN_BFXDLG_BRIGHTNESSCONTRAST,             // Token string               
01899                                     BfxPlugInDlg::GetState,     // GetState function          
01900                                     0,  /* help ID */           // Help ID                    
01901                                     NULL,                       // Bubble ID                  
01902                                     NULL,                       // Resource ID                
01903                                     NULL,                       // Control ID                 
01904                                     SYSTEMBAR_ILLEGAL,         // Bar ID                     
01905                                     TRUE,                      // Recieve system messages    
01906                                     FALSE,                     // Smart duplicate operation  
01907                                     TRUE,                      // Clean operation            
01908                                     0,                         // No vertical counterpart
01909                                     _R(IDS_BFXDLG_ONE),            // String for one copy only
01910                                     GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE
01911                                     );
01912     ok = ok && RegisterOpDescriptor(
01913                                     0,                         // Tool ID                    
01914                                     _R(IDS_BFXDLGM),               // String resource ID        
01915                                     CC_RUNTIME_CLASS(BfxSpecialEffectsDlg),  // Runtime class              
01916                                     OPTOKEN_BFXDLG_SPECIALEFFECTS,             // Token string               
01917                                     BfxPlugInDlg::GetState,     // GetState function          
01918                                     0,  /* help ID */           // Help ID                    
01919                                     NULL,                       // Bubble ID                  
01920                                     NULL,                       // Resource ID                
01921                                     NULL,                       // Control ID                 
01922                                     SYSTEMBAR_ILLEGAL,         // Bar ID                     
01923                                     TRUE,                      // Recieve system messages    
01924                                     FALSE,                     // Smart duplicate operation  
01925                                     TRUE,                      // Clean operation            
01926                                     0,                         // No vertical counterpart
01927                                     _R(IDS_BFXDLG_ONE),            // String for one copy only
01928                                     GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE
01929                                     );
01930     ok = ok && RegisterOpDescriptor(
01931                                     0,                         // Tool ID                    
01932                                     _R(IDS_BFXDLGM),               // String resource ID        
01933                                     CC_RUNTIME_CLASS(BfxResizeDlg),  // Runtime class              
01934                                     OPTOKEN_BFXDLG_RESIZE,         // Token string               
01935                                     BfxPlugInDlg::GetState,     // GetState function          
01936                                     0,  /* help ID */           // Help ID                    
01937                                     NULL,                       // Bubble ID                  
01938                                     NULL,                       // Resource ID                
01939                                     NULL,                       // Control ID                 
01940                                     SYSTEMBAR_ILLEGAL,         // Bar ID                     
01941                                     TRUE,                      // Recieve system messages    
01942                                     FALSE,                     // Smart duplicate operation  
01943                                     TRUE,                      // Clean operation            
01944                                     0,                         // No vertical counterpart
01945                                     _R(IDS_BFXDLG_ONE),            // String for one copy only
01946                                     GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE
01947                                     );
01948     ok = ok && RegisterOpDescriptor(
01949                                     0,                         // Tool ID                    
01950                                     _R(IDS_BFXDLGM),               // String resource ID        
01951                                     CC_RUNTIME_CLASS(BfxFlipAndRotateDlg),  // Runtime class              
01952                                     OPTOKEN_BFXDLG_FLIPROTATE,     // Token string               
01953                                     BfxPlugInDlg::GetState,     // GetState function          
01954                                     0,  /* help ID */           // Help ID                    
01955                                     NULL,                       // Bubble ID                  
01956                                     NULL,                       // Resource ID                
01957                                     NULL,                       // Control ID                 
01958                                     SYSTEMBAR_ILLEGAL,         // Bar ID                     
01959                                     TRUE,                      // Recieve system messages    
01960                                     FALSE,                     // Smart duplicate operation  
01961                                     TRUE,                      // Clean operation            
01962                                     0,                         // No vertical counterpart
01963                                     _R(IDS_BFXDLG_ONE),            // String for one copy only
01964                                     GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE
01965                                     );
01966     ok = ok && RegisterOpDescriptor(
01967                                     0,                         // Tool ID                    
01968                                     _R(IDS_BFXDLGM),               // String resource ID        
01969                                     CC_RUNTIME_CLASS(BfxColourDepthDlg),  // Runtime class              
01970                                     OPTOKEN_BFXDLG_COLOURDEPTH,            // Token string               
01971                                     BfxPlugInDlg::GetState,     // GetState function          
01972                                     0,  /* help ID */           // Help ID                    
01973                                     NULL,                       // Bubble ID                  
01974                                     NULL,                       // Resource ID                
01975                                     NULL,                       // Control ID                 
01976                                     SYSTEMBAR_ILLEGAL,         // Bar ID                     
01977                                     TRUE,                      // Recieve system messages    
01978                                     FALSE,                     // Smart duplicate operation  
01979                                     TRUE,                      // Clean operation            
01980                                     0,                         // No vertical counterpart
01981                                     _R(IDS_BFXDLG_ONE),            // String for one copy only
01982                                     GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE
01983                                     );
01984 
01985     ok = ok && BfxOp::Init();
01986 
01987     return ok;
01988 } 

MsgResult BfxPlugInDlg::Message Msg Message  )  [virtual]
 

This is the message handler for the BfxPlugInDlg.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
Message,: The message [INPUTS]
Returns:
OK Message handled ok (return this even if you don't need to respond to the message).
FAIL Something terrible happened whilst processing the message eg. we ran out of memory. You must set ERROR if you are returning this value.

EAT_MSG The Message was handled ok but don't send it to any more MessageHandlers.

Reimplemented from DialogOp.

Definition at line 949 of file bfxdlg2.cpp.

00950 {
00951     if (IS_OUR_DIALOG_MSG(Message))
00952     {
00953         DialogMsg* Msg = ((DialogMsg*) Message); 
00954         
00955         BOOL EndDialog = FALSE;     // TRUE if we should quit the dialog
00956         BOOL CommitValues = FALSE;  // TRUE if we should commit the dialog values
00957 
00958         // Determine from what page the message originated
00959         if (OpenPage) switch (OpenPage)
00960         {
00961             case _R(IDD_BFXPLUGINDLG_PG1):
00962                 HandleFlipAndRotateMsg(Msg, &CommitValues, &EndDialog); 
00963                 break;
00964             case _R(IDD_BFXPLUGINDLG_PG2):
00965                 HandleResizeMsg(Msg, &CommitValues, &EndDialog); 
00966                 break;
00967             case _R(IDD_BFXPLUGINDLG_PG3):
00968                 HandleBrightnessAndContrastMsg(Msg, &CommitValues, &EndDialog); 
00969                 break;
00970             case _R(IDD_BFXPLUGINDLG_PG4):
00971                 HandleDitherMsg(Msg, &CommitValues, &EndDialog); 
00972                 break;
00973             case _R(IDD_BFXPLUGINDLG_PG5):
00974                 HandleSpecialEffectsMsg(Msg, &CommitValues, &EndDialog); 
00975                 break;
00976             case _R(IDD_BFXPLUGINDLG_PG6):
00977                 HandleAlchemistMsg(Msg, &CommitValues, &EndDialog); 
00978                 break;
00979             default:
00980                 ERROR3("Message from unknown tab dialog page"); 
00981         }
00982 
00983         switch (Msg->DlgMsg)
00984         {
00985             case DIM_CREATE:
00986                 pOriginal=NULL;
00987                 FindBitmap();
00988                 FixOriginalComboBox();
00989                 SetDirty();
00990                 break;
00991             
00992             case DIM_COMMIT:        // Want to commit and quit
00993                 EndDialog = TRUE;
00994                 CommitValues = TRUE; 
00995                 break;
00996 
00997             case DIM_SOFT_COMMIT:   // Want to commit
00998                 CommitValues = TRUE; 
00999                 break; 
01000 
01001             case DIM_CANCEL:        // Want to quit
01002                 if (!(IsCustomComboDropdownVisible (_R(IDC_BFXDLG_ORIGCOMBO))))
01003                 {
01004                     EndDialog = TRUE;
01005                 }
01006                 else
01007                 {
01008                     CloseDropdown (_R(IDC_BFXDLG_ORIGCOMBO), FALSE);
01009                 }
01010                 break;
01011 
01012         // These are common to all pages, and get passed on to the pages themselves
01013             case DIM_SET_ACTIVE:
01014                 CheckOriginalBitmap();
01015                 FixOriginalComboBox();
01016                 SetDirty();
01017                 break;
01018 
01019             case DIM_REDRAW :
01020                 // This is where all the redrawing is done
01021                 // Which control in the window is sending the redraw message (if there are many
01022                 // grdraw controls you can tell which is which from the Gadget ID
01023                 switch (Msg->GadgetID)
01024                 {
01025                     // Draw the redraw_me control in here
01026                     case _R(IDC_BFXDLG_ORIGREDRAW) :
01027                     {
01028                         RenderBitmap((ReDrawInfoType*) Msg->DlgMsgParam, pOriginal);
01029                         break;
01030                     }
01031                     case _R(IDC_BFXDLG_ORIGREDRAW2) :
01032                     {
01033                         RenderBitmap((ReDrawInfoType*) Msg->DlgMsgParam, pDestination);
01034                         break;
01035                     }
01036                 }
01037                 break;
01038             
01039             case DIM_SELECTION_CHANGED:
01040                 switch (Msg->GadgetID)
01041                 {
01042                     // Draw the redraw_me control in here
01043                     case _R(IDC_BFXDLG_ORIGCOMBO) :
01044                     {
01045                         ReadOriginalComboBox();
01046                         break;
01047                     }
01048                 }
01049                 break;                                                 
01050         }
01051 
01052         // Commit values here
01053         if (CommitValues)
01054         {
01055             if (pOriginal)
01056             {
01057                 if (pFX)
01058                 {
01059                     if (!Clean)
01060                     {
01061                         // Check to see if we`re exiting without doing anything to a converted 32bit BMP
01062                 /*      if(Msg->DlgMsg == DIM_COMMIT && m_UseInitial)
01063                         {
01064                             // Right, we`ve got to rename it or the Destructor will delete it!
01065                             // Get The Current Name and then chop off the "(Copy)"
01066                             StringBase Current;
01067                             Current.Alloc(256);
01068                             pOriginal->GetName().Left(&Current,pOriginal->GetName().Length() - 13);
01069                             String_256 NewName = (TCHAR*)Current;
01070 
01071                             // Set the name with the new string! Now there should be two bitmaps with the
01072                             // same name, but one will be 32bit and the other this 24bit copy!
01073                             pOriginal->SetName(NewName);
01074                         }
01075 
01076                     */
01077                         ClearDestination();
01078 
01079                         // Bodge to avoid progress bar on interactive B&C
01080 /*                      if (Msg->DlgMsg==DIM_COMMIT || Msg->DlgMsg==DIM_SOFT_COMMIT)
01081                         {
01082                             BeginSlowJob(100, FALSE, &String_64(_R(IDS_BFXDLG_PROCESSING)));
01083                             ContinueSlowJob();
01084                         }
01085 */                      
01086                         BeginSlowJob();
01087                         BeginBusyCursor();
01088                         
01089                         pFX->SetParameters(Param1, Param2, Param3, Matrix);
01090                         pDestination = pFX->GetProcessedBitmap(pOriginal);
01091 
01092 /*                      if (Msg->DlgMsg==DIM_COMMIT || Msg->DlgMsg==DIM_SOFT_COMMIT)
01093                         {
01094                             ContinueSlowJob(99);
01095                             EndSlowJob();
01096                         }
01097 */                      
01098                         EndBusyCursor();
01099                         EndSlowJob();
01100                         
01101                         if (!pDestination)  
01102                         {
01103                             InformError ();
01104                             EndDialog = FALSE;          // an error occured - we don't want to close the dialog!
01105                         }
01106                         else
01107                         {
01108                             DestinationChanged();
01109                             Clean=TRUE;
01110                         }
01111                     }
01112                 }
01113                 else
01114                 {
01115                     TRACEUSER( "Neville", _T("Wierd - he didn't actually ask for an effect..."));
01116                     // Check to see if we`re exiting without doing anything to a converted 32bit BMP
01117                     if(Msg->DlgMsg == DIM_COMMIT && m_UseInitial)
01118                     {
01119                         // Right, we`ve got to rename it or the Destructor will delete it!
01120                         // Get The Current Name and then chop off the "(Copy)"
01121                         StringBase Current;
01122                         Current.Alloc(256);
01123                         pOriginal->GetName().Left(&Current,pOriginal->GetName().Length() - 13);
01124                         String_256 NewName = (TCHAR*)Current;
01125 
01126                         // Set the name with the new string! Now there should be two bitmaps with the
01127                         // same name, but one will be 32bit and the other this 24bit copy!
01128                         pOriginal->SetName(NewName);
01129                     }
01130                 }
01131             }
01132         }
01133 
01134         // End dialog here
01135         if (EndDialog)  // Dialog communication over 
01136         {   
01137             // **** Warning ****
01138             // This assumes that the dialog box is modal and so the OpParam is still around
01139             // rather than having been deleted 
01140             if (m_pParam != NULL)
01141             {
01142                 // return the ok/cancel state to the caller
01143                 if (m_pParam->Output != NULL)
01144                     *(m_pParam->Output) = CommitValues;
01145                 // return a default of a null bitmap to the caller
01146                 m_pParam->Param1 = NULL;
01147             }
01148 
01149             if (pOriginal != NULL && CommitValues && pDestination != NULL)
01150             {
01151                 OpenPage = 0;
01152                 //TalkToPage(0);
01153 
01154                 // The bitmap created is a temp bitmap, so we need to add it properly to the system.
01155                 // So we'll extract the OILBitmap (which will delete the KBmp),
01156                 // and create a 'proper' kbmp to attach to the node
01157                 OILBitmap * pDestWinBitmap = pDestination->ExtractOILBitmap();
01158 
01159                 // See if this matches an existing bitmap, otherwise this will create a new kernel
01160                 // bitmap for us.
01161                 KernelBitmap * pDestBitmap = NULL;
01162                 BitmapList * pBmpList = NULL;
01163                 // The bitmap system relies on the Current Doc being correct,
01164                 // so we'll set it to be on the safe side
01165                 BOOL IsNew = TRUE;
01166                 if (m_pDocument)
01167                 {
01168                     m_pDocument->SetCurrent();
01169                     //pDestBitmap = KernelBitmap::MakeKernelBitmap(pDestWinBitmap, m_pDocument);
01170                     pDestBitmap = KernelBitmap::TryAndUseExistingBitmap(pDestWinBitmap, m_pDocument, &IsNew);
01171                     pBmpList = m_pDocument->GetBitmapList();
01172                     ERROR3IF(pBmpList == NULL,"No document bitmap ref found!");
01173                 }
01174 
01175                 // Try and add it to the list of bitmaps already present in this document
01176                 if (pDestBitmap != NULL && pBmpList != NULL)
01177                 {
01178                     // and then attach the bitmap
01179                     pDestBitmap->Attach(pBmpList);
01180                     
01181                     // remove this pointer so that the new bitmap does not get deleted
01182                     // pDestBitmap is more than likely equal to pDestination
01183                     //if (!IsNew) This always seems to be true
01184                     pDestination = NULL;
01185 
01186                     // tell everybody about the new bitmap in the system
01187                     BROADCAST_TO_ALL(BitmapListChangedMsg(pBmpList, pDestBitmap)); 
01188 
01189                     // return the output bitmap to the caller
01190                     if (m_pParam)
01191                         m_pParam->Param1 = (INT32)pDestBitmap;
01192                 }
01193                 else
01194                     ERROR3("Couldn't add bitmap into system");
01195             }
01196 
01197             ClearDestination();
01198 
01199             Close();           
01200 //          TRACEUSER( "Neville", _T("Calling End()\n"));
01201             End();      // End of dialog 
01202         }
01203         //return (DLG_EAT_IF_HUNGRY(Msg));   // I return EAT_MSG unless the message needs to be sent to all dialogs 
01204     } else if (MESSAGE_IS_A(Message, SelChangingMsg))       // Selection changed - use new bitmap
01205     {
01206         //if (OpenPage) TalkToPage(OpenPage);
01207         SelChangingMsg *Msg = (SelChangingMsg *) Message;
01208         switch ( Msg->State )
01209         {
01210             case SelChangingMsg::SelectionState::SELECTIONCHANGED:
01211             case SelChangingMsg::SelectionState::NODECHANGED:
01212 //              pOriginal=NULL;
01213                 FindBitmap();
01214                 break;
01215         }
01216     } else if (MESSAGE_IS_A(Message, BitmapListChangedMsg))     // Selection changed - use new bitmap
01217     {
01218         //if (OpenPage) TalkToPage(OpenPage);
01219         CheckOriginalBitmap();
01220         FixOriginalComboBox();
01221     } else if (MESSAGE_IS_A(Message, BfxMsg))
01222     {
01223         //if (OpenPage) TalkToPage(OpenPage);
01224         pOriginal=((BfxMsg*)(Message))->pBitmap;
01225         CheckOriginalBitmap();
01226     }
01227 
01228     return DialogOp::Message(Message);
01229 } 

BOOL BfxPlugInDlg::OriginalChanged  )  [protected]
 

Invalidates area for original bitmap, marks no destination as yet.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 325 of file bfxdlg2.cpp.

00326 {
00327     if (pPrevOriginal==pOriginal) return TRUE;
00328     pPrevOriginal=pOriginal;
00329 
00330     if (!pOrigInfo)
00331     {
00332         pOrigInfo = new BitmapInfo;
00333         if (!pOrigInfo) return FALSE; // error already set.
00334     }
00335 
00336     pOrigInfo->PixelWidth = 100;
00337     pOrigInfo->PixelHeight = 100;
00338     pOrigInfo->PixelDepth = 24;
00339     if (pOriginal && pOrigInfo) // Should always be true
00340     {
00341         pOriginal->ActualBitmap->GetInfo(pOrigInfo);
00342     }
00343 
00344     if (SetDirty() && (OpenPage != 0))
00345     {
00346         InvalidateGadget(_R(IDC_BFXDLG_ORIGREDRAW));
00347     }
00348 
00349     BROADCAST_TO_CLASS(DialogMsg(WindowID, DIM_OUT_OF_SPACE, _R(IDC_BFXDLG_ORIGREDRAW),
00350                        0, OpenPage) ,DialogOp);  // Pretty horrible bodge
00351 
00352     return FixOriginalComboBox();
00353 }

BOOL BfxPlugInDlg::ReadOriginalComboBox  )  [protected]
 

Chooses a different bitmap from the combo box.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-
This routine is heavilly copied from one within the fill tool

Definition at line 804 of file bfxdlg2.cpp.

00805 {
00806     if (!OpenPage) return FALSE;
00807 
00808     Document * pDoc = Document::GetSelected();
00809 
00810     // Get the bitmap list
00811     BitmapList* Bitmaps = NULL;
00812     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00813 
00814     if (Bitmaps == NULL)
00815         return TRUE;
00816 
00817     ListItem* pBmp = Bitmaps->GetHead();
00818 
00819     WORD Index;
00820     GetValueIndex(_R(IDC_BFXDLG_ORIGCOMBO),&Index); 
00821 
00822     for (INT32 i = 0; i < Index; i++)
00823     {
00824         if (pBmp == NULL)
00825             break;
00826 
00827         pBmp = Bitmaps->GetNext(pBmp);
00828     }
00829 
00830     pOriginal = (KernelBitmap*)pBmp; // Might be NULL (conceivably)
00831     return CheckOriginalBitmap();
00832 }

void BfxPlugInDlg::Remove24BitTempCopy  )  [protected]
 

Definition at line 241 of file bfxdlg2.cpp.

00242 {
00243     // Get the selected Document
00244     Document * pDoc = Document::GetSelected();
00245 
00246     // Get the bitmap list
00247     BitmapList* Bitmaps = NULL;
00248     if (pDoc)
00249     {
00250         Bitmaps = pDoc->GetBitmapList();
00251     }
00252 
00253     // Get the first bitmap out of the bitmap list
00254     KernelBitmap * pBmp = (KernelBitmap *)(Bitmaps->GetHead());
00255     KernelBitmap * pTemp = NULL;
00256 
00257     POSITION Pos = NULL;
00258     BOOL DeleteThisBMP = FALSE;
00259 
00260     // If we`ve got a valid BMP then do some testing!
00261     while (pBmp != NULL)
00262     {
00263         // Get the first Copy Name from our list
00264         Pos = m_p24BitCopyNames.GetHeadPosition();
00265 
00266         // While the Position and the BMP are both valid do the check!
00267         while(Pos != NULL && pBmp != NULL)
00268         {
00269             // Check to see if the BMP`s name matches the one held in the copy list
00270             if (pBmp->GetName().CompareTo(m_p24BitCopyNames.GetAt(Pos)) == 0)
00271             {
00272                 // Mark this BMP For deletion!
00273                 DeleteThisBMP = TRUE;
00274 
00275                 // Now break out of this while loop!
00276                 break;
00277             }
00278 
00279             // Get the next name from the copy name list
00280             m_p24BitCopyNames.GetNext(Pos);
00281         }
00282 
00283         // If this isn`t the one then get the next in the list!
00284         pTemp = (KernelBitmap *) Bitmaps->GetNext(pBmp);
00285 
00286         // If the flag has been set then delete it!
00287         if(DeleteThisBMP)
00288         {
00289             // Remove it, Detach it, delete it and then just for good measure NULL it!!!
00290             Bitmaps->RemoveItem(pBmp);
00291             pBmp->Detach();
00292             delete pBmp;
00293             pBmp = NULL;
00294 
00295             // Reset the Delete flag
00296             DeleteThisBMP = FALSE;
00297         }
00298 
00299         // Set the Current BMP with the Temp
00300         pBmp = pTemp;
00301     }
00302 
00303     // Finished with everything so make sure the list is totally empty!
00304     while(!m_p24BitCopyNames.IsEmpty())
00305     {
00306         m_p24BitCopyNames.RemoveHead();
00307     }
00308 }

BOOL BfxPlugInDlg::RenderBitmap ReDrawInfoType ExtraInfo,
KernelBitmap BitmapToUse
[protected]
 

Fills a renderable control with a bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
ExtraInfo - The structure that has the extra data we need to start rendering [INPUTS] BitmapToUse - The bitmap to render
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 850 of file bfxdlg2.cpp.

00851 {
00852     // Go get a render region
00853     DocRect VirtualSize(0, 0, ExtraInfo->dx, ExtraInfo->dy);
00854     RenderRegion* pRender = CreateGRenderRegion(&VirtualSize, ExtraInfo);
00855     if (pRender!=NULL)
00856     {
00857         pRender->m_DoCompression = TRUE;
00858 
00859         DialogColourInfo RedrawColours;     // Get a supplier for default dlg colours
00860 
00861         // A Grey colour [...hmmm, it's not a very grey grey any more... oragnge more like]
00862         DocColour Grey(255,200,0);
00863 
00864         // Render the attributes and the a rectangle
00865         pRender->SaveContext();
00866         pRender->SetLineColour(COLOUR_TRANS);
00867 
00868             // Draw a rectangle to fill in the background - Fill with Dialogue Background colour
00869         pRender->SetFillColour(RedrawColours.DialogBack());
00870         pRender->DrawRect(&VirtualSize);
00871     
00872         if (BitmapToUse)
00873         {
00874 
00875             NodeBitmap NB;
00876             NodeBitmap * pNodeBitmap = &NB;
00877         
00878             if (!((pNodeBitmap == NULL) || (!pNodeBitmap->SetUpPath(12,12))))
00879             {
00880                 // Get a new bitmap object for this node.
00881                 pNodeBitmap->GetBitmapRef()->SetBitmap(BitmapToUse);
00882                         
00883                 ENSURE(pNodeBitmap->GetBitmap()->ActualBitmap != NULL, "No bitmap object found!");
00884         
00885                 DocRect BitmapSize(VirtualSize);
00886                 BitmapInfo BMInfo;
00887                 BitmapToUse->ActualBitmap->GetInfo(&BMInfo);
00888                 if (BMInfo.PixelWidth==0) BMInfo.PixelWidth=1;
00889                 if (BMInfo.PixelHeight==0) BMInfo.PixelHeight=1;
00890 
00891                 double BMAspect = ((double)(BMInfo.PixelWidth))/((double)(BMInfo.PixelHeight));
00892                 double RedrawAspect = ((double)(ExtraInfo->dx))/((double)(ExtraInfo->dy));
00893 
00894                 if (BMAspect>RedrawAspect)
00895                 {
00896                     // grey at top and bottom
00897                     INT32 NewHeight = (INT32)( 0.5 + ((double)(VirtualSize.Width()))/BMAspect);
00898                     if (NewHeight<1) NewHeight = 1;
00899                     BitmapSize.loy = (VirtualSize.Height()-NewHeight)/2;
00900                     BitmapSize.hiy = BitmapSize.loy + NewHeight;
00901                 }
00902                 else
00903                 {
00904                     // grey on left and right
00905                     INT32 NewWidth = (INT32)( 0.5 + ((double)(VirtualSize.Height()))*BMAspect);
00906                     if (NewWidth<1) NewWidth = 1;
00907                     BitmapSize.lox = (VirtualSize.Width()-NewWidth)/2;
00908                     BitmapSize.hix = BitmapSize.lox + NewWidth;
00909                 }
00910 
00911                 // And set this in our bitmap node
00912                 pNodeBitmap->CreateShape(BitmapSize);
00913                     
00914                 pNodeBitmap->Render(pRender);
00915             }
00916         }
00917 
00918         pRender->RestoreContext();
00919 
00920         // Get rid of the render region
00921         DestroyGRenderRegion(pRender);
00922     }
00923     return TRUE;
00924 }

BOOL BfxPlugInDlg::SetDirty BOOL  Redraw = TRUE  )  [protected]
 

Clears the clean flag and deletes the effect.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 402 of file bfxdlg2.cpp.

00403 {
00404     if (!ClearDestination(Redraw)) return FALSE;
00405     Clean = FALSE;
00406     if (pFX)
00407     {
00408         delete pFX;
00409         pFX = NULL;
00410     }
00411     return TRUE;
00412 }

BOOL BfxPlugInDlg::SetEffect CCRuntimeClass Effect  )  [protected]
 

Choses the bitmap effect for processing.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
Effect = runtime class of effect to be used, or none. [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None at present

See also:
-

Definition at line 370 of file bfxdlg2.cpp.

00371 {
00372     if (pFX)
00373     {
00374         if (pFX->GetRuntimeClass() == Effect) return TRUE;
00375         delete pFX;
00376         pFX = NULL;
00377     }
00378     if (Effect)
00379     {
00380         pFX = (AccusoftBitmapEffect *) (Effect->CreateObject());
00381         if (!pFX) return FALSE;
00382         return pFX->SetParameters(Param1, Param2, Param3, Matrix);
00383     }
00384     else return TRUE;
00385 }

BOOL BfxPlugInDlg::SetParameters INT32  p1 = 0,
INT32  p2 = 0,
INT32  p3 = 0
[inline, protected]
 

Definition at line 173 of file bfxdlg2.h.

00174                     { Param1=p1; Param2=p2; Param3=p3; return TRUE;};


Member Data Documentation

BOOL BfxPlugInDlg::Clean [protected]
 

Definition at line 189 of file bfxdlg2.h.

UINT32 BfxPlugInDlg::IDD = _R(IDD_BFXDLG) [static]
 

Definition at line 151 of file bfxdlg2.h.

BOOL BfxPlugInDlg::InteractiveBCC = TRUE [static, protected]
 

Definition at line 198 of file bfxdlg2.h.

CList< String_256, String_256 > BfxPlugInDlg::m_p24BitCopyNames [protected]
 

Definition at line 191 of file bfxdlg2.h.

Document* BfxPlugInDlg::m_pDocument [protected]
 

Definition at line 200 of file bfxdlg2.h.

OpParam* BfxPlugInDlg::m_pParam [protected]
 

Definition at line 201 of file bfxdlg2.h.

BOOL BfxPlugInDlg::m_UseInitial [protected]
 

Definition at line 192 of file bfxdlg2.h.

double BfxPlugInDlg::Matrix[9] [protected]
 

Definition at line 158 of file bfxdlg2.h.

const CDlgMode BfxPlugInDlg::Mode = MODAL [static]
 

Definition at line 148 of file bfxdlg2.h.

CDlgResID BfxPlugInDlg::OpenPage [protected]
 

Definition at line 196 of file bfxdlg2.h.

INT32 BfxPlugInDlg::Param1 [protected]
 

Definition at line 155 of file bfxdlg2.h.

INT32 BfxPlugInDlg::Param2 [protected]
 

Definition at line 156 of file bfxdlg2.h.

INT32 BfxPlugInDlg::Param3 [protected]
 

Definition at line 157 of file bfxdlg2.h.

KernelBitmap* BfxPlugInDlg::pDestination [protected]
 

Definition at line 186 of file bfxdlg2.h.

AccusoftBitmapEffect* BfxPlugInDlg::pFX [protected]
 

Definition at line 194 of file bfxdlg2.h.

KernelBitmap* BfxPlugInDlg::pOriginal [protected]
 

Definition at line 185 of file bfxdlg2.h.

BitmapInfo* BfxPlugInDlg::pOrigInfo [protected]
 

Definition at line 188 of file bfxdlg2.h.

KernelBitmap* BfxPlugInDlg::pPrevOriginal [protected]
 

Definition at line 187 of file bfxdlg2.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:12 2007 for Camelot by  doxygen 1.4.4