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:
Włodzimierz Skiba 2004-12-31 07:08:11 +00:00
parent ecda94753a
commit 555f645a40
11 changed files with 203 additions and 16 deletions

View 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 \

View 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

View File

@ -1460,20 +1460,21 @@
# 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 || \

View 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; }

View 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__

View 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;

View 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;

View 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_

View 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_

View 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
// -------------------------------

119
src/palmos/progdlg.cpp Normal file
View 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