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.

01815 {
01816     if (m_PaletteControl.GetSelectedColour() != BitmapExportPaletteControl::INVALID_COLOUR_VALUE)
01817         m_PaletteControl.SetSelectedColourToggleDeleted();
01818 
01819     m_pExportOptions->SetTempFileMatchesExportOptions(FALSE);
01820 //  m_pExportOptions->InvalidatePalette();
01821     SetPreviewButtonState(true); // set the preview button
01822 }

void BmapPrevDlg::HandlePaletteDitheringListChange  )  [private]
 

Definition at line 1643 of file bmapprev.cpp.

01644 {
01645     //  Get the user's selection
01646     String_16 DitherSelected = GetStringGadgetValue(_R(IDC_DITHERING_COMBO) );
01647 
01648     if( DitherSelected.IsIdentical(String_16(_R(IDS_DITHER_NONE))))
01649     {
01650         m_pExportOptions->SetDither(XARADITHER_NONE);
01651     }
01652     else if( DitherSelected.IsIdentical( String_16( _R(IDS_DITHER_ORDERED))))
01653     {
01654         m_pExportOptions->SetDither(XARADITHER_ORDERED);
01655     }
01656     else if( DitherSelected.IsIdentical( String_16( _R(IDS_DITHER_ERROR_DIFFUSED))))
01657     {
01658         m_pExportOptions->SetDither(XARADITHER_ERROR_DIFFUSION);
01659     }
01660     else
01661     {
01662         ERROR3("Impossible dither type selected");
01663     }
01664 
01665     // Invalidate the palette and therefor force a redraw of the the preview
01666     m_pExportOptions->InvalidatePalette();
01667 }

void BmapPrevDlg::HandlePaletteLockedColourButtonChange  )  [private]
 

Definition at line 1749 of file bmapprev.cpp.

01750 {
01751     if (m_PaletteControl.GetSelectedColour() != BitmapExportPaletteControl::INVALID_COLOUR_VALUE)
01752     {
01753         m_PaletteControl.SetSelectedColourToggleLocked();
01754 //      m_pExportOptions->InvalidatePalette(); // unlocking a colour means this colour could become anything
01755 //                                              // locking is safe but we dont check for that
01756 
01757         // set the preedited colour to match the edited colour
01758         SetPreEditedPaletteColour();
01759     }
01760     SetPreviewButtonState(true); // set the preview button
01761 }

void BmapPrevDlg::HandlePalettePaletteListChange  )  [private]
 

Definition at line 1675 of file bmapprev.cpp.

01676 {
01677     //  Get the user's selection
01678     String_16 PaletteSelected = GetStringGadgetValue(_R(IDC_PALETTE_COMBO));
01679 
01680     if(PaletteSelected.IsIdentical(String_16(_R(IDS_PALETTE_BROWSER))))
01681     {
01682         m_pExportOptions->SetToUseBrowserPalette(TRUE);
01683         m_pExportOptions->SetWebSnapPaletteAmount(0);
01684     }
01685     else
01686     {
01687         if(PaletteSelected.IsIdentical( String_16(_R(IDS_PALETTE_OPTIMISED))))
01688         {
01689             m_pExportOptions->SetToUseBrowserPalette(FALSE);
01690             m_pExportOptions->SetWebSnapPaletteAmount(0);
01691         }
01692         else if(PaletteSelected.IsIdentical( String_16(_R(IDS_PALETTE_WEB_SNAP))))
01693         {
01694             m_pExportOptions->SetToUseBrowserPalette(FALSE);
01695             m_pExportOptions->SetWebSnapPaletteAmount(12);
01696         }
01697 
01698         // Quick fix so ordered dithering is not used with palette types other
01699         // than browser
01700         if (m_pExportOptions->GetDither() == XARADITHER_ORDERED)
01701         {
01702             m_pExportOptions->SetDither(XARADITHER_ERROR_DIFFUSION);
01703         }
01704     }
01705 }

void BmapPrevDlg::HandlePaletteRestoreColourButtonChange  )  [private]
 

Definition at line 1833 of file bmapprev.cpp.

void BmapPrevDlg::HandlePaletteSortListChange  )  [private]
 

Definition at line 1862 of file bmapprev.cpp.

01863 {
01864     //  Get the user's selection
01865     String_16 sort = GetStringGadgetValue(_R(IDC_T2_SORT_LIST));
01866 
01867     if(sort.IsIdentical(String_16(_R(IDS_SORT_BY_USES))))
01868     {
01869         m_PaletteControl.SetCurrentSortType(BitmapExportPaletteInterface::SORT_USE);
01870     }
01871     else if(sort.IsIdentical( String_16(_R(IDS_SORT_BY_LUMINANCE))))
01872     {
01873         m_PaletteControl.SetCurrentSortType(BitmapExportPaletteInterface::SORT_LUMINANCE);
01874     }
01875     else if(sort.IsIdentical( String_16(_R(IDS_SORT_BY_HUE))))
01876     {
01877         m_PaletteControl.SetCurrentSortType(BitmapExportPaletteInterface::SORT_HUE);
01878     }
01879     else
01880     {
01881         ERROR3("Unknown item selected");
01882     }
01883 
01884 //  m_PaletteControl.RenderSoon();
01885 }

void BmapPrevDlg::HandlePaletteSystemColoursButtonChnage  )  [private]
 

Definition at line 1848 of file bmapprev.cpp.

01849 {
01850     m_pExportOptions->SetToUseSystemPalette(GetLongGadgetValue(_R(IDC_T2_SYSTEM_COLOURS), 0, 1));
01851     m_pExportOptions->InvalidatePalette();
01852     SetPreviewButtonState(true); // set the preview button
01853 }

void BmapPrevDlg::HandlePaletteTabMsg DialogMsg Msg  )  [private]
 

Definition at line 1476 of file bmapprev.cpp.

