]> git.saurik.com Git - wxWidgets.git/commitdiff
wxDialog::Show is virtual as elsewhere. Native PalmOS progress dialog.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 31 Dec 2004 07:08:11 +0000 (07:08 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 31 Dec 2004 07:08:11 +0000 (07:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/palmos/makefile
docs/changes.txt
include/wx/chkconf.h
include/wx/cocoa/dialog.h
include/wx/generic/progdlgg.h
include/wx/mac/carbon/dialog.h
include/wx/mac/classic/dialog.h
include/wx/palmos/progdlg.h [new file with mode: 0644]
include/wx/progdlg.h
include/wx/univ/dialog.h
src/palmos/progdlg.cpp [new file with mode: 0644]

index 20d2ca89c09237846b09c0e8698dafd452c450ad..ce31ae88bec7c9ef78fe6ed0605f6f317167a0d4 100644 (file)
@@ -247,6 +247,7 @@ SOURCES =  ../../samples/minimal/minimal.cpp \
 ../../src/palmos/prefconf.cpp \
 ../../src/palmos/printdlg.cpp \
 ../../src/palmos/printpalm.cpp \
+../../src/palmos/progdlg.cpp \
 ../../src/palmos/radiobox.cpp \
 ../../src/palmos/radiobut.cpp \
 ../../src/palmos/region.cpp \
index c40943cf5cca82270f61fc824ef8d09ac7e52bc9..4b701423c5d9c2d1addf05e28dd1376845147f49 100644 (file)
@@ -100,6 +100,7 @@ wxPalmOS:
   all wxMSW specific code which was base for the new port)
 - enumeration of available volumes
 - native wxPrefConfig around Preferences database
+- native wxProgressDialog implementation
 
 
 2.5.3
index bf26c9d78077303d247aad14e08e675b95474822..341dc163b509cbf1cffdcf02bbeee65faa421dd0 100644 (file)
 #   endif
 #endif /* wxUSE_FILEDLG */
 
-#if !wxUSE_GAUGE
-#   if wxUSE_PROGRESSDLG
+#if !wxUSE_GAUGE || !wxUSE_BUTTON
+#   if wxUSE_PROGRESSDLG && !defined(__WXPALMOS__)
 #       ifdef wxABORT_ON_CONFIG_ERROR
-#           error "Progress dialog require wxUSE_GAUGE"
+#           error "Generic progress dialog requires wxUSE_GAUGE and wxUSE_BUTTON"
 #       else
 #           undef wxUSE_GAUGE
+#           undef wxUSE_BUTTON
 #           define wxUSE_GAUGE 1
+#           define wxUSE_BUTTON 1
 #       endif
 #   endif
 #endif /* !wxUSE_GAUGE */
 
 #if !wxUSE_BUTTON
-#   if wxUSE_PROGRESSDLG || \
-       wxUSE_FONTDLG || \
+#   if wxUSE_FONTDLG || \
        wxUSE_FILEDLG || \
        wxUSE_CHOICEDLG || \
        wxUSE_NUMBERDLG || \
index 50785849f8db93f5dd3253f2198964a4416b5f1e..b4e0145e911d1ca548d5aaf1c0a2042c122d62ae 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2002/12/15
 // RCS-ID:      $Id:
 // Copyright:   David Elliott
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _WX_COCOA_DIALOG_H_
@@ -81,7 +81,7 @@ protected:
 // Implementation
 // ------------------------------------------------------------------------
 public:
-    bool Show(bool show = true);
+    virtual bool Show(bool show = true);
 
     void SetModal(bool flag);
     virtual bool IsModal() const { return m_isModal; }
index 6444697cecc3d0be5811e33da8fb4e0c18a6d003..5f16104d84a51daba88817ac8e2419d2fb222899 100644 (file)
@@ -63,7 +63,7 @@ public:
    */
    void Resume();
 
-   bool Show( bool show = true );
+   virtual bool Show( bool show = true );
 
 protected:
    // callback for optional abort button
@@ -150,7 +150,7 @@ private:
 
     DECLARE_NO_COPY_CLASS(wxProgressDialog)
 };
