BfxDlg Class Reference

#include <bfxdlg.h>

Inheritance diagram for BfxDlg:

DialogTabOp DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 BfxDlg ()
 The Constructor of the DialogTabOp derived class simply sets modality of the dialog, and it's ID.
 ~BfxDlg ()
 Destructor.
MsgResult Message (Msg *Message)
 This is the message handler for the BfxDlg.
void Do (OpDescriptor *)
 Like all Do functions invokes the BfxDlg.
void DoWithParam (OpDescriptor *pOp, OpParam *pParam)
 Performs the BfxOp for the first time.
virtual BOOL RegisterYourPagesInOrderPlease ()
 This virtual function will get called to give you a chance to add pages to your DialogTabOp. This function will usually make multiple calls to AddAPage to register the initial set of pages to be contained in the tab dialog. The pages should all be the same size and be registered in the left to right order in which you wish them to appear.

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 = MODELESS
static const UINT32 IDD = _R(IDD_BFXDLG)

Private 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.
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.

Private Attributes

INT32 Param1
INT32 Param2
INT32 Param3
double Matrix [9]
KernelBitmappOriginal
KernelBitmappDestination
KernelBitmappPrevOriginal
BitmapInfopOrigInfo
BOOL Clean
AccusoftBitmapEffectpFX
CDlgResID OpenPage

Static Private Attributes

static BOOL InteractiveBCC = TRUE

Detailed Description

Definition at line 179 of file bfxdlg.h.


Constructor & Destructor Documentation

BfxDlg::BfxDlg  ) 
 

The Constructor of the DialogTabOp derived class simply sets modality of the dialog, and it's ID.

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

Definition at line 172 of file bfxdlg.cpp.

00172               : DialogTabOp(BfxDlg::IDD, BfxDlg::Mode) 
00173 {
00174     OpenPage = 0;
00175     pOriginal = NULL;
00176     pDestination = NULL;
00177     pPrevOriginal=NULL;
00178     pOrigInfo = NULL;
00179     Clean = FALSE;
00180     pFX = NULL;
00181     SetParameters();
00182     for (INT32 i = 0; i<=8; i++) Matrix[i]=(i==4)?1.0:0.0;
00183 }        

BfxDlg::~BfxDlg  ) 
 

Destructor.

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

Definition at line 195 of file bfxdlg.cpp.

00196 {
00197     if (pFX) delete pFX;
00198     if (pDestination) {TRACEUSER( "Alex", _T("Destructor deleting destination\n"));delete pDestination;}
00199     if (pOrigInfo) delete pOrigInfo;
00200 }        


Member Function Documentation

BOOL BfxDlg::CheckOriginalBitmap  )  [private]
 

Ensures pOriginal points to a valid bitmap in this document.

Author:
Alex_Bligh (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 431 of file bfxdlg.cpp.

00432 {
00433     Document * pDoc = Document::GetSelected();
00434 
00435     // Get the bitmap list
00436     BitmapList* Bitmaps = NULL;
00437     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00438 
00439     if (Bitmaps == NULL)
00440     {
00441         pOriginal = NULL;
00442         return OriginalChanged();
00443     }
00444 
00445     KernelBitmap * pBmp = (KernelBitmap *)(Bitmaps->GetHead());
00446 
00447     while (pBmp != NULL)
00448     {
00449         if (pBmp == pOriginal) return OriginalChanged(); // OK we've found it.
00450         pBmp = (KernelBitmap *) Bitmaps->GetNext(pBmp);
00451     }
00452 
00453     pOriginal = (KernelBitmap *)(Bitmaps->GetHead()); // possibly NULL but certainly on the list
00454     return OriginalChanged();
00455 }

BOOL BfxDlg::ClearDestination BOOL  Redraw = TRUE  )  [private]
 

Marks no dest bitmap.

Author:
Alex_Bligh (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 345 of file bfxdlg.cpp.

00346 {
00347     if (pDestination)
00348     {
00349         delete pDestination;
00350         pDestination = NULL; //TRACEUSER( "Alex", _T("ClearDestination deleting dest\n"));
00351         return ((!Redraw) || (DestinationChanged()));
00352     }
00353     return TRUE;
00354 }

BOOL BfxDlg::DestinationChanged  )  [private]
 

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

Author:
Alex_Bligh (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 321 of file bfxdlg.cpp.

00322 {
00323     if (OpenPage)
00324     {
00325         InvalidateGadget(_R(IDC_BFXDLG_ORIGREDRAW2));
00326     }
00327     return TRUE;
00328 }

void BfxDlg::Do OpDescriptor  )  [virtual]
 

Like all Do functions invokes the BfxDlg.

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

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 1611 of file bfxdlg.cpp.

01612 {
01613     String_256 Title(_R(IDS_BFXDLG));
01614     SetName(&Title); 
01615     BOOL ok = Create(); // Create the TAB dialog please
01616     if (!ok)
01617     {
01618         /*InformError(blobby)*/;    // Display an error if this is a real dialog please
01619         OpenPage=0;
01620         End(); 
01621     }
01622     TalkToPage(0);
01623     SetStringGadgetValue(_R(ID_APPLY_NOW), _R(IDS_BFXDLG_TEST));
01624     SetStringGadgetValue(IDOK, _R(IDS_BFXDLG_INSERT));
01625     SetStringGadgetValue(IDCANCEL, _R(IDS_BFXDLG_CLOSE));
01626 }

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

Performs the BfxOp for the first time.

Author:
Alex_Bligh (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 1645 of file bfxdlg.cpp.

01646 {
01647     Do(pOp);
01648     KernelBitmap * pBitmap = NULL;
01649     if (pParam) pBitmap = (KernelBitmap *)(void *)(pParam->Param1);
01650     if (pBitmap && pBitmap->IsKindOf(CC_RUNTIME_CLASS(KernelBitmap)))
01651     {
01652         pOriginal=pBitmap;
01653         TalkToPage(OpenPage);
01654         OriginalChanged();
01655     }
01656     return;
01657 }

BOOL BfxDlg::FindBitmap  )  [private]
 

Set pOriginal to point at a bitmap.

Author:
Alex_Bligh (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 371 of file bfxdlg.cpp.

00372 {
00373 //  pOriginal = NULL;
00374 
00375     Range Sel(*(GetApplication()->FindSelection()));
00376 
00377     Node* FirstSelectedNode = Sel.FindFirst(); 
00378     if (FirstSelectedNode != NULL) // No nodes selected so End
00379     {
00380         Node* CurrentNode = FirstSelectedNode;       
00381         Node* NextCurrent; 
00382         
00383         // Do all bitmaps. OK this should pick up the fill as well. Never mind
00384         while (CurrentNode != NULL)
00385         {
00386             NextCurrent = Sel.FindNext(CurrentNode);
00387             if  ( (CurrentNode->IsSelected()) && (CurrentNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeBitmap)) ) 
00388             {         
00389                 pOriginal = ((NodeBitmap *)(CurrentNode))->GetBitmap();
00390                 return CheckOriginalBitmap();
00391             }
00392             CurrentNode = NextCurrent; 
00393         }
00394 
00395     } 
00396 
00397     // Find the first Fill Attribute in the selection
00398     AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr();
00399 
00400     while (pAttrNode != NULL)
00401     {
00402         if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrBitmapColourFill)))
00403         {
00404             pOriginal = pAttrNode->GetBitmap();
00405             return CheckOriginalBitmap();
00406         }
00407 
00408         // Check the next fill
00409         pAttrNode = AttrFillGeometry::FindNextSelectedAttr();
00410     }
00411 
00412     return CheckOriginalBitmap();
00413 }