01477 {
01478     CDlgResID PageID = GetCurrentPageID();  // Get currently selected Tab id
01479     TalkToPage(_R(IDD_PALETTE_TAB));  // The Coords Page identifier
01480     switch (Msg->DlgMsg)
01481     {
01482         case DIM_CREATE:
01483         {
01484             InitPaletteTab();
01485             break;
01486         }
01487         case DIM_SELECTION_CHANGED:
01488         {
01489             if( Msg->GadgetID == _R(IDC_DITHERING_COMBO) )
01490                 HandlePaletteDitheringListChange();
01491             else
01492             if( Msg->GadgetID == _R(IDC_PALETTE_COMBO) )
01493                 HandlePalettePaletteListChange();
01494             else
01495             if( Msg->GadgetID == _R(IDC_COLOUR_DEPTH_COMBO) )
01496                 HandlePaletteColourDepthListChange();
01497             else
01498             if( Msg->GadgetID == _R(IDC_T2_SORT_LIST) )
01499                 HandlePaletteSortListChange();
01500             else
01501             if( Msg->GadgetID == _R(IDC_COLOR_MODEL_LIST) )
01502                 HandlePaletteColourModelListChange();
01503 
01504             RefreshPaletteOptionsTab(); // Changes may have had an effect other controls
01505             break;
01506         }
01507 
01508         case DIM_TEXT_CHANGED:
01509             if (PageID != _R(IDD_PALETTE_TAB) || m_LockSizeUpdates)
01510                 break;
01511 
01512         case DIM_KILL_FOCUS:
01513         {
01514             if (Msg->GadgetID == _R(IDC_COLOURS_USED_EDIT))
01515             {
01516                 HandlePaletteColoursUsedChange();
01517                 RefreshPaletteLinkedControls();
01518             }
01519             else
01520             if (Msg->GadgetID == _R(IDC_RED_EDIT) || Msg->GadgetID == _R(IDC_GREEN_EDIT) || Msg->GadgetID == _R(IDC_BLUE_EDIT))
01521             {
01522                 HandlePaletteColourEditChange(Msg->GadgetID);
01523                 ReDrawInfoType info;
01524                 GetKernelRenderedGadgetInfo(_R(IDC_T2_PALETTE_CONTROL), &info);
01525                 m_PaletteControl.RedrawSelectedCell(&info);
01526             }
01527             TalkToPage(PageID);
01528             break;
01529         }
01530 
01531         case DIM_REDRAW:
01532         {
01533             if (Msg->GadgetID == _R(IDC_T2_PALETTE_CONTROL))
01534                 m_PaletteControl.Render(reinterpret_cast<ReDrawInfoType *>(Msg->DlgMsgParam));
01535             TalkToPage(PageID);
01536             break;
01537         }
01538 
01539         case DIM_MOUSE_MOVE:
01540         {
01541             // Need to tell the palette about mouse movement both inside and outsite of the palette control
01542             // (so it knows when to remove the highlight thing)
01543 
01544             INT32 startColour   = m_PaletteControl.GetMouseOverColour();
01545             INT32 endColour = BitmapExportPaletteControl::INVALID_COLOUR_VALUE;
01546 
01547             if (Msg->GadgetID == _R(IDC_T2_PALETTE_CONTROL))
01548             {
01549                 m_MouseInsidePaletteControl = true;
01550                 m_PaletteControl.MsgMouseMove(reinterpret_cast<ReDrawInfoType *>(Msg->DlgMsgParam));
01551                 endColour = m_PaletteControl.GetMouseOverColour();
01552             }
01553             else if (m_MouseInsidePaletteControl == true)
01554             {
01555                 // This is the first mouse move message since the mouse has left the palette
01556                 m_MouseInsidePaletteControl = false;
01557                 ReDrawInfoType info;
01558                 GetKernelRenderedGadgetInfo(_R(IDC_T2_PALETTE_CONTROL), &info);
01559                 m_PaletteControl.SetHighlightedCell(&info, BitmapExportPaletteControl::INVALID_COLOUR_VALUE);
01560             }
01561 
01562             if (startColour != endColour)
01563                 RefreshPaletteColoursEdit();
01564 
01565             TalkToPage(PageID);
01566             break;
01567         }
01568 
01569         case DIM_LFT_BN_DOWN:
01570         {
01571             if (Msg->GadgetID == _R(IDC_T2_PALETTE_CONTROL))
01572             {
01573                 if (m_PaletteControl.MsgMouseLeftButtonDown(reinterpret_cast<ReDrawInfoType *>(Msg->DlgMsgParam)))
01574                 {
01575                     // The message resulted in a change to the selection
01576                     RefreshPaletteLinkedControls();
01577                 }
01578             }
01579             break;
01580         }
01581 
01582         case DIM_LFT_BN_CLICKED:
01583         {
01584             if( Msg->GadgetID == _R(IDC_T2_LOCKED_COLOUR) )
01585                 HandlePaletteLockedColourButtonChange();
01586             else
01587             if( Msg->GadgetID == _R(IDC_T2_WEB_SAFE_COLOUR) )
01588                 HandlePaletteWebSafeColourButtonChange();
01589             else
01590             if( Msg->GadgetID == _R(IDC_T2_TRANSPARENT_BACKGROUND) )
01591                 HandlePaletteTransparentBackgroundButtonChange();
01592             else
01593             if( Msg->GadgetID == _R(IDC_T2_TRANSPARENT_COLOUR) )
01594                 HandlePaletteTransparentColourButtonChange();
01595             else
01596             if( Msg->GadgetID == _R(IDC_T2_DELETE_COLOUR) )
01597                 HandlePaletteDeleteColourButtonChnage();
01598             else
01599             if( Msg->GadgetID == _R(IDC_T2_RESTORE_COLOUR) )
01600                 HandlePaletteRestoreColourButtonChange();
01601             else
01602             if( Msg->GadgetID == _R(IDC_T2_SYSTEM_COLOURS) )
01603                 HandlePaletteSystemColoursButtonChnage();
01604 
01605             RefreshPaletteOptionsTab(); // Changes may have had an effect other controls
01606             break;
01607         }
01608 
01609         case DIM_RGT_BN_UP:
01610         {
01611         /*  
01612             I have disabled the palette right click menu as some of the manipulations it does on the palette are
01613             a bit iffy, for example toggling lockedness only does half the things it needes to (see the handler
01614             for the locking button).  -- Jonathan 22/12/2000
01615 
01616 
01617             if (Msg->GadgetID == _R(IDC_T2_PALETTE_CONTROL))
01618             {
01619                 m_PaletteControl.MsgMouseRightButtonUp(reinterpret_cast<ReDrawInfoType *>(Msg->DlgMsgParam), this);
01620                 RefreshPaletteLinkedControls();
01621             }
01622         */
01623             break;
01624         }
01625 
01626         case DIM_SET_ACTIVE:
01627             UpdateCurrentTab();
01628             break;
01629 
01630         default:
01631             TalkToPage(PageID);
01632             break;
01633     };
01634 }

void BmapPrevDlg::HandlePaletteTransparentBackgroundButtonChange  )  [private]
 

Definition at line 1779 of file bmapprev.cpp.

01780 {
01781     BOOL TransValue = GetLongGadgetValue(_R(IDC_T2_TRANSPARENT_BACKGROUND), 0, 1 );
01782     m_pExportOptions->SetBackgroundTransparency(TransValue);
01783     SetPreviewButtonState(true); // set the preview button
01784 }

void BmapPrevDlg::HandlePaletteTransparentColourButtonChange  )  [private]
 

Definition at line 1792 of file bmapprev.cpp.

01793 {
01794     if (m_PaletteControl.GetSelectedColour() != BitmapExportPaletteControl::INVALID_COLOUR_VALUE)
01795     {
01796         // toggle the control for the colour
01797         if (m_PaletteControl.SetSelectedColourToggleTransparent())
01798         {
01799             // the colour toggled was the background colour so turn background transp off if required
01800             if (m_pExportOptions->IsBackgroundTransparent())
01801                 m_pExportOptions->SetBackgroundTransparency(FALSE);
01802         }
01803         m_pExportOptions->SetTempFileMatchesExportOptions(FALSE); // we have edited the palette
01804         SetPreviewButtonState(true); // set the preview button
01805     }
01806 }

void BmapPrevDlg::HandlePaletteWebSafeColourButtonChange  )  [private]
 

Definition at line 1763 of file bmapprev.cpp.

01764 {
01765     if (m_PaletteControl.GetSelectedColour() != BitmapExportPaletteControl::INVALID_COLOUR_VALUE)
01766     {
01767         m_PaletteControl.SetSelectedColourWebSafe();
01768         m_pExportOptions->SetTempFileMatchesExportOptions(FALSE); // we have edited the palette
01769     }
01770     SetPreviewButtonState(true); // set the preview button
01771 }

void BmapPrevDlg::ImageMapEnableExportToFileOptions BOOL  fValue  )  [private]
 

void BmapPrevDlg::ImageMapEnableOptions BOOL  fValue  )  [private]
 

void BmapPrevDlg::ImageMapGetOptions ImagemapFilterOptions pOptions  )  [private]
 

void BmapPrevDlg::ImageMapOnBrowseClicked  )  [private]
 

void BmapPrevDlg::ImageMapOnCommit  )  [private]
 

void BmapPrevDlg::ImageMapOnCreate  )  [private]
 

void BmapPrevDlg::ImageMapOnFileNameChanged  )  [private]
 

BOOL BmapPrevDlg::Init void   )  [static]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Definition at line 216 of file bmapprev.cpp.

00217 {  
00218     return (RegisterOpDescriptor(   0,
00219                                     _R(IDS_BMAPPREVDLG), 
00220                                     CC_RUNTIME_CLASS(BmapPrevDlg),
00221                                     OPTOKEN_GIFTABDLG,
00222                                     BmapPrevDlg::GetState));
00223 } 

void BmapPrevDlg::InitBitmapOptionsTab  )  [private]
 

void BmapPrevDlg::InitBitmapSizeAntiAlisingRadioGroup  )  [private]
 

void BmapPrevDlg::InitBitmapSizeDPIList  )  [private]
 

void BmapPrevDlg::InitBitmapSizePutHTMLTick  )  [private]
 

void BmapPrevDlg::InitBitmapSizeSelectionRadioGroup  )  [private]
 

void BmapPrevDlg::InitBitmapSizeTab  )  [private]
 

void BmapPrevDlg::InitPaletteButtonStrip  )  [private]
 

Definition at line 1437 of file bmapprev.cpp.

01438 {
01439     SetGadgetBitmaps(_R(IDC_T2_LOCKED_COLOUR),          0, 0 );
01440     SetGadgetBitmaps(_R(IDC_T2_WEB_SAFE_COLOUR),        0, 0 );
01441     SetGadgetBitmaps(_R(IDC_T2_TRANSPARENT_COLOUR),     0, 0 );
01442     SetGadgetBitmaps(_R(IDC_T2_TRANSPARENT_BACKGROUND), 0, 0 );
01443     SetGadgetBitmaps(_R(IDC_T2_DELETE_COLOUR),          0, 0 );
01444     SetGadgetBitmaps(_R(IDC_T2_RESTORE_COLOUR),         0, 0 );
01445     SetGadgetBitmaps(_R(IDC_T2_SYSTEM_COLOURS),         0, 0 );
01446 }

void BmapPrevDlg::InitPaletteColourDepthList  )  [private]
 

