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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 986
Date       : Tue May  9 19:42:26 BST 2006

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

Progress bar now working (I think). Status line still requires a little more work.


Diff:
Index: Trunk/XaraLX/Kernel/statline.h
===================================================================
--- Trunk/XaraLX/Kernel/statline.h	(revision 985)
+++ Trunk/XaraLX/Kernel/statline.h	(revision 986)
@@ -202,15 +202,17 @@
 
 // Progress related functions
 public:
-	BOOL ShowProgress (BOOL Show=TRUE, String_64 *JobDescrip = NULL);
+	BOOL ShowProgress (BOOL Show=TRUE, StringBase *JobDescrip = NULL);
 
 	INT32 GetPercent(void) const {return CurrentPercent;}
-	BOOL SetPercent(INT32 Percent, BOOL RedrawBackground = FALSE, String_64 *JobDescrip = NULL);
+	BOOL SetPercent(INT32 Percent, BOOL RedrawBackground = FALSE, StringBase *JobDescrip = NULL);
 
 protected:
 	INT32 CurrentPercent;			// The currently displayed percentage value
-	String_64 *JobDescription;	// NULL, or pointer to description of current job
+	String_256 *JobDescription;	// NULL, or pointer to description of current job
 	BOOL ProgressShown;
+	String_256 StatusText;
+	BOOL SetStatusText(const String_256 &text);
 
 	CC_DECLARE_DYNCREATE(StatusLine);              
 };
Index: Trunk/XaraLX/Kernel/statline.cpp
===================================================================
--- Trunk/XaraLX/Kernel/statline.cpp	(revision 985)
+++ Trunk/XaraLX/Kernel/statline.cpp	(revision 986)
@@ -695,9 +695,7 @@
 	
 	if ((IsRestrictedAccessToColourPicker () == FALSE) && (DoControlHelp == TRUE))
 	{
-		BOOL ok=SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), text);
-		PaintGadgetNow(_R(IDC_SL_STATUSTEXT));
-		return ok;
+		return SetStatusText(text);
 	}
 	else
 	{
@@ -748,9 +746,7 @@
 	// re-sample time and update status line
 	TextTimer.Sample();
 	
-	BOOL ok=SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), text);
-	PaintGadgetNow(_R(IDC_SL_STATUSTEXT));
-	return ok;
+	return SetStatusText(text);
 }
 
 
@@ -1266,7 +1262,7 @@
 }
 
 /********************************************************************************************
->	BOOL StatusLine::ShowProgress (BOOL Show=TRUE, String_64 *JobDescrip = NULL)
+>	BOOL StatusLine::ShowProgress (BOOL Show=TRUE, StringBase *JobDescrip = NULL)
 
 	Author:		Alex Bligh
 	Created:	09/05/2006
@@ -1282,11 +1278,11 @@
 	SeeAlso:	StatusLine::SetPercent; StatusLine::GetPercent
 ********************************************************************************************/
 
-BOOL StatusLine::ShowProgress (BOOL Show, String_64 *JobDescrip)
+BOOL StatusLine::ShowProgress (BOOL Show, StringBase *JobDescrip)
 {
 	BOOL ShowChanged=(Show != ProgressShown);
 
-	String_64 EmptyString(_T(""));
+	String_8 EmptyString(_T(""));
 
 	// Make "NULL" mean "empty string"
 	if (!JobDescrip)
@@ -1300,7 +1296,6 @@
 
 	if (ShowChanged)
 	{
-		HideGadget(_R(IDC_SL_PROGRESSTEXT), !Show);
 		HideGadget(_R(IDC_SL_PROGRESSGAUGE), !Show);
 		HideGadget(_R(IDC_SL_PROGRESSPERCENT), !Show);
 
@@ -1308,6 +1303,7 @@
 
 		CurrentPercent=-1;		// Force a redraw
 		SetPercent(0, TRUE, JobDescrip);	// Force redraw of window _including background_; always refresh string
+
 		return TRUE;
 	}
 
@@ -1317,7 +1313,7 @@
 
 /********************************************************************************************
 >	BOOL StatusLine::SetPercent(INT32 NewPercent,
-									BOOL ClearBackground = FALSE, String_64 *JobDescrip = NULL)
+									BOOL ClearBackground = FALSE, StringBase *JobDescrip = NULL)
 
 	Author:		Jason_Williams (Xara Group Ltd) <camelotdev@xxxxxxxx>
 	Created:	15/02/94
@@ -1341,7 +1337,7 @@
 ********************************************************************************************/
 
 BOOL StatusLine::SetPercent(INT32 NewPercent, BOOL ClearBackground /* =FALSE */,
-								String_64 *JobDescrip /* =NULL */)
+								StringBase *JobDescrip /* =NULL */)
 // The extra argument ClearBackground is not mentioned in the help, because it
 // is used internally - When the window is first created, the background must be cleared,
 // but on normal updates this causes horrible flicker, so is to be avoided.