-#endif
 
-#endif
-    // __PROGDLGH_G__
+#endif // wxUSE_PROGRESSDLG
+
+#endif // __PROGDLGH_G__
index 490cd0af5ce943c4423e6b03e80f21b525eb6c64..5a5a28675ff2ea0b4f4d7d096f26133bd006434e 100644 (file)
@@ -67,7 +67,7 @@ public:
     ~wxDialog();
 
 //    virtual bool Destroy();
-    bool Show(bool show = true);
+    virtual bool Show(bool show = true);
 
     void SetModal(bool flag);
     virtual bool IsModal() const;
index 490cd0af5ce943c4423e6b03e80f21b525eb6c64..5a5a28675ff2ea0b4f4d7d096f26133bd006434e 100644 (file)
@@ -67,7 +67,7 @@ public:
     ~wxDialog();
 
 //    virtual bool Destroy();
-    bool Show(bool show = true);
+    virtual bool Show(bool show = true);
 
     void SetModal(bool flag);
     virtual bool IsModal() const;
diff --git a/include/wx/palmos/progdlg.h b/include/wx/palmos/progdlg.h
new file mode 100644 (file)
index 0000000..8381b44
--- /dev/null
@@ -0,0 +1,60 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/palmos/progdlg.h
+// Purpose:     wxProgressDialog interface
+// Author:      Wlodzimierz ABX Skiba
+// Modified by:
+// Created:     29.12.2004
+// RCS-ID:      $Id$
+// Copyright:   (c) Wlodzimierz Skiba
+// License:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _PREFCONF_H_
+#define _PREFCONF_H_
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma interface "progdlg.h"
+#endif
+
+#include "wx/defs.h"
+
+#if wxUSE_PROGRESSDLG
+
+#include "wx/dialog.h"
+
+class WXDLLEXPORT wxProgressDialog : public wxDialog
+{
+DECLARE_DYNAMIC_CLASS(wxProgressDialog)
+public:
+    wxProgressDialog(const wxString &title,
+                     wxString const &message,
+                     int maximum = 100,
+                     wxWindow *parent = NULL,
+                     int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
+    ~wxProgressDialog();
+
+    virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL);
+    void Resume();
+    virtual bool Show( bool show = true );
+
+    wxString GetMessage(){return m_msg;}
+    void SetMessage(wxString const &message){m_msg = message;}
+
+    int GetMaxValue(){return m_max;}
+    int GetCurValue(){return m_cur;}
+private:
+
+    ProgressType *m_prgFrame;
+    wxString m_msg;
+    int m_max,m_cur;
+
+    // Virtual function hiding supression
+    virtual void Update() { wxDialog::Update(); }
+
+    DECLARE_NO_COPY_CLASS(wxProgressDialog)
+};
+
+#endif // wxUSE_PROGRESSDLG
+
+#endif // _PREFCONF_H_
+
index 38e3b0d18d0c7a90356817ad87152377e13800f6..8e600c0780b40b5f453e069f9a8f89e6ff0ec0fa 100644 (file)
@@ -1,7 +1,12 @@
 #ifndef _WX_PROGDLG_H_BASE_
 #define _WX_PROGDLG_H_BASE_
 
-#include "wx/generic/progdlgg.h"
+#include "wx/defs.h"
 
+#ifdef __WXPALMOS__
+    #include "wx/palmos/progdlg.h"
+#else
+    #include "wx/generic/progdlgg.h"
 #endif
-    // _WX_PROGDLG_H_BASE_
+
+#endif // _WX_PROGDLG_H_BASE_
index 0892d2f95007adcaea4a1bd0aa997029c7d285c6..f4a1c331b1ebcf0d03bdeb78decd7b1486272ade 100644 (file)
@@ -58,7 +58,7 @@ public:
     // returns true if we're in a modal loop
     bool IsModalShowing() const;
 