BOOL BfxDlg::FixOriginalComboBox  )  [private]
 

Makes the combo box reflect the bitmaps within the document.

Author:
Alex_Bligh (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 474 of file bfxdlg.cpp.

00475 {
00476     // Find the doccomponent with the list of bitmaps in it
00477     Document * pDoc = Document::GetSelected();
00478 
00479     // Get the bitmap list
00480     BitmapList* Bitmaps = NULL;
00481     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00482 
00483     if (Bitmaps == NULL)
00484         return TRUE;
00485 
00486     String_256 Str;
00487 
00488     if (OpenPage)
00489     {
00490         DeleteAllValues(_R(IDC_BFXDLG_ORIGCOMBO));
00491     }
00492 
00493     BOOL DoneMain = FALSE;
00494     INT32 SelIndex = 0;
00495 
00496     if (Bitmaps->GetCount() > 0)
00497     {
00498         INT32 Index = 0;
00499 
00500         ListItem* pBmp = Bitmaps->GetHead();
00501 
00502         while (pBmp != NULL)
00503         {
00504             Str = ((KernelBitmap*)pBmp)->ActualBitmap->GetName();
00505             if (OpenPage)
00506             {
00507                 if (((KernelBitmap*)(pBmp)) == pOriginal)
00508                 {
00509                     SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str, FALSE, -1);
00510                     DoneMain = TRUE;
00511                     SelIndex=Index;
00512                 }
00513                 SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str,FALSE, Index++);
00514             }
00515             pBmp = Bitmaps->GetNext(pBmp);
00516         }
00517     }
00518     else
00519     {
00520         Str.Load(_R(IDS_K_BFXDLG_DEFAULT));
00521         if (OpenPage) SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str,TRUE, 0);
00522     }
00523 
00524     if (OpenPage)
00525     {
00526         Str.Load(_R(IDS_K_BFXDLG_DEFAULT));
00527         SetComboListLength(_R(IDC_BFXDLG_ORIGCOMBO));
00528         if (!DoneMain)
00529         {
00530             SetStringGadgetValue(_R(IDC_BFXDLG_ORIGCOMBO),&Str, FALSE, -1);
00531             SetSelectedValueIndex(_R(IDC_BFXDLG_ORIGCOMBO), 0);
00532         }
00533         else
00534         {
00535             SetSelectedValueIndex(_R(IDC_BFXDLG_ORIGCOMBO), SelIndex);
00536         }
00537     }
00538     return TRUE;
00539 }

OpState BfxDlg::GetState String_256 ,
OpDescriptor
[static]
 

The standard GetState fn, does nothing.

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

Errors: -

See also:
-

Definition at line 1513 of file bfxdlg.cpp.

01514 {    
01515     OpState OpSt;
01516     return(OpSt);
01517 }

void BfxDlg::HandleAlchemistMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[private]
 

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

Author:
Alex_Bligh (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:
BfxDlg::Message

Definition at line 1428 of file bfxdlg.cpp.

01429 {
01430     TalkToPage(_R(IDD_BFXDLG_PG6));  // The Coords Page identifier
01431     switch(Msg->DlgMsg)
01432     {
01433         case DIM_CREATE:
01434             {
01435                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_HUE_CHECK), TRUE); 
01436                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SATURATION_CHECK), TRUE); 
01437                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VALUE_CHECK), TRUE); 
01438                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_RAINBOW_CHECK), TRUE); 
01439                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VARIATION_CHECK), TRUE); 
01440                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SHAPES_CHECK), TRUE); 
01441                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_STYLE_CHECK), TRUE); 
01442                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_OPACITY_CHECK), TRUE); 
01443                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_GRAIN_CHECK), TRUE); 
01444 
01445                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_HUE_SLIDER), 0, 127, 1);
01446                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_HUE_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01447                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_HUE_SLIDER), 64); 
01448                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_SATURATION_SLIDER), 0, 127, 1);
01449                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_SATURATION_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01450                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SATURATION_SLIDER), 64); 
01451                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_VALUE_SLIDER), 0, 127, 1);
01452                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_VALUE_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01453                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VALUE_SLIDER), 64); 
01454                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_RAINBOW_SLIDER), 0, 127, 1);
01455                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_RAINBOW_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01456                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_RAINBOW_SLIDER), 64); 
01457                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_VARIATION_SLIDER), 0, 127, 1);
01458                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_VARIATION_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01459                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_VARIATION_SLIDER), 64); 
01460                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_SHAPES_SLIDER), 0, 127, 1);
01461                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_SHAPES_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01462                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_SHAPES_SLIDER), 64); 
01463                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_STYLE_SLIDER), 0, 127, 1);
01464                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_STYLE_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01465                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_STYLE_SLIDER), 64); 
01466                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_OPACITY_SLIDER), 0, 127, 1);
01467                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_OPACITY_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01468                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_OPACITY_SLIDER), 64); 
01469                 SetGadgetRange    (_R(IDC_BFXDLG_ALC_GRAIN_SLIDER), 0, 127, 1);
01470                 SetGadgetBitmaps  (_R(IDC_BFXDLG_ALC_GRAIN_SLIDER), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01471                 SetLongGadgetValue(_R(IDC_BFXDLG_ALC_GRAIN_SLIDER), 64); 
01472 
01473             }
01474             break; //RUN THROUGH
01475 
01476         case DIM_SLIDER_POS_SET:
01477         //case DIM_SLIDER_POS_CHANGING:
01478         case DIM_LFT_BN_CLICKED:
01479         case DIM_SELECTION_CHANGED:
01480         case DIM_TEXT_CHANGED:             // Text changed 
01481             {
01482                 SetDirty();
01483             }
01484             break;
01485 
01486         case DIM_COMMIT:
01487         case DIM_SOFT_COMMIT:
01488             {
01489             }
01490             break;
01491 
01492     }
01493 }

void BfxDlg::HandleBrightnessAndContrastMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[private]
 

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

