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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 971
Date       : Sun May  7 21:27:53 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/statline.cpp
   M /Trunk/XaraLX/Kernel/statline.h
   M /Trunk/XaraLX/wxOil/dlgmgr.cpp
   M /Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc

A little more status bar work. Still unfinished


Diff:
Index: Trunk/XaraLX/Kernel/statline.h
===================================================================
--- Trunk/XaraLX/Kernel/statline.h	(revision 970)
+++ Trunk/XaraLX/Kernel/statline.h	(revision 971)
@@ -136,12 +136,7 @@
 class StatusLine : public StandardBar
 {
 public:
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	StatusLine(CCStatusBar* pCCSB);
-#else
 	StatusLine();
-#endif
 	~StatusLine();
 	MsgResult Message(Msg* Msg);
 	BOOL OnIdle();
@@ -184,10 +179,6 @@
 
 protected:
 
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	CCStatusBar*  pCCStatusBar;
-#endif
 	MonotonicTime TextTimer;
 	MonotonicTime RenderTimer;
 	BOOL MousePosPaneNeedsResizing;
Index: Trunk/XaraLX/Kernel/statline.cpp
===================================================================
--- Trunk/XaraLX/Kernel/statline.cpp	(revision 970)
+++ Trunk/XaraLX/Kernel/statline.cpp	(revision 971)
@@ -156,30 +156,6 @@
 	Purpose:	Constructor for StatusLine
 *****************************************************************************/
 
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-StatusLine::StatusLine(CCStatusBar* pCCSB)
-{
-	ERROR3IF(pCCSB==NULL,"StatusLine::StatusLine() - pCCStatusBar==NULL");
-	pCCStatusBar=pCCSB;
-
-	// ensure initial updates
-	OldMemory=0;
-	MousePosDP=2;
-	TextTimer.Sample();
-	RenderTimer.Sample();
-	RenderAnimationState=0;
-	MousePosNeedsUpdatingFlag=TRUE;
-	MousePosPaneNeedsResizing=TRUE;
-//	TransparencyNeedsUpdating=TRUE;
-
-	// create a 'snapped' mouse pointer
-	pSnappedCursor = new Cursor(_R(IDCSR_SNAPPED));
-	SnappedCursorID = 0;
-
-}
-
-#else
 StatusLine::StatusLine()
 {
 	// ensure initial updates
@@ -197,9 +173,7 @@
 	SnappedCursorID = 0;
 }
 
-#endif
 
-
 /*****************************************************************************
 >	StatusLine::~StatusLine()
 
@@ -244,12 +218,6 @@
 
 BOOL StatusLine::OnIdle()
 {
-//	FixFPControlRegister();
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	ERROR2IF(pCCStatusBar==NULL,FALSE,"StatusLine::OnIdle() - pCCStatusBar==NULL");
-#endif
-
 	// If the current doc doesn't have a doc view (e.g. it's a clipboard doc), then there's no point
 	// carrying on, because it's not a proper document, hence doen't require up-to-date status bar info.
 	if (DocView::GetSelected() == NULL)
@@ -328,12 +296,6 @@
 
 BOOL StatusLine::RefreshHelpText()
 {	
-//	FixFPControlRegister();
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	ERROR2IF(pCCStatusBar==NULL,FALSE,"StatusLine::RefreshHelpText() - pCCStatusBar==NULL");
-#endif
-
 	// if drag op in progress, don't slow it down, just exit
 	if (Operation::GetCurrentDragOp())
 		return TRUE;
@@ -428,7 +390,7 @@
 		}
 		else
 		{
-PORTNOTE("statline", "Removed use of GetMousePosAndWindowID to abort snap processing")
+PORTNOTE("statline", "Removed use of ControlHelper")
 #if !defined(EXCLUDE_FROM_XARALX)
 			TextValid=ControlHelper::GetStatusLineText(&text,WinID);				// try buttons/bars
 			if (TextValid)
@@ -704,11 +666,6 @@
 	PrefixSelDesc = FALSE;	// Never show Selection Description in Viewer
 #endif
 
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	ERROR2IF(pCCStatusBar==NULL,FALSE,"StatusLine::UpdateText() - pCCStatusBar==NULL");
-#endif
-
 	// create a string by concatenating sel desc and help text (as required)
 	String_256 text("");
 	SelRange* pSelection = 0;
@@ -740,13 +697,9 @@
 	
 	if ((IsRestrictedAccessToColourPicker () == FALSE) && (DoControlHelp == TRUE))
 	{
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-		CString MyString;
-		pCCStatusBar->GetPaneText(0, MyString);
-
-		return pCCStatusBar->UpdatePaneText(0,&text,TRUE);
-#endif
+		BOOL ok=SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), text);
+		PaintGadgetNow(_R(IDC_SL_STATUSTEXT));
+		return ok;
 	}
 	else
 	{
@@ -797,12 +750,9 @@
 	// re-sample time and update status line
 	TextTimer.Sample();
 	
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	return pCCStatusBar->UpdatePaneText(0,&text,TRUE);
-#else
-	return TRUE;
-#endif
+	BOOL ok=SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), text);
+	PaintGadgetNow(_R(IDC_SL_STATUSTEXT));
+	return ok;
 }
 
 
@@ -825,10 +775,6 @@
 BOOL StatusLine::TruncateTextToWidth(String_256* pText, INT32 width)
 {
 	ERROR2IF(       pText==NULL,FALSE,"StatusLine::TruncateTextToPane() - pText==NULL");
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	ERROR2IF(pCCStatusBar==NULL,FALSE,"StatusLine::TruncateTextToPane() - pCCStatusBar==NULL");
-#endif
 
 	// try truncating text at each successive point until it no longer fits the pane then
 	// use the last one that fitted (if text null or no truncation points use whole text)
@@ -883,10 +829,6 @@
 {
 	ERROR2IF(       pText==NULL,FALSE,"StatusLine::GetMousePosText() - pText==NULL");
 	ERROR2IF(     pSpread==NULL,FALSE,"StatusLine::GetMousePosText() - pSpread==NULL");
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	ERROR2IF(pCCStatusBar==NULL,FALSE,"StatusLine::GetMousePosText() - pCCStatusBar==NULL");
-#endif
 
 	if (dp == -1)
 		dp = MousePosDP;
@@ -921,10 +863,7 @@
 
 BOOL StatusLine::SetMousePosPaneWidth(Spread* pSpread)
 {	
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
 	ERROR2IF(     pSpread==NULL,FALSE,"StatusLine::SetMousePosPaneWidth() - pSpread==NULL");
-	ERROR2IF(pCCStatusBar==NULL,FALSE,"StatusLine::SetMousePosPaneWidth() - pCCStatusBar==NULL");
 
 	// find/cache number of decimal places required to resolve a pixel with current units & scale
 	INT32 dp=2;
@@ -947,7 +886,8 @@
 
 	String_256 ZeroChar(_R(IDS_CONVERT_ZERO_CHAR));
 
-	for (INT32 i=0;i<dp;i++)
+	INT32 i;
+	for (i=0;i<dp;i++)
 	{
 		MousePosText += ZeroChar;
 		MousePosText += ZeroChar;
@@ -957,7 +897,12 @@
 	MousePosText += DPSChar;
 	MousePosText += DPSChar;
 
+PORTNOTE("StatusLine", "Removed use of CCStatusBar")
+#ifndef EXCLUDE_FROM_XARALX
 	INT32 MinCoordTextWidth=pCCStatusBar->GetTextWidth(&MousePosText);
+#else
+	INT32 MinCoordTextWidth=100;
+#endif
 	
 	if (MinCoordTextWidth==-1)
 		return FALSE;
@@ -975,19 +920,24 @@
 	MousePosText += DPSChar;
 	MousePosText += DPSChar;
 	
+PORTNOTE("StatusLine", "Removed use of CCStatusBar")
+#ifndef EXCLUDE_FROM_XARALX
 	INT32 MaxCoordTextWidth=pCCStatusBar->GetTextWidth(&MousePosText) ; 
+#else
+	INT32 MaxCoordTextWidth=100;
+#endif
+
 	if (MaxCoordTextWidth==-1)
 		return FALSE;
 	
 // set pane width
+PORTNOTE("StatusLine", "Removed use of CCStatusBar")
+#ifndef EXCLUDE_FROM_XARALX
 	INT32 TextWidth = max(MaxCoordTextWidth,MinCoordTextWidth);
 	if (pCCStatusBar->SetPaneWidth(TextWidth,_R(IDS_SL_MOUSEPOS))==FALSE)
 		return FALSE;
-
-	return ReturnValue;
-#else
-	return TRUE;
 #endif
+	return ReturnValue;
 }
 
 
@@ -1030,9 +980,6 @@
 	}
 
 
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	ERROR2IF(pCCStatusBar==NULL,FAIL,"StatusLine::Message() - pCCStatusBar==NULL");
 
 	// if pref units changed, or zoom changed flag mouse pos pane needs resizing
 	if (MESSAGE_IS_A(pMsg,OptionsChangingMsg) /* && ((OptionsChangingMsg*)pMsg)->State==OptionsChangingMsg::NEWUNITS */
@@ -1049,7 +996,7 @@
 
 	if (MESSAGE_IS_A(pMsg, DocViewMsg) && ((DocViewMsg*)pMsg)->State==DocViewMsg::SELCHANGED)
 	{
-		CMainFrame* pMainFrame = GetMainFrame();
+		CCamFrame* pMainFrame = GetMainFrame();
 		if (pMainFrame)
 		{
 			DocView* pView = ((DocViewMsg*)pMsg)->pNewDocView;
@@ -1103,12 +1050,13 @@
 			{
 				bState = FALSE;
 			}
-
+PORTNOTE("printing", "Removed SetPrinterColourStatus");
+#ifndef EXCLUDE_FROM_XARALX
 			pMainFrame->SetPrinterColourStatus(bState, &sPlateName);
+#endif
 		}
 
 	}
-#endif
 
 	return StandardBar::Message(pMsg);
 }