-    bool Show(bool show = true);
+    virtual bool Show(bool show = true);
 
     // implementation only from now on
     // -------------------------------
diff --git a/src/palmos/progdlg.cpp b/src/palmos/progdlg.cpp
new file mode 100644 (file)
index 0000000..29da0fa
--- /dev/null
@@ -0,0 +1,119 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/palmos/progdlg.cpp
+// Purpose:     wxProgressDialog implementation
+// Author:      Wlodzimierz ABX Skiba
+// Modified by:
+// Created:     29.12.2004
+// RCS-ID:      $Id$
+// Copyright:   (c) Wlodzimierz Skiba
+// License:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma implementation "progdlg.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+    #include  "wx/string.h"
+#endif //WX_PRECOMP
+
+#if wxUSE_PROGRESSDLG
+
+//****************
+//* NEEDS DEBUGING
+//****************
+
+#include "wx/progdlg.h"
+#include "wx/msgdlg.h"
+
+IMPLEMENT_CLASS(wxProgressDialog, wxDialog)
+
+static Boolean wxProgressCallback(PrgCallbackData *data)
+{
+    if(!data)
+        return false;
+
+    wxProgressDialog *dialog = (wxProgressDialog *)data->userDataP;
+
+    if(!dialog)
+        return false;
+
+//    /* uint16_t */  data->bitmapId = 0;
+//    /* DmOpenRef */ data->bitmapDatabase = 0;
+    /* char * */    data->textP = "test";
+//    /* status_t */  data->error;
+//    /* uint16_t */  data->canceled;
+    /* uint16_t */  data->textChanged = false;
+    /* uint16_t */  data->displaySkipBtn = true;
+//    /* uint16_t */  data->skipped:1;
+//    /* uint32_t */  data->timeout;
+    /* uint32_t */  data->barMaxValue = (uint32_t)dialog->GetMaxValue();
+    /* uint32_t */  data->barCurValue = (uint32_t)dialog->GetCurValue();
+    /* uint16_t */  data->delay = false ;
+
+    /* NOT USED
+    data->spareBits1:10;
+    data->padding1;
+    data->padding2;
+    data->barMessage;
+    data->barFlags;
+    data->spareBits2:15;
+    */
+
+    return true;
+}
+
+wxProgressDialog::wxProgressDialog(const wxString &title,
+                                   wxString const &message,
+                                   int maximum,
+                                   wxWindow *parent,
+                                   int style)
+                 :wxDialog(parent, wxID_ANY, title),
+                  m_prgFrame(NULL),
+                  m_msg(message),
+                  m_cur(0),
+                  m_max(maximum)
+{
+    wxString prgTitle = title.Mid(0, progressMaxTitle);
+    
+    m_prgFrame = PrgStartDialog(prgTitle.ToAscii(), wxProgressCallback, this);
+}
+
+wxProgressDialog::~wxProgressDialog()
+{
+    if(m_prgFrame)
+    {
+        PrgStopDialog(m_prgFrame, false);
+        m_prgFrame = NULL;
+    }
+}
+
+bool wxProgressDialog::Update(int value, const wxString& newmsg, bool *skip)
+{
+    if(!m_prgFrame)
+        return false;
+    if(!newmsg.empty())
+        SetMessage(newmsg);
+    m_cur = value;
+    // PrgUpdateDialog crashes, needs debugging
+    // PrgUpdateDialog(m_prgFrame, 0, 1, newmsg.ToAscii(), true);
+    return true;
+}
+
+void wxProgressDialog::Resume()
+{
+}
+
+bool wxProgressDialog::Show(bool show)
+{
+    return false;
+}
+
+#endif // wxUSE_PROGRESSDLG