@@ -1364,15 +1360,15 @@
 	if (JobDescrip != NULL)
 	{
 		delete JobDescription;
-		JobDescription = new String_64(*JobDescrip);
+		JobDescription = new String_256(*JobDescrip);
 
 		if (JobDescription)
 		{
-			SetStringGadgetValue(_R(IDC_SL_PROGRESSTEXT), *JobDescription);
+			SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), ProgressShown?*JobDescription:StatusText);
 		}
 		else
 		{
-			SetStringGadgetValue(_R(IDC_SL_PROGRESSTEXT), String_64(_T("")));
+			SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), ProgressShown?String_256(_T("")):StatusText);
 		}
 
 		InvalidateGadget(0, TRUE); // Repaint the whole bar
@@ -1389,3 +1385,31 @@
 
 	return(TRUE);
 }
+
+/********************************************************************************************
+>	BOOL StatusLine::SetStatusText(const String_256 &text)
+
+	Author:		Alex Bligh <alex@xxxxxxxxxxx>
+	Created:	09/05/2006
+	Inputs:		text - the text to set it to
+
+	Outputs:	-
+	Returns:	TRUE if it successfully makes the change.
+	Purpose:	Sets the status line text. Records it. Puts it in the gadget and invalidates
+				it if the gadget is shown
+	SeeAlso:	CProgressBar::GetPercent; CProgressBar::Create
+
+********************************************************************************************/
+
+BOOL StatusLine::SetStatusText(const String_256 &text)
+{
+	StatusText = text;
+	if (!ProgressShown)
+	{
+		StatusText = text;
+		BOOL ok=SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), text);
+		PaintGadgetNow(_R(IDC_SL_STATUSTEXT));
+		return ok;
+	}
+	return TRUE;
+}
Index: Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc	(revision 985)
+++ Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc	(revision 986)
@@ -9,15 +9,15 @@
             <orient>wxHORIZONTAL</orient>
 
             <object class="sizeritem">
-                <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
+                <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE|wxGROW</flag>
                 <border>1</border>
                 <option>1</option>
                 <object class="wxStaticText" name="IDC_SL_STATUSTEXT">
                     <font>
                         <size>8</size>
                     </font>
-                    <style>wxALIGN_LEFT</style>
-                    <label>Nothing selected</label>
+                    <style>wxALIGN_LEFT|wxST_NO_AUTORESIZE</style>
+                    <label>Nothing Selected</label>
                     <tooltip>Status bar text</tooltip>
                     <help>Displays the current status</help>
                 </object>
@@ -30,30 +30,8 @@
             </object>
 
             <object class="sizeritem">
-                <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
-                <border>1</border>
-                <option>1000</option>
-                <object class="wxStaticText" name="IDC_SL_PROGRESSTEXT">
-                    <hidden>1</hidden>
-                    <font>
-                        <size>8</size>
-                    </font>
-                    <style>wxALIGN_RIGHT</style>
-                    <label>Nothing selected</label>
-                    <tooltip>Status bar text</tooltip>
-                    <help>Displays the current status</help>
-                </object>
-            </object>
-
-            <object class="spacer">
                 <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
                 <border>1</border>
-                <size>3,16</size>
-            </object>
-
-            <object class="sizeritem">
-                <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
-                <border>1</border>
                 <object class="wxGauge" name="IDC_SL_PROGRESSGAUGE">
                     <hidden>1</hidden>
                     <size>-1,12</size>


Xara