@@ -1141,10 +1089,6 @@
 	{
 		ERROR2IF(     pSpread==NULL,FALSE,"StatusLine::UpdateMousePosAndSnap() - pSpread==NULL");
 		ERROR2IF(   pDocCoord==NULL,FALSE,"StatusLine::UpdateMousePosAndSnap() - pDocCoord==NULL");
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-		ERROR2IF(pCCStatusBar==NULL,FALSE,"StatusLine::UpdateMousePosAndSnap() - pCCStatusBar==NULL");
-#endif
 	}
 
 	BOOL ReturnValue=TRUE;
@@ -1153,11 +1097,8 @@
 	String_256 MousePosText("");
 	if (!Blank && GetMousePosText(&MousePosText,*pDocCoord,pSpread)==FALSE)
 		ReturnValue=FALSE;
-PORTNOTE("StatusLine", "Removed use of CCStatusBar")
-#ifndef EXCLUDE_FROM_XARALX
-	if (pCCStatusBar->UpdatePaneText(_R(IDS_SL_MOUSEPOS),&MousePosText,TRUE)==FALSE)
-		ReturnValue=FALSE;
-#endif
+	ReturnValue &=SetStringGadgetValue(_R(IDC_SL_MOUSEPOS), MousePosText);
+	PaintGadgetNow(_R(IDC_SL_MOUSEPOS));
 
 // WEBSTER - markn 15/1/97
 // No rulers in Webster
