[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1482
Date       : Thu Jul 20 11:23:25 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/Makefile.am
   M /Trunk/XaraLX/Kernel/bmapprev.cpp
   M /Trunk/XaraLX/Kernel/bmpexprw.cpp
   M /Trunk/XaraLX/Kernel/bmpexprw.h
   M /Trunk/XaraLX/Kernel/prvwmenu.cpp
   M /Trunk/XaraLX/wxOil/Makefile.am
   M /Trunk/XaraLX/wxOil/cbmpdata.cpp
   M /Trunk/XaraLX/wxOil/dlgmgr.cpp
   M /Trunk/XaraLX/wxOil/fileutil.cpp
   M /Trunk/XaraLX/wxOil/xrc/EN/exprwres.xrc

Re-add preview panes to export dialog (NOTE this is still in progress, so don't bugzilla any issues). Also doesn't do stuff in the rigth way all of the time, I've PROTNOTE these areas


Diff:
Index: Trunk/XaraLX/Kernel/Makefile.am
===================================================================
--- Trunk/XaraLX/Kernel/Makefile.am	(revision 1481)
+++ Trunk/XaraLX/Kernel/Makefile.am	(revision 1482)
@@ -63,7 +63,7 @@
 	zdeflate.cpp jpgdest.cpp webparam.cpp bmpalint.cpp zdftrees.cpp animparams.cpp \
 	sglayer.cpp layermgr.cpp layergal.cpp backgrnd.cpp viewmenu.cpp renddlg.cpp \
 	sgcolour.cpp sgbitmap.cpp bmpsdlg.cpp ngcore.cpp ngitem.cpp ngscan.cpp \
-	ngsentry.cpp ngsetop.cpp ngdialog.cpp property.cpp \
+	ngsentry.cpp ngsetop.cpp ngdialog.cpp property.cpp bmpexprw.cpp \
 	optsedit.cpp optsmisc.cpp optspntr.cpp optstune.cpp optsview.cpp optsgrid.cpp \
 	optspage.cpp optsundo.cpp optsscal.cpp optsunit.cpp pagesize.cpp radio.cpp \
 	xpfcaps.cpp xpfilter.cpp xpfrgn.cpp layerprp.cpp prpsgds.cpp prpslyrs.cpp \
@@ -77,7 +77,7 @@
 	swfbuttn.cpp swffont.cpp swfplace.cpp swfrndr.cpp swfshape.cpp swfsprit.cpp \
 	swfexpdc.cpp swftext.cpp pmaskrgn.cpp printctl.cpp prnmkcom.cpp prnmks.cpp \
 	xsepsops.cpp xarprefs.cpp printing.cpp prntview.cpp psrndrgn.cpp opimgset.cpp \
-	optsprin.cpp prnprefs.cpp rulers.cpp biasgdgt.cpp biasdlg.cpp
+	optsprin.cpp prnprefs.cpp rulers.cpp biasgdgt.cpp biasdlg.cpp prvwmenu.cpp
 
 
 AM_CXXFLAGS = $(XARAFLAGS)
Index: Trunk/XaraLX/Kernel/bmapprev.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bmapprev.cpp	(revision 1481)
+++ Trunk/XaraLX/Kernel/bmapprev.cpp	(revision 1482)
@@ -270,7 +270,8 @@
 	}
 
 PORTNOTE("other","Removed _R(IDD_TIMAPOPTIONS) - isn't wanted yet")
-#ifndef EXCLUDE_FROM_XARALX// design notes stuff on the image map page is needed in image slicing
+#ifndef EXCLUDE_FROM_XARALX
+	// design notes stuff on the image map page is needed in image slicing
 	if (ok && m_bSlicingImage)
 	{
 		ok = AddAPage(_R(IDD_TIMAPOPTIONS));
@@ -688,6 +689,7 @@
 		//First get the size of the current window
 		wxRect Rect;
 		GetWindowRect(WindowID, &Rect);
+#endif
 
 		//Now, the current window contains only the Tabs
 		//section of the dialog. We need to insert the Preview
@@ -722,7 +724,18 @@
 		// Get the window ID
 		m_DialogWnd = m_pPreviewDlg->WindowID;
 		ERROR2IF(m_DialogWnd == NULL, FALSE, "No preview dialog!");
+	
+PORTNOTE("other","Nasty pool of oil contaminating nive clean kernel");
+		// Fuse the whole lot into one dialog
+		wxSizer*		pMainSizer = WindowID->GetSizer();
+		wxSizer*		pVertSizer( new wxBoxSizer( wxVERTICAL ) );
+		pVertSizer->Add( m_pPreviewDlg->WindowID, wxALL );
+		pVertSizer->Add( pMainSizer );
 
+		WindowID->SetSizerAndFit( pVertSizer, false );
+
+PORTNOTE("other","Preview section NOT setup");
+#ifndef EXCLUDE_FROM_XARALX
 		//And get the Preview Dialog's rectangle
 		wxRect rectPreview;
 		GetWindowRect(m_DialogWnd, &rectPreview);
@@ -775,10 +788,10 @@
 		//produce the right effect, so let's not question
 		//why.
 		MoveWindow(m_DialogWnd, 0, 0, rectPreview.GetRight() - rectPreview.GetLeft(), rectPreview.GetBottom() - rectPreview.GetTop(), TRUE);
-		
+#endif
+
 		// enable our window (which has been disabled when the preview window was created)
-		EnableWindow(WindowID, TRUE);
-#endif
+		WindowID->Enable( TRUE );
 	}
 
 	// set the title bar
@@ -822,10 +835,7 @@
 
 	UpdateCurrentTab();
 
-PORTNOTE("other","Removed Windows style function EnumChildProc")
-#ifndef EXCLUDE_FROM_XARALX
 	m_PaletteControl.Init(GetReadWriteWindowID());
-#endif
 
 	return TRUE;
 }
@@ -1089,8 +1099,6 @@
 ********************************************************************************************/
 BOOL BmapPrevDlg::DoPreview()
 {
-PORTNOTETRACE("other", "BmapPrevDlg::DoPreview - do nothing - returning true" );
-#if !defined(EXCLUDE_FROM_XARALX)
 	//	TRACEUSER( "Gerry", _T("DoPreview 0x%08x
"), m_pExportOptions);
 
 	CDlgResID PageID = GetCurrentPageID();	// Get currently selected Tab id
@@ -1130,8 +1138,6 @@
 	TalkToPage(PageID);
 
 	return ok;
-#endif
-	return true;
 }
 
 
@@ -3042,8 +3048,7 @@
 
 	HandleBitmapSizeDPIChange();
 	