Definition at line 1402 of file bmapprev.cpp.

01403 {
01404     // This case is handled in the refresh case
01405 }

void BmapPrevDlg::InitPaletteColourModelList  )  [private]
 

Definition at line 1416 of file bmapprev.cpp.

01417 {
01418     //  Make sure that the list is empty.
01419     DeleteAllValues(_R(IDC_COLOR_MODEL_LIST));
01420 
01421     //  Add the necessary strings to the list. 
01422     //  This is the complete collection of them.
01423     SetStringGadgetValue( _R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_RGB_HEX),      FALSE, 0 );
01424     SetStringGadgetValue( _R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_RGB_NUMBER),   FALSE, 1 );
01425     SetStringGadgetValue( _R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_RGB_PERCENT),  FALSE, 2 );
01426     SetStringGadgetValue( _R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_HSV),          FALSE, 3 );
01427 
01428     SetComboListLength( _R(IDC_COLOR_MODEL_LIST) );
01429 }

void BmapPrevDlg::InitPaletteDitheringList  )  [private]
 

Definition at line 1369 of file bmapprev.cpp.

01370 {
01371     // All of this is done in the RefreshPaletteDitherList function as
01372     // the dithering depends on the colour depth etc.
01373 }

void BmapPrevDlg::InitPalettePaletteList  )  [private]
 

Definition at line 1382 of file bmapprev.cpp.

01383 {
01384     // Make sure the list is empty
01385     DeleteAllValues( _R(IDC_PALETTE_COMBO) );
01386 
01387     //  Add the necessary strings to the list. 
01388     //  This is the complete collection of them.
01389     SetStringGadgetValue( _R(IDC_PALETTE_COMBO), _R(IDS_PALETTE_BROWSER),   FALSE, 0 );
01390     SetStringGadgetValue( _R(IDC_PALETTE_COMBO), _R(IDS_PALETTE_OPTIMISED), FALSE, 1 );
01391     SetStringGadgetValue( _R(IDC_PALETTE_COMBO), _R(IDS_PALETTE_WEB_SNAP),  FALSE, 2 );
01392 
01393     SetComboListLength(_R(IDC_PALETTE_COMBO));
01394 }

void BmapPrevDlg::InitPaletteSortList  )  [private]
 

Definition at line 1455 of file bmapprev.cpp.

01456 {
01457     //  Make sure that the list is empty.
01458     DeleteAllValues( _R(IDC_T2_SORT_LIST) );
01459 
01460     //  Add the necessary strings to the list. 
01461     //  This is the complete collection of them.
01462     SetStringGadgetValue( _R(IDC_T2_SORT_LIST), _R(IDS_SORT_BY_USES),       FALSE, 0 );
01463     SetStringGadgetValue( _R(IDC_T2_SORT_LIST), _R(IDS_SORT_BY_LUMINANCE),  FALSE, 1 );
01464     SetStringGadgetValue( _R(IDC_T2_SORT_LIST), _R(IDS_SORT_BY_HUE),        FALSE, 2 );
01465 
01466     SetComboListLength( _R(IDC_T2_SORT_LIST) );
01467 }

void BmapPrevDlg::InitPaletteTab  )  [private]
 

Definition at line 1342 of file bmapprev.cpp.

01343 {
01344     // Initialise the dithering list.
01345     InitPaletteDitheringList();
01346 
01347     // Initialise the palette list.
01348     InitPalettePaletteList();
01349 
01350     // Initialise the colour depth list.
01351     InitPaletteColourDepthList();
01352 
01353     // Initialise the colour model list.
01354     InitPaletteColourModelList();
01355 
01356     // Initialise the button strip
01357     InitPaletteButtonStrip();
01358 
01359     // Initialise the palette sort list
01360     InitPaletteSortList();
01361 }

MsgResult BmapPrevDlg::Message Msg Message  )  [virtual]
 

This is the message handler for the BmapPrevDlg.

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 1109 of file bmapprev.cpp.

01110 {
01111     // handle the message
01112     if (!IS_OUR_DIALOG_MSG(Message))
01113         return OK;
01114 
01115     if (m_DialogWnd != NULL)
01116         m_DialogWnd->Enable( TRUE );
01117     
01118     DialogMsg* Msg = ((DialogMsg*) Message); 
01119 
01120     BOOL EndDialog = FALSE;     // TRUE if we should quit the dialog
01121 //  BOOL CommitValues = FALSE;  // TRUE if we should commit the dialog values
01122 
01123     // Catch mouse move messages for all tabs here so we can do all the bubble help / status
01124     // bar stuff for all the tabs (note: DIM_MOUSE_MOVE still goes to the tabs, this is just
01125     // a hook to process it a little first)
01126     if (Msg->DlgMsg == DIM_MOUSE_MOVE && m_LastCursorOverControlID != Msg->GadgetID)
01127     {
01128         m_LastCursorOverControlID = Msg->GadgetID;
01129 
01130         UpdateStatusBar(Msg->GadgetID);
01131         PrepareBubbleHelp();
01132     }
01133 
01134     if (Msg->DlgMsg == DIM_TIMER)
01135     {
01136         if (m_pBubbleTimer && m_pBubbleTimer->Elapsed(BUBBLE_TIME))
01137         {
01138             // Delete the timer as it is no longer needed
01139             delete m_pBubbleTimer;
01140             m_pBubbleTimer = 0;
01141 
01142             // Show the bubble help window
01143             DoBubbleHelp();
01144         }
01145     }
01146 
01147     // Determine from what page the message originated
01148     if( Msg->PageID == _R(IDD_TBITMAPSIZE) )
01149         HandleBitmapSizeTabMsg(Msg); 
01150     else
01151     if( Msg->PageID == _R(IDD_PALETTE_TAB) )
01152         HandlePaletteTabMsg(Msg);
01153     else
01154     if( Msg->PageID == _R(IDD_TIMAPOPTIONS) )
01155         HandleImageMapTabMsg(Msg); 
01156     else
01157     if( Msg->PageID == _R(IDD_TBROWSER) )
01158         HandleBrowserPreviewTabMsg(Msg); 
01159     else
01160     if( Msg->PageID == _R(IDD_TBITMAPOPTIONS) )
01161         HandleBitmapOptionsTabMsg(Msg);
01162     else
01163     if( Msg->PageID == 0 )
01164     {
01165         // A message generated from the tabbed dialog itself
01166         switch (Msg->DlgMsg)
01167         {
01168             case DIM_CREATE:
01169             {
01170                 if (!OnCreate()) // initialise
01171                 {
01172                     ERROR3("Problem in OnCreate()");
01173                     return FAIL;
01174                 }
01175                 // disable browser preview for now
01176 //              BOOL Old = m_bDoPreviewInBrowser; // remember the value of the flag
01177 //              m_bDoPreviewInBrowser = FALSE; // disable browser preview
01178 //              DoPreview(); // do preview
01179 //              m_bDoPreviewInBrowser = Old; // restore the setting
01180 
01181 PORTNOTE("other", "Remove bubble help timer usage" );
01182 #if !defined(EXCLUDE_FROM_XARALX)
01183             //  Set up the bubble-help timer.
01184                 SetTimer(BUBBLE_HELP_TIMMER_ID, 100);
01185 #endif
01186                 break;
01187             }
01188 
01189             case DIM_COMMIT:        // Close dialog and insert the bitmap in the document
01190                 EndDialog = TRUE;
01191 PORTNOTE("other", "Remove bubble help timer usage" );
01192 #if !defined(EXCLUDE_FROM_XARALX)
01193                 KillTimer(BUBBLE_HELP_TIMMER_ID);
01194 #endif
01195                 BmapPrevDlg::m_bClickedOnExport = TRUE;
01196                 ImageMapOnCommit();     // Save the image map values
01197                 break;
01198 
01199             case DIM_SOFT_COMMIT:       // Update the preview
01200                 EndDialog = FALSE;
01201                 DoPreview();
01202                 BmapPrevDlg::m_bClickedOnExport = FALSE;
01203                 break; 
01204 
01205             case DIM_CANCEL:        // Close dialog and don't insert the bitmap in the document
01206                 EndDialog = TRUE;
01207 PORTNOTE("other", "Remove bubble help timer usage" );
01208 #if !defined(EXCLUDE_FROM_XARALX)
01209                 KillTimer(BUBBLE_HELP_TIMMER_ID);
01210 #endif
01211                 BmapPrevDlg::m_bClickedOnExport = FALSE;
01212                 // we have cancelled so these options are not valid
01213                 m_pExportOptions->MarkInvalid();
01214                 break;
01215 
01216             case DIM_LFT_BN_CLICKED:
01217             case DIM_RGT_BN_CLICKED:
01218                 // If they clicked on the help button
01219                 if (Msg->GadgetID == wxID_HELP)
01220                     OnHelpButtonClicked();
01221                 break;
01222 
01223             default:
01224                 break;
01225         }
01226     }
01227     else
01228         ERROR3("Message from unknown tab dialog page"); 
01229 
01230     if (EndDialog)  // Dialog communication over 
01231     {   
01232         // set the proper state in the export options to indicate which button was clicked
01233         if (Msg->DlgMsg == DIM_COMMIT)
01234         {
01235             //  Now, the ModifiedAfterLastExport variable used to tell us whether the options had
01236             //  been changed since the user last pressed the Preview button. This does not
01237             //  apply now since the preview is always up to date, so we will ignore it.
01238             if (m_FilterType == MAKE_BITMAP_FILTER)
01239             {
01240                 // we need to get rid of any temp files
01241                 if (m_pExportOptions->HasTempFile())
01242                 {
01243                     // get the path name
01244                     PathName Path = m_pExportOptions->GetPathName();
01245 
01246                     // if a valid path, delete it
01247                     if (Path.IsValid())
01248                         FileUtil::DeleteFile(&Path);
01249 
01250                     m_pExportOptions->SetPathName(NULL);
01251                 }
01252             }
01253 
01254             // set the extention as we may have changed file type
01255             // some extentions are in the form jpg,jpeg
01256             // just use the first example
01257             String_256 Ext = m_pExportOptions->FindBitmapFilterForTheseExportOptions()->pOILFilter->FilterExt;
01258             for (INT32 i = 0; i < 256 && Ext[i]; i++)
01259             {
01260                 if (Ext[i] == ',')
01261                 {
01262                     Ext.Remove(i, Ext.Length()-i);
01263                     break;
01264                 }
01265             }
01266             BmapPrevDlg::m_pthExport.SetType ( Ext );
01267 
01268             m_pExportOptions->SetPutHTMLTagOnClipboard(m_ClipBoardUsage == CLIPBOARD_HTML);
01269 
01270             // we have committed these values so mark them as valid
01271             m_pExportOptions->MarkValid();
01272         } // End DIM_COMMIT.
01273         else 
01274         {
01275             // check if jpeg export dialog has been canceled 
01276             if (m_FilterType == JPEG)
01277             {
01278                 // set our KernelBitmap pointer to NULL.
01279                 JPEGExportOptions::SetKernelBitmap(NULL);
01280             }
01281         }
01282 
01283         // tell the preview dialog to shut down         
01284         if (m_DialogWnd != NULL)
01285             BROADCAST_TO_CLASS( DialogMsg(m_DialogWnd, Msg->DlgMsg, 0, 0, 0), DialogOp );
01286         m_DialogWnd = NULL;
01287 
01288         Close();
01289         End();      // End of dialog 
01290     }
01291 
01292     return DLG_EAT_IF_HUNGRY(Msg);   // I return EAT_MSG unless the message needs to be sent to all dialogs 
01293 }