Index: Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc	(revision 970)
+++ Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc	(revision 971)
@@ -12,7 +12,7 @@
                 <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
                 <border>1</border>
                 <option>1</option>
-                <object class="wxStaticText" name="IDC_STATUSTEXT">
+                <object class="wxStaticText" name="IDC_SL_STATUSTEXT">
                     <font>
                         <size>8</size>
                     </font>
@@ -32,7 +32,7 @@
             <object class="sizeritem">
                 <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
                 <border>1</border>
-                <object class="wxGauge" name="IDC_PROGRESSGAUGE">
+                <object class="wxGauge" name="IDC_SL_PROGRESSGAUGE">
                     <size>-1,12</size>
                     <value>50</value>
                     <range>100</range>
@@ -48,7 +48,7 @@
             <object class="sizeritem">
                 <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
                 <border>1</border>
-                <object class="wxCamArtControl" name="IDB_SL_SDRAG0">
+               <object class="wxCamArtControl" name="IDB_SL_SDRAG0">
                     <camartstyle>wxCACS_PUSHBUTTON|wxCACS_ALLOWHOVER|wxCACS_TOGGLEBUTTON</camartstyle>
                     <optoken>LiveDrag</optoken>
                 </object>
@@ -78,7 +78,7 @@
             <object class="sizeritem">
                 <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
                 <border>1</border>
-                <object class="wxStaticText" name="IDC_SL_MOUSEPOSITION">
+                <object class="wxStaticText" name="IDC_SL_MOUSEPOS">
                     <font>
                         <size>8</size>
                     </font>
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 970)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 971)
@@ -4845,7 +4845,7 @@
 	wxWindow * pGadget = GetGadget(WindowID, Gadget);
 	if (!pGadget) return;
 
-	pGadget->Refresh();
+	pGadget->Update();
 }
 
 


Xara