wxDialog::Show is virtual as elsewhere. Native PalmOS progress dialog.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -247,6 +247,7 @@ SOURCES = ../../samples/minimal/minimal.cpp \
|
|||||||
../../src/palmos/prefconf.cpp \
|
../../src/palmos/prefconf.cpp \
|
||||||
../../src/palmos/printdlg.cpp \
|
../../src/palmos/printdlg.cpp \
|
||||||
../../src/palmos/printpalm.cpp \
|
../../src/palmos/printpalm.cpp \
|
||||||
|
../../src/palmos/progdlg.cpp \
|
||||||
../../src/palmos/radiobox.cpp \
|
../../src/palmos/radiobox.cpp \
|
||||||
../../src/palmos/radiobut.cpp \
|
../../src/palmos/radiobut.cpp \
|
||||||
../../src/palmos/region.cpp \
|
../../src/palmos/region.cpp \
|
||||||
|
@@ -100,6 +100,7 @@ wxPalmOS:
|
|||||||
all wxMSW specific code which was base for the new port)
|
all wxMSW specific code which was base for the new port)
|
||||||
- enumeration of available volumes
|
- enumeration of available volumes
|
||||||
- native wxPrefConfig around Preferences database
|
- native wxPrefConfig around Preferences database
|
||||||
|
- native wxProgressDialog implementation
|
||||||
|
|
||||||
|
|
||||||
2.5.3
|
2.5.3
|
||||||
|
@@ -1460,20 +1460,21 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* wxUSE_FILEDLG */
|
#endif /* wxUSE_FILEDLG */
|
||||||
|
|
||||||
#if !wxUSE_GAUGE
|
#if !wxUSE_GAUGE || !wxUSE_BUTTON
|
||||||
# if wxUSE_PROGRESSDLG
|
# if wxUSE_PROGRESSDLG && !defined(__WXPALMOS__)
|
||||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||||
# error "Progress dialog require wxUSE_GAUGE"
|
# error "Generic progress dialog requires wxUSE_GAUGE and wxUSE_BUTTON"
|
||||||
# else
|
# else
|
||||||
# undef wxUSE_GAUGE
|
# undef wxUSE_GAUGE
|
||||||
|
# undef wxUSE_BUTTON
|
||||||
# define wxUSE_GAUGE 1
|
# define wxUSE_GAUGE 1
|
||||||
|
# define wxUSE_BUTTON 1
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif /* !wxUSE_GAUGE */
|
#endif /* !wxUSE_GAUGE */
|
||||||
|
|
||||||
#if !wxUSE_BUTTON
|
#if !wxUSE_BUTTON
|
||||||
# if wxUSE_PROGRESSDLG || \
|
# if wxUSE_FONTDLG || \
|
||||||
wxUSE_FONTDLG || \
|
|
||||||
wxUSE_FILEDLG || \
|
wxUSE_FILEDLG || \
|
||||||
wxUSE_CHOICEDLG || \
|
wxUSE_CHOICEDLG || \
|
||||||
wxUSE_NUMBERDLG || \
|
wxUSE_NUMBERDLG || \
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 2002/12/15
|
// Created: 2002/12/15
|
||||||
// RCS-ID: $Id:
|
// RCS-ID: $Id:
|
||||||
// Copyright: David Elliott
|
// Copyright: David Elliott
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_COCOA_DIALOG_H_
|
#ifndef _WX_COCOA_DIALOG_H_
|
||||||
@@ -81,7 +81,7 @@ protected:
|
|||||||
// Implementation
|
// Implementation
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
void SetModal(bool flag);
|
void SetModal(bool flag);
|
||||||
virtual bool IsModal() const { return m_isModal; }
|
virtual bool IsModal() const { return m_isModal; }
|
||||||
|
@@ -63,7 +63,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Resume();
|
void Resume();
|
||||||
|
|
||||||
bool Show( bool show = true );
|
virtual bool Show( bool show = true );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// callback for optional abort button
|
// callback for optional abort button
|
||||||
@@ -150,7 +150,7 @@ private:
|
|||||||
|
|
||||||
DECLARE_NO_COPY_CLASS(wxProgressDialog)
|
DECLARE_NO_COPY_CLASS(wxProgressDialog)
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif // wxUSE_PROGRESSDLG
|
||||||
// __PROGDLGH_G__
|
|
||||||
|
#endif // __PROGDLGH_G__
|
||||||
|
@@ -67,7 +67,7 @@ public:
|
|||||||
~wxDialog();
|
~wxDialog();
|
||||||
|
|
||||||
// virtual bool Destroy();
|
// virtual bool Destroy();
|
||||||
bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
void SetModal(bool flag);
|
void SetModal(bool flag);
|
||||||
virtual bool IsModal() const;
|
virtual bool IsModal() const;
|
||||||
|
@@ -67,7 +67,7 @@ public:
|
|||||||
~wxDialog();
|
~wxDialog();
|
||||||
|
|
||||||
// virtual bool Destroy();
|
// virtual bool Destroy();
|
||||||
bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
void SetModal(bool flag);
|
void SetModal(bool flag);
|
||||||
virtual bool IsModal() const;
|
virtual bool IsModal() const;
|
||||||
|
60
include/wx/palmos/progdlg.h
Normal file
60
include/wx/palmos/progdlg.h
Normal file
@@ -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_
|
||||||
|
|
@@ -1,7 +1,12 @@
|
|||||||
#ifndef _WX_PROGDLG_H_BASE_
|
#ifndef _WX_PROGDLG_H_BASE_
|
||||||
#define _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
|
#endif
|
||||||
// _WX_PROGDLG_H_BASE_
|
|
||||||
|
#endif // _WX_PROGDLG_H_BASE_
|
||||||
|
@@ -58,7 +58,7 @@ public:
|
|||||||
// returns true if we're in a modal loop
|
// returns true if we're in a modal loop
|
||||||
bool IsModalShowing() const;
|
bool IsModalShowing() const;
|
||||||
|
|
||||||
bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
// implementation only from now on
|
// implementation only from now on
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
|
119
src/palmos/progdlg.cpp
Normal file
119
src/palmos/progdlg.cpp
Normal file
@@ -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
|
Reference in New Issue
Block a user