Author:
Alex_Bligh (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:
BfxDlg::Message

Definition at line 1086 of file bfxdlg.cpp.

01087 {
01088     TalkToPage(_R(IDD_BFXDLG_PG3));  // The Coords Page identifier
01089     switch(Msg->DlgMsg)
01090     {
01091         case DIM_CREATE:
01092             SetGadgetRange(_R(IDC_BFXDLG_BRIGHTNESS), -127, 127, 1);
01093             SetGadgetBitmaps(_R(IDC_BFXDLG_BRIGHTNESS), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
01094             SetGadgetRange(_R(IDC_BFXDLG_CONTRAST), -127, 127, 1);
01095             SetGadgetBitmaps(_R(IDC_BFXDLG_CONTRAST), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
01096             SetGadgetRange(_R(IDC_BFXDLG_COLOUR), -127, 127, 1);
01097             SetGadgetBitmaps(_R(IDC_BFXDLG_COLOUR), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
01098             SetLongGadgetValue(_R(IDC_BFXDLG_BRIGHTNESS), 0); 
01099             SetLongGadgetValue(_R(IDC_BFXDLG_CONTRAST), 0); 
01100             SetLongGadgetValue(_R(IDC_BFXDLG_COLOUR), 0); 
01101             break;
01102 //      case DIM_SLIDER_POS_SET:
01103 //      case DIM_SLIDER_POS_IDLE:
01104         case DIM_LFT_BN_CLICKED:
01105         case DIM_SELECTION_CHANGED:
01106             {
01107                 switch (Msg->GadgetID)
01108                 {
01109                     case _R(IDC_BFXDLG_BRIGHTNESS):
01110                     case _R(IDC_BFXDLG_CONTRAST):
01111                     case _R(IDC_BFXDLG_COLOUR):
01112                         SetDirty();
01113                         break;
01114                     default:
01115                         break;
01116                 }
01117             }
01118             break;
01119 
01120         case DIM_SLIDER_POS_SET:
01121         case DIM_SLIDER_POS_IDLE:
01122         case DIM_COMMIT:
01123         case DIM_SOFT_COMMIT:
01124             {
01125                 INT32 Brightness = -GetLongGadgetValue(_R(IDC_BFXDLG_BRIGHTNESS),-127,127);
01126                 INT32 Contrast = -GetLongGadgetValue(_R(IDC_BFXDLG_CONTRAST),-127,127);
01127                 INT32 Colour = -GetLongGadgetValue(_R(IDC_BFXDLG_COLOUR),-127,127);
01128                 if (Msg->DlgMsg == DIM_SLIDER_POS_SET || Msg->DlgMsg == DIM_SLIDER_POS_IDLE)
01129                 {
01130                     if (InteractiveBCC)
01131                     {                   
01132                         if ((!pFX) || (!pFX->IsKindOf(CC_RUNTIME_CLASS(ABFXBrightnessContrast))) ||
01133                             (Brightness!=Param1) || (Contrast!=Param2) || (Colour!=Param3))
01134                         {
01135                             *pCommitValues = TRUE;
01136                             *pEndDialog = FALSE;
01137                             SetDirty(FALSE); // no redraw right now
01138                         }
01139                         else break;
01140                     }
01141                     else
01142                     {
01143                         SetDirty();
01144                         break;
01145                     }
01146                 }
01147                 SetEffect(CC_RUNTIME_CLASS(ABFXBrightnessContrast));
01148                 SetParameters(Brightness, Contrast, Colour);
01149             }
01150             break;
01151 
01152     }
01153 }

void BfxDlg::HandleDitherMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[private]
 

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

Author:
Alex_Bligh (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:
BfxDlg::Message

Definition at line 1171 of file bfxdlg.cpp.

01172 {
01173     TalkToPage(_R(IDD_BFXDLG_PG4));  // The Coords Page identifier
01174     switch(Msg->DlgMsg)
01175     {
01176         case DIM_CREATE:
01177             SetLongGadgetValue(_R(IDC_BFXDLG_BAYERMONO), TRUE); 
01178             SetLongGadgetValue(_R(IDC_BFXDLG_HALFTONEMONO), FALSE); 
01179             SetLongGadgetValue(_R(IDC_BFXDLG_DIFFUSIONMONO), FALSE); 
01180             SetLongGadgetValue(_R(IDC_BFXDLG_BAYERCOLOUR), FALSE); 
01181             SetLongGadgetValue(_R(IDC_BFXDLG_DIFFUSIONCOLOUR), FALSE); 
01182             SetLongGadgetValue(_R(IDC_BFXDLG_POPULARITY), FALSE); 
01183             SetLongGadgetValue(_R(IDC_BFXDLG_MAKEGREYSCALE), FALSE); 
01184             SetLongGadgetValue(_R(IDC_BFXDLG_OCTREECOLOUR), FALSE); 
01185             
01186 //EnableGadget(_R(IDC_BFXDLG_DIFFUSIONCOLOUR), FALSE); // Accusoft library crashes
01187 //EnableGadget(_R(IDC_BFXDLG_OCTREECOLOUR), FALSE); // Accusoft library crashes
01188             
01189             break;
01190 
01191         case DIM_LFT_BN_CLICKED:
01192         case DIM_SELECTION_CHANGED:
01193             {
01194                 switch (Msg->GadgetID)
01195                 {
01196                     case _R(IDC_BFXDLG_BAYERMONO):
01197                     case _R(IDC_BFXDLG_HALFTONEMONO):
01198                     case _R(IDC_BFXDLG_DIFFUSIONMONO):
01199                     case _R(IDC_BFXDLG_BAYERCOLOUR):
01200                     case _R(IDC_BFXDLG_DIFFUSIONCOLOUR):
01201                     case _R(IDC_BFXDLG_POPULARITY):
01202                     case _R(IDC_BFXDLG_MAKEGREYSCALE):
01203                     case _R(IDC_BFXDLG_OCTREECOLOUR):
01204                         SetDirty();
01205                         break;
01206                     default:
01207                         break;
01208                 }
01209             }
01210             break;
01211 
01212         case DIM_COMMIT:
01213         case DIM_SOFT_COMMIT:
01214             {
01215                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_BAYERMONO)      )) SetEffect(CC_RUNTIME_CLASS(ABFXBayerMono));
01216                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_HALFTONEMONO)   )) SetEffect(CC_RUNTIME_CLASS(ABFXHalftoneMono));
01217                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_DIFFUSIONMONO)  )) SetEffect(CC_RUNTIME_CLASS(ABFXDiffusionMono));
01218                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_BAYERCOLOUR)    )) SetEffect(CC_RUNTIME_CLASS(ABFXBayerColour));
01219                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_DIFFUSIONCOLOUR))) SetEffect(CC_RUNTIME_CLASS(ABFXDiffusionColour));
01220                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_POPULARITY)     )) SetEffect(CC_RUNTIME_CLASS(ABFXPopularityColour));
01221                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_MAKEGREYSCALE)  )) SetEffect(CC_RUNTIME_CLASS(ABFXMakeGreyscale));
01222                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_OCTREECOLOUR)      )) SetEffect(CC_RUNTIME_CLASS(ABFXOctree));
01223             }
01224             break;
01225 
01226     }
01227 }

void BfxDlg::HandleFlipAndRotateMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[private]
 

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

Author:
Alex_Bligh (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:
BfxDlg::Message

Definition at line 924 of file bfxdlg.cpp.

00925 {
00926     TalkToPage(_R(IDD_BFXDLG_PG1));  // The Coords Page identifier
00927     switch(Msg->DlgMsg)
00928     {
00929         case DIM_CREATE:
00930             SetLongGadgetValue(_R(IDC_BFXDLG_FLIPX), TRUE); 
00931             SetLongGadgetValue(_R(IDC_BFXDLG_FLIPY), FALSE); 
00932             SetLongGadgetValue(_R(IDC_BFXDLG_ROTATE90), FALSE); 
00933             SetLongGadgetValue(_R(IDC_BFXDLG_ROTATE180), FALSE); 
00934             SetLongGadgetValue(_R(IDC_BFXDLG_ROTATE270), FALSE); 
00935             break;
00936 
00937         case DIM_LFT_BN_CLICKED:
00938         case DIM_SELECTION_CHANGED:
00939             {
00940                 switch (Msg->GadgetID)
00941                 {
00942                     case _R(IDC_BFXDLG_FLIPX):
00943                     case _R(IDC_BFXDLG_FLIPY):
00944                     case _R(IDC_BFXDLG_ROTATE90):
00945                     case _R(IDC_BFXDLG_ROTATE180):
00946                     case _R(IDC_BFXDLG_ROTATE270):
00947                         SetDirty();
00948                         break;
00949                     default:
00950                         break;
00951                 }
00952             }
00953             break;
00954 
00955         case DIM_COMMIT:
00956         case DIM_SOFT_COMMIT:
00957             {
00958                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_FLIPX))) SetEffect(CC_RUNTIME_CLASS(ABFXFlipX));
00959                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_FLIPY))) SetEffect(CC_RUNTIME_CLASS(ABFXFlipY));
00960                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_ROTATE90) )) SetEffect(CC_RUNTIME_CLASS(ABFXRotate90 ));
00961                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_ROTATE180))) SetEffect(CC_RUNTIME_CLASS(ABFXRotate180));
00962                 if (GetBoolGadgetSelected(_R(IDC_BFXDLG_ROTATE270))) SetEffect(CC_RUNTIME_CLASS(ABFXRotate270));
00963             }
00964             break;
00965 
00966     }
00967 }

void BfxDlg::HandleResizeMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[private]
 

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

Author:
Alex_Bligh (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:
BfxDlg::Message

Definition at line 986 of file bfxdlg.cpp.

00987 {
00988     static BOOL ReEntered = FALSE;
00989     BOOL RescanSize = FALSE;
00990     TalkToPage(_R(IDD_BFXDLG_PG2));  // The Coords Page identifier
00991     switch(Msg->DlgMsg)
00992     {
00993         case DIM_SET_ACTIVE:
00994             ReEntered = FALSE; // Just in case we get out of sync
00995             break;
00996 
00997         case DIM_CREATE:
00998             FindBitmap();
00999             SetLongGadgetValue(_R(IDC_BFXDLG_INTERP), TRUE); 
01000             SetLongGadgetValue(_R(IDC_BFXDLG_ASPECT), TRUE); 
01001             RescanSize=TRUE;
01002             break;
01003 
01004         case DIM_OUT_OF_SPACE: // BODGE!!
01005             if (Msg->GadgetID == _R(IDC_BFXDLG_ORIGREDRAW))
01006                 RescanSize=TRUE;
01007             break;
01008 
01009         case DIM_SELECTION_CHANGED:
01010         case DIM_SLIDER_POS_SET:
01011         //case DIM_SLIDER_POS_CHANGING:
01012         case DIM_LFT_BN_CLICKED:
01013         case DIM_TEXT_CHANGED:             // Text changed 
01014             SetDirty();
01015             if ((GetLongGadgetValue(_R(IDC_BFXDLG_ASPECT),0,1)!=0) && !ReEntered)
01016             {
01017                 INT32 NewX = GetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE),0,10000000);
01018                 INT32 NewY = GetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE),0,10000000);
01019                 switch (Msg->GadgetID)
01020                 {
01021                     case _R(IDC_BFXDLG_NEWXSIZE):
01022                         if (pOrigInfo->PixelWidth)
01023                         {
01024                             ReEntered = TRUE;
01025                             SetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE), (INT32)(0.5+ (
01026                                 ((double)(pOrigInfo->PixelHeight))/((double)(pOrigInfo->PixelWidth))*((double)(NewX)) )));
01027                             ReEntered = FALSE;
01028                         }
01029                         break;
01030                 
01031                     case _R(IDC_BFXDLG_NEWYSIZE):
01032                         if (pOrigInfo->PixelHeight)
01033                         {
01034                             ReEntered = TRUE;
01035                             SetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE), (INT32)(0.5+ (
01036                                 ((double)(pOrigInfo->PixelWidth))/((double)(pOrigInfo->PixelHeight))*((double)(NewY)) )));
01037                             ReEntered = FALSE;
01038                         }
01039                         break;
01040 
01041                     default:
01042                         break;
01043                 }
01044             }
01045             break;
01046         case DIM_COMMIT:
01047         case DIM_SOFT_COMMIT:
01048             {
01049                 SetEffect(CC_RUNTIME_CLASS(ABFXResize));
01050                 INT32 NewX = GetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE),0,10000000);
01051                 INT32 NewY = GetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE),0,10000000);
01052                 if (NewX<2) NewX = 2;
01053                 if (NewY<2) NewY = 2;
01054                 SetParameters(NewX, NewY, (INT32)(BOOL)(GetLongGadgetValue(_R(IDC_BFXDLG_INTERP),0,1)!=0));
01055                 }
01056             break;
01057     }
01058 
01059     if (RescanSize && pOrigInfo)
01060     {
01061         ReEntered = TRUE;
01062         SetLongGadgetValue(_R(IDC_BFXDLG_ORIGXSIZE), pOrigInfo->PixelWidth);
01063         SetLongGadgetValue(_R(IDC_BFXDLG_NEWXSIZE),  pOrigInfo->PixelWidth);
01064         SetLongGadgetValue(_R(IDC_BFXDLG_ORIGYSIZE), pOrigInfo->PixelHeight);
01065         SetLongGadgetValue(_R(IDC_BFXDLG_NEWYSIZE),  pOrigInfo->PixelHeight);
01066         ReEntered = FALSE;
01067     }
01068 }

void BfxDlg::HandleSpecialEffectsMsg DialogMsg Msg,
BOOL *  pCommitValues,
BOOL *  pEndDialog
[private]
 

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

Author:
Alex_Bligh (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:
BfxDlg::Message

Definition at line 1246 of file bfxdlg.cpp.

01247 {
01248     TalkToPage(_R(IDD_BFXDLG_PG5));  // The Coords Page identifier
01249     switch(Msg->DlgMsg)
01250     {
01251         case DIM_CREATE:
01252             {
01253                 SetLongGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO), 0); 
01254                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM1), (INT32)(Matrix[0]+0.5));
01255                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM2), (INT32)(Matrix[1]+0.5));
01256                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM3), (INT32)(Matrix[2]+0.5));
01257                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM4), (INT32)(Matrix[3]+0.5));
01258                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM5), (INT32)(Matrix[4]+0.5));
01259                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM6), (INT32)(Matrix[5]+0.5));
01260                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM7), (INT32)(Matrix[6]+0.5));
01261                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM8), (INT32)(Matrix[7]+0.5));
01262                 SetLongGadgetValue(_R(IDC_BFXDLG_CUSTOM9), (INT32)(Matrix[8]+0.5));
01263                 SetGadgetRange(_R(IDC_BFXDLG_AMOUNT), 0, 127, 1);
01264                 SetGadgetBitmaps(_R(IDC_BFXDLG_AMOUNT), _R(IDB_QUALITYBASE), _R(IDB_QUALITYSLIDER));
01265                 SetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT), 64); 
01266 
01267                 DeleteAllValues(_R(IDC_BFXDLG_EFFECTCOMBO));
01268 
01269                 String_256 Str0(_R(IDS_BFXDLG_EFFECTMENU0));
01270                 String_256 Str1(_R(IDS_BFXDLG_EFFECTMENU1));
01271                 String_256 Str2(_R(IDS_BFXDLG_EFFECTMENU2));
01272                 String_256 Str3(_R(IDS_BFXDLG_EFFECTMENU3));
01273                 String_256 Str4(_R(IDS_BFXDLG_EFFECTMENU4));
01274                 String_256 Str5(_R(IDS_BFXDLG_EFFECTMENU5));
01275                 String_256 Str6(_R(IDS_BFXDLG_EFFECTMENU6));
01276                 String_256 Str7(_R(IDS_BFXDLG_EFFECTMENU7));
01277                 String_256 Str8(_R(IDS_BFXDLG_EFFECTMENU8));
01278                 String_256 Str9(_R(IDS_BFXDLG_EFFECTMENU9));
01279                 String_256 Str10(_R(IDS_BFXDLG_EFFECTMENU10));
01280                 String_256 Str11(_R(IDS_BFXDLG_EFFECTMENU11));
01281                 String_256 Str12(_R(IDS_BFXDLG_EFFECTMENU12));
01282                 String_256 Str13(_R(IDS_BFXDLG_EFFECTMENU13));
01283                 String_256 Str14(_R(IDS_BFXDLG_EFFECTMENU14));
01284                 String_256 Str15(_R(IDS_BFXDLG_EFFECTMENU15));
01285                 String_256 Str16(_R(IDS_BFXDLG_EFFECTMENU16));
01286                 String_256 Str17(_R(IDS_BFXDLG_EFFECTMENU17));
01287                 String_256 Str18(_R(IDS_BFXDLG_EFFECTMENU18));
01288                 String_256 Str19(_R(IDS_BFXDLG_EFFECTMENU19));
01289             
01290                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str0,FALSE, 0);
01291                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str1,FALSE, 1);
01292                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str2,FALSE, 2);
01293                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str3,FALSE, 3);
01294                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str4,FALSE, 4);
01295                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str5,FALSE, 5);
01296                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str6,FALSE, 6);
01297                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str7,FALSE, 7);
01298                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str8,FALSE, 8);
01299                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str9,FALSE, 9);
01300                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str10,FALSE, 10);
01301                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str11,FALSE, 11);
01302                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str12,FALSE, 12);
01303                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str13,FALSE, 13);
01304                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str14,FALSE, 14);
01305                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str15,FALSE, 15);
01306                 if (IsUserName("Alex"))
01307                 {
01308                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str16,FALSE, 16);
01309                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str17,FALSE, 17);
01310                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str18,FALSE, 18);
01311                     SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str19,FALSE, 19);
01312                 }           
01313                 
01314                 
01315                 SetStringGadgetValue(_R(IDC_BFXDLG_EFFECTCOMBO),&Str11, FALSE, -1);
01316                 SetComboListLength(_R(IDC_BFXDLG_EFFECTCOMBO));
01317                 SetSelectedValueIndex(_R(IDC_BFXDLG_EFFECTCOMBO), 11);
01318             }
01319             //break; RUN THROUGH
01320 
01321         case DIM_SLIDER_POS_SET:
01322         //case DIM_SLIDER_POS_CHANGING:
01323         case DIM_LFT_BN_CLICKED:
01324         case DIM_SELECTION_CHANGED:
01325         case DIM_TEXT_CHANGED:             // Text changed 
01326             {
01327                 SetDirty();
01328                 INT32 Choice = GetSelectedValueIndex(_R(IDC_BFXDLG_EFFECTCOMBO));
01329                 BOOL GreyAmount = (Choice <= 9);
01330                 BOOL GreyCustom = (Choice != 0);
01331                 EnableGadget(_R(IDC_BFXDLG_CUSTOM1), !GreyCustom);
01332                 EnableGadget(_R(IDC_BFXDLG_CUSTOM2), !GreyCustom);
01333                 EnableGadget(_R(IDC_BFXDLG_CUSTOM3), !GreyCustom);
01334                 EnableGadget(_R(IDC_BFXDLG_CUSTOM4), !GreyCustom);
01335                 EnableGadget(_R(IDC_BFXDLG_CUSTOM5), !GreyCustom);
01336                 EnableGadget(_R(IDC_BFXDLG_CUSTOM6), !GreyCustom);
01337                 EnableGadget(_R(IDC_BFXDLG_CUSTOM7), !GreyCustom);
01338                 EnableGadget(_R(IDC_BFXDLG_CUSTOM8), !GreyCustom);
01339                 EnableGadget(_R(IDC_BFXDLG_CUSTOM9), !GreyCustom);
01340                 EnableGadget(_R(IDC_BFXDLG_AMOUNT), !GreyAmount);
01341                 EnableGadget(_R(IDC_BFXDLG_AMOUNTTXT), !GreyAmount);
01342             }
01343             break;
01344 
01345         case DIM_COMMIT:
01346         case DIM_SOFT_COMMIT:
01347             {
01348                 INT32 Choice = GetSelectedValueIndex(_R(IDC_BFXDLG_EFFECTCOMBO));
01349                 Matrix[0]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM1),-255.0,255.0);
01350                 Matrix[1]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM2),-255.0,255.0);
01351                 Matrix[2]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM3),-255.0,255.0);
01352                 Matrix[3]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM4),-255.0,255.0);
01353                 Matrix[4]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM5),-255.0,255.0);
01354                 Matrix[5]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM6),-255.0,255.0);
01355                 Matrix[6]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM7),-255.0,255.0);
01356                 Matrix[7]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM8),-255.0,255.0);
01357                 Matrix[8]=GetDoubleGadgetValue(_R(IDC_BFXDLG_CUSTOM9),-255.0,255.0);
01358 
01359                 switch (Choice)
01360                 {
01361                     case 0:
01362                     case 1:
01363                     case 2:
01364                     case 3:
01365                     case 4:
01366                     case 5:
01367                     case 6:
01368                     case 7:
01369                     case 8:
01370                     case 9:
01371                         SetEffect(CC_RUNTIME_CLASS(ABFXSpecialEffect));
01372                         SetParameters((INT32) Choice);
01373                         break;
01374                     case 10:
01375                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01376                         SetParameters(((INT32) 127-GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)), 1);
01377                         break;
01378                     case 11:
01379                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01380                         SetParameters(((INT32) 127-GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)), 2);
01381                         break;
01382                     case 12:
01383                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01384                         SetParameters(((INT32) 127-GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)), 3);
01385                         break;
01386                     case 13:
01387                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01388                         SetParameters(((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127))-127, 1);
01389                         break;
01390                     case 14:
01391                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01392                         SetParameters(((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127))-127, 2);
01393                         break;
01394                     case 15:
01395                         SetEffect(CC_RUNTIME_CLASS(ABFXSharpenBlur));
01396                         SetParameters(((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127))-127, 3);
01397                         break;
01398                     case 16:
01399                     case 17:
01400                     case 18:
01401                     case 19:
01402                         SetEffect(CC_RUNTIME_CLASS(ABFXRemoveDither));
01403                         SetParameters((127-((INT32) GetLongGadgetValue(_R(IDC_BFXDLG_AMOUNT),0,127)))<<1, 30, Choice-16);
01404                         break;
01405                 }                                           
01406             }
01407 
01408     }
01409 }

BOOL BfxDlg::Init void   )  [static]
 

The standard Init fn for the op.

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

Errors: -

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 1536 of file bfxdlg.cpp.

01537 {  
01538     GetApplication()->DeclareSection( "Bitmap Effects", 1);
01539     GetApplication()->DeclarePref( "Bitmap Effects", "Interactive Brightness & Contrast", &InteractiveBCC, FALSE, TRUE);
01540     
01541     return (RegisterOpDescriptor(
01542                                 0,                         // Tool ID                    
01543                                 _R(IDS_BFXDLGM),               // String resouirce ID        
01544                                 CC_RUNTIME_CLASS(BfxDlg),  // Runtime class              
01545                                 OPTOKEN_BFXDLG,            // Token string               
01546                                 BfxDlg::GetState,          // GetState function          
01547                                 0,  /* help ID */          // Help ID                    
01548                                 _R(IDBBL_BITMAPEFFECTS),//_R(IDBBL_BFXDLG),   // Bubble ID                  
01549                                 _R(IDD_BARCONTROLSTORE),       // Resource ID                
01550                                 _R(IDC_BITMAPEFFECTS),         // Control ID                 
01551                                 SYSTEMBAR_UTILITIES,       // Bar ID                     
01552                                 TRUE,                      // Recieve system messages    
01553                                 FALSE,                     // Smart duplicate operation  
01554                                 TRUE,                      // Clean operation            
01555                                 0,                         // No vertical counterpart
01556                                 _R(IDS_BFXDLG_ONE),            // String for one copy only
01557                                 GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE
01558                                 )
01559                                 
01560         && BfxOp::Init()); // HORRIBLE! But means I don't have to get a lock on main.cpp
01561 } 

MsgResult BfxDlg::Message Msg Message  )  [virtual]
 

This is the message handler for the BfxDlg.

Author:
Alex_Bligh (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 DialogTabOp.

Definition at line 702 of file bfxdlg.cpp.

00703 {
00704     if (IS_OUR_DIALOG_MSG(Message))
00705     {
00706         DialogMsg* Msg = ((DialogMsg*) Message); 
00707         
00708         BOOL EndDialog = FALSE;     // TRUE if we should quit the dialog
00709         BOOL CommitValues = FALSE;  // TRUE if we should commit the dialog values
00710 
00711         CDlgResID ThePage = Msg->PageID;
00712 
00713         if (ThePage == 0) switch (Msg->DlgMsg)
00714         {
00715             case DIM_CREATE:
00716                 OpenPage=0;
00717                 pOriginal=NULL;
00718                 TalkToPage(0);
00719                 FindBitmap();
00720                 FixOriginalComboBox();
00721                 SetDirty();
00722                 break;
00723             
00724             case DIM_COMMIT:        // Want to commit and quit
00725                 EndDialog = TRUE;
00726                 CommitValues = TRUE; 
00727                 ThePage = OpenPage;
00728                 break;
00729 
00730             case DIM_SOFT_COMMIT:   // Want to commit
00731                 CommitValues = TRUE; 
00732                 ThePage = OpenPage;
00733                 break; 
00734 
00735             case DIM_CANCEL:        // Want to quit
00736                 ThePage = OpenPage;
00737                 EndDialog = TRUE;
00738                 break;
00739 
00740         }
00741 
00742         // These are common to all pages, and get passed on to the pages themselves
00743         switch (Msg->DlgMsg)
00744         {
00745             case DIM_SET_ACTIVE:
00746                 OpenPage = Msg->PageID;
00747                 TalkToPage(Msg->PageID);
00748                 CheckOriginalBitmap();
00749                 FixOriginalComboBox();
00750                 SetDirty();
00751                 break;
00752 
00753             case DIM_REDRAW :
00754                 // This is where all the redrawing is done
00755                 // Which control in the window is sending the redraw message (if there are many
00756                 // grdraw controls you can tell which is which from the Gadget ID
00757                 TalkToPage(Msg->PageID);
00758                 switch (Msg->GadgetID)
00759                 {
00760                     // Draw the redraw_me control in here
00761                     case _R(IDC_BFXDLG_ORIGREDRAW) :
00762                     {
00763                         RenderBitmap((ReDrawInfoType*) Msg->DlgMsgParam, pOriginal);
00764                         break;
00765                     }
00766                     case _R(IDC_BFXDLG_ORIGREDRAW2) :
00767                     {
00768                         RenderBitmap((ReDrawInfoType*) Msg->DlgMsgParam, pDestination);
00769                         break;
00770                     }
00771                 }
00772                 break;
00773             
00774             case DIM_SELECTION_CHANGED:
00775                 TalkToPage(Msg->PageID);
00776                 switch (Msg->GadgetID)
00777                 {
00778                     // Draw the redraw_me control in here
00779                     case _R(IDC_BFXDLG_ORIGCOMBO) :
00780                     {
00781                         ReadOriginalComboBox();
00782                         break;
00783                     }
00784                 }
00785                 break;                                                 
00786 
00787         }
00788 
00789         // Determine from what page the message originated
00790         if (ThePage) switch (ThePage)
00791         {
00792             case _R(IDD_BFXDLG_PG1):
00793                 HandleFlipAndRotateMsg(Msg, &CommitValues, &EndDialog); 
00794                 break;
00795             case _R(IDD_BFXDLG_PG2):
00796                 HandleResizeMsg(Msg, &CommitValues, &EndDialog); 
00797                 break;
00798             case _R(IDD_BFXDLG_PG3):
00799                 HandleBrightnessAndContrastMsg(Msg, &CommitValues, &EndDialog); 
00800                 break;
00801             case _R(IDD_BFXDLG_PG4):
00802                 HandleDitherMsg(Msg, &CommitValues, &EndDialog); 
00803                 break;
00804             case _R(IDD_BFXDLG_PG5):
00805                 HandleSpecialEffectsMsg(Msg, &CommitValues, &EndDialog); 
00806                 break;
00807             case _R(IDD_BFXDLG_PG6):
00808                 HandleAlchemistMsg(Msg, &CommitValues, &EndDialog); 
00809                 break;
00810             default:
00811                 ERROR3("Message from unknown tab dialog page"); 
00812         }
00813 
00814         // Commit values here
00815         if (CommitValues)
00816         {
00817             if (pOriginal)
00818             {
00819                 if (pFX)
00820                 {
00821                     if (!Clean)
00822                     {
00823                         ClearDestination();
00824                         String_64 ProcessMessage(_R(IDS_BFXDLG_PROCESSING));
00825                         // Bodge to avoid progress bar on interactive B&C
00826                         if (Msg->DlgMsg==DIM_COMMIT || Msg->DlgMsg==DIM_SOFT_COMMIT)
00827                         {
00828                             BeginSlowJob(100, FALSE, &ProcessMessage);
00829                             ContinueSlowJob();
00830                         }
00831                         pFX->SetParameters(Param1, Param2, Param3, Matrix);
00832                         pDestination = pFX->GetProcessedBitmap(pOriginal);
00833                         if (Msg->DlgMsg==DIM_COMMIT || Msg->DlgMsg==DIM_SOFT_COMMIT)
00834                         {
00835                             ContinueSlowJob(99);
00836                             EndSlowJob();
00837                         }
00838                         if (!pDestination) InformError(); else
00839                         {
00840                             DestinationChanged();
00841                             Clean=TRUE;
00842                         }
00843                     }
00844                 }
00845                 else
00846                 {
00847                     TRACEUSER( "Alex", _T("Wierd - he didn't actually ask for an effect..."));
00848                 }
00849             }
00850         }
00851 
00852         // End dialog here
00853         if (EndDialog)  // Dialog communication over 
00854         {   
00855             if (pOriginal && CommitValues)
00856             {
00857                 OpenPage = 0;
00858                 TalkToPage(0);
00859 
00860                 BfxOpParam param;
00861                 param.ppBitmap = &pDestination;
00862             
00863                 OpDescriptor* pOpDesc=OpDescriptor::FindOpDescriptor("BfxOp");
00864                 ERROR3IF_PF(pOpDesc==NULL,("Couldn't find OPTOKEN_OPBFXOP op descriptor"));
00865                 pOpDesc->Invoke((OpParam*)&param);
00866                 // NULLs destination on success
00867             }
00868 
00869             ClearDestination();
00870 
00871             Close();           
00872 //          TRACEUSER( "Alex", _T("Calling End()\n"));
00873             End();      // End of dialog 
00874         }
00875         //return (DLG_EAT_IF_HUNGRY(Msg));   // I return EAT_MSG unless the message needs to be sent to all dialogs 
00876     } else if (MESSAGE_IS_A(Message, SelChangingMsg))       // Selection changed - use new bitmap
00877     {
00878         if (OpenPage) TalkToPage(OpenPage);
00879         SelChangingMsg *Msg = (SelChangingMsg *) Message;
00880         switch ( Msg->State )
00881         {
00882             case SelChangingMsg::SelectionState::SELECTIONCHANGED:
00883             case SelChangingMsg::SelectionState::NODECHANGED:
00884 //              pOriginal=NULL;
00885                 FindBitmap();
00886                 break;
00887         }
00888     } else if (MESSAGE_IS_A(Message, BitmapListChangedMsg))     // Selection changed - use new bitmap
00889     {
00890         if (OpenPage) TalkToPage(OpenPage);
00891         CheckOriginalBitmap();
00892         FixOriginalComboBox();
00893     } else if (MESSAGE_IS_A(Message, BfxMsg))
00894     {
00895         if (OpenPage) TalkToPage(OpenPage);
00896         pOriginal=((BfxMsg*)(Message))->pBitmap;
00897         CheckOriginalBitmap();
00898     }
00899 
00900     return DialogTabOp::Message(Message);
00901 } 

BOOL BfxDlg::OriginalChanged  )  [private]
 

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

Author:
Alex_Bligh (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 217 of file bfxdlg.cpp.

00218 {
00219     if (pPrevOriginal==pOriginal) return TRUE;
00220     pPrevOriginal=pOriginal;
00221 
00222     if (!pOrigInfo)
00223     {
00224         pOrigInfo = new BitmapInfo;
00225         if (!pOrigInfo) return FALSE; // error already set.
00226     }
00227 
00228     pOrigInfo->PixelWidth = 100;
00229     pOrigInfo->PixelHeight = 100;
00230     pOrigInfo->PixelDepth = 24;
00231     if (pOriginal && pOrigInfo) // Should always be true
00232     {
00233         pOriginal->ActualBitmap->GetInfo(pOrigInfo);
00234     }
00235 
00236     if (SetDirty() && (OpenPage != 0))
00237     {
00238         InvalidateGadget(_R(IDC_BFXDLG_ORIGREDRAW));
00239     }
00240 
00241     BROADCAST_TO_CLASS(DialogMsg(WindowID, DIM_OUT_OF_SPACE, _R(IDC_BFXDLG_ORIGREDRAW),
00242                        0, OpenPage) ,DialogOp);  // Pretty horrible bodge
00243 
00244     return FixOriginalComboBox();
00245 }

BOOL BfxDlg::ReadOriginalComboBox  )  [private]
 

Chooses a different bitmap from the combo box.

Author:
Alex_Bligh (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 559 of file bfxdlg.cpp.

00560 {
00561     if (!OpenPage) return FALSE;
00562 
00563     Document * pDoc = Document::GetSelected();
00564 
00565     // Get the bitmap list
00566     BitmapList* Bitmaps = NULL;
00567     if (pDoc) Bitmaps = pDoc->GetBitmapList();
00568 
00569     if (Bitmaps == NULL)
00570         return TRUE;
00571 
00572     ListItem* pBmp = Bitmaps->GetHead();
00573 
00574     WORD Index;
00575     GetValueIndex(_R(IDC_BFXDLG_ORIGCOMBO),&Index); 
00576 
00577     for (INT32 i = 0; i < Index; i++)
00578     {
00579         if (pBmp == NULL)
00580             break;
00581 
00582         pBmp = Bitmaps->GetNext(pBmp);
00583     }
00584 
00585     pOriginal = (KernelBitmap*)pBmp; // Might be NULL (conceivably)
00586     return CheckOriginalBitmap();
00587 }

BOOL BfxDlg::RegisterYourPagesInOrderPlease  )  [virtual]
 

This virtual function will get called to give you a chance to add pages to your DialogTabOp. This function will usually make multiple calls to AddAPage to register the initial set of pages to be contained in the tab dialog. The pages should all be the same size and be registered in the left to right order in which you wish them to appear.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/02/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
return TRUE if all calls to AddAPage returned TRUE
This function get's called directly from the Create method, Don't call it explicitly yourself. If you return FALSE from this method then the Create method will fail.

Returns:
Errors: -
See also:
DialogTabOp::AddPage

DialogOp::Create

Reimplemented from DialogTabOp.

Definition at line 1687 of file bfxdlg.cpp.

01688 {
01689     BOOL ok = AddAPage(_R(IDD_BFXDLG_PG1)) &&   
01690               AddAPage(_R(IDD_BFXDLG_PG2)) &&
01691               AddAPage(_R(IDD_BFXDLG_PG3)) &&
01692               AddAPage(_R(IDD_BFXDLG_PG4)) &&
01693               AddAPage(_R(IDD_BFXDLG_PG5)) &&
01694 #ifdef _DEBUG
01695               ((!IsUserName("Alex")) || AddAPage(_R(IDD_BFXDLG_PG6))) &&
01696 #endif
01697               TRUE;
01698     return (ok); 
01699 }

BOOL BfxDlg::RenderBitmap ReDrawInfoType ExtraInfo,
KernelBitmap BitmapToUse
[private]
 

Fills a renderable control with a bitmap.

Author:
Alex_Bligh (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 605 of file bfxdlg.cpp.

00606 {
00607     // Go get a render region
00608     DocRect VirtualSize(0, 0, ExtraInfo->dx, ExtraInfo->dy);
00609     RenderRegion* pRender = CreateGRenderRegion(&VirtualSize, ExtraInfo);
00610     if (pRender!=NULL)
00611     {
00612         DialogColourInfo RedrawColours;     // Get a supplier for default dlg colours
00613 
00614         // A Grey colour [...hmmm, it's not a very grey grey any more... oragnge more like]
00615         DocColour Grey(255,200,0);
00616 
00617         // Render the attributes and the a rectangle
00618         pRender->SaveContext();
00619         pRender->SetLineColour(COLOUR_TRANS);
00620 
00621             // Draw a rectangle to fill in the background - Fill with Dialogue Background colour
00622         pRender->SetFillColour(RedrawColours.DialogBack());
00623         pRender->DrawRect(&VirtualSize);
00624     
00625         if (BitmapToUse)
00626         {
00627 
00628             NodeBitmap NB;
00629             NodeBitmap * pNodeBitmap = &NB;
00630         
00631             if (!((pNodeBitmap == NULL) || (!pNodeBitmap->SetUpPath(12,12))))
00632             {
00633                 // Get a new bitmap object for this node.
00634                 pNodeBitmap->GetBitmapRef()->SetBitmap(BitmapToUse);
00635                         
00636                 ENSURE(pNodeBitmap->GetBitmap()->ActualBitmap != NULL, "No bitmap object found!");
00637         
00638                 DocRect BitmapSize(VirtualSize);
00639                 BitmapInfo BMInfo;
00640                 BitmapToUse->ActualBitmap->GetInfo(&BMInfo);
00641                 if (BMInfo.PixelWidth==0) BMInfo.PixelWidth=1;
00642                 if (BMInfo.PixelHeight==0) BMInfo.PixelHeight=1;
00643 
00644                 double BMAspect = ((double)(BMInfo.PixelWidth))/((double)(BMInfo.PixelHeight));
00645                 double RedrawAspect = ((double)(ExtraInfo->dx))/((double)(ExtraInfo->dy));
00646 
00647                 if (BMAspect>RedrawAspect)
00648                 {
00649                     // grey at top and bottom
00650                     INT32 NewHeight = (INT32)( 0.5 + ((double)(VirtualSize.Width()))/BMAspect);
00651                     if (NewHeight<1) NewHeight = 1;
00652                     BitmapSize.loy = (VirtualSize.Height()-NewHeight)/2;
00653                     BitmapSize.hiy = BitmapSize.loy + NewHeight;
00654                 }
00655                 else
00656                 {
00657                     // grey on left and right
00658                     INT32 NewWidth = (INT32)( 0.5 + ((double)(VirtualSize.Height()))*BMAspect);
00659                     if (NewWidth<1) NewWidth = 1;
00660                     BitmapSize.lox = (VirtualSize.Width()-NewWidth)/2;
00661                     BitmapSize.hix = BitmapSize.lox + NewWidth;
00662                 }
00663 
00664                 // And set this in our bitmap node
00665                 pNodeBitmap->CreateShape(BitmapSize);
00666                     
00667                 pNodeBitmap->Render(pRender);
00668             }
00669         }
00670 
00671         pRender->RestoreContext();
00672 
00673         // Get rid of the render region
00674         DestroyGRenderRegion(pRender);
00675     }
00676     return TRUE;
00677 }

BOOL BfxDlg::SetDirty BOOL  Redraw = TRUE  )  [private]
 

Clears the clean flag and deletes the effect.

Author:
Alex_Bligh (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 294 of file bfxdlg.cpp.

00295 {
00296     if (!ClearDestination(Redraw)) return FALSE;
00297     Clean = FALSE;
00298     if (pFX)
00299     {
00300         delete pFX;
00301         pFX = NULL;
00302     }
00303     return TRUE;
00304 }

BOOL BfxDlg::SetEffect CCRuntimeClass Effect  )  [private]
 

Choses the bitmap effect for processing.

Author:
Alex_Bligh (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 262 of file bfxdlg.cpp.

00263 {
00264     if (pFX)
00265     {
00266         if (pFX->GetRuntimeClass() == Effect) return TRUE;
00267         delete pFX;
00268         pFX = NULL;
00269     }
00270     if (Effect)
00271     {
00272         pFX = (AccusoftBitmapEffect *) (Effect->CreateObject());
00273         if (!pFX) return FALSE;
00274         return pFX->SetParameters(Param1, Param2, Param3, Matrix);
00275     }
00276     else return TRUE;
00277 }

BOOL BfxDlg::SetParameters INT32  p1 = 0,
INT32  p2 = 0,
INT32  p3 = 0
[inline, private]
 

Definition at line 217 of file bfxdlg.h.

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


Member Data Documentation

BOOL BfxDlg::Clean [private]
 

Definition at line 233 of file bfxdlg.h.

const UINT32 BfxDlg::IDD = _R(IDD_BFXDLG) [static]
 

Definition at line 197 of file bfxdlg.h.

BOOL BfxDlg::InteractiveBCC = TRUE [static, private]
 

Definition at line 239 of file bfxdlg.h.

double BfxDlg::Matrix[9] [private]
 

Definition at line 204 of file bfxdlg.h.

const CDlgMode BfxDlg::Mode = MODELESS [static]
 

Definition at line 194 of file bfxdlg.h.

CDlgResID BfxDlg::OpenPage [private]
 

Definition at line 237 of file bfxdlg.h.

INT32 BfxDlg::Param1 [private]
 

Definition at line 201 of file bfxdlg.h.

INT32 BfxDlg::Param2 [private]
 

Definition at line 202 of file bfxdlg.h.

INT32 BfxDlg::Param3 [private]
 

Definition at line 203 of file bfxdlg.h.

KernelBitmap* BfxDlg::pDestination [private]
 

Definition at line 230 of file bfxdlg.h.

AccusoftBitmapEffect* BfxDlg::pFX [private]
 

Definition at line 235 of file bfxdlg.h.

KernelBitmap* BfxDlg::pOriginal [private]
 

Definition at line 229 of file bfxdlg.h.

BitmapInfo* BfxDlg::pOrigInfo [private]
 

Definition at line 232 of file bfxdlg.h.

KernelBitmap* BfxDlg::pPrevOriginal [private]
 

Definition at line 231 of file bfxdlg.h.


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