BOOL BmapPrevDlg::OnCreate  )  [private]
 

Definition at line 682 of file bmapprev.cpp.

00683 {
00684     // If we need to add a preview section then go and do it now
00685     if ((m_FilterType == JPEG) || (m_pExportOptions->GetSelectionType() != ABITMAP))
00686     {
00687 PORTNOTETRACE("other","Preview section NOT setup");
00688 #ifndef EXCLUDE_FROM_XARALX
00689         //First get the size of the current window
00690         wxRect Rect;
00691         GetWindowRect(WindowID, &Rect);
00692 #endif
00693 
00694         //Now, the current window contains only the Tabs
00695         //section of the dialog. We need to insert the Preview
00696         //section of the dialog above the Tabs section. This
00697         //means doing the following:
00698 
00699         //1. Increasing the height of the dialog by the
00700         //   height of the Preview section
00701         //2. Moving the Tabs section downwards, by a distance
00702         //   equal to the height of the Preview section
00703         //3. Inserting the Preview section at the top of the
00704         //   dialog
00705 
00706         //Also, if this is the first time the dialog
00707         //has been created, we must recentre the dialog on 
00708         //screen to compensate for the fact that the Preview
00709         //section has been added. We do this at the same
00710         //time as step 1.
00711 
00712         //So...
00713 
00714         //First, we need to get the height of the 
00715         //Preview section
00716 
00717         //To do this, we create the Preview dialog object
00718         m_pPreviewDlg = new BitmapExportPreviewDialog(WindowID);
00719         ERROR2IF(m_pPreviewDlg == NULL, FALSE, "No preview dialog!");
00720 
00721         //And start the dialog up
00722         m_pPreviewDlg->InitPreviewDialog(this, m_pBmpFilter);
00723 
00724         // Get the window ID
00725         m_DialogWnd = m_pPreviewDlg->WindowID;
00726         ERROR2IF(m_DialogWnd == NULL, FALSE, "No preview dialog!");
00727     
00728         DialogManager::MergeDialogs( WindowID, m_pPreviewDlg->WindowID, true );
00729 
00730         // enable our window (which has been disabled when the preview window was created)
00731         WindowID->Enable( TRUE );
00732     }
00733 
00734     // set the title bar
00735     if (m_FilterType != MAKE_BITMAP_FILTER) 
00736     {
00737         // Set up the title of the dialog box according to the passed in string which
00738         // is the name of the filter plus export bitmap options.
00739         String_256 Temp = ""; //*(m_pExportOptions->GetFilterName());
00740         Temp.Load(m_pExportOptions->GetFilterNameStrID()); // which is safer than the ptr into whatever
00741         Temp += String_256(_R(IDN_EXPORTBMPOPTS));
00742 
00743         DialogManager::SetTitlebarName(WindowID, &Temp); // set the title bar for the window
00744     }
00745     else
00746     {
00747         // set up the title string for the MakeBitmap filter
00748         String_256 Temp(_R(IDS_MAKEBMPOPTS));
00749         DialogManager::SetTitlebarName(WindowID, &Temp); // set the title bar
00750     }
00751 
00752     // set the OK and preview button
00753     SetButtonsText();
00754 
00755     // calculate a dpi value if dpi is not supported
00756     if (!m_bDpiSupported)                           // Doesn't support dpi...
00757     {
00758         // and ensure that its always the number of dpi as defined by a pixel unit
00759         DocUnitList* pDocUnitList = DocUnitList::GetCurrentDocUnitList();
00760         ERROR3IF(pDocUnitList == 0, "BmapPrevDlg::OnCreate - no pDocUnitList!");
00761         Unit* pPixelUnit = pDocUnitList->FindUnit(PIXELS);
00762         ERROR3IF(pPixelUnit == 0, "BmapPrevDlg::OnCreate - no pixel units!");
00763         Unit* pInchUnit = pDocUnitList->FindUnit(INCHES);
00764         ERROR3IF(pInchUnit == 0, "BmapPrevDlg::OnCreate - no inch units!");
00765         double newDpi = (pPixelUnit->GetMillipoints() > 0)
00766                             ? pInchUnit->GetMillipoints() / pPixelUnit->GetMillipoints()
00767                             : 96.0;
00768         m_pExportOptions->SetDPI(newDpi);
00769     }
00770 
00771     AddControlsToHelper();
00772 
00773     UpdateCurrentTab();
00774 
00775     m_PaletteControl.Init(GetReadWriteWindowID());
00776 
00777     return TRUE;
00778 }

void BmapPrevDlg::OnHelpButtonClicked  ) 
 

Definition at line 1302 of file bmapprev.cpp.

01303 {
01304     //Fetch a help page relevant to the filter we're using to export
01305     switch (m_FilterType) 
01306     {
01307         case GIF:
01308         case TI_GIF:
01309             HelpUserTopic(_R(IDS_HELPPATH_Dialog_Bitmap_Export_GIF));
01310             break;
01311         
01312         case PNG:
01313             HelpUserTopic(_R(IDS_HELPPATH_Dialog_Bitmap_Export_PNG));
01314             break;
01315 
01316         case MAKE_BITMAP_FILTER:
01317             HelpUserTopic(_R(IDS_HELPPATH_Command_Create_Bitmap_Copy));
01318             break;
01319         
01320         case BMP_UNCOMPRESSED:
01321             HelpUserTopic(_R(IDS_HELPPATH_Dialog_Bitmap_Export_BMP));
01322             break;
01323 
01324         case JPEG:
01325             HelpUserTopic(_R(IDS_HELPPATH_Dialog_Bitmap_Export_JPEG));
01326             break;
01327     }
01328 }

void BmapPrevDlg::PrepareBubbleHelp  )  [private]
 

Definition at line 877 of file bmapprev.cpp.

00878 {
00879     if (m_pBubbleTimer)
00880         m_pBubbleTimer->Sample();           // reuse the timer created on the last mouse move message
00881     else
00882         m_pBubbleTimer = new MonotonicTime; // it is OK for new to fail as this will just return a null
00883                                             // pointer and therefore there will be no bubble help
00884 PORTNOTE("other","Removed registry usage")
00885 #if !defined(EXCLUDE_FROM_XARALX)
00886     // Create a new 
00887     delete m_pBubbleWnd;
00888     m_pBubbleWnd = 0;
00889 #endif
00890 }

void BmapPrevDlg::RefreshBitmapOptionsTab  )  [private]
 

void BmapPrevDlg::RefreshBitmapSizeScaleFactor  )  [private]
 

void BmapPrevDlg::RefreshBitmapSizeTab  )  [private]
 

void BmapPrevDlg::RefreshImageMapTab  )  [private]
 

void BmapPrevDlg::RefreshPaletteButtonStrip  )  [private]
 

Definition at line 2368 of file bmapprev.cpp.

02369 {
02370     if (m_PaletteControl.GetSelectedColour() == BitmapExportPaletteControl::INVALID_COLOUR_VALUE
02371         || m_bSlicingImage)
02372     {
02373         EnableGadget(_R(IDC_T2_LOCKED_COLOUR),              FALSE);
02374         EnableGadget(_R(IDC_T2_WEB_SAFE_COLOUR),            FALSE);
02375         EnableGadget(_R(IDC_T2_TRANSPARENT_COLOUR),         FALSE);
02376         EnableGadget(_R(IDC_T2_DELETE_COLOUR),              FALSE);
02377         EnableGadget(_R(IDC_T2_RESTORE_COLOUR),             FALSE);
02378     }
02379     else
02380     {
02381         // Locked colour button
02382         EnableGadget(_R(IDC_T2_LOCKED_COLOUR),              m_pExportOptions->GetSupportsPalette());
02383         SetLongGadgetValue(_R(IDC_T2_LOCKED_COLOUR),        m_PaletteControl.GetSelectedColourLocked());
02384 
02385         // Web safe button
02386         EnableGadget(_R(IDC_T2_WEB_SAFE_COLOUR),            m_pExportOptions->GetSupportsPalette());
02387         SetLongGadgetValue(_R(IDC_T2_WEB_SAFE_COLOUR),      FALSE);
02388 
02389         // Make colour transparent button
02390         EnableGadget(_R(IDC_T2_TRANSPARENT_COLOUR),         m_pExportOptions->GetSupportsPalette()
02391                                                             && m_pExportOptions->GetSupportsTransparency());
02392         SetLongGadgetValue(_R(IDC_T2_TRANSPARENT_COLOUR),   m_PaletteControl.GetSelectedColourTransparent());
02393 
02394         // Delete colour button
02395         EnableGadget(_R(IDC_T2_DELETE_COLOUR),              m_pExportOptions->GetSupportsPalette()
02396                                                             && !m_PaletteControl.GetSelectedColourDeleted());
02397         SetLongGadgetValue(_R(IDC_T2_DELETE_COLOUR),        FALSE);
02398 
02399         // Restore colour button
02400         EnableGadget(_R(IDC_T2_RESTORE_COLOUR),             m_pExportOptions->GetSupportsPalette()
02401                                                             && m_PaletteControl.GetSelectedColourDeleted());
02402         SetLongGadgetValue(_R(IDC_T2_RESTORE_COLOUR),       FALSE);
02403     }
02404 
02405     // Make background transparent button
02406     EnableGadget(_R(IDC_T2_TRANSPARENT_BACKGROUND),         m_pExportOptions->GetSupportsTransparency());
02407     SetLongGadgetValue(_R(IDC_T2_TRANSPARENT_BACKGROUND),   m_pExportOptions->IsBackgroundTransparent());
02408 
02409     // System colours button
02410     EnableGadget(_R(IDC_T2_SYSTEM_COLOURS),                 m_pExportOptions->GetSupportsPalette());
02411     SetLongGadgetValue(_R(IDC_T2_SYSTEM_COLOURS),           m_pExportOptions->IsUsingSystemPalette());
02412 }

void BmapPrevDlg::RefreshPaletteColourDepthList  )  [private]
 

Definition at line 2171 of file bmapprev.cpp.

02172 {
02173     // Make sure the list is empty
02174     DeleteAllValues( _R(IDC_COLOUR_DEPTH_COMBO) );
02175 
02176     INT32 nColourDepths = 0;
02177 
02178     DWORD colourDepths = m_pExportOptions->GetSupportedColourDepths();
02179 
02180     if (colourDepths & BitmapExportOptions::COLOUR_32BIT)
02181         SetStringGadgetValue(_R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_32), FALSE, nColourDepths++);
02182     if (colourDepths & BitmapExportOptions::COLOUR_24BIT)
02183         SetStringGadgetValue(_R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_24), FALSE, nColourDepths++);
02184 //  if (colourDepths & BitmapExportOptions::COLOUR_16BIT)
02185 //      SetStringGadgetValue(_R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_16), FALSE, nColourDepths++);
02186     if (colourDepths & BitmapExportOptions::COLOUR_256)
02187         SetStringGadgetValue(_R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_8), FALSE, nColourDepths++);
02188     if (colourDepths & BitmapExportOptions::COLOUR_16)
02189         SetStringGadgetValue(_R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_4), FALSE, nColourDepths++);
02190     if (colourDepths & BitmapExportOptions::COLOUR_2)
02191         SetStringGadgetValue(_R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_1), FALSE, nColourDepths++);
02192 
02193     SetComboListLength(_R(IDC_COLOUR_DEPTH_COMBO));
02194 
02195     switch( m_pExportOptions->GetDepth() )
02196     {
02197         case 1:     SetSelectedDropListItem( _R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_1) );   break;
02198         case 4:     SetSelectedDropListItem( _R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_4) );   break;
02199         case 8:     SetSelectedDropListItem( _R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_8) );   break;
02200         case 24:    SetSelectedDropListItem( _R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_24) );  break;
02201         case 32:    SetSelectedDropListItem( _R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_32) );  break;
02202         default:    SetSelectedDropListItem( _R(IDC_COLOUR_DEPTH_COMBO), _R(IDS_COLOR_DEPTH_8) );   break;
02203     }
02204 
02205     if (nColourDepths > 1)
02206         EnableGadget(_R(IDC_COLOUR_DEPTH_COMBO), TRUE);
02207 }

void BmapPrevDlg::RefreshPaletteColourModelList  )  [private]
 

Definition at line 2249 of file bmapprev.cpp.

02250 {
02251     switch(m_ColorModelType)
02252     {
02253         case MODEL_RGBHEX:      SetSelectedDropListItem(_R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_RGB_HEX) );      break;
02254         case MODEL_RGBNUMBER:   SetSelectedDropListItem(_R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_RGB_NUMBER));    break;
02255         case MODEL_RGBPERCENT:  SetSelectedDropListItem(_R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_RGB_PERCENT));   break;
02256         case MODEL_HSV:         SetSelectedDropListItem(_R(IDC_COLOR_MODEL_LIST), _R(IDS_COLOR_DISPLAY_HSV));           break;
02257         default: // Do nothing
02258             break;
02259     }
02260 
02261     EnableGadget(_R(IDC_COLOR_MODEL_LIST), m_pExportOptions->GetSupportsPalette());
02262 }

void BmapPrevDlg::RefreshPaletteColoursEdit  )  [private]
 

Definition at line 2271 of file bmapprev.cpp.

02272 {
02273     BOOL bPalette       = m_pExportOptions->GetSupportsPalette();
02274     BOOL bSelection     = m_PaletteControl.GetSelectedColour()  != BitmapExportPaletteControl::INVALID_COLOUR_VALUE;
02275     BOOL bHighlight     = m_PaletteControl.GetMouseOverColour() != BitmapExportPaletteControl::INVALID_COLOUR_VALUE;
02276 
02277     // the m_LockSizeUpdates is moonlighting as a lock for palette text controls too
02278     m_LockSizeUpdates = TRUE;
02279 
02280     EnableGadget(_R(IDC_RED_EDIT),      bPalette && bSelection && !m_bIsCreateBitmap && !m_bSlicingImage);
02281     EnableGadget(_R(IDC_GREEN_EDIT),    bPalette && bSelection && !m_bIsCreateBitmap && !m_bSlicingImage);
02282     EnableGadget(_R(IDC_BLUE_EDIT),     bPalette && bSelection && !m_bIsCreateBitmap && !m_bSlicingImage);
02283 
02284     if (bPalette && (bSelection || bHighlight))
02285     {
02286         ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
02287         ERROR3IF(!palette, "There is no palette - This should never happen");
02288 
02289         BYTE r, g, b;
02290         if (bHighlight)
02291         {
02292             r = palette->Data[m_PaletteControl.GetMouseOverColour()].Red;
02293             g = palette->Data[m_PaletteControl.GetMouseOverColour()].Green;
02294             b = palette->Data[m_PaletteControl.GetMouseOverColour()].Blue;
02295         }
02296         else
02297         {
02298             r = palette->Data[m_PaletteControl.GetSelectedColour()].Red;
02299             g = palette->Data[m_PaletteControl.GetSelectedColour()].Green;
02300             b = palette->Data[m_PaletteControl.GetSelectedColour()].Blue;
02301         }
02302 
02303         switch (m_ColorModelType)
02304         {
02305             case MODEL_RGBHEX:
02306             {
02307                 TCHAR str[16];  // Temp string buffer (of abitary size)
02308                 camSprintf(str, _T("%02x"), r); SetStringGadgetValue(_R(IDC_RED_EDIT),      String_16(str));
02309                 camSprintf(str, _T("%02x"), g); SetStringGadgetValue(_R(IDC_GREEN_EDIT),    String_16(str));
02310                 camSprintf(str, _T("%02x"), b); SetStringGadgetValue(_R(IDC_BLUE_EDIT),     String_16(str));
02311                 break;
02312             }
02313             case MODEL_RGBPERCENT:
02314             {
02315                 double p = 100.0 / 255.0;
02316                 SetDoubleGadgetValue(_R(IDC_RED_EDIT),      r * p);
02317                 SetDoubleGadgetValue(_R(IDC_GREEN_EDIT),    g * p);
02318                 SetDoubleGadgetValue(_R(IDC_BLUE_EDIT),     b * p);
02319                 break;
02320             }
02321             case MODEL_RGBNUMBER:
02322             {
02323                 SetLongGadgetValue(_R(IDC_RED_EDIT),        r);
02324                 SetLongGadgetValue(_R(IDC_GREEN_EDIT),      g);
02325                 SetLongGadgetValue(_R(IDC_BLUE_EDIT),       b);
02326                 break;
02327             }
02328             case MODEL_HSV:
02329             {
02330                 INT32 h, s, v;
02331                 DocColour colour(r, g, b);
02332                 colour.GetHSVValue(&h, &s, &v);
02333                 SetLongGadgetValue(_R(IDC_RED_EDIT),        h);             // H
02334                 double p = 100.0 / 255.0;
02335                 SetDoubleGadgetValue(_R(IDC_GREEN_EDIT),    s * p);         // S (as percentage)
02336                 SetDoubleGadgetValue(_R(IDC_BLUE_EDIT),     v * p);         // V (as percentage)
02337                 break;
02338             }
02339             default: // Do nothing
02340                 break;
02341         }
02342     }
02343     else
02344     {
02345         SetStringGadgetValue(_R(IDC_RED_EDIT),      String_16(_T("")));
02346         SetStringGadgetValue(_R(IDC_GREEN_EDIT),    String_16(_T("")));
02347         SetStringGadgetValue(_R(IDC_BLUE_EDIT),     String_16(_T("")));
02348     }
02349 
02350     if(m_ColorModelType == MODEL_HSV)
02351     {
02352         //  Display 'H', 'S', and 'V' beside the colour edit boxes
02353         SetStringGadgetValue(_R(IDC_T2STATIC7), _R(IDS_H_LABEL));
02354         SetStringGadgetValue(_R(IDC_T2STATIC8), _R(IDS_S_LABEL));
02355         SetStringGadgetValue(_R(IDC_T2STATIC9), _R(IDS_V_LABEL));
02356     }
02357     else
02358     {
02359         //  Display 'R', 'G', and 'B' beside the colour edit boxes
02360         SetStringGadgetValue(_R(IDC_T2STATIC7), _R(IDS_R_LABEL));
02361         SetStringGadgetValue(_R(IDC_T2STATIC8), _R(IDS_G_LABEL));
02362         SetStringGadgetValue(_R(IDC_T2STATIC9), _R(IDS_B_LABEL));
02363     }
02364 
02365     m_LockSizeUpdates = FALSE;
02366 }

void BmapPrevDlg::RefreshPaletteColoursUsedEdit  )  [private]
 

Definition at line 2209 of file bmapprev.cpp.

02210 {
02211     BOOL active = m_pExportOptions->GetSupportsPalette();
02212 
02213     EnableGadget(_R(IDC_COLOURS_USED_EDIT), active);
02214 
02215     // the m_LockSizeUpdates is moonlighting as a lock for palette text controls too
02216     m_LockSizeUpdates = TRUE;
02217 
02218     if (active)
02219     {
02220         ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
02221         ERROR3IF(!palette, "There is no palette - This should never happen");
02222 
02223         if (m_pExportOptions->DoesTempFileMatchExportOptions())
02224             // if we are uptodate go with the number of colours in the palette
02225             SetLongGadgetValue(_R(IDC_COLOURS_USED_EDIT), palette->NumberOfColours);
02226 PORTNOTE( "other", "Some very un-kernel stuff is being done, needs movinf to oil" )
02227 #ifndef EXCLUDE_FROM_XARALX
02228         else
02229             // only set the value here if it doesn't has focus
02230             if (::GetFocus() != GetDlgItem(GetReadWriteWindowID(), (INT32)_R(IDC_COLOURS_USED_EDIT)))
02231                 SetLongGadgetValue(_R(IDC_COLOURS_USED_EDIT), m_pExportOptions->GetNumberOfUserRequestedColours());
02232 #endif
02233     }
02234     else
02235         SetStringGadgetValue(_R(IDC_COLOURS_USED_EDIT), String_16(_T("")));
02236 
02237     m_LockSizeUpdates = FALSE;
02238 }

void BmapPrevDlg::RefreshPaletteDitheringList  )  [private]
 

Definition at line 2096 of file bmapprev.cpp.

02097 {
02098     // Make sure the list is empty
02099     DeleteAllValues(_R(IDC_DITHERING_COMBO));
02100 
02101     // Set the first string
02102     SetStringGadgetValue( _R(IDC_DITHERING_COMBO), _R(IDS_DITHER_NONE), FALSE);
02103 
02104     // Find out what types of dithering are currently supported
02105     DWORD dithers = m_pExportOptions->GetSupportedDithers();
02106 
02107     // If there are no dither types supported, stop now
02108     if (!dithers)
02109     {
02110         SetSelectedDropListItem(_R(IDC_DITHERING_COMBO), _R(IDS_DITHER_NONE));
02111     }
02112     else
02113     {
02114         //  Add the necessary strings to the list
02115         if (dithers & BitmapExportOptions::ORDERED_DITHER)
02116             SetStringGadgetValue( _R(IDC_DITHERING_COMBO), _R(IDS_DITHER_ORDERED), FALSE);
02117 
02118         if (dithers & BitmapExportOptions::ERROR_DITHER)
02119             SetStringGadgetValue( _R(IDC_DITHERING_COMBO), _R(IDS_DITHER_ERROR_DIFFUSED), FALSE);
02120 
02121         switch (m_pExportOptions->GetDither())
02122         {
02123             case XARADITHER_ORDERED:
02124             case XARADITHER_ORDERED_GREY:
02125                 SetSelectedDropListItem(_R(IDC_DITHERING_COMBO), _R(IDS_DITHER_ORDERED));
02126                 break;
02127 
02128             case XARADITHER_ERROR_DIFFUSION:
02129                 SetSelectedDropListItem(_R(IDC_DITHERING_COMBO), _R(IDS_DITHER_ERROR_DIFFUSED));
02130                 break;
02131 
02132             case XARADITHER_NONE:
02133                 SetSelectedDropListItem(_R(IDC_DITHERING_COMBO), _R(IDS_DITHER_NONE));
02134                 break;
02135 
02136             default:
02137             case XARADITHER_SIMPLE:
02138                 ERROR3("Unknown dithering type used");
02139                 break;
02140         }
02141     }
02142 
02143     // Enable the control if there are any dithering options
02144     EnableGadget(_R(IDC_DITHERING_COMBO), dithers != 0);
02145 
02146     // Make the drop list the correct length
02147     SetComboListLength( _R(IDC_DITHERING_COMBO) );
02148 }

void BmapPrevDlg::RefreshPaletteLinkedControls  )  [private]
 

Definition at line 2079 of file bmapprev.cpp.

void BmapPrevDlg::RefreshPaletteOptionsTab  )  [private]
 

Definition at line 2050 of file bmapprev.cpp.

02051 {
02052 //  if (m_pExportOptions->GetSupportsPalette())
02053 //  {
02054         if (!m_pExportOptions->IsPaletteValid())
02055             DoPreview();
02056         else
02057             m_PaletteControl.RenderSoon();
02058 //  }
02059 
02060 
02061     RefreshPaletteDitheringList();
02062     RefreshPalettePaletteList();
02063     RefreshPaletteColourDepthList();
02064     RefreshPaletteSortList();
02065     RefreshPaletteLinkedControls();
02066 
02067     SetPreviewButtonState(true);
02068 }

void BmapPrevDlg::RefreshPalettePaletteList  )  [private]
 

Definition at line 2150 of file bmapprev.cpp.

02151 {
02152     if (!m_pExportOptions->GetSupportsPalette())
02153     {
02154         EnableGadget(_R(IDC_PALETTE_COMBO), FALSE);
02155         return;
02156     }
02157     else
02158     {
02159         EnableGadget(_R(IDC_PALETTE_COMBO), TRUE);
02160     }
02161 
02162     // Set the selected item.
02163     if(m_pExportOptions->IsUsingBrowserPalette() == TRUE)
02164         SetSelectedDropListItem(_R(IDC_PALETTE_COMBO), _R(IDS_PALETTE_BROWSER));
02165     else if (m_pExportOptions->GetWebSnapPaletteAmount() > 0)
02166         SetSelectedDropListItem(_R(IDC_PALETTE_COMBO), _R(IDS_PALETTE_WEB_SNAP));
02167     else
02168         SetSelectedDropListItem(_R(IDC_PALETTE_COMBO), _R(IDS_PALETTE_OPTIMISED));
02169 }

void BmapPrevDlg::RefreshPaletteSortList  )  [private]
 

Definition at line 2414 of file bmapprev.cpp.

02415 {
02416     if (!m_pExportOptions->GetSupportsPalette())
02417     {
02418         EnableGadget(_R(IDC_T2_SORT_LIST), FALSE);
02419         return;
02420     }
02421     else
02422     {
02423         EnableGadget(_R(IDC_T2_SORT_LIST), TRUE);
02424     }
02425     
02426     switch (m_PaletteControl.GetCurrentSortType())
02427     {
02428         case BitmapExportPaletteInterface::SORT_USE:
02429             SetSelectedDropListItem(_R(IDC_T2_SORT_LIST), _R(IDS_SORT_BY_USES));
02430             break;
02431 
02432         case BitmapExportPaletteInterface::SORT_LUMINANCE:
02433             SetSelectedDropListItem(_R(IDC_T2_SORT_LIST), _R(IDS_SORT_BY_LUMINANCE));
02434             break;
02435 
02436         case BitmapExportPaletteInterface::SORT_HUE:
02437             SetSelectedDropListItem(_R(IDC_T2_SORT_LIST), _R(IDS_SORT_BY_HUE));
02438             break;
02439 
02440         default:
02441             ERROR3("How did this happen?");
02442             break;
02443     }
02444 }

BOOL BmapPrevDlg::RegisterYourPagesInOrderPlease  )  [private, virtual]
 

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.

See also:
DialogTabOp::AddPage, DialogOp::Create

Reimplemented from DialogTabOp.

Definition at line 242 of file bmapprev.cpp.

00243 {
00244     BOOL ok = TRUE;
00245 
00246     // flag indicating we are doing a bitmap export
00247     BOOL bExportABitmap = (m_pExportOptions->GetSelectionType() == ABITMAP);
00248 
00249     if (bExportABitmap)
00250     {
00251         ok = ok && AddAPage(_R(IDD_TBITMAPOPTIONS));
00252     }
00253     else
00254     {
00255         // Not exporting a bitmap from the bitmap gallery
00256         AddAPage(_R(IDD_PALETTE_TAB));
00257     
00258         if (!m_bSlicingImage)
00259             ok = AddAPage(_R(IDD_TBITMAPSIZE));
00260     }
00261 
00262     // add the imagemap and browser pages
00263     bool    fUsedImapOption = false;
00264     if (ok && !bExportABitmap && m_FilterType != MAKE_BITMAP_FILTER && !m_bSlicingImage)
00265     {
00266 PORTNOTE("other","Removed _R(IDD_TIMAPOPTIONS) & _R(IDD_TBROWSER) - isn't wanted yet")
00267 //      ok =  AddAPage(_R(IDD_TBITMAPOPTIONS)) && AddAPage(_R(IDD_TIMAPOPTIONS)) && AddAPage(_R(IDD_TBROWSER));
00268         ok =  AddAPage(_R(IDD_TBITMAPOPTIONS));
00269         fUsedImapOption = true;
00270     }
00271 
00272 PORTNOTE("other","Removed _R(IDD_TIMAPOPTIONS) - isn't wanted yet")
00273 #ifndef EXCLUDE_FROM_XARALX
00274     // design notes stuff on the image map page is needed in image slicing
00275     if (ok && m_bSlicingImage)
00276     {
00277         ok = AddAPage(_R(IDD_TIMAPOPTIONS));
00278         fUsedImapOption = true;
00279     }
00280 
00281     // These needs to be done before the property sheet is sized, else
00282     // it comes out the wrong size
00283     if( ok && fUsedImapOption )
00284         ImageMapOnCreate();
00285 #endif
00286 
00287     return (ok); 
00288 }

void BmapPrevDlg::RenderControl ReDrawInfoType pExtraInfo  )  [private]
 

void BmapPrevDlg::SetButtonsText  )  [private]
 

Definition at line 571 of file bmapprev.cpp.

00572 {
00573     CDlgResID PageID = GetCurrentPageID();  // Get currently selected Tab id
00574     TalkToPage(0);                      // Select the main tab
00575 
00576     UINT32 ResID;
00577 
00578     if (NamedExportProp::m_fApplyNotExport)
00579         switch (m_CurrentPreview)
00580         {
00581             case 1:     ResID = _R(IDS_PREVIEW_APPLYA);         break;
00582             case 2:     ResID = _R(IDS_PREVIEW_APPLYB);         break;
00583             default:    ResID = _R(IDS_PREVIEW_APPLY);          break;
00584         }
00585     else if (m_FilterType == MAKE_BITMAP_FILTER)
00586         switch (m_CurrentPreview)
00587         {
00588             case 1:     ResID = _R(IDS_PREVIEW_SAVEA);          break;
00589             case 2:     ResID = _R(IDS_PREVIEW_SAVEB);          break;
00590             default:    ResID = _R(IDS_SAVE_BUTTON);            break;
00591         }
00592     else
00593         switch (m_CurrentPreview)
00594         {
00595             case 1:     ResID = _R(IDS_PREVIEW_EXPORTA);        break;
00596             case 2:     ResID = _R(IDS_PREVIEW_EXPORTB);        break;
00597             default:    ResID = _R(IDS_EXPORT_BUTTON);          break;
00598         }
00599 
00600     SetStringGadgetValue(wxID_OK, ResID);
00601     
00602     // Use the tabbed dialogs 'Apply' button as a 'Preview' button
00603     SetStringGadgetValue(_R(ID_APPLY_NOW), _R(IDS_PREVIEW_BUTTON));
00604 
00605     TalkToPage(PageID);         // Select the originally selected tab
00606 }

void BmapPrevDlg::SetDontWantMouseMessage BOOL   )  [inline]
 

Definition at line 126 of file bmapprev.h.

00126 { ASSERT(FALSE); }

void BmapPrevDlg::SetPaletteHighlight INT32  index  ) 
 

Definition at line 970 of file bmapprev.cpp.

00971 {
00972     if (GetCurrentPageID() != _R(IDD_PALETTE_TAB))
00973         return;
00974 
00975     ReDrawInfoType info;
00976     GetKernelRenderedGadgetInfo(_R(IDC_T2_PALETTE_CONTROL), &info);
00977     m_PaletteControl.SetHighlightedCell(&info, index);
00978     RefreshPaletteLinkedControls();
00979 }

void BmapPrevDlg::SetPaletteSelection INT32  index  ) 
 

Definition at line 953 of file bmapprev.cpp.

00954 {
00955     if (GetCurrentPageID() != _R(IDD_PALETTE_TAB))
00956         return;
00957     
00958     ReDrawInfoType info;
00959     GetKernelRenderedGadgetInfo(_R(IDC_T2_PALETTE_CONTROL), &info);
00960     m_PaletteControl.SetSelectedCell(&info, index);
00961     RefreshPaletteLinkedControls();
00962 }

void BmapPrevDlg::SetPreEditedPaletteColour INT32  r = -1,
INT32  g = -1,
INT32  b = -1
[private]
 

void BmapPrevDlg::SetPreviewButtonState bool  enabled  )  [private]
 

Definition at line 608 of file bmapprev.cpp.

00609 {
00610     TRACEUSER( "Gerry", _T("SetPreviewButtonState matches = %d\n"), m_pExportOptions->DoesTempFileMatchExportOptions());
00611     
00612     CDlgResID PageID = GetCurrentPageID();      // Get currently selected Tab id
00613     TalkToPage(0);                          // Select the main tab
00614     EnableGadget(_R(ID_APPLY_NOW), !m_pExportOptions->DoesTempFileMatchExportOptions() /*enabled == 1*/);
00615     TalkToPage(PageID);                         // Select the originally selected tab
00616 }

BOOL BmapPrevDlg::SetSelectedDropListItem INT32  ListID,
INT32  ItemID
[private]
 

void BmapPrevDlg::UpdateCurrentTab  ) 
 

Definition at line 987 of file bmapprev.cpp.

00988 {
00989     CDlgResID PageID = GetCurrentPageID();  // Get currently selected Tab id
00990     if(PageID == _R(IDD_TBITMAPSIZE) )
00991     {
00992         //TRACEUSER( "Simonk", _T("Update tab SIZE\n"));
00993         // Refresh the size tab
00994         RefreshBitmapSizeTab();
00995     }
00996     else
00997     if(PageID == _R(IDD_PALETTE_TAB) )
00998     {
00999         //TRACEUSER( "Simonk", _T("Update tab PALETTE\n"));
01000         RefreshPaletteOptionsTab();
01001     }
01002     else
01003     if(PageID == _R(IDD_TIMAPOPTIONS) )
01004     {
01005         //TRACEUSER( "Simonk", _T("Update tab IMAGE MAP\n"));
01006         // Refresh the image map tab
01007         RefreshImageMapTab();
01008     }
01009     else
01010     if(PageID == _R(IDD_TBROWSER) )
01011     {
01012         //TRACEUSER( "Simonk", _T("Update tab BROWSER\n"));
01013         // Refresh browser tab
01014     }
01015     else
01016     if(PageID == _R(IDD_TBITMAPOPTIONS) )
01017     {
01018         //TRACEUSER( "Simonk", _T("Update tab OPTIONS\n"));
01019         // for this tab the init works just like the refresh
01020         InitBitmapOptionsTab();
01021     }
01022     else
01023     {
01024         //TRACEUSER( "Simonk", _T("Update tab NULL\n"));
01025     }
01026 }

void BmapPrevDlg::UpdateStatusBar UINT32  id  )  [private]
 

Definition at line 892 of file bmapprev.cpp.

00893 {
00894     // now do the status line messages      
00895     UINT32 statusTextID;
00896 
00897     // Find the status message ID from the Gadget ID
00898     if( id == _R(IDC_T2_LOCKED_COLOUR) )            // 'Locked Colour' button
00899     {
00900         statusTextID = _R(IDS_LOCKED_COLOUR_STATUS_TEXT);
00901     }
00902     else
00903     if( id == _R(IDC_T2_WEB_SAFE_COLOUR) )          // 'Web Safe Colour' button
00904     {
00905         statusTextID = _R(IDS_WEB_SAFE_COLOUR_STATUS_TEXT);
00906     }
00907     else
00908     if( id == _R(IDC_T2_TRANSPARENT_COLOUR) )       // 'Transparent Colour' button
00909     {
00910         statusTextID = _R(IDS_TRANSPARENT_COLOUR_STATUS_TEXT);
00911     }
00912     else
00913     if( id == _R(IDC_T2_TRANSPARENT_BACKGROUND) )
00914     {
00915         statusTextID = _R(IDS_TRANSPARENT_BACKGROUND_STATUS_TEXT);
00916     }
00917     else
00918     if( id == _R(IDC_T2_DELETE_COLOUR) )            // 'Delete Colour' button
00919     {
00920         statusTextID = _R(IDS_DELETE_COLOUR_STATUS_TEXT);
00921     }
00922     else
00923     if( id == _R(IDC_T2_RESTORE_COLOUR) )           // 'Restore Colour' button
00924     {
00925         statusTextID = _R(IDS_RESTORE_COLOUR_STATUS_TEXT);
00926     }
00927     else
00928     if( id == _R(IDC_T2_SYSTEM_COLOURS) )           // 'Add System Colours' button
00929     {
00930         statusTextID = _R(IDS_SYSTEM_COLOURS_STATUS_TEXT);
00931     }
00932     else                                            // Nothing - Just show 'Preview...'
00933     {
00934         statusTextID = _R(IDS_BITMAPPREVIEWDIALOG);
00935     }
00936 
00937     //  Put up some status line help
00938     StatusLine* pStatusLine = GetApplication()->GetpStatusLine();
00939     if ( pStatusLine != NULL )
00940     {
00941         String_256  strStatus(statusTextID);
00942         pStatusLine->UpdateText( &strStatus, FALSE );
00943     }
00944 }


Member Data Documentation

const UINT32 BmapPrevDlg::IDD = _R(IDD_BMAPPREVDLG) [static, private]
 

Definition at line 211 of file bmapprev.h.

bool BmapPrevDlg::m_bBrowserPreviewTabCreated [private]
 

Definition at line 197 of file bmapprev.h.

BOOL BmapPrevDlg::m_bClickedOnExport = FALSE [static]
 

Definition at line 153 of file bmapprev.h.

BOOL BmapPrevDlg::m_bDpiSupported [private]
 

Definition at line 192 of file bmapprev.h.

bool BmapPrevDlg::m_bImageMapTabCreated [private]
 

Definition at line 196 of file bmapprev.h.

BOOL BmapPrevDlg::m_bIsCreateBitmap = FALSE [static]
 

Definition at line 146 of file bmapprev.h.

BOOL BmapPrevDlg::m_bIsOrderedDither = TRUE [static]
 

Definition at line 150 of file bmapprev.h.

BOOL BmapPrevDlg::m_bPopularityValuesWanted [private]
 

Definition at line 194 of file bmapprev.h.

BOOL BmapPrevDlg::m_bSlicingImage = FALSE [static]
 

Definition at line 145 of file bmapprev.h.

BOOL BmapPrevDlg::m_bUseExistingPalette = FALSE [static]
 

Definition at line 143 of file bmapprev.h.

enum { ... } BmapPrevDlg::m_ClipBoardUsage [private]
 

ColourTypes BmapPrevDlg::m_ColorModelType [private]
 

Definition at line 200 of file bmapprev.h.

BOOL BmapPrevDlg::m_CurrentPreview [private]
 

Definition at line 193 of file bmapprev.h.

CWindowID BmapPrevDlg::m_DialogWnd [private]
 

Definition at line 190 of file bmapprev.h.

INT32 BmapPrevDlg::m_FilterType
 

Definition at line 156 of file bmapprev.h.

UINT32 BmapPrevDlg::m_LastCursorOverControlID [private]
 

Definition at line 207 of file bmapprev.h.

BOOL BmapPrevDlg::m_LockSizeUpdates [private]
 

Definition at line 203 of file bmapprev.h.

bool BmapPrevDlg::m_MouseInsidePaletteControl [private]
 

Definition at line 201 of file bmapprev.h.

bool BmapPrevDlg::m_MovedWindow = false [static, private]
 

Definition at line 215 of file bmapprev.h.

INT32 BmapPrevDlg::m_NumOfColoursUserAskedFor = 256 [static]
 

Definition at line 147 of file bmapprev.h.

BitmapExportPaletteControl BmapPrevDlg::m_PaletteControl [private]
 

Definition at line 195 of file bmapprev.h.

BaseBitmapFilter* BmapPrevDlg::m_pBmpFilter [private]
 

Definition at line 191 of file bmapprev.h.

MonotonicTime* BmapPrevDlg::m_pBubbleTimer [private]
 

Definition at line 208 of file bmapprev.h.

BubbleHelpWnd* BmapPrevDlg::m_pBubbleWnd [private]
 

Definition at line 206 of file bmapprev.h.

BitmapExportOptions * BmapPrevDlg::m_pExportOptions = NULL [static]
 

Definition at line 142 of file bmapprev.h.

BitmapExportPreviewDialog* BmapPrevDlg::m_pPreviewDlg [private]
 

Definition at line 189 of file bmapprev.h.

PathName BmapPrevDlg::m_pthExport [static]
 

Definition at line 144 of file bmapprev.h.

const CDlgMode BmapPrevDlg::Mode = MODAL [static, private]
 

Definition at line 212 of file bmapprev.h.


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