OSDN Git Service

Patch #1804762 continued
authorJochen Tucht <jtuc@users.sourceforge.net>
Sun, 14 Oct 2007 08:19:26 +0000 (08:19 +0000)
committerJochen Tucht <jtuc@users.sourceforge.net>
Sun, 14 Oct 2007 08:19:26 +0000 (08:19 +0000)
Src/WaitStatusCursor.cpp
Src/WaitStatusCursor.h

index bb38c35..6a4d13e 100644 (file)
@@ -38,30 +38,36 @@ int CustomStatusCursor::stackSize = 0;
 CustomStatusCursor::CustomStatusCursor()
 : m_ended(false)
 {
-};
+}
 
 CustomStatusCursor::CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...)
 : m_ended(false)
 {
        va_list argp;
        va_start(argp, fmt);
-       Create(hinst, lpCursorName, fmt, argp);
+       CString msg;
+       msg.FormatV(fmt, argp);
+       Create(hinst, lpCursorName, msg);
        va_end(argp);
 }
 
-void CustomStatusCursor::Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...)
+CustomStatusCursor::CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, UINT fmtid, ...)
+: m_ended(false)
+{
+       va_list argp;
+       va_start(argp, fmtid);
+       CString msg;
+       msg.FormatV(theApp.LoadString(fmtid).c_str(), argp);
+       Create(hinst, lpCursorName, msg);
+       va_end(argp);
+}
+
+void CustomStatusCursor::Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR m_msg)
 {
-       CString m_msg;
        CString m_oldmsg;
        HCURSOR m_prevCursor = NULL;
        HCURSOR m_myCursor = NULL;
 
-       // update status text
-       va_list args;
-       va_start(args, fmt);
-       m_msg.FormatV(fmt, args);
-       va_end(args);
-
        if (c_piStatusDisplay)
                m_oldmsg = c_piStatusDisplay->BeginStatus(m_msg);
 
@@ -260,7 +266,9 @@ WaitStatusCursor::WaitStatusCursor(LPCTSTR fmt, ...)
 {
        va_list argp;
        va_start(argp, fmt);
-       Create(NULL, IDC_WAIT, fmt, argp);
+       CString msg;
+       msg.FormatV(fmt, argp);
+       Create(NULL, IDC_WAIT, fmt);
        va_end(argp);
 }
 
@@ -268,6 +276,8 @@ WaitStatusCursor::WaitStatusCursor(UINT fmtid, ...)
 {
        va_list argp;
        va_start(argp, fmtid);
-       Create(NULL, IDC_WAIT, theApp.LoadString(fmtid).c_str(), argp);
+       CString msg;
+       msg.FormatV(theApp.LoadString(fmtid).c_str(), argp);
+       Create(NULL, IDC_WAIT, msg);
        va_end(argp);
 }
index 29c1787..8ad444a 100644 (file)
@@ -23,6 +23,7 @@ class CustomStatusCursor
 // public interface
 public:
        CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...);
+       CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, UINT fmtid, ...);
        void ChangeMsg(LPCTSTR fmt, ...);
        void End();
        ~CustomStatusCursor();
@@ -31,7 +32,7 @@ public:
 protected:
        // default constructor for derivation, in two steps 'cause of variable argument list
        CustomStatusCursor();
-       void Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...);
+       void Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR m_msg);
 
 private:
        int posInStack;