00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 #ifndef INC_BMAPPREV
00100 #define INC_BMAPPREV
00101
00102 #include "bmpprefs.h"
00103
00104 #include "bmpalctrl.h"
00105
00106 class BitmapExportPreviewDialog;
00107 class BrowserPreviewOptions;
00108 class ImagemapFilterOptions;
00109 class BubbleHelpWnd;
00110
00111 #define OPTOKEN_GIFTABDLG _T("BmapPrevDlg")
00112
00113
00114
00115 class BmapPrevDlg : public DialogTabOp
00116 {
00117 CC_DECLARE_DYNCREATE( BmapPrevDlg )
00118
00119 public:
00120 BmapPrevDlg();
00121 ~BmapPrevDlg();
00122
00123 public:
00124 static BOOL Init();
00125 MsgResult Message(Msg* Message);
00126 void SetDontWantMouseMessage( BOOL ) { ASSERT(FALSE); }
00127 void OnHelpButtonClicked();
00128 void UpdateCurrentTab();
00129 void SetPaletteSelection(INT32 index);
00130
00131 void SetPaletteHighlight(INT32 index);
00132
00133 BOOL DoPreview();
00134
00135 public:
00136
00137
00138 static INT32 GetNumberOfTransparentColours();
00139 static INT32 GetTransparentColour( INT32 Index );
00140
00141 public:
00142 static BitmapExportOptions *m_pExportOptions;
00143 static BOOL m_bUseExistingPalette;
00144 static PathName m_pthExport;
00145 static BOOL m_bSlicingImage;
00146 static BOOL m_bIsCreateBitmap;
00147 static INT32 m_NumOfColoursUserAskedFor;
00148
00149
00150 static BOOL m_bIsOrderedDither;
00151
00152
00153 static BOOL m_bClickedOnExport;
00154
00155
00156 INT32 m_FilterType;
00157
00158 private:
00159 virtual void DoWithParam(OpDescriptor*, OpParam* pParam);
00160 virtual BOOL RegisterYourPagesInOrderPlease();
00161
00162 BOOL OnCreate();
00163 void SetButtonsText();
00164 void SetPreviewButtonState(bool enabled);
00165
00166 void DoBubbleHelp();
00167 void PrepareBubbleHelp();
00168 void UpdateStatusBar(UINT32 id);
00169
00170 void SetPreEditedPaletteColour(INT32 r = -1, INT32 g = -1, INT32 b = -1);
00171
00172
00173 INT32 GetPositionOfItemInDropList( INT32 ListID, INT32 ItemID );
00174 BOOL SetSelectedDropListItem( INT32 ListID, INT32 ItemID );
00175 void RenderControl( ReDrawInfoType* pExtraInfo );
00176
00177 void BrowserPreviewGetOptions(BrowserPreviewOptions *pBrowserOptions);
00178
00179 void ImageMapGetOptions(ImagemapFilterOptions* pOptions);
00180 void ImageMapOnFileNameChanged();
00181 void ImageMapOnBrowseClicked();
00182 void ImageMapEnableExportToFileOptions(BOOL fValue);
00183 void ImageMapEnableOptions(BOOL fValue);
00184 void ImageMapOnCreate();
00185 void ImageMapOnCommit();
00186 WinRect GetExportSize(double dpi);
00187
00188 private:
00189 BitmapExportPreviewDialog *m_pPreviewDlg;
00190 CWindowID m_DialogWnd;
00191 BaseBitmapFilter *m_pBmpFilter;
00192 BOOL m_bDpiSupported;
00193 BOOL m_CurrentPreview;
00194 BOOL m_bPopularityValuesWanted;
00195 BitmapExportPaletteControl m_PaletteControl;
00196 bool m_bImageMapTabCreated;
00197 bool m_bBrowserPreviewTabCreated;
00198 enum { CLIPBOARD_NONE, CLIPBOARD_IMAGEMAP, CLIPBOARD_HTML } m_ClipBoardUsage;
00199 typedef enum { MODEL_INVALID, MODEL_RGBHEX, MODEL_RGBPERCENT, MODEL_RGBNUMBER, MODEL_HSV } ColourTypes;
00200 ColourTypes m_ColorModelType;
00201 bool m_MouseInsidePaletteControl;
00202
00203 BOOL m_LockSizeUpdates;
00204
00205
00206 BubbleHelpWnd *m_pBubbleWnd;
00207 UINT32 m_LastCursorOverControlID;
00208 MonotonicTime *m_pBubbleTimer;
00209
00210 private:
00211 static const UINT32 IDD;
00212 static const CDlgMode Mode;
00213 static OpState GetState(String_256*, OpDescriptor*);
00214
00215 static bool m_MovedWindow;
00216
00217
00218
00219 private:
00220
00221
00222 void InitPaletteTab();
00223 void InitPaletteDitheringList();
00224 void InitPalettePaletteList();
00225 void InitPaletteColourDepthList();
00226 void InitPaletteColourModelList();
00227 void InitPaletteButtonStrip();
00228 void InitPaletteSortList();
00229
00230 void InitBitmapSizeTab();
00231 void InitBitmapSizeDPIList();
00232 void InitBitmapSizeSelectionRadioGroup();
00233 void InitBitmapSizeAntiAlisingRadioGroup();
00234 void InitBitmapSizePutHTMLTick();
00235
00236 void InitBitmapOptionsTab();
00237
00238 private:
00239
00240
00241 void HandlePaletteTabMsg(DialogMsg* Msg);
00242
00243 void HandlePaletteDitheringListChange();
00244 void HandlePalettePaletteListChange();
00245 void HandlePaletteColourDepthListChange();
00246 void HandlePaletteColoursUsedChange();
00247 void HandlePaletteColourModelListChange();
00248 void HandlePaletteSortListChange();
00249 void HandlePaletteColourEditChange(CGadgetID id);
00250
00251
00252 void HandlePaletteLockedColourButtonChange();
00253 void HandlePaletteWebSafeColourButtonChange();
00254 void HandlePaletteTransparentBackgroundButtonChange();
00255 void HandlePaletteTransparentColourButtonChange();
00256 void HandlePaletteDeleteColourButtonChnage();
00257 void HandlePaletteRestoreColourButtonChange();
00258 void HandlePaletteSystemColoursButtonChnage();
00259
00260
00261 void HandleBitmapSizeTabMsg(DialogMsg* Msg);
00262 void HandleBitmapSizeDPIChange();
00263 void HandleBitmapSizeWidthChange();
00264 void HandleBitmapSizeHeightChange();
00265 void HandleBitmapSizeAreaToSaveChange(SelectionType type);
00266 void HandleBitmapSizeAntiAliasingChange(BOOL DoMinimise);
00267 void HandleBitmapSizePutHTMLChange();
00268 void HandleBitmapSizeScaleFactorChange();
00269
00270 void HandleBitmapOptionsTicks(UINT32 tick);
00271
00272 void HandleBrowserPreviewTabMsg(DialogMsg* Msg);
00273
00274 void HandleBitmapOptionsTabMsg(DialogMsg* Msg);
00275
00276 void HandleImageMapTabMsg(DialogMsg* Msg);
00277
00278
00279
00280
00281
00282 private:
00283
00284 void RefreshPaletteOptionsTab();
00285 void RefreshPaletteDitheringList();
00286 void RefreshPalettePaletteList();
00287 void RefreshPaletteColourDepthList();
00288 void RefreshPaletteSortList();
00289 void RefreshPaletteLinkedControls();
00290 void RefreshPaletteColourModelList();
00291 void RefreshPaletteButtonStrip();
00292 void RefreshPaletteColoursUsedEdit();
00293 void RefreshPaletteColoursEdit();
00294
00295
00296 void RefreshBitmapSizeTab();
00297 void RefreshBitmapSizeScaleFactor();
00298
00299 void RefreshBitmapOptionsTab();
00300
00301 void RefreshImageMapTab();
00302
00303
00304
00305
00306 };
00307
00308 #endif
00309