-PORTNOTE("other", "Remove preview usage" )
-//	if (m_pPreviewDlg )
+	if (m_pPreviewDlg )
 	{
 		m_LockSizeUpdates = TRUE;
 		WinRect wr = GetExportSize(m_pExportOptions->GetDPI());
Index: Trunk/XaraLX/Kernel/bmpexprw.h
===================================================================
--- Trunk/XaraLX/Kernel/bmpexprw.h	(revision 1481)
+++ Trunk/XaraLX/Kernel/bmpexprw.h	(revision 1482)
@@ -253,7 +253,7 @@
 	BOOL m_Dragging; // are we in drag mode?
 	BOOL m_ZoomRectRender; // whether we are to render the zoom rectangle in the redraw() function
 	INT32 m_CurID; // the id of the last set cursor
-	BubbleHelpWnd *m_pBubbleWnd; // the bubble help window
+//	BubbleHelpWnd *m_pBubbleWnd; // the bubble help window
 	UINT32 m_LastCursorOverControlID; //the id of the last control, the cursor was over
 	MonotonicTime BubbleTimer; // the timer for the bubble help
 	BOOL m_BubbleHelpPending; // is it waiting for the timer to signal displaying of bubble help
Index: Trunk/XaraLX/Kernel/bmpexprw.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bmpexprw.cpp	(revision 1481)
+++ Trunk/XaraLX/Kernel/bmpexprw.cpp	(revision 1482)
@@ -166,7 +166,7 @@
 BitmapExportPreviewDialog::BitmapExportPreviewDialog(CWindowID ParentWnd)  
 														: DialogOp(BitmapExportPreviewDialog::IDD, 
 																	BitmapExportPreviewDialog::Mode, 
-																	0,0,0,CC_RUNTIME_CLASS(DialogOp),-1,
+																	0, CC_RUNTIME_CLASS(DialogOp), -1,
 																	ParentWnd) 
 {
 	m_pBitmapExportPreviewDialog = this;
@@ -182,8 +182,8 @@
 	m_CurID = -1;
 	m_ActiveBitmap = 0;
 
-	m_pBubbleWnd = NULL;
-	m_LastCursorOverControlID = 0;
+PORTNOTE("other","Removed BubbleHelp")
+//	m_LastCursorOverControlID = 0;
 	m_BubbleHelpPending = TRUE;
 	m_LastAdjustState = FALSE;
 	m_MouseOperationStarted = FALSE;
@@ -236,12 +236,15 @@
 	// delete the cursor if one is still left
 	DeleteCurrentCursor();
 	
+PORTNOTE("other","Removed BubbleHelp")
+#if !defined(EXCLUDE_FROM_XARALX)
 	// if there is a bubble help window from a previous call, delete it
 	if (m_pBubbleWnd != NULL)
 	{
 		delete m_pBubbleWnd;
 		m_pBubbleWnd = NULL;
 	}
+#endif
 
 	// delete the background bitmap file, if one was created
 	if (BitmapPreviewData::pPagePath != NULL)
@@ -506,9 +509,12 @@
 		// remember the control the mouse is over
 		m_LastCursorOverControlID = id;
 
+PORTNOTE("other","Removed BubbleHelp")
+#if !defined(EXCLUDE_FROM_XARALX)
 		// delete the bubble help window
 		delete m_pBubbleWnd;
 		m_pBubbleWnd = NULL;
+#endif
 
 		m_BubbleHelpPending = TRUE;
 
@@ -516,64 +522,56 @@
 		
 		UINT32 StatusTextID = 0;		
 		// find the status text ID from the Gadget ID
-		switch (id)
+		if( id == _R(IDC_ZOOM_TOOL) )
+			StatusTextID = _R(IDS_ZOOM_TOOL_STATUS_TEXT);
+		else
+		if( id == _R(IDC_PUSH_TOOL) )
+			StatusTextID = _R(IDS_PUSH_TOOL_STATUS_TEXT);
+		else
+		if( id == _R(IDC_ZOOM_TO_FIT) )
+			StatusTextID = _R(IDS_ZOOMTOFIT_STATUS_TEXT);
+		else
+		if( id == _R(IDC_100PERCENT) )
+			StatusTextID = _R(IDS_ZOOMTO100_STATUS_TEXT);
+		else
+		if( id == _R(IDC_1TO1) )
+			StatusTextID = _R(IDS_1TO1_STATUS_TEXT);
+		else
+		if( id == _R(IDC_COLOUR_SELECTOR) )
+			StatusTextID = _R(IDS_COLOUR_SELECTOR_STATUS_TEXT);
+		else
+		if( id == _R(IDC_REDRAW1) ||
+			id == _R(IDC_REDRAW2) )
 		{
-			case _R(IDC_ZOOM_TOOL):
-					StatusTextID = _R(IDS_ZOOM_TOOL_STATUS_TEXT);
-					break;
-			
-			case _R(IDC_PUSH_TOOL):
-					StatusTextID = _R(IDS_PUSH_TOOL_STATUS_TEXT);
-					break;
-			
-			case _R(IDC_ZOOM_TO_FIT):
-					StatusTextID = _R(IDS_ZOOMTOFIT_STATUS_TEXT);
-					break;
+			// over one of the draw controls
 
-			case _R(IDC_100PERCENT):
-					StatusTextID = _R(IDS_ZOOMTO100_STATUS_TEXT);
-					break;
-
-			case _R(IDC_1TO1):
-					StatusTextID = _R(IDS_1TO1_STATUS_TEXT);
-					break;
-
-			case _R(IDC_COLOUR_SELECTOR):
-					StatusTextID = _R(IDS_COLOUR_SELECTOR_STATUS_TEXT);
-					break;
-
-			case _R(IDC_REDRAW1):
-			case _R(IDC_REDRAW2):
-				{
-					// over one of the draw controls
-
-					if (((id == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
-						((id == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
-					{
-						// over the unselected bitmap
-						StatusTextID = _R(IDS_UNSELECTED_STATUS_TEXT);
-					}
-					else
-					{
-						// over the selected bitmap - display the current tool options
-						if (m_CurrentTool == PREVIEW_ZOOM_TOOL)
-							StatusTextID = _R(IDS_ZOOM_MODE_STATUS_TEXT);
-						else if (m_CurrentTool == PREVIEW_PUSH_TOOL)
-							StatusTextID = _R(IDS_PUSH_MODE_STATUS_TEXT);
-						else if( m_CurrentTool == PREVIEW_COLOUR_SELECTOR_TOOL )
-							StatusTextID = _R(IDS_COLOUR_SELECTOR_MODE_STATUS_TEXT);
-					}
-					break;
-				}
-		
-			default:
-				StatusTextID = _R(IDS_BITMAPPREVIEWDIALOG);
+			if (((id == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
+				((id == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
+			{
+				// over the unselected bitmap
+				StatusTextID = _R(IDS_UNSELECTED_STATUS_TEXT);
+			}
+			else
+			{
+				// over the selected bitmap - display the current tool options
+				if (m_CurrentTool == PREVIEW_ZOOM_TOOL)
+					StatusTextID = _R(IDS_ZOOM_MODE_STATUS_TEXT);
+				else if (m_CurrentTool == PREVIEW_PUSH_TOOL)
+					StatusTextID = _R(IDS_PUSH_MODE_STATUS_TEXT);
+				else if( m_CurrentTool == PREVIEW_COLOUR_SELECTOR_TOOL )
+					StatusTextID = _R(IDS_COLOUR_SELECTOR_MODE_STATUS_TEXT);
+			}
 		}
+		else
+			StatusTextID = _R(IDS_BITMAPPREVIEWDIALOG);
 		
 		// put up some status line help
 		StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
 		if (pStatusLine != NULL)
-			pStatusLine->UpdateText(&String_256(StatusTextID),FALSE);
+		{
+			String_256	str( StatusTextID );
+			pStatusLine->UpdateText( &str, FALSE );
+		}
 	}
 }
 
@@ -595,12 +593,15 @@
 
 void BitmapExportPreviewDialog::DoBubbleHelp()
 {
+PORTNOTE("other","Removed BubbleHelp")
+#if !defined(EXCLUDE_FROM_XARALX)
 	// if there is a bubble help window from a previous call, delete it
 	if (m_pBubbleWnd != NULL)
 	{
 		delete m_pBubbleWnd;
 		m_pBubbleWnd = NULL;
 	}
+#endif
 	
 	// check if we are over a control
 	if (!m_LastCursorOverControlID)
@@ -609,55 +610,45 @@
 	UINT32 BubbleID = 0;
 
 	// find the bubble text ID from the Gadget ID
-	switch (m_LastCursorOverControlID)
-	{
-		case _R(IDC_ZOOM_TOOL):
-			BubbleID = _R(IDS_PREVIEW_ZOOM_TOOL);
-			break;
+	if( m_LastCursorOverControlID == _R(IDC_ZOOM_TOOL) )
+		BubbleID = _R(IDS_PREVIEW_ZOOM_TOOL);
+	else
+	if( m_LastCursorOverControlID == _R(IDC_PUSH_TOOL) )
+		BubbleID = _R(IDS_PREVIEW_PUSH_TOOL);
+	else
+	if( m_LastCursorOverControlID == _R(IDC_ZOOM_TO_FIT) )
+		BubbleID = _R(IDS_PREVIEW_ZOOM_TO_FIT);
+	else
+	if( m_LastCursorOverControlID == _R(IDC_100PERCENT) )
+		BubbleID = _R(IDS_PREVIEW_ZOOM_TO_100);
+	else
+	if( m_LastCursorOverControlID == _R(IDC_1TO1) )
+		BubbleID = _R(IDS_PREVIEW_1TO1);
+	else
+	if( m_LastCursorOverControlID == _R(IDC_COLOUR_SELECTOR) )
+		BubbleID = _R(IDS_PREVIEW_COLOUR_SELECTOR);
+	else
+		m_LastCursorOverControlID = 0;
 
-		case _R(IDC_PUSH_TOOL):
-				BubbleID = _R(IDS_PREVIEW_PUSH_TOOL);
-				break;
-
-		case _R(IDC_ZOOM_TO_FIT):
-			BubbleID = _R(IDS_PREVIEW_ZOOM_TO_FIT);
-			break;
-
-		case _R(IDC_100PERCENT):
-			BubbleID = _R(IDS_PREVIEW_ZOOM_TO_100);
-			break;
-
-		case _R(IDC_1TO1):
-			BubbleID = _R(IDS_PREVIEW_1TO1);
-			break;
-
-		case _R(IDC_COLOUR_SELECTOR):
-			BubbleID = _R(IDS_PREVIEW_COLOUR_SELECTOR);
-			break;
-
-		default:
-			m_LastCursorOverControlID = 0;
-	}
-
 	// no bubble found
 	if (BubbleID == 0)
 		return;
 	
-
+PORTNOTE("other","Removed BubbleHelp")
+#ifndef EXCLUDE_FROM_XARALX
 	////try to load the text
 	String_256 BubbleText(BubbleID);
 
 	// Make a new bubble help window
-	TRY
+	try
 	{
 		m_pBubbleWnd = new BubbleHelpWnd;
 	}
-	CATCH(CMemoryException, e)
+	catch( CMemoryException )
 	{
 		TRACEALL( _T("Unable to create bubble help window!
"));
 		return;
 	}
-	END_CATCH
 
 	// Create the actual window
 	if (!m_pBubbleWnd->Create())
@@ -672,7 +663,7 @@
 
 	// display the window
 	m_pBubbleWnd->Show();
-
+#endif
 }
 
 
@@ -734,20 +725,27 @@
 					if (BitmapData[2-m_ActiveBitmap].m_bIsSameBitmap != TRUE) // not same bitmap
 					{
 						// delete the file
-						FileUtil::DeleteFile(&(BitmapData[2-m_ActiveBitmap].m_pOptions->GetPathName()));
+						PathName	path( BitmapData[2-m_ActiveBitmap].m_pOptions->GetPathName() );
+						FileUtil::DeleteFile( & path );
 					}
 
 					// delete the temp file for the active bitmap, but only if Cancel was chosen
 					if (Msg->DlgMsg == DIM_CANCEL)
-						FileUtil::DeleteFile(&(BitmapData[m_ActiveBitmap-1].m_pOptions->GetPathName()));
+					{
+						PathName	path( BitmapData[m_ActiveBitmap-1].m_pOptions->GetPathName() );
+						FileUtil::DeleteFile( &path );
+					}
 				}
 
+PORTNOTE("other","Removed BubbleHelp")
+#if !defined(EXCLUDE_FROM_XARALX)
 				// if there is a bubble help window from a previous call, delete it
 				if (m_pBubbleWnd != NULL)
 				{
 					delete m_pBubbleWnd;
 					m_pBubbleWnd = NULL;
 				}
+#endif
 
 				EndDialog = TRUE;
 				//Close();
@@ -769,49 +767,44 @@
 
 			case DIM_LFT_BN_DOWN :
 			{
-				switch (Msg->GadgetID)
+				if( Msg->GadgetID == _R(IDC_REDRAW1) ||
+					Msg->GadgetID == _R(IDC_REDRAW2) )
 				{
-					case _R(IDC_REDRAW1) :
-					case _R(IDC_REDRAW2) :
-					{
-						// get the extra info
-						ReDrawInfoType*param = (ReDrawInfoType*) Msg->DlgMsgParam;
+					// get the extra info
+					ReDrawInfoType*param = (ReDrawInfoType*) Msg->DlgMsgParam;
+					
+					// sanity check
+					ERROR3IF((param == NULL)  || (param->pMousePos == NULL), "Invalid mouse position passed");
 						
-						// sanity check
-						ERROR3IF((param == NULL)  || (param->pMousePos == NULL), "Invalid mouse position passed");
-						
-						// remember the current pos
-						m_CurrentPos = *(param->pMousePos);
+					// remember the current pos
+					m_CurrentPos = *(param->pMousePos);
 
-						// initialize for zoom to rect
-						m_StartPos = m_CurrentPos;
+					// initialize for zoom to rect
+					m_StartPos = m_CurrentPos;
 
-						// indicate start of mouse operation
-						m_MouseOperationStarted = TRUE;
+					// indicate start of mouse operation
+					m_MouseOperationStarted = TRUE;
 
-						//  If we are doing image slicing, then return now
-						if( BmapPrevDlg::m_bSlicingImage )
-							break;
-
-						// If the 'Colour Selector' is selected, the file format supports a palette
-						// and the message is for the active window more things have to be done.
-						if(	m_CurrentTool == PREVIEW_COLOUR_SELECTOR_TOOL &&
-							m_pParentDlg->m_pExportOptions->GetSupportsPalette() &&
-							(
-								((Msg->GadgetID==_R(IDC_REDRAW1)) && (m_ActiveBitmap==1)) ||
-								((Msg->GadgetID==_R(IDC_REDRAW2)) && (m_ActiveBitmap==2))
-							)
-						  )
-						{
-							//  The user has just clicked on a pixel in one of the preview images
-							//  Need to get the palette inidex of the colour that this pixel uses.
-							INT32 PaletteIndex = GetPaletteIndexOfColour( param, Msg->GadgetID );
-							//  If -1 was returned, then something went wrong, so just leave.
-							if( PaletteIndex == -1 )
-								break;
-							m_pParentDlg->SetPaletteSelection(PaletteIndex);
-						}
+					//  If we are doing image slicing, then return now
+					if( BmapPrevDlg::m_bSlicingImage )
 						break;
+
+					// If the 'Colour Selector' is selected, the file format supports a palette
+					// and the message is for the active window more things have to be done.
+					if(	m_CurrentTool == PREVIEW_COLOUR_SELECTOR_TOOL &&
+						m_pParentDlg->m_pExportOptions->GetSupportsPalette() &&
+						(
+							((Msg->GadgetID==_R(IDC_REDRAW1)) && (m_ActiveBitmap==1)) ||
+							((Msg->GadgetID==_R(IDC_REDRAW2)) && (m_ActiveBitmap==2))
+						) )
+					{
+						//  The user has just clicked on a pixel in one of the preview images
+						//  Need to get the palette inidex of the colour that this pixel uses.
+						INT32 PaletteIndex = GetPaletteIndexOfColour( param, Msg->GadgetID );
+						//  If -1 was returned, then something went wrong, so just leave.
+						if( PaletteIndex == -1 )
+							break;
+						m_pParentDlg->SetPaletteSelection(PaletteIndex);
 					}
 				}
 				break;
@@ -820,100 +813,92 @@
 
 			case DIM_LFT_BN_UP :
 			{
-				switch (Msg->GadgetID)
+				if( Msg->GadgetID == _R(IDC_REDRAW1) ||
+					Msg->GadgetID == _R(IDC_REDRAW2) )
 				{
-					case _R(IDC_REDRAW1) :
-					case _R(IDC_REDRAW2) :
-					{
-						// if the press of the button was outside the control, or ESC was pressed
-						if (!m_MouseOperationStarted)
-						{						
-							// delete the cursor so new one can be displayed
-							DeleteCurrentCursor();
+					// if the press of the button was outside the control, or ESC was pressed
+					if (!m_MouseOperationStarted)
+					{						
+						// delete the cursor so new one can be displayed
+						DeleteCurrentCursor();
 
-							break;
-						}
+						break;
+					}
 						
-						// end of the mouseop
-						m_MouseOperationStarted = FALSE;
+					// end of the mouseop
+					m_MouseOperationStarted = FALSE;
 
-						// change the active bitmap if necessary
-						if (((Msg->GadgetID == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
-							((Msg->GadgetID == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
-						{
-							// change the selected bitmap
-							ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
-						}
-						else
-						{
-							//perform zoom/pan
+					// change the active bitmap if necessary
+					if (((Msg->GadgetID == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
+						((Msg->GadgetID == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
+					{
+						// change the selected bitmap
+						ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
+					}
+					else
+					{
+						//perform zoom/pan
 
-							// get the extra info
-							ReDrawInfoType*param = (ReDrawInfoType*) Msg->DlgMsgParam;
+						// get the extra info
+						ReDrawInfoType*param = (ReDrawInfoType*) Msg->DlgMsgParam;
 							
-							// sanity check
-							ERROR3IF((param == NULL)  || (param->pMousePos == NULL), 
-													"Invalid mouse position passed");
+						// sanity check
+						ERROR3IF((param == NULL)  || (param->pMousePos == NULL), 
+												"Invalid mouse position passed");
 							
-							// remember the current position
-							m_CurrentPos = *(param->pMousePos);
+						// remember the current position
+						m_CurrentPos = *(param->pMousePos);
 
-							if (m_CurrentTool == PREVIEW_ZOOM_TOOL)
-							{
-								if (!m_Dragging) // click-zoom
-									CalcViewRect(FindNearestZoom(!KeyPress::IsAdjustPressed()),
-											param->pMousePos);
-								else // zoom to rectangle
+						if (m_CurrentTool == PREVIEW_ZOOM_TOOL)
+						{
+							if (!m_Dragging) // click-zoom
+								CalcViewRect(FindNearestZoom(!KeyPress::IsAdjustPressed()),
+										param->pMousePos);
+							else // zoom to rectangle
 									ZoomToRect();
-							}
-
-							m_Dragging = FALSE;
 						}
-	
-						// delete the cursor so new one can be displayed
-						DeleteCurrentCursor();
 
-						break;
+						m_Dragging = FALSE;
 					}
+	
+					// delete the cursor so new one can be displayed
+					DeleteCurrentCursor();
 
-					// Any other controls on the 1st image, swap to that image
-					case _R(IDC_ACTIVE1) :
+				}
+				else
+				// Any other controls on the 1st image, swap to that image
+				if( Msg->GadgetID == _R(IDC_ACTIVE1) ||
 //					case _R(IDC_ACTIVEFRAME1) :
-					case _R(IDC_IMAGESIZE1) :
-					case _R(IDC_FILESIZE1) :
-					case _R(IDC_FILEDIFF1) :
-					case _R(IDC_FILE_TYPE_LIST):
+					Msg->GadgetID == _R(IDC_IMAGESIZE1) ||
+					Msg->GadgetID == _R(IDC_FILESIZE1) ||
+					Msg->GadgetID == _R(IDC_FILEDIFF1) ||
+					Msg->GadgetID == _R(IDC_FILE_TYPE_LIST) )
+				{
+					// change the active bitmap if necessary
+					if (m_ActiveBitmap != 1)
 					{
-						// change the active bitmap if necessary
-						if (m_ActiveBitmap != 1)
-						{
-							// change the selected bitmap
-							ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
-
-							//  Don't want to respond to any mouse messages until this piece has
-							//  been finished. 
-//							m_pParentDlg->SetDontWantMouseMessage( TRUE );
-//							BmapPrevDlg::m_bNeedPaletteUpdated = TRUE;
-						}
-						break;
+						// change the selected bitmap
+						ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
+						//  Don't want to respond to any mouse messages until this piece has
+						//  been finished. 
+//						m_pParentDlg->SetDontWantMouseMessage( TRUE );
+//						BmapPrevDlg::m_bNeedPaletteUpdated = TRUE;
 					}
-
-					// Any other controls on the second image, swap to that image
-					case _R(IDC_ACTIVE2) :
+				}
+				else
+				// Any other controls on the second image, swap to that image
+				if( Msg->GadgetID == _R(IDC_ACTIVE2) ||
 //					case _R(IDC_ACTIVEFRAME2) :
-					case _R(IDC_IMAGESIZE2) :
-					case _R(IDC_FILESIZE2) :
-					case _R(IDC_FILEDIFF2) :
-					case _R(IDC_FILE_TYPE_LIST2):
+					Msg->GadgetID == _R(IDC_ACTIVE2) || Msg->GadgetID == _R(IDC_IMAGESIZE2) ||
+					Msg->GadgetID == _R(IDC_ACTIVE2) || Msg->GadgetID == _R(IDC_FILESIZE2) ||
+					Msg->GadgetID == _R(IDC_ACTIVE2) || Msg->GadgetID == _R(IDC_FILEDIFF2) ||
+					Msg->GadgetID == _R(IDC_ACTIVE2) || Msg->GadgetID == _R(IDC_FILE_TYPE_LIST2) )
+				{
+					// change the active bitmap if necessary
+					if (m_ActiveBitmap != 2)
 					{
-						// change the active bitmap if necessary
-						if (m_ActiveBitmap != 2)
-						{
-							// change the selected bitmap
-							ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
-
-						}
-						break;
+						// change the selected bitmap
+						ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
 					}
 				}
 				break;
@@ -928,7 +913,7 @@
 					DeleteCurrentCursor();					// pop the cursor from the stack
 					ReleaseMouse(Msg->GadgetID);			// release the mouse capture
 					if (m_PreviousWithFocus != NULL)		// restore the keyboard input focus to
-						::SetFocus(m_PreviousWithFocus);	// the last window with the focus
+						m_PreviousWithFocus->SetFocus();	// the last window with the focus
 					m_PreviousWithFocus = NULL; // reset it
 				}
 				else
@@ -957,7 +942,7 @@
 						
 						// restore the keyboard input focus to the last window with the focus
 						if (m_PreviousWithFocus != NULL)
-							::SetFocus(m_PreviousWithFocus);
+							m_PreviousWithFocus->SetFocus();
 						m_PreviousWithFocus = NULL; // reset it
 						
 						// pop the cursor from the stack
@@ -965,6 +950,8 @@
 					}
 					else
 					{
+PORTNOTE("other","Removed some oilieness for kernel")
+#ifndef EXCLUDE_FROM_XARALX
 						// get the hwnd of the control
 						CWindowID hChild = ::GetDlgItem(GetReadWriteWindowID(), Msg->GadgetID);
 						
@@ -980,6 +967,7 @@
 						
 						// the mouse is moved inside the control, so update the cursor
 						SetCurrentCursor(Msg->GadgetID);
+#endif
 						
 						//	If we are doing image slicing, then return now
 						if( BmapPrevDlg::m_bSlicingImage )
@@ -1010,32 +998,29 @@
 			{
 				ResetInfo(Msg->GadgetID);
 
-				switch (Msg->GadgetID)
+				if( Msg->GadgetID == _R(IDC_REDRAW1) ||
+					Msg->GadgetID == _R(IDC_REDRAW2) )
 				{
-					case _R(IDC_REDRAW1) :
-					case _R(IDC_REDRAW2):
-					{
-						// check whether the mouse button was first pressed inside our window
-						if (!m_MouseOperationStarted)
-							break;
+					// check whether the mouse button was first pressed inside our window
+					if (!m_MouseOperationStarted)
+						break;
 
-						// check for a drag in the unselected control
-						if (((Msg->GadgetID == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
-							((Msg->GadgetID == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
-							break;
+					// check for a drag in the unselected control
+					if (((Msg->GadgetID == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
+						((Msg->GadgetID == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
+						break;
 
-						if (KeyPress::IsEscapePressed())
-						{
-							// cancel the operation
-							m_MouseOperationStarted = FALSE;
-							
-							// if we are zooming to a rectangle, hide the rectangle
-							if (m_Dragging && (m_CurrentTool == PREVIEW_ZOOM_TOOL))
-								DrawZoomRect();
-
-							break;
-						}
-
+					if (KeyPress::IsEscapePressed())
+					{
+						// cancel the operation
+						m_MouseOperationStarted = FALSE;
+					
+						// if we are zooming to a rectangle, hide the rectangle
+						if (m_Dragging && (m_CurrentTool == PREVIEW_ZOOM_TOOL))
+							DrawZoomRect();
+					}
+					else
+					{
 						// get the extra info
 						ReDrawInfoType*param = (ReDrawInfoType*) Msg->DlgMsgParam;
 						
@@ -1056,7 +1041,10 @@
 
 							// display the text
 							if (StatusTextID != 0)
-								pStatusLine->UpdateText(&String_256(StatusTextID),FALSE);
+							{
+								String_256	str( StatusTextID );
+								pStatusLine->UpdateText( &str, FALSE );
+							}
 						}
 
 						// perform the drag operation
@@ -1064,7 +1052,6 @@
 							DoPush(param->pMousePos);
 						else if (m_CurrentTool == PREVIEW_ZOOM_TOOL)
 							DoZoom(param->pMousePos);
-						break;
 					}
 				}
 				break;
@@ -1073,39 +1060,33 @@
 		case DIM_RGT_BN_UP :
 			{
 				// See which button was pressed
-				switch (Msg->GadgetID)
+				if( Msg->GadgetID == _R(IDC_REDRAW1) ||
+					Msg->GadgetID == _R(IDC_REDRAW2) )
 				{
-					case _R(IDC_REDRAW1) :
-					case _R(IDC_REDRAW2) :
+					// change the active bitmap if necessary
+					if (((Msg->GadgetID == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
+						((Msg->GadgetID == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
 					{
-						// change the active bitmap if necessary
-						if (((Msg->GadgetID == _R(IDC_REDRAW1)) && (m_ActiveBitmap != 1)) ||
-							((Msg->GadgetID == _R(IDC_REDRAW2)) && (m_ActiveBitmap != 2)))
-						{
-							// change the selected bitmap
-							ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
-//							BmapPrevDlg::m_bNeedPaletteUpdated = TRUE;
-						}
-						else
-						{
-							// initialise the popup menu
-							OpPreviewPopupCommand::Init();
+						// change the selected bitmap
+						ChangeActiveBitmap(1 + (m_ActiveBitmap == 1));
+//						BmapPrevDlg::m_bNeedPaletteUpdated = TRUE;
+					}
+					else
+					{
+						// initialise the popup menu
+						OpPreviewPopupCommand::Init();
+						// create the right-click menu
+						PreviewContextMenu *menu = new PreviewContextMenu;
 
-							// create the right-click menu
-							PreviewContextMenu *menu = new PreviewContextMenu;
-
-							// display the menu
-							if (menu != NULL)
-								menu->Show();
-							else
-								ERROR3("Can't create PreviewContextMenu");
-						}
-
-						// delete the cursor, so new one can be set
-						DeleteCurrentCursor();
-
-						break;
+						// display the menu
+						if (menu != NULL)
+							menu->Show();
+						else
+							ERROR3("Can't create PreviewContextMenu");
 					}
+
+					// delete the cursor, so new one can be set
+					DeleteCurrentCursor();
 				}
 				break;
 			}
@@ -1114,46 +1095,28 @@
 		case DIM_LFT_BN_CLICKED :
 			{
 				// See which button was pressed
-				switch (Msg->GadgetID)
+				if( Msg->GadgetID == _R(IDC_ZOOM_TOOL) )
+					OnZoomTool();
+				else
+				if( Msg->GadgetID == _R(IDC_PUSH_TOOL) )
+					OnPushTool();
+				else
+				if( Msg->GadgetID == _R(IDC_ZOOM_TO_FIT)  )
 				{
-					case _R(IDC_ZOOM_TOOL) :
-					{
-						OnZoomTool();
-						break;
-					}
-
-					case _R(IDC_PUSH_TOOL) :
-					{
-						OnPushTool();
-						break;
-					}
-
-					case _R(IDC_ZOOM_TO_FIT) :
-					{
-						// first check if there is any bitmap
-						if (m_ActiveBitmap != 0)
-							CalcViewRect(-1, NULL);
-						break;
-					}
-
-					case _R(IDC_1TO1):
-					{
-						On1to1();
-						break;
-					}
-
-					case _R(IDC_100PERCENT):
-					{
-						On100Percent();
-						break;
-					}
-
-					case _R(IDC_COLOUR_SELECTOR):
-					{
-						OnColourSelectorTool();
-						break;
-					}
+					// first check if there is any bitmap
+					if (m_ActiveBitmap != 0)
+						CalcViewRect(-1, NULL);
 				}
+				else
+				if( Msg->GadgetID == _R(IDC_1TO1) )
+					On1to1();
+				else
+				if( Msg->GadgetID == _R(IDC_100PERCENT) )
+					On100Percent();
+				else
+				if( Msg->GadgetID == _R(IDC_COLOUR_SELECTOR) )
+					OnColourSelectorTool();
+				
 				break;
 			}
 
@@ -1162,23 +1125,19 @@
 				// This is where all the redrawing is done
 				// Which control in the window is sending the redraw message (if there are many
 				// grdraw controls you can tell which is which from the Gadget ID
-				switch (Msg->GadgetID)
-				{
-					// Draw the redraw_me control in here
-					case _R(IDC_REDRAW1) :
-					case _R(IDC_REDRAW2) :
-					{
-						RenderControl((ReDrawInfoType*) Msg->DlgMsgParam, Msg->GadgetID);
-						break;
-					}
 
+				// Draw the redraw_me control in here
+				if( Msg->GadgetID == _R(IDC_REDRAW1) ||
+					Msg->GadgetID == _R(IDC_REDRAW2) )
+				{
+					RenderControl((ReDrawInfoType*) Msg->DlgMsgParam, Msg->GadgetID);
+				}
+				else
+				{
 					// there are no other controls that should get a redraw message ever
-					default :
-					{
-						// give out an error in debug builds, ignore in retail builds
-						ERROR3("Got a redraw message for a control I don't know about");
-						break;
-					}
+				
+					// give out an error in debug builds, ignore in retail builds
+					ERROR3("Got a redraw message for a control I don't know about");
 				}
 
 				break;
@@ -1189,18 +1148,18 @@
 			{
 				//  Make sure that the message came from one of the file type drop-lists
 				//  before calling the handling function.
-				switch( Msg -> GadgetID )
-				{
-				case _R(IDC_FILE_TYPE_LIST):	
+				if( Msg->GadgetID == _R(IDC_FILE_TYPE_LIST) )	
 					HandleFileTypeListChange( 0 );
-					break;
-				case _R(IDC_FILE_TYPE_LIST2):
+				else
+				if( Msg->GadgetID == _R(IDC_FILE_TYPE_LIST2) )
 					HandleFileTypeListChange( 1 );
-					break;
-				}
+
 				break;
 			}
 
+			default:
+				// Do nothing, but quiten compiler
+				break;
 		}
 
 		// Allow the base class access to the message, it will do the
@@ -1211,8 +1170,9 @@
 		// End dialog here
 		if (EndDialog) 
 		{
-			Close();				// Hide the dialog box
-			End();					// Finish the operation
+			// DialogOp has already done this
+//			Close();				// Hide the dialog box
+//			End();					// Finish the operation
 
 			// Free up any unused bitmaps in the global list
 			// (just deleting the KernelBitmaps doesn't seem to do it)
@@ -1334,7 +1294,7 @@
 
 	//  Get the palette from the BmapPrevDlg class.
 	//  Don't need to do this every time the mouse moves.
-	ExtendedPalette* pPal = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
+//	ExtendedPalette* pPal = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
 	INT32 PaletteIndex = pBit->ReturnPaletteIndexUsed( MouseX, MouseY );
 
 	return PaletteIndex;
@@ -1383,7 +1343,7 @@
 void BitmapExportPreviewDialog::OnZoomTool()
 {
 	BOOL Valid = FALSE;
-	BOOL State = GetLongGadgetValue(_R(IDC_ZOOM_TOOL), 0, 1, NULL, &Valid);
+	BOOL State = GetLongGadgetValue(_R(IDC_ZOOM_TOOL), 0, 1, 0, &Valid);
 	if (!State)
 	{
 		SetLongGadgetValue(_R(IDC_ZOOM_TOOL), TRUE);
@@ -1442,7 +1402,7 @@
 void BitmapExportPreviewDialog::OnPushTool()
 {
 	BOOL Valid = FALSE;
-	BOOL State = GetLongGadgetValue(_R(IDC_PUSH_TOOL), 0, 1, NULL, &Valid);
+	BOOL State = GetLongGadgetValue(_R(IDC_PUSH_TOOL), 0, 1, 0, &Valid);
 	if (!State)
 	{
 		SetLongGadgetValue(_R(IDC_PUSH_TOOL), TRUE);
@@ -1488,24 +1448,22 @@
 	m_BitmapView.lo.y = h/2 - Height / 2;
 	m_BitmapView.hi.y = h/2 + Height / 2;
 
-	INT32 PixelSize = 72000 / param.Dpi;
-
 	// make sure one of the corners is aligned at a pixel
 
 	// get the pixel size in millipoints
 	MILLIPOINT PixSize = 0;
 	DocUnitList* pDocUnitList =	DocUnitList::GetCurrentDocUnitList();
-	ERROR3IF(pDocUnitList == NULL, "BmpPrefsDlg::InitDialog() - no pDocUnitList!")
+	ERROR3IF(pDocUnitList == NULL, "BmpPrefsDlg::InitDialog() - no pDocUnitList!");
 	if (pDocUnitList != NULL)
 	{
 		Unit* pPixelUnit = pDocUnitList->FindUnit(PIXELS);
-		ERROR3IF(pPixelUnit == NULL, "BmpPrefsDlg::InitDialog() - no pixel units!")
+		ERROR3IF(pPixelUnit == NULL, "BmpPrefsDlg::InitDialog() - no pixel units!");
 		if (pPixelUnit != NULL)
 			PixSize = (MILLIPOINT) pPixelUnit->GetMillipoints();
 	}
 
 	// shift the rectangle, so that the lower left corner is aligned at a pixel boundary
-	if (PixSize != NULL)
+	if (PixSize != 0)
 	{
 		MILLIPOINT ShiftX = m_BitmapView.lo.x % PixSize;
 		MILLIPOINT ShiftY = m_BitmapView.lo.y % PixSize;
@@ -1554,12 +1512,12 @@
 {
 	// Set up the bitmaps for the play controls
 	// Uses the title defined in the rc file so do not specify any bitmaps
-	SetGadgetBitmaps(_R(IDC_ZOOM_TOOL), NULL, NULL);
-	SetGadgetBitmaps(_R(IDC_PUSH_TOOL), NULL, NULL);
-	SetGadgetBitmaps(_R(IDC_ZOOM_TO_FIT), NULL, NULL);
-	SetGadgetBitmaps(_R(IDC_1TO1), NULL, NULL);
-	SetGadgetBitmaps(_R(IDC_100PERCENT), NULL, NULL);
-	SetGadgetBitmaps(_R(IDC_COLOUR_SELECTOR), NULL, NULL );
+	SetGadgetBitmaps(_R(IDC_ZOOM_TOOL), 0, 0);
+	SetGadgetBitmaps(_R(IDC_PUSH_TOOL), 0, 0);
+	SetGadgetBitmaps(_R(IDC_ZOOM_TO_FIT), 0, 0);
+	SetGadgetBitmaps(_R(IDC_1TO1), 0, 0);
+	SetGadgetBitmaps(_R(IDC_100PERCENT), 0, 0);
+	SetGadgetBitmaps(_R(IDC_COLOUR_SELECTOR), 0, 0 );
 
 	// default to push button
 	SetLongGadgetValue(_R(IDC_PUSH_TOOL), TRUE);
@@ -1610,26 +1568,30 @@
 	SetStringGadgetValue( _R(IDC_FILE_TYPE_LIST2), _R(IDS_FILE_TYPE_BMP), FALSE, 2 );
 	SetStringGadgetValue( _R(IDC_FILE_TYPE_LIST2), _R(IDS_FILE_TYPE_JPG), FALSE, 3 );
 
-	switch(BmapPrevDlg::m_pExportOptions->GetFilterNameStrID())
+	UINT32				idString = BmapPrevDlg::m_pExportOptions->GetFilterNameStrID();
+	if( idString == _R(IDN_FILTERNAME_GIF) ) // its a windows bitmap bmp type
 	{
-	case _R(IDN_FILTERNAME_GIF): // its a windows bitmap bmp type
 		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST), 0 );
 		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST2), 0 );
-		break;
-	default:
-	case _R(IDS_FILTERNAME_PNG): // its a png
-		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST), 1 );
-		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST2), 1 );
-		break;
-	case _R(IDT_FILTERNAME_BMP): // its a windows bitmap bmp type
+	}
+	else
+	if( idString == _R(IDT_FILTERNAME_BMP) ) // its a windows bitmap bmp type
+	{
 		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST), 2 );
 		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST2), 2 );
-		break;
-	case _R(IDS_JPG_EXP_FILTERNAME): // its a jpeg type
+	}
+	else
+	if( idString == _R(IDS_JPG_EXP_FILTERNAME) ) // its a jpeg type
+	{
 		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST), 3 );
 		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST2), 3 );
-		break;
 	}
+	else
+	{
+//	case _R(IDS_FILTERNAME_PNG): // its a png
+		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST), 1 );
+		SetSelectedValueIndex( _R(IDC_FILE_TYPE_LIST2), 1 );
+	}
 	
 	//  Set the lists to the correct length
 	SetComboListLength( _R(IDC_FILE_TYPE_LIST) );
@@ -1849,7 +1811,7 @@
 		if (pDialogView)
 		{
 			// Try and create the bitmap etc
-			StartedOk = m_pRender->AttachDevice(pDialogView, pExtraInfo->pDC, NULL);
+			StartedOk = m_pRender->AttachDevice( pDialogView, pExtraInfo->pDC->GetDC(), NULL );
 
 			// Try and start the render region
 			StartedOk = StartedOk && m_pRender->StartRender();
@@ -1871,15 +1833,12 @@
 		// Get the current bitmap for the passed control
 		KernelBitmap * pBitmapToUse;
 		//  The ( 1-based ) number of the bitmap currently being rendered.
-		UINT32 BitmapNumber = -1;
 		if (GadgetID == _R(IDC_REDRAW1))
 		{
-			BitmapNumber = 1;
 			pBitmapToUse = BitmapData[0].m_pBitmap;
 		}
 		else if (GadgetID == _R(IDC_REDRAW2))
 		{
-			BitmapNumber = 2;
 			pBitmapToUse = BitmapData[1].m_pBitmap;
 		}
 		else
@@ -2106,8 +2065,6 @@
 		m_BitmapView.hi.x = w/2 + Width / 2;
 		m_BitmapView.lo.y = h/2 - Height / 2;
 		m_BitmapView.hi.y = h/2 + Height / 2;
-
-		INT32 PixelSize = 72000 / param.Dpi;
 	}
 	else 
 	{
@@ -2156,8 +2113,6 @@
 		m_BitmapView.hi.y = Centre.y + Height/ 2;
 
 		
-		INT32 PixelSize = 72000 / param.Dpi;
-
 		DocCoord Pos;
 		// if no position passed assume click in the middle of the control
 		if (pos == NULL)
@@ -2187,17 +2142,17 @@
 	// get the pixel size in millipoints
 	MILLIPOINT PixSize = 0;
 	DocUnitList* pDocUnitList =	DocUnitList::GetCurrentDocUnitList();
-	ERROR3IF(pDocUnitList == NULL, "BmpPrefsDlg::InitDialog() - no pDocUnitList!")
+	ERROR3IF(pDocUnitList == NULL, "BmpPrefsDlg::InitDialog() - no pDocUnitList!");
 	if (pDocUnitList != NULL)
 	{
 		Unit* pPixelUnit = pDocUnitList->FindUnit(PIXELS);
-		ERROR3IF(pPixelUnit == NULL, "BmpPrefsDlg::InitDialog() - no pixel units!")
+		ERROR3IF(pPixelUnit == NULL, "BmpPrefsDlg::InitDialog() - no pixel units!");
 		if (pPixelUnit != NULL)
 			PixSize = (MILLIPOINT) pPixelUnit->GetMillipoints();
 	}
 
 	// shift the rectangle, so that the lower left corner is aligned at a pixel boundary
-	if (PixSize != NULL)
+	if (PixSize != 0)
 	{
 		MILLIPOINT ShiftX = m_BitmapView.lo.x % PixSize;
 		MILLIPOINT ShiftY = m_BitmapView.lo.y % PixSize;
@@ -2462,7 +2417,7 @@
 	else
 		EnableGadget(_R(IDC_ACTIVE1), FALSE);
 
-	SetStringGadgetValue(_R(IDC_ACTIVE1),&Str1);
+	SetStringGadgetValue(_R(IDC_ACTIVE1),Str1);
 	InvalidateGadget(_R(IDC_FILE_TYPE_LIST)); // so the outline is not drawn over the top of the drop down
 
 	// for the second image
@@ -2475,7 +2430,7 @@
 	else
 		EnableGadget(_R(IDC_ACTIVE2), FALSE);
 
-	SetStringGadgetValue(_R(IDC_ACTIVE2),&Str1);
+	SetStringGadgetValue(_R(IDC_ACTIVE2),Str1);
 	InvalidateGadget(_R(IDC_FILE_TYPE_LIST2)); // so the outline is not drawn over the top of the drop down
 
 	DisplayBitmapInfo();
@@ -2521,13 +2476,13 @@
 	
 	// for the first image
 	BitmapData[0].GenerateBitmapInfoStrings(ImageSize, FileSize, TRUE);
-	SetStringGadgetValue(_R(IDC_IMAGESIZE1), &ImageSize);
-	SetStringGadgetValue(_R(IDC_FILESIZE1), &FileSize);
+	SetStringGadgetValue(_R(IDC_IMAGESIZE1), ImageSize);
+	SetStringGadgetValue(_R(IDC_FILESIZE1), FileSize);
 
 	// for the second image
 	BitmapData[1].GenerateBitmapInfoStrings(ImageSize, FileSize, TRUE);
-	SetStringGadgetValue(_R(IDC_IMAGESIZE2), &ImageSize);
-	SetStringGadgetValue(_R(IDC_FILESIZE2), &FileSize);
+	SetStringGadgetValue(_R(IDC_IMAGESIZE2), ImageSize);
+	SetStringGadgetValue(_R(IDC_FILESIZE2), FileSize);
 
 	// now set the file difference
 
@@ -2556,7 +2511,7 @@
 		else
 			FileDiff += String_16(_R(IDS_SAMESIZE));
 
-		SetStringGadgetValue(_R(IDC_FILEDIFF1),&FileDiff);
+		SetStringGadgetValue(_R(IDC_FILEDIFF1),FileDiff);
 	}
 	else
 	{
@@ -2567,7 +2522,7 @@
 		else
 			FileDiff += String_16(_R(IDS_SAMESIZE));
 
-		SetStringGadgetValue(_R(IDC_FILEDIFF2),&FileDiff);
+		SetStringGadgetValue(_R(IDC_FILEDIFF2),FileDiff);
 	}
 }
 
@@ -2598,9 +2553,6 @@
 //	if (m_pBmpFilter == NULL)
 //		return FALSE;
 
-	// get the current options
-	BitmapExportOptions *pCurrentOptions = BitmapData[Num-1].m_pOptions;
-
 	if (pExportOptions == NULL)
 		return FALSE;
 
@@ -2721,7 +2673,7 @@
 
 	BOOL ok = TRUE;
 		
-	TRY  // to export the document to the temp file
+	try  // to export the document to the temp file
 	{
 		//no need for preview bitmap
 		m_pBmpFilter->IncludePreviewBmp(FALSE);
@@ -2784,7 +2736,7 @@
 		}
 	}
 	// See if there was a file io error
-	CATCH(CFileException, e)
+	catch( CFileException )
 	{
 		UINT32 ErrNo = Error::GetErrorNumber();
 		// Report the error if no one else did
@@ -2799,7 +2751,7 @@
 		EndSlowJob();
 
 		// Make sure that the file is closed and deleted
-		TRY
+		try
 		{
 			// First try and delete it (tries to close it first)
 			if (m_pBmpFilter)
@@ -2809,15 +2761,13 @@
 			if (TempDiskFile.isOpen())
 				TempDiskFile.close();
 		}
-		CATCH(CFileException, e)
+		catch( CFileException )
 		{
 			// Failed to close the file - not much we can do about it really
 		}
-		END_CATCH
 
 		return FALSE;
 	}
-	END_CATCH
 
 	if (ok)
 	{
@@ -2894,7 +2844,8 @@
 					if (pOptions->GetPathName().IsValid() && (oldTempPath != TempPath.GetPath()))
 					{
 						// Delete any old files that might be around
-						FileUtil::DeleteFile(&(pOptions->GetPathName()));
+						PathName		path( pOptions->GetPathName() );
+						FileUtil::DeleteFile( &path );
 					}
 
 					// set the new path name in the options object
@@ -2952,27 +2903,19 @@
 						// try to make them both the same and borrow the bitmap from the first side
 						BitmapExportOptions * pNewOptions = NULL;
 
-						switch(pOptions->GetFilterNameStrID())
-						{
-						case _R(IDN_FILTERNAME_GIF):
+						UINT32 idString = pOptions->GetFilterNameStrID();
+						if( idString == _R(IDN_FILTERNAME_GIF) )
 							pNewOptions = new GIFExportOptions();
-							break;
-
-						case _R(IDT_FILTERNAME_BMP):
+						else
+						if( idString == _R(IDT_FILTERNAME_BMP) )
 							pNewOptions = new BMPExportOptions();
-							break;
-
-						default:
-						case _R(IDS_FILTERNAME_PNG):
+						else
+						if( idString == _R(IDS_JPG_EXP_FILTERNAME) )
+							pNewOptions = new JPEGExportOptions();
+						else
+//						if( idString == _R(IDS_FILTERNAME_PNG):
 							pNewOptions = new PNGExportOptions();
-							break;
 
-						case _R(IDS_JPG_EXP_FILTERNAME):
-							pNewOptions = new JPEGExportOptions();
-							break;
-						}
-
-
 						KernelBitmap * pNewKBMP = new KernelBitmap(pKernelBitmap->ActualBitmap);
 
 						if (pNewKBMP && pNewOptions)
@@ -3085,19 +3028,19 @@
 
 void BitmapExportPreviewDialog::DoCommand(StringBase *CommandID)
 {
-	if (*CommandID == (TCHAR *)OPTOKEN_PREVIEW_ZOOM_TOOL)
+	if (*CommandID == (PCTSTR)OPTOKEN_PREVIEW_ZOOM_TOOL)
 		OnZoomTool(); // "Zoom Tool"
-	else if (*CommandID == (TCHAR *)OPTOKEN_PREVIEW_PUSH_TOOL)
+	else if (*CommandID == (PCTSTR)OPTOKEN_PREVIEW_PUSH_TOOL)
 		OnPushTool(); // "Push Tool"
-	else if (*CommandID == (TCHAR *)OPTOKEN_PREVIEW_COLOUR_SELECTOR_TOOL)
+	else if (*CommandID == (PCTSTR)OPTOKEN_PREVIEW_COLOUR_SELECTOR_TOOL)
 		OnColourSelectorTool(); // 'Colour Selector'
-	else if (*CommandID == (TCHAR *)OPTOKEN_PREVIEW_ZOOM_TO_FIT)
+	else if (*CommandID == (PCTSTR)OPTOKEN_PREVIEW_ZOOM_TO_FIT)
 		CalcViewRect(-1, NULL); //"Zoom to Fit"
-	else if (*CommandID == (TCHAR *)OPTOKEN_PREVIEW_ZOOM_TO_100)
+	else if (*CommandID == (PCTSTR)OPTOKEN_PREVIEW_ZOOM_TO_100)
 		On100Percent(); // "Zoom to 100%"
-	else if (*CommandID == (TCHAR *)OPTOKEN_PREVIEW_1TO1)
+	else if (*CommandID == (PCTSTR)OPTOKEN_PREVIEW_1TO1)
 		On1to1(); // "Zoom to 100%"
-	else if (*CommandID == (TCHAR *)OPTOKEN_PREVIEW_HELP)
+	else if (*CommandID == (PCTSTR)OPTOKEN_PREVIEW_HELP)
 	{
 		// call the parent dialog to do the help 
 		if (m_pParentDlg != NULL)
Index: Trunk/XaraLX/Kernel/prvwmenu.cpp
===================================================================
--- Trunk/XaraLX/Kernel/prvwmenu.cpp	(revision 1481)
+++ Trunk/XaraLX/Kernel/prvwmenu.cpp	(revision 1482)
@@ -168,21 +168,21 @@
 
 BOOL OpPreviewPopupCommand::InitPolymorphicCommand(TCHAR *OpToken, UINT32 MenuTextID)
 {
-	return(RegisterOpDescriptor(NULL,								// Tool ID 
+	return(RegisterOpDescriptor(0,									// Tool ID 
 								MenuTextID,		 					// String resource ID
 								CC_RUNTIME_CLASS(OpPreviewPopupCommand),// Runtime class
 								OpToken, 							// Token string
 								OpPreviewPopupCommand::GetCommandState,	// GetState function
-								NULL,								// help ID
-								NULL,								// bubble help
-								NULL,								// resource ID
-								NULL,								// control ID
+								0,									// help ID
+								0,									// bubble help
+								0,									// resource ID
+								0,									// control ID
 								SYSTEMBAR_ILLEGAL,					// Bar ID
 								FALSE,								// Receive system messages
 								FALSE,								// Smart duplicate operation
 								TRUE,								// Clean operation
 								NULL,								// No vertical counterpart
-								NULL,								// String for one copy only error
+								0,									// String for one copy only error
 								DONT_GREY_WHEN_SELECT_INSIDE		// Auto state flags
 								));
 }
Index: Trunk/XaraLX/wxOil/Makefile.am
===================================================================
--- Trunk/XaraLX/wxOil/Makefile.am	(revision 1481)
+++ Trunk/XaraLX/wxOil/Makefile.am	(revision 1482)
@@ -16,7 +16,7 @@
 libwxOil_a_SOURCES = \
 	varstr.cpp \
 	basestr.cpp camdoc.cpp camelot.cpp camframe.cpp \
-	camview.cpp ccobject.cpp ccdc.cpp clikmods.cpp convert.cpp \
+	camview.cpp ccobject.cpp ccdc.cpp clikmods.cpp convert.cpp cbmpdata.cpp \
 	diagnost.cpp dibconv.cpp dibutil.cpp dlgmgr.cpp dlgview.cpp ensure.cpp \
 	errors.cpp filehndl.cpp filesize.cpp fixmem.cpp fixstr8.cpp fixstr16.cpp \
 	fixstr32.cpp fixstr64.cpp fixst128.cpp fixst256.cpp handles.cpp makemsg.cpp \
Index: Trunk/XaraLX/wxOil/cbmpdata.cpp
===================================================================
--- Trunk/XaraLX/wxOil/cbmpdata.cpp	(revision 1481)
+++ Trunk/XaraLX/wxOil/cbmpdata.cpp	(revision 1482)
@@ -344,25 +344,25 @@
 	pColour->GetRGBValue(&R, &G, &B);
 	
 	// convert this into a html colour string
-	OutColour = String_32("#");
+	OutColour = String_32( _T("#") );
 	String_32 c;
 	
 	// add the red component
 	if (R < 16) // is a leading 0 required
-		OutColour += "0";
-	c._MakeMsg("#1%X", R % 256);
+		OutColour += _T("0");
+	c._MakeMsg( _T("#1%X"), R % 256);
 	OutColour += c;
 	
 	// the green component
 	if (G < 16)
-		OutColour += "0";
-	c._MakeMsg("#1%X", G % 256);
+		OutColour += _T("0");
+	c._MakeMsg( _T("#1%X"), G % 256);
 	OutColour += c;
 	
 	// the blue component
 	if (B < 16)
-		OutColour += "0";
-	c._MakeMsg("#1%X", B % 256);
+		OutColour += _T("0");
+	c._MakeMsg( _T("#1%X"), B % 256);
 	OutColour += c;
 	
 	return TRUE;
@@ -482,7 +482,7 @@
 			if (pPagePath)
 			{
 				// create a new temporary file
-				Ok = FileUtil::GetTemporaryPathName("gif", pPagePath);
+				Ok = FileUtil::GetTemporaryPathName( _T("gif"), pPagePath);
 			}
 			else
 				Ok = FALSE;
@@ -604,6 +604,8 @@
 *******************************************************************************************/
 BOOL BitmapPreviewData::GenerateHTMLStub(BrowserPreviewOptions BrowserOptions)
 {
+PORTNOTE("other","Removed _R(IDD_TIMAPOPTIONS) - isn't wanted yet")
+#ifndef EXCLUDE_FROM_XARALX
 	// sanity checks
 	
 	// check for export options
@@ -632,7 +634,7 @@
 		return FALSE;
 	
 	// create a new temp file 
-	if (FileUtil::GetTemporaryPathName("htm",m_pTempHTMLPath) == FALSE)
+	if (FileUtil::GetTemporaryPathName( _T("htm"),m_pTempHTMLPath) == FALSE)
 	{
 		delete m_pTempHTMLPath;
 		m_pTempHTMLPath = NULL;
@@ -653,7 +655,7 @@
 	// create a path name object from the program name
 	PathName ProgramPath(strPathName);
 	
-	TRY
+	try
 	{
 		// open it for reading
 		if (!TempDiskFile.open(*m_pTempHTMLPath, ios::out))
@@ -736,17 +738,15 @@
 			}
 			else
 			{
-				switch (m_pOptions->GetFilterNameStrID())
+				if( m_pOptions->GetFilterNameStrID() == _R(IDN_FILTERNAME_GIF) ||
+					m_pOptions->GetFilterNameStrID() == _R(IDS_JPG_EXP_FILTERNAME) ||
+					m_pOptions->GetFilterNameStrID() == _R(IDT_FILTERNAME_BMP) )
 				{
-				case _R(IDN_FILTERNAME_GIF):
-				case _R(IDS_JPG_EXP_FILTERNAME): 
-				case _R(IDT_FILTERNAME_BMP):
 					s.MakeMsg(_R(IDS_DISPLAY_BMP), (const TCHAR *)TempPath.GetFileName());
-					break;
-				case _R(IDS_FILTERNAME_PNG):
+				}
+				else
+				if( m_pOptions->GetFilterNameStrID() == _R(IDS_FILTERNAME_PNG) )
 					s.MakeMsg(_R(IDS_DISPLAY_PNG), (const TCHAR *)TempPath.GetFileName());
-					break;
-				}
 			}	
 			
 			TempDiskFile.write(s);
@@ -1361,7 +1361,7 @@
 		
 	} // end of TRY block
 	
-	CATCH(CFileException, e)
+	catch( CFileException )
 	{
 		// any disk problems - come here
 		
@@ -1371,9 +1371,9 @@
 		
 		return FALSE;
 	}
-	END_CATCH
+#endif
 		
-		return TRUE;
+	return TRUE;
 }
 
 
Index: Trunk/XaraLX/wxOil/xrc/EN/exprwres.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/exprwres.xrc	(revision 1481)
+++ Trunk/XaraLX/wxOil/xrc/EN/exprwres.xrc	(revision 1482)
@@ -1,6 +1,6 @@
 <?xml version="1.0" ?>
 <resource>
-	<object class="wxDialog" name="IDD_BITMAPPREVIEWDIALOG">
+	<object class="wxPanel" name="IDD_BITMAPPREVIEWDIALOG">
 			 <pos>0,0d</pos> <size>397,153d</size>
 		<object class="wxStaticBox" name="IDC_ACTIVE1">
 			 <pos>6,1d</pos> <size>167,150d</size>
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1481)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1482)
@@ -374,7 +374,8 @@
 		pDialogName=CamResource::GetObjectNameFail(MainDlgID);
 		ERROR1IF(pDialogName == NULL, FALSE, _R(IDE_CANNOT_CREATE_DIALOG));
 
-		if (wxAUImanaged)
+PORTNOTE("dialog","A more general scheme is needed to allow creation of a panel for non-toolbar type dialog")
+		if (wxAUImanaged || _R(IDD_BITMAPPREVIEWDIALOG) == MainDlgID )
 			pDialogWnd = wxXmlResource::Get()->LoadPanel((wxWindow *)ParentWnd, pDialogName);
 		else
 			pDialogWnd = wxXmlResource::Get()->LoadDialog((wxWindow *)ParentWnd, pDialogName);
Index: Trunk/XaraLX/wxOil/fileutil.cpp
===================================================================
--- Trunk/XaraLX/wxOil/fileutil.cpp	(revision 1481)
+++ Trunk/XaraLX/wxOil/fileutil.cpp	(revision 1482)
@@ -396,7 +396,9 @@
 	return FALSE;
 }
 
+#endif
 
+
 /********************************************************************************************
 >	static PathName FileUtil::GetTemporaryFile()
 
@@ -421,14 +423,15 @@
 PathName FileUtil::GetTemporaryPathName()
 {
 	//First get the directory in which to put our temporary files
-	TCHAR pcPath[MAX_PATH];
+	TCHAR pcPath[MAX_PATH] = _T("");
 
-	FileUtil::GetTemporaryPath(MAX_PATH, pcPath);
+PORTNOTE("other", "This call is not needed, wxFileName::CreateTempFileName does the right thing" )
+//	FileUtil::GetTemporaryPath(MAX_PATH, pcPath);
 
 	//Now get a temporary file name
 	TCHAR pcFileName[MAX_PATH];
 
-	FileUtil::GetTemporaryFileName(pcPath, "xar", 0, pcFileName);
+	FileUtil::GetTemporaryFileName(pcPath, _T("xar"), 0, pcFileName);
 
 	//And convert the file name into a PathName
 	String_256 strFileName=pcFileName;
@@ -480,19 +483,14 @@
 		BOOL ok = GetTemporaryPathName(pExt, pTempPath);
 
 		// remove our .tmp file
-		_tremove((TCHAR *)pInFile);
+		wxRemoveFile( (PCTSTR)pInFile );
 
 		return ok;
 	}
-	else
-	{
-		// try to rename the file
-		String_256 path = pTempPath->GetPath();
-		if (_trename(pInFile,path) != 0)
-			return FALSE;
-		else
-			return TRUE;
-	}
+
+	// try to rename the file
+	wxString			path = (PCTSTR)pTempPath->GetPath();
+	return wxRenameFile( (PCTSTR)pInFile, path );
 }
 
 
@@ -522,10 +520,17 @@
 		return FALSE;
 	}
 
-	return ::GetTempFileName(PathName,Prefix,Unique,FileName);
+	wxString			str( PathName );
+//	str += Prefix;
+
+	str = wxFileName::CreateTempFileName( str );
+	camStrcpy( FileName, str.c_str() );
+	return Unique != 0 ? Unique : 0xD7334;	// Random non-zero value
 }
 
 
+PORTNOTE("other", "Removed lots of Windows'isms" )
+#if !defined(EXCLUDE_FROM_XARALX)
 
 /********************************************************************************************
 >	static INT32 FileUtil::GetTempPath(UINT32 BufferLength,	TCHAR *Buffer)
@@ -552,6 +557,7 @@
 
 #endif
 
+
 /*******************************************************************************************
 
 >	static BOOL FileUtil::DeleteFile(PathName *FileToRemove)


Xara