BmapPrevDlg Class Reference

#include <bmapprev.h>

Inheritance diagram for BmapPrevDlg:

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

Public Member Functions

 BmapPrevDlg ()
 ~BmapPrevDlg ()
MsgResult Message (Msg *Message)
 This is the message handler for the BmapPrevDlg.
void SetDontWantMouseMessage (BOOL)
void OnHelpButtonClicked ()
void UpdateCurrentTab ()
void SetPaletteSelection (INT32 index)
void SetPaletteHighlight (INT32 index)
BOOL DoPreview ()

Static Public Member Functions

static BOOL Init ()
 Declares a preference that allows you to clear memory in delete().
static INT32 GetNumberOfTransparentColours ()
static INT32 GetTransparentColour (INT32 Index)

Public Attributes

INT32 m_FilterType

Static Public Attributes

static BitmapExportOptionsm_pExportOptions = NULL
static BOOL m_bUseExistingPalette = FALSE
static PathName m_pthExport
static BOOL m_bSlicingImage = FALSE
static BOOL m_bIsCreateBitmap = FALSE
static INT32 m_NumOfColoursUserAskedFor = 256
static BOOL m_bIsOrderedDither = TRUE
static BOOL m_bClickedOnExport = FALSE

Private Types

enum  { CLIPBOARD_NONE, CLIPBOARD_IMAGEMAP, CLIPBOARD_HTML }
enum  ColourTypes {
  MODEL_INVALID, MODEL_RGBHEX, MODEL_RGBPERCENT, MODEL_RGBNUMBER,
  MODEL_HSV
}

Private Member Functions

virtual void DoWithParam (OpDescriptor *, OpParam *pParam)
 This function should be over-ridden to perform an operation which requires parameters.
virtual BOOL RegisterYourPagesInOrderPlease ()
BOOL OnCreate ()
void SetButtonsText ()
void SetPreviewButtonState (bool enabled)
void DoBubbleHelp ()
void PrepareBubbleHelp ()
void UpdateStatusBar (UINT32 id)
void SetPreEditedPaletteColour (INT32 r=-1, INT32 g=-1, INT32 b=-1)
INT32 GetPositionOfItemInDropList (INT32 ListID, INT32 ItemID)
BOOL SetSelectedDropListItem (INT32 ListID, INT32 ItemID)
void RenderControl (ReDrawInfoType *pExtraInfo)
void BrowserPreviewGetOptions (BrowserPreviewOptions *pBrowserOptions)
void ImageMapGetOptions (ImagemapFilterOptions *pOptions)
void ImageMapOnFileNameChanged ()
void ImageMapOnBrowseClicked ()
void ImageMapEnableExportToFileOptions (BOOL fValue)
void ImageMapEnableOptions (BOOL fValue)
void ImageMapOnCreate ()
void ImageMapOnCommit ()
WinRect GetExportSize (double dpi)
void InitPaletteTab ()
void InitPaletteDitheringList ()
void InitPalettePaletteList ()
void InitPaletteColourDepthList ()
void InitPaletteColourModelList ()
void InitPaletteButtonStrip ()
void InitPaletteSortList ()
void InitBitmapSizeTab ()
void InitBitmapSizeDPIList ()
void InitBitmapSizeSelectionRadioGroup ()
void InitBitmapSizeAntiAlisingRadioGroup ()
void InitBitmapSizePutHTMLTick ()
void InitBitmapOptionsTab ()
void HandlePaletteTabMsg (DialogMsg *Msg)
void HandlePaletteDitheringListChange ()
void HandlePalettePaletteListChange ()
void HandlePaletteColourDepthListChange ()
void HandlePaletteColoursUsedChange ()
void HandlePaletteColourModelListChange ()
void HandlePaletteSortListChange ()
void HandlePaletteColourEditChange (CGadgetID id)
void HandlePaletteLockedColourButtonChange ()
void HandlePaletteWebSafeColourButtonChange ()
void HandlePaletteTransparentBackgroundButtonChange ()
void HandlePaletteTransparentColourButtonChange ()
void HandlePaletteDeleteColourButtonChnage ()
void HandlePaletteRestoreColourButtonChange ()
void HandlePaletteSystemColoursButtonChnage ()
void HandleBitmapSizeTabMsg (DialogMsg *Msg)
 All messages generated from the tabbed dialog's page 1 get processed here Gets the values from the Imagemap tab and puts them into the pOptions structure.
void HandleBitmapSizeDPIChange ()
void HandleBitmapSizeWidthChange ()
void HandleBitmapSizeHeightChange ()
void HandleBitmapSizeAreaToSaveChange (SelectionType type)
void HandleBitmapSizeAntiAliasingChange (BOOL DoMinimise)
void HandleBitmapSizePutHTMLChange ()
void HandleBitmapSizeScaleFactorChange ()
void HandleBitmapOptionsTicks (UINT32 tick)
void HandleBrowserPreviewTabMsg (DialogMsg *Msg)
void HandleBitmapOptionsTabMsg (DialogMsg *Msg)
void HandleImageMapTabMsg (DialogMsg *Msg)
void RefreshPaletteOptionsTab ()
void RefreshPaletteDitheringList ()
void RefreshPalettePaletteList ()
void RefreshPaletteColourDepthList ()
void RefreshPaletteSortList ()
void RefreshPaletteLinkedControls ()
void RefreshPaletteColourModelList ()
void RefreshPaletteButtonStrip ()
void RefreshPaletteColoursUsedEdit ()
void RefreshPaletteColoursEdit ()
void RefreshBitmapSizeTab ()
void RefreshBitmapSizeScaleFactor ()
void RefreshBitmapOptionsTab ()
void RefreshImageMapTab ()

Static Private Member Functions

static OpState GetState (String_256 *, OpDescriptor *)

Private Attributes

BitmapExportPreviewDialogm_pPreviewDlg
CWindowID m_DialogWnd
BaseBitmapFilterm_pBmpFilter
BOOL m_bDpiSupported
BOOL m_CurrentPreview
BOOL m_bPopularityValuesWanted
BitmapExportPaletteControl m_PaletteControl
bool m_bImageMapTabCreated
bool m_bBrowserPreviewTabCreated
enum BmapPrevDlg:: { ... }  m_ClipBoardUsage
ColourTypes m_ColorModelType
bool m_MouseInsidePaletteControl
BOOL m_LockSizeUpdates
BubbleHelpWndm_pBubbleWnd
UINT32 m_LastCursorOverControlID
MonotonicTimem_pBubbleTimer

Static Private Attributes

static const UINT32 IDD = _R(IDD_BMAPPREVDLG)
static const CDlgMode Mode = MODAL
static bool m_MovedWindow = false

Detailed Description

Definition at line 115 of file bmapprev.h.


Member Enumeration Documentation

anonymous enum [private]
 

Enumerator:
CLIPBOARD_NONE 
CLIPBOARD_IMAGEMAP 
CLIPBOARD_HTML 

Definition at line 198 of file bmapprev.h.

enum BmapPrevDlg::ColourTypes [private]
 

Enumerator:
MODEL_INVALID 
MODEL_RGBHEX 
MODEL_RGBPERCENT 
MODEL_RGBNUMBER 
MODEL_HSV 

Definition at line 199 of file bmapprev.h.


Constructor & Destructor Documentation

BmapPrevDlg::BmapPrevDlg  ) 
 

Definition at line 298 of file bmapprev.cpp.

00299   : DialogTabOp(BmapPrevDlg::IDD, BmapPrevDlg::Mode, CC_RUNTIME_CLASS(DialogOp), 0)
00300   , m_pPreviewDlg(NULL)
00301   , m_DialogWnd(NULL)
00302   , m_bImageMapTabCreated(false)
00303   , m_bBrowserPreviewTabCreated(false)
00304   , m_ClipBoardUsage(CLIPBOARD_NONE)    // which of the two clipboard check boxes are set
00305   , m_MouseInsidePaletteControl(true)   // at this point we don't know where the mouse is so this is a safe option
00306   , m_pBubbleWnd(0)                     // used by bubble help
00307   , m_LastCursorOverControlID(0)        // used by bubble help
00308   , m_pBubbleTimer(0)                   // timer is only created when we need it
00309 {
00310     // nasty bit to quickly read the user last used value from the registry
00311     m_ColorModelType = MODEL_INVALID;
00312 PORTNOTE("other","Removed registry usage")
00313 #ifndef EXCLUDE_FROM_XARALX
00314     HKEY optionsKey = OpenRegKeyReadOnly(hAppStateRegKey, TEXT("Options"));
00315     if (optionsKey)
00316     {
00317         HKEY palettesKey = OpenRegKeyReadOnly(optionsKey, TEXT("Palettes"));
00318         if (palettesKey)
00319         {
00320             m_ColorModelType = (ColourTypes)GetRegInt(palettesKey, TEXT("Display"));
00321             CloseRegKey(palettesKey);
00322         }
00323         CloseRegKey(optionsKey);
00324     }
00325 #endif
00326     if (m_ColorModelType != MODEL_RGBHEX    && m_ColorModelType != MODEL_RGBPERCENT && 
00327         m_ColorModelType != MODEL_RGBNUMBER && m_ColorModelType != MODEL_HSV)
00328     {
00329         m_ColorModelType = MODEL_RGBPERCENT;    // fall back value
00330     }
00331 
00332     //  The first time that the dialog appears, we want the palette displayed in 'By Use'
00333     //  mode, so we have to work out the number of times each colour is used in the image.
00334     m_bPopularityValuesWanted = TRUE;
00335 
00336     m_LockSizeUpdates = FALSE;
00337 
00338     // Have to initialise a static variable in the palette right-click menu class.
00339 //  OpPalettePopupCommand::m_pDialog = this;
00340 }

BmapPrevDlg::~BmapPrevDlg  ) 
 

Definition at line 349 of file bmapprev.cpp.

00350 {
00351     //  If a bubble-help window exists, then reclaim the memory.
00352 PORTNOTE("other","Removed BubbleHelpWnd usage")
00353 #if !defined(EXCLUDE_FROM_XARALX)
00354     delete m_pBubbleWnd;
00355 #endif
00356     delete m_pBubbleTimer;
00357 /*  
00358     if( m_FilterType == MAKE_BITMAP_FILTER )
00359     {
00360         //  Do nothing at the moment.
00361         //  In this case, we reset the variable later on.
00362     }
00363     else
00364     {
00365         //  Reset the following variable
00366         GRenderOptPalette::UseOldPalette = TRUE;
00367     }
00368 */
00369 PORTNOTE("other","Removed registry usage")
00370 #if !defined(EXCLUDE_FROM_XARALX)
00371     HKEY optionsKey = OpenRegKey( hAppStateRegKey, TEXT("Options") );
00372     if (!optionsKey)
00373         optionsKey = CreateRegKey(hAppStateRegKey, TEXT("Options") );
00374     if (optionsKey)
00375     {
00376         HKEY palettesKey = OpenRegKey(optionsKey, TEXT("Palettes") );
00377         if (!palettesKey)
00378             palettesKey = CreateRegKey(optionsKey, TEXT("Palettes") );
00379         if (palettesKey )
00380         {
00381             //  Set the relevant value in the key.
00382             SetRegInt(palettesKey, TEXT("Display"), m_ColorModelType);
00383             CloseRegKey(palettesKey);
00384         }
00385         CloseRegKey(optionsKey);
00386     }
00387 #endif
00388 /*
00389     // If we are not dealing with the create bitmap copy dialog, then reset all the 
00390     // transparency settings back to their default values.
00391     //
00392     // Graeme (12/7/00) - I've changed this so that it doesn't clear up the
00393     // transparency values when the dialogue is slicing images. This is because it
00394     // kills off the transparency settings before it's finished with them. In this
00395     // case clean-up takes place in OpSlice::Do ().
00396 //  if( !m_bIsCreateBitmap && !m_bSlicingImage )
00397 //      CancelTransparency();
00398 */
00399 }


Member Function Documentation

void BmapPrevDlg::BrowserPreviewGetOptions BrowserPreviewOptions pBrowserOptions  )  [private]
 

void BmapPrevDlg::DoBubbleHelp  )  [private]
 

Definition at line 787 of file bmapprev.cpp.

00788 {
00789 PORTNOTE("other","Removed registry usage")
00790 #if !defined(EXCLUDE_FROM_XARALX)
00791     //  If a bubble help window exists from a previous call to this function then delete it
00792     delete m_pBubbleWnd;
00793 #endif
00794     m_pBubbleWnd = 0;
00795     
00796     //  Are we over a control?  This is the case if this variable is non-zero.
00797     if ( !m_LastCursorOverControlID )
00798         return;
00799 
00800     //  This holds the ID of the string we want to display in the bubble-help window.
00801     UINT32 bubbleID;
00802 
00803     //  Get the bubble-help string from the gadget ID.
00804     if( m_LastCursorOverControlID == _R(IDC_T2_LOCKED_COLOUR) )         //  'Locked Colour' button.
00805     {
00806         bubbleID = _R(IDS_LOCKED_COLOUR);
00807     }
00808     else
00809     if( m_LastCursorOverControlID == _R(IDC_T2_WEB_SAFE_COLOUR) )       //  'Web Safe Colour' button.
00810     {
00811         bubbleID = _R(IDS_WEB_SAFE_COLOUR);
00812     }
00813     else
00814     if( m_LastCursorOverControlID == _R(IDC_T2_TRANSPARENT_COLOUR) )    //  'Transparent Colour' button.
00815     {
00816         bubbleID = _R(IDS_TRANSPARENT_COLOUR);
00817     }
00818     else
00819     if( m_LastCursorOverControlID == _R(IDC_T2_TRANSPARENT_BACKGROUND) )
00820     {
00821         bubbleID = _R(IDS_TRANSPARENT_BACKGROUND);
00822     }
00823     else
00824     if( m_LastCursorOverControlID == _R(IDC_T2_DELETE_COLOUR) )         //  'Delete Colour' button.
00825     {
00826         bubbleID = _R(IDS_DELETE_COLOUR);
00827     }
00828     else
00829     if( m_LastCursorOverControlID == _R(IDC_T2_RESTORE_COLOUR) )        //  'Restore Colour' button.
00830     {
00831         bubbleID = _R(IDS_RESTORE_COLOUR);
00832     }
00833     else
00834     if( m_LastCursorOverControlID == _R(IDC_T2_SYSTEM_COLOURS) )        //  'Add System Colors' button.
00835     {
00836         bubbleID = _R(IDS_SYSTEM_COLOURS);
00837     }
00838     else                                                                // Any other control.
00839     {
00840         m_LastCursorOverControlID = 0;
00841         bubbleID = 0;
00842     }
00843 
00844     //  If no bubble-help required, then return.
00845     if (bubbleID == 0)
00846         return;
00847     
00848     //  Load the bubble-help string into a variable.
00849     String_256 bubbleText(bubbleID);
00850 
00851 PORTNOTE("other","Removed registry usage")
00852 #if !defined(EXCLUDE_FROM_XARALX)
00853     //  Make a new bubble help window
00854     m_pBubbleWnd = new BubbleHelpWnd;
00855     if (!m_pBubbleWnd)
00856     {
00857         TRACEALL( _T("Unable to create bubble help window in bitmap export dialog\n"));
00858         return;
00859     }
00860 
00861     // Create the actual window
00862     if (!m_pBubbleWnd->Create())
00863     {
00864         TRACEALL( _T("Could not Init bubble help window in bitmap export dialog\n"));
00865         return;
00866     }
00867 
00868     //  Set the text for the window
00869     if (!m_pBubbleWnd->SetText(bubbleText))
00870         return;  // no bubble help for this item
00871 
00872     //  Show the window
00873     m_pBubbleWnd->Show();
00874 #endif
00875 }

BOOL BmapPrevDlg::DoPreview  ) 
 

Definition at line 1037 of file bmapprev.cpp.

01038 {
01039 
01040     //  TRACEUSER( "Gerry", _T("DoPreview 0x%08x\n"), m_pExportOptions);
01041 
01042     CDlgResID PageID = GetCurrentPageID();  // Get currently selected Tab id
01043     if (m_pPreviewDlg == NULL)
01044         return FALSE;
01045 
01046     // Disable 'Export' button to stop nasty crashes
01047     TalkToPage(0);
01048     bool                fIsExportEnabled = IsGadgetEnabled( wxID_OK );
01049     EnableGadget( wxID_OK, false );
01050     
01051     BOOL ok = (m_pExportOptions != NULL);
01052 
01053     if (ok && !m_pExportOptions->DoesTempFileMatchExportOptions())
01054     {
01055         // Set the flag early as otherwise the set active bitmap call in the OnExport system
01056         // generates a second preivew
01057         m_pExportOptions->SetTempFileMatchesExportOptions(TRUE);
01058 
01059         ok = m_pPreviewDlg->OnExport( m_pExportOptions );
01060     }
01061 
01062     if (!ok) m_pExportOptions->SetTempFileMatchesExportOptions(FALSE);
01063 
01064     if (ok)
01065     {
01066         // if first time set the first bitmap as active
01067         if (m_CurrentPreview == 0)
01068             m_CurrentPreview = 1;
01069 
01070         // now do the automatic browser preview
01071 //      if ((m_pPreviewDlg != NULL) && m_bDoPreviewInBrowser)
01072 //          m_pPreviewDlg->DoBrowserPreview(t_BrowserOptions);
01073     }
01074 
01075     // Disable the preview button as the dialog settings currently match the preview
01076     SetPreviewButtonState(false);
01077 
01078     // Update the palette as it may have been changed when the preview was generated
01079     m_PaletteControl.RenderSoon();
01080 
01081     // Re-enable 'Export' button
01082     TalkToPage(0);
01083     EnableGadget( wxID_OK, fIsExportEnabled );
01084     
01085     TalkToPage(PageID);
01086 
01087     return ok;
01088 }

void BmapPrevDlg::DoWithParam OpDescriptor ,
OpParam pParam
[private, virtual]
 

This function should be over-ridden to perform an operation which requires parameters.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/6/94
Parameters:
OpDesc,: A pointer to the OpDescriptor which invoked the operation [INPUTS] pOpParam: Optional operator parameters, these are similar to a window procedures (lParam, wParam). Each operation requiring parameters will describe what these should be.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Operation::Do

Reimplemented from Operation.

Definition at line 408 of file bmapprev.cpp.

00409 {
00410     BOOL ok = TRUE;
00411 
00412     ERROR3IF(pParam == NULL, "pParam = NULL");
00413 
00414     // remember the options
00415 
00416     // this should be the only place where the export options are deleted
00417     // so delete them if we have a new and valid and different set of options to replace them
00418     if (m_pExportOptions && m_pExportOptions != (BitmapExportOptions *)(void *)pParam->Param1)
00419     {
00420         delete m_pExportOptions;
00421         m_pExportOptions = NULL;
00422     }
00423 
00424     m_pExportOptions = (BitmapExportOptions *)(void*)pParam->Param1;
00425 
00426     // remember the bitmap filter
00427     m_pBmpFilter = (BaseBitmapFilter *)(void*)pParam->Param2;
00428 
00429     // safety check
00430     ERROR3IF((m_pExportOptions == NULL) || (m_pBmpFilter == NULL), "No filter or export options");
00431     if ((m_pExportOptions == NULL) || (m_pBmpFilter == NULL))
00432     {
00433         End();
00434         return;
00435     }
00436 
00437     // get the filter ID
00438     m_FilterType = m_pExportOptions->GetFilterType();
00439     //  The following is to stop the BitmapExportPreviewDialog from trying to
00440     //  generate popularity values when we are exporting a jpeg ( and hence there is no palette );
00441     if( m_FilterType == JPEG )
00442         m_bPopularityValuesWanted = FALSE;
00443 
00444     // iniitialize the preview dialog
00445     m_pPreviewDlg = NULL;
00446     m_DialogWnd = NULL;
00447     
00448     m_CurrentPreview = 0;
00449     m_bDpiSupported = TRUE; 
00450 
00451     // assume for the meantime that we are not doing a create bitmap copy
00452     m_bIsCreateBitmap = FALSE;
00453     
00454     // oh ye virtuals
00455     switch ( m_FilterType ) 
00456     {
00457         case GIF:
00458         case TI_GIF:
00459         {
00460 PORTNOTETRACE("other", "Removed GIFExportOptions check" );
00461 #if !defined(EXCLUDE_FROM_XARALX)
00462             GIFExportOptions* pGIFOptions = (GIFExportOptions*)m_pExportOptions;
00463             ERROR3IF(!pGIFOptions->IS_KIND_OF(GIFExportOptions), "pGIFOptions isn't");
00464 
00465             m_bDpiSupported = FALSE;
00466 //          m_bTransparent = pGIFOptions->WantTransparent();
00467 
00468             // > 8bpp not leled by the gif filter
00469             if (pGIFOptions->GetDepth() > 8)
00470                 pGIFOptions->SetDepth(8);
00471 #endif
00472             break;
00473         }
00474         case MAKE_BITMAP_FILTER:
00475         {
00476 PORTNOTETRACE("other", "Removed MakeBitmapExportOptions check" );
00477 #if !defined(EXCLUDE_FROM_XARALX)
00478             MakeBitmapExportOptions* pMkBOptions = (MakeBitmapExportOptions*)m_pExportOptions;
00479             ERROR3IF(!pMkBOptions->IS_KIND_OF(MakeBitmapExportOptions), "pMkBOptions isn't");
00480 
00481             m_bDpiSupported = TRUE;
00482 //          m_bTransparent = pMkBOptions->WantTransparent();
00483 
00484             // Find the png filter 
00485             Filter *pFilter = Filter::GetFirst();
00486             while (pFilter != NULL)
00487             {
00488                 if ((pFilter->GetFlags().CanExport) && 
00489                     (IS_A(pFilter,PNGFilter)))
00490                     // This is the filter!
00491                     break;
00492 
00493                 // Try the next filter
00494                 pFilter = Filter::GetNext(pFilter);
00495             }
00496 
00497             // check for no filter found
00498             if (pFilter == NULL)
00499                 ok = FALSE;
00500 
00501             // convert the options to png options
00502             PNGExportOptions *pPNGOptions = new PNGExportOptions(PNG, NULL);
00503             if (pPNGOptions == NULL)
00504                 ok = FALSE;
00505             else if (ok)
00506             {
00507                 // copy the values across
00508                 pPNGOptions->CopyFromMasked(pMkBOptions);
00509 
00510                 // delete the old options (these would be the makebitmap ones)
00511                 if (m_pExportOptions)
00512                     delete m_pExportOptions;
00513 
00514                 // set the new png options as current
00515                 m_pExportOptions = pPNGOptions;
00516 
00517                 // remove the export options from this filter
00518                 // which deletes the export options
00519                 //if (m_pBmpFilter)
00520                 //  m_pBmpFilter->SetExportOptions(NULL);
00521 
00522                 // remember the filter
00523                 m_pBmpFilter = (BaseBitmapFilter*)pFilter;
00524 
00525                 m_pBmpFilter->SetExportOptions(pPNGOptions);
00526 
00527             }
00528             m_bIsCreateBitmap = TRUE;
00529 #endif
00530             break;
00531         }
00532         case PNG: 
00533         {
00534 //          PNGExportOptions* pPNGOptions = (PNGExportOptions*)m_pExportOptions;
00535 //          ERROR3IF(!pPNGOptions->IS_KIND_OF(PNGExportOptions), "pPNGOptions isn't");
00536             // 1, 4, 8, 24 and 32 bpp
00537 //          m_bTransparent = pPNGOptions->WantTransparent();
00538 
00539             m_bDpiSupported = TRUE;
00540             break;
00541         }
00542 
00543         case BMP_UNCOMPRESSED:
00544             m_bDpiSupported = TRUE;
00545             break;
00546 
00547         case JPEG:
00548             m_bDpiSupported = TRUE;
00549             m_pExportOptions->SetDepth(24); // init to 24bpp
00550             break;
00551 
00552         default:
00553             m_bDpiSupported = FALSE;
00554             break;
00555     }
00556 
00557     // Create the TAB dialog please
00558     if (ok)
00559         ok = Create(); 
00560 
00561     if (!ok)
00562     {
00563         m_pExportOptions->MarkInvalid();
00564         //  Need to use this to indicate that the user clicked on Cancel after having
00565         //  changed the file type.
00566         m_bClickedOnExport = FALSE;
00567         End(); 
00568     }
00569 } 

WinRect BmapPrevDlg::GetExportSize double  dpi  )  [private]
 

BOOL BmapPrevDlg::GetNumberOfTransparentColours  )  [static]
 

Definition at line 185 of file bmapprev.cpp.

00186 {
00187 //  ASSERT(FALSE);
00188     return 0;
00189 }

INT32 BmapPrevDlg::GetPositionOfItemInDropList INT32  ListID,
INT32  ItemID
[private]
 

OpState BmapPrevDlg::GetState String_256 ,
OpDescriptor
[static, private]
 

Definition at line 203 of file bmapprev.cpp.

00204 {    
00205     OpState OpSt;
00206     return(OpSt);
00207 }

INT32 BmapPrevDlg::GetTransparentColour INT32  Index  )  [static]
 

Definition at line 191 of file bmapprev.cpp.

00192 {
00193 //  ASSERT(FALSE);
00194     return 0;
00195 }

void BmapPrevDlg::HandleBitmapOptionsTabMsg DialogMsg Msg  )  [private]
 

void BmapPrevDlg::HandleBitmapOptionsTicks UINT32  tick  )  [private]
 

void BmapPrevDlg::HandleBitmapSizeAntiAliasingChange BOOL  DoMinimise  )  [private]
 

void BmapPrevDlg::HandleBitmapSizeAreaToSaveChange SelectionType  type  )  [private]
 

void BmapPrevDlg::HandleBitmapSizeDPIChange  )  [private]
 

void BmapPrevDlg::HandleBitmapSizeHeightChange  )  [private]
 

void BmapPrevDlg::HandleBitmapSizePutHTMLChange  )  [private]
 

void BmapPrevDlg::HandleBitmapSizeScaleFactorChange  )  [private]
 

void BmapPrevDlg::HandleBitmapSizeTabMsg DialogMsg Msg  )  [private]
 

All messages generated from the tabbed dialog's page 1 get processed here Gets the values from the Imagemap tab and puts them into the pOptions structure.

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

Errors: - Scope: private

See also:
BmapPrevDlg::Message
It sets up the controls on the tab to appropriate defaults.

> void BmapPrevDlg::ImageMapGetOptions(ImagemapFilterOptions* pOptions)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/7/97
It brings up a file dialog to allow the user to enter a file to save into. Then it puts the path the user entered into the pathname field.

It checks if the file exists. If so, it

a. Brings up the Insert/Replace radio buttons b. Parses the file to get the names of all the imagemaps, and puts those names in the drop-down list of the Name combo box

Definition at line 2467 of file bmapprev.cpp.

void BmapPrevDlg::HandleBitmapSizeWidthChange  )  [private]
 

void BmapPrevDlg::HandleBrowserPreviewTabMsg DialogMsg Msg  )  [private]
 

void BmapPrevDlg::HandleImageMapTabMsg DialogMsg Msg  )  [private]
 

void BmapPrevDlg::HandlePaletteColourDepthListChange  )  [private]
 

Definition at line 1714 of file bmapprev.cpp.

01715 {
01716     String_32 ColorDepthSelected = GetStringGadgetValue(_R(IDC_COLOUR_DEPTH_COMBO));
01717 
01718     INT32 newDepth;
01719 
01720     if      (ColorDepthSelected.IsIdentical(String_32(_R(IDS_COLOR_DEPTH_32))))
01721         newDepth = 32;
01722     else if (ColorDepthSelected.IsIdentical(String_32(_R(IDS_COLOR_DEPTH_24))))
01723         newDepth = 24;
01724     else if (ColorDepthSelected.IsIdentical(String_32(_R(IDS_COLOR_DEPTH_8))))
01725         newDepth = 8;
01726     else if (ColorDepthSelected.IsIdentical(String_32(_R(IDS_COLOR_DEPTH_4))))
01727     {
01728         newDepth = 4;
01729 
01730         // Quick fix so ordered dithering is not used in 16 colour mode
01731         // as it does not work
01732         if (m_pExportOptions->GetDither() == XARADITHER_ORDERED)
01733         {
01734             m_pExportOptions->SetDither(XARADITHER_ERROR_DIFFUSION);
01735         }
01736 
01737     }
01738     else if (ColorDepthSelected.IsIdentical(String_16(_R(IDS_COLOR_DEPTH_1))))
01739         newDepth = 1;
01740     else
01741     {
01742         ERROR3("Colour depth was not understood");
01743         return; // Give up
01744     }
01745 
01746     m_pExportOptions->SetDepth(newDepth);
01747 }

void BmapPrevDlg::HandlePaletteColourEditChange CGadgetID  id  )  [private]
 

Definition at line 1919 of file bmapprev.cpp.

01920 {
01921     BOOL valid;
01922 
01923     String_256 str = GetStringGadgetValue(id, &valid);
01924 
01925     if (!valid)
01926         return; // don't change the value so when the control is refreshed it is set
01927                 // back to the old value
01928 
01929     ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
01930     ERROR3IF(!palette, "There is no palette - This should never happen");
01931 
01932     BYTE *pR, *pG, *pB;
01933     pR = &(palette->Data[m_PaletteControl.GetSelectedColour()].Red);
01934     pG = &(palette->Data[m_PaletteControl.GetSelectedColour()].Green);
01935     pB = &(palette->Data[m_PaletteControl.GetSelectedColour()].Blue);
01936 
01937     BYTE startR = *pR;
01938     BYTE startG = *pG;
01939     BYTE startB = *pB;
01940 
01941     BYTE *pColourWeAreChanging = NULL;  // not used in HSV mode
01942 
01943     if( id == _R(IDC_RED_EDIT) )
01944         pColourWeAreChanging = pR;
01945     else
01946     if( id == _R(IDC_GREEN_EDIT) )
01947         pColourWeAreChanging = pG;
01948     else
01949     if( id == _R(IDC_BLUE_EDIT) )
01950         pColourWeAreChanging = pB;
01951     
01952     switch (m_ColorModelType)
01953     {
01954         case MODEL_RGBHEX:
01955         {
01956             INT32 t;
01957             camSscanf(str, _T("%x"), &t);
01958             if (t >= 0 && t < 256)
01959                 *pColourWeAreChanging = t;
01960             break;
01961         }
01962 
01963         case MODEL_RGBPERCENT:
01964         {
01965             double t;
01966             camSscanf(str, _T("%lf"), &t);
01967             double tt = t * (255.0 / 100.0); // convert from percent to 0-255
01968             if (tt >= 0 && tt < 256)
01969                 *pColourWeAreChanging = UINT8(tt + 0.5); // adding 0.5 so number rounds to nearest INT32
01970             break;
01971         }
01972         case MODEL_RGBNUMBER:
01973         {
01974             INT32 t;
01975             camSscanf(str, _T("%u"), &t);
01976             if (t >= 0 && t < 256)
01977                 *pColourWeAreChanging = UINT8(t);
01978             break;
01979         }
01980 
01981         case MODEL_HSV:
01982         {
01983             INT32 newValue;                         // New value of colour component
01984 
01985             if (id == _R(IDC_RED_EDIT))                 // H component
01986             {
01987                 INT32 t;                                // temp INT32 varaible
01988                 camSscanf(str, _T("%u"), &t);               // read as an in
01989                 newValue = t;                       // value to be set (check range before setting)
01990             }
01991             else                                    // S & V components
01992             {
01993                 double t;                           // temp float variable (using float to keep sscanf happy)
01994                 camSscanf(str, _T("%lf"), &t);              // read value as a float
01995                 t *= (float)(255.0 / 100.0);        // convert from percent to 0-255
01996                 newValue = UINT8(t + 0.5);                  // value to be set (check range before setting)
01997             }
01998 
01999 
02000             if (newValue >= 0 && ((id == _R(IDC_RED_EDIT) && newValue < 360) || (id != _R(IDC_RED_EDIT) && newValue < 256)))
02001             {
02002                 INT32 h, s, v;
02003                 DocColour colour(*pR, *pG, *pB);
02004                 colour.GetHSVValue(&h, &s, &v);
02005                 if( id == _R(IDC_RED_EDIT) )
02006                     colour.SetHSVValue(newValue, s, v);
02007                 else
02008                 if( id == _R(IDC_GREEN_EDIT) )
02009                     colour.SetHSVValue(h, newValue, v);
02010                 else
02011                 if( id == _R(IDC_BLUE_EDIT) )
02012                     colour.SetHSVValue(h, s, newValue);
02013                 
02014                 INT32 newR, newG, newB;
02015                 colour.GetRGBValue(&newR, &newG, &newB);
02016                 *pR = newR; *pG = newG; *pB = newB;
02017             }
02018             break;
02019         }
02020 
02021         default:
02022         {
02023             ERROR3("You've broken it");
02024             break;
02025         }
02026     } // end of switch (m_ColorModelType)
02027 
02028     // Lock the colour it the user has managed to change it
02029     if ((startR != *pR || startG != *pG || startB != *pB))
02030     {
02031         // set the colour that it was before in the pre edit fields
02032         SetPreEditedPaletteColour(startR, startG, startB);
02033         // lock the colour
02034         if (!m_PaletteControl.GetSelectedColourLocked())
02035             m_PaletteControl.SetSelectedColourToggleLocked();
02036 
02037         // we have edited the palette so the options now longer match the image
02038         m_pExportOptions->SetTempFileMatchesExportOptions(FALSE);
02039         SetPreviewButtonState(true); // set the preview button
02040     }
02041 }

void BmapPrevDlg::HandlePaletteColourModelListChange  )  [private]
 

Definition at line 1893 of file bmapprev.cpp.

01894 {
01895     String_16 sort = GetStringGadgetValue(_R(IDC_COLOR_MODEL_LIST));
01896 
01897     if(sort.IsIdentical(String_16(_R(IDS_COLOR_DISPLAY_RGB_HEX))))
01898         m_ColorModelType = MODEL_RGBHEX;
01899     else if(sort.IsIdentical( String_16(_R(IDS_COLOR_DISPLAY_RGB_NUMBER))))
01900         m_ColorModelType = MODEL_RGBNUMBER;
01901     else if(sort.IsIdentical( String_16(_R(IDS_COLOR_DISPLAY_RGB_PERCENT))))
01902         m_ColorModelType = MODEL_RGBPERCENT;
01903     else if(sort.IsIdentical( String_16(_R(IDS_COLOR_DISPLAY_HSV))))
01904         m_ColorModelType = MODEL_HSV;
01905     else
01906         ERROR3("Unknown item selected");
01907 }

void BmapPrevDlg::HandlePaletteColoursUsedChange  )  [private]
 

Definition at line 1909 of file bmapprev.cpp.

01910 {
01911     BOOL valid = FALSE;
01912     INT32 colours = GetLongGadgetValue(_R(IDC_COLOURS_USED_EDIT), 2, 256, 0, &valid);
01913     if (valid)
01914         m_pExportOptions->SetNumberOfUserRequestedColours(colours);
01915 
01916     SetPreviewButtonState(true); // set the preview button
01917 }

void BmapPrevDlg::HandlePaletteDeleteColourButtonChnage  )  [private]
 

Definition at line 1814 of file bmapprev